Papers
Topics
Authors
Recent
Search
2000 character limit reached

GravLensX: Neural Rendering for Black Holes

Updated 6 July 2026
  • GravLensX is a neural rendering method that approximates null geodesics in curved spacetime to simulate gravitational lensing around black holes and thin accretion disks.
  • It employs MLPs with Fourier positional encoding to map ray initial conditions to positions, reducing computation time by 15x to 26x compared to traditional integration methods.
  • The approach splits the domain into near-field and far-field networks, ensuring high-fidelity multi-black-hole visualization while acknowledging limitations in real-time applications and generalization.

GravLensX is a neural rendering method for black holes that approximates null geodesics in curved spacetime and uses those learned trajectories to render gravitational lensing effects around black holes with optically thin accretion disks. Rather than numerically integrating the geodesic ODE for every ray during rendering, it trains neural networks to map ray initial conditions and affine parameter to ray position, then queries those learned maps during inference. The method is demonstrated on multiple black hole systems with a superposed Kerr metric and is reported to achieve about 15×15\times reduced computational time for full rendering and about 26×26\times for sky-sphere-only rendering while preserving good visual fidelity (Sun et al., 21 Jul 2025).

1. Problem setting and scope

GravLensX addresses the dominant computational bottleneck in general-relativistic black-hole rendering: repeated null-geodesic integration through a metric tensor field. In the baseline formulation, each camera ray requires repeated evaluation of the metric gμνg_{\mu\nu}, its derivatives, Christoffel symbols, and numerical integration of the geodesic equations. The paper frames this as especially expensive for rotating black holes, multiple black holes, and scenes requiring many rays, such as volume rendering (Sun et al., 21 Jul 2025).

The method is defined for scenes containing one or more black holes, optically thin accretion disks, and a sky sphere. The spacetime is modeled with the Kerr metric for single rotating black holes and with a superposed Kerr metric approximation for two-black-hole and three-black-hole scenes. Rays terminate when they either cross an inner boundary representing capture by a black hole or reach the sky sphere. The authors explicitly state that the accretion disk is treated as a “simple thin texture,” rather than with full relativistic radiative transfer, absorption, scattering, polarization, or Faraday rotation (Sun et al., 21 Jul 2025).

This design places GravLensX in a distinct category within gravitational-lensing computation. It is a rendering-oriented surrogate model for null-geodesic propagation in strong-field general relativity, rather than a thin-lens cosmology or image-inference package.

2. Geometric and relativistic formulation

The physical core of GravLensX is the null-geodesic equation in curved spacetime. Light rays are constrained by

gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,

and evolve according to

d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.

The Christoffel symbols are written as

Γαβμ=12gμν(gναpβ+gνβpαgαβpν).\Gamma_{\alpha \beta}^\mu=\frac{1}{2} g^{\mu \nu}\left(\frac{\partial g_{\nu \alpha}}{\partial p^\beta}+\frac{\partial g_{\nu \beta}}{\partial p^\alpha}-\frac{\partial g_{\alpha \beta}}{\partial p^\nu}\right).

For the Kerr spacetime in Cartesian coordinates, the paper gives the metric in Kerr–Schild form as

gab=ηab+2mr3r4+a2z2ab,g_{a b}=\eta_{a b}+\frac{2 m r^3}{r^4+a^2 z^2} \ell_a \ell_b,

with

=[1,rx+ayr2+a2,ryaxr2+a2,zr]T.\ell=\left[1, \frac{r x+a y}{r^2+a^2}, \frac{r y-a x}{r^2+a^2}, \frac{z}{r}\right]^\mathsf T.

For multiple black holes, the implementation uses a superposed metric of the form

gI4×4+i2miri3ri4+ai2zi2iiT.g \leftarrow I_{4\times 4} + \sum_i \frac{2m_i r_i^3}{r_i^4+a_i^2 z_i^2}\,\ell_i \ell_i^\mathsf T.

The learned target is not the metric itself but the geodesic map

f(p,d,λ)=p+λ0λv(λ)dλ,v(λ0)=d,f(p, d, \lambda)=p+\int_{\lambda_0}^{\lambda}v(\lambda')\mathrm{d}\lambda', \qquad v(\lambda_0)=d,

where 26×26\times0 is the initial spatial position, 26×26\times1 the initial spatial direction, and 26×26\times2 an affine parameter. A crucial implementation choice is that the spatial ray velocity is normalized at every step so that the spatial speed with respect to 26×26\times3 is 26×26\times4. This makes affine-parameter increments correspond directly to distance traveled in space, which simplifies rendering and sampling (Sun et al., 21 Jul 2025).

3. Neural representation of null geodesics

GravLensX approximates the geodesic map with an MLP,

26×26\times5

where 26×26\times6 is a Fourier positional encoding,

26×26\times7

The encoding is introduced because the dependence of ray position on initial conditions is smooth for small 26×26\times8 but can become highly nonlinear for large 26×26\times9, especially near strong-lensing regions.

A single global network was reported to perform poorly, so the domain is split into multiple neural fields: one near-field network per black hole and one far-field network. The near-field regions are spherical neighborhoods around each black hole, while the far field is the region inside the sky sphere but outside the near-field interiors, with a small overlap margin. This decomposition reflects the paper’s empirical conclusion that geodesics are substantially harder to approximate near black holes than in the far field (Sun et al., 21 Jul 2025).

Training uses both position and velocity supervision. The position loss is

gμνg_{\mu\nu}0

the velocity loss is

gμνg_{\mu\nu}1

and the total loss is

gμνg_{\mu\nu}2

The networks have 12 hidden layers with residual connections and SoftPlus activations. The near-field networks use 200 neurons per layer; the far-field network uses 128 neurons per layer in the two-black-hole system and 200 in the three-black-hole system. Training data are generated by a classical Euler geodesic solver, and the reported dataset size is 14,400,000 rays from each region. Optimization uses Adam with learning rate gμνg_{\mu\nu}3 (Sun et al., 21 Jul 2025).

4. Rendering pipeline and system design

The pipeline begins by specifying black hole positions, masses, spin parameters, inner capture boundaries, and outer sky-sphere radius. For the two-black-hole scene, the paper uses positions gμνg_{\mu\nu}4 and gμνg_{\mu\nu}5, masses gμνg_{\mu\nu}6, spins gμνg_{\mu\nu}7, gμνg_{\mu\nu}8, gμνg_{\mu\nu}9, and in-black-hole radius gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,0. For the three-black-hole scene, it uses positions gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,1, gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,2, and gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,3, masses gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,4, spins gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,5, gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,6, gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,7, and in-black-hole radius gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,8. The computations are performed in geometric units with

gμνdpμdλdpνdλ=0,g_{\mu \nu} \frac{\mathrm{d} p^\mu}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\nu}{\mathrm{d} \lambda}=0,9

Classical training data are generated with Euler integration rather than RK4, because the authors state that RK4 did not outperform Euler at equal step size in their implementation while costing more time. Once trained, the renderer identifies ray segments by region, advances them to the next relevant boundary, and evaluates the appropriate near-field or far-field MLP for each segment. Disk intersections are then found by a coarse-to-fine search: uniformly sample d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.0 points on each near-field segment, test neighboring sample pairs for disk crossings, then refine with d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.1 samples where needed. During inference, velocity is computed by finite differences rather than autodiff for speed (Sun et al., 21 Jul 2025).

The rendering step uses front-to-back compositing,

d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.2

The implementation uses Taichi and PyTorch. The reported training hardware is four RTX 3090 GPUs for the far-field network and one RTX 3090 GPU for each near-field network. The approximate training cost is 13.8 GPU hours per near-field network and 33.5 GPU hours for the far-field network (Sun et al., 21 Jul 2025).

In methodological terms, GravLensX differs sharply from thin-lens multiple-plane ray-tracing systems such as GLAMER, which project matter onto discrete lens planes and use inverse ray-shooting through a cosmological light cone (Petkova et al., 2013), and from semi-analytic strong-lensing generators such as MOKA, which synthesize cluster lenses from analytic halo components calibrated on simulations (Giocoli et al., 2011). GravLensX instead learns strong-field null-geodesic propagation directly in black-hole spacetimes.

5. Empirical evaluation

The quantitative evaluation is carried out on d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.3 images for two-black-hole and three-black-hole scenes, with separate measurements for accretion-disk-only, sky-sphere-only, and combined rendering. The paper reports PSNR and LPIPS for each setting (Sun et al., 21 Jul 2025).

Configuration PSNR LPIPS
2 BH, accretion disk + sky sphere 19.47 0.168
2 BH, sky sphere only 24.65 0.161
2 BH, accretion disk only 20.12 0.057
3 BH, accretion disk + sky sphere 20.52 0.143
3 BH, sky sphere only 24.98 0.133
3 BH, accretion disk only 21.70 0.042

The speed results reported in the paper are the main practical motivation for the method. Full rendering is about d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.4 faster on average than the Euler-based baseline, while sky-sphere-only rendering is about d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.5 faster. The speed advantage increases as the camera gets farther from the center because long-distance ray integration is expensive in conventional methods but relatively cheap under neural querying. In an appendix comparison for a single Kerr black hole, GravLensX running on one RTX 3090 is reported to be roughly d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.6 to d2pμdλ2+Γαβμdpαdλdpβdλ=0.\frac{\mathrm{d}^2 p^\mu}{\mathrm{d} \lambda^2}+\Gamma_{\alpha \beta}^\mu \frac{\mathrm{d} p^\alpha}{\mathrm{d} \lambda} \frac{\mathrm{d} p^\beta}{\mathrm{d} \lambda}=0.7 faster than kgeo on 16 Xeon Gold 5218 CPU processes, while the paper emphasizes that kgeo’s analytic method is not applicable to the multi-black-hole superposed-Kerr setting (Sun et al., 21 Jul 2025).

Qualitatively, the authors state that the rendered black holes exhibit high-fidelity shadows, visible accretion disks, and strong gravitational-lensing effects, with separate disk-only and sky-sphere-only renders “almost indistinguishable to the naked eye” from Euler ground truth. They also report that the far-field networks converge faster than the near-field networks, which is consistent with the lower geometric complexity of far-field trajectories (Sun et al., 21 Jul 2025).

6. Position within gravitational-lensing research and limitations

GravLensX occupies a different niche from mainstream strong-lensing software. JAXtronomy is a JAX-based reimplementation of lenstronomy intended to preserve an identical API while accelerating strong-lensing simulation and modeling with JIT compilation, autodiff, and GPU execution (Huang et al., 1 Jun 2026). GIGA-Lens is a gradient-informed, GPU-accelerated Bayesian framework for strong gravitational lens modeling that combines multi-start gradient descent, variational inference, and HMC for posterior inference (Gu et al., 2022). Lenstool-HPC is a high-performance implementation of cluster-scale strong-lens map generation and fit evaluation using CPU, GPU, and hybrid execution (Schäfer et al., 2020). By contrast, GravLensX is not a thin-lens inference package, a cosmological light-cone simulator, or a survey-scale Bayesian modeling framework. It is a scene-specific neural surrogate for rendering null geodesics in black-hole spacetimes.

The paper is explicit about its limitations. GravLensX does not achieve real-time rendering. Training is expensive, requiring tens of GPU hours per network and scaling linearly with the number of black holes. The multi-black-hole spacetime is based on a superposed Kerr metric, which the paper describes as an approximation rather than an exact solution of Einstein’s equations. The accretion disk is not modeled with detailed optical or geometric physics. Errors accumulate when rays traverse multiple regions, reducing PSNR through pixel misalignment. The near-field networks are harder to train, particularly for long spiraling trajectories near black holes. The model is trained per scene and is not shown to generalize across masses, spins, or black-hole configurations. The paper also provides no explicit uncertainty estimate or failure-detection mechanism for inaccurate MLP predictions (Sun et al., 21 Jul 2025).

These constraints imply a specific domain of use. GravLensX is well suited when a fixed spacetime configuration must be rendered many times and approximate but visually faithful general-relativistic lensing is acceptable. A plausible implication is that it is most valuable as a reusable surrogate for astronomical visualization and exploratory rendering, rather than as a replacement for exact geodesic solvers in precision strong-field astrophysics.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to GravLensX.