NeRF-SLAM

Rosinol 2023 · Paper

One-line summary — Coupled a dense monocular SLAM frontend (DROID-SLAM) with an Instant-NGP radiance-field backend, weighting the NeRF depth loss by the SLAM depth marginal covariances — real-time, geometrically and photometrically accurate dense monocular reconstruction.

Problem

The first neural-implicit SLAM systems (iMAP, NICE-SLAM) required RGB-D input, and radiance fields trained on photometric loss alone are prone to “floaters” — ghost geometry from bad initialisation or bad local minima; adding depth supervision removes it and speeds convergence. Dense monocular SLAM can supply that depth in real time, but its depth maps “are extremely noisy due to their density, since even textureless regions are given a depth value”. NeRF-SLAM’s insight: dense monocular SLAM provides exactly the right information to fit a NeRF in real time — accurate poses plus dense depth maps with associated uncertainty, so the map can trust each depth only as much as the estimator does.

Method & architecture

Two threads run in parallel on one GPU (RTX 2080 Ti, 11 GB, PyTorch + CUDA):

Tracking: dense SLAM with covariances. DROID-SLAM computes dense optical flow pij\mathbf{p}_{ij} between frame pairs with a RAFT-style ConvGRU that also outputs per-measurement weights Σpij\mathbf{\Sigma}_{\mathbf{p}_{ij}}, then solves a dense bundle adjustment with geometry parametrised as per-keyframe inverse depth maps. Linearising gives the block-sparse system

Hx=b,[CEETP][ΔξΔd]=[vw],H\mathbf{x}=\mathbf{b}, \quad \begin{bmatrix} C & E \\ E^{T} & P \end{bmatrix} \begin{bmatrix} \Delta\boldsymbol{\xi} \\ \Delta\mathbf{d} \end{bmatrix} = \begin{bmatrix} \mathbf{v} \\ \mathbf{w} \end{bmatrix},

with CC the camera block, PP the (diagonal) inverse-depth block, EE the camera/depth coupling, Δξ\Delta\boldsymbol{\xi} the SE(3)SE(3) pose updates and Δd\Delta\mathbf{d} the per-pixel inverse-depth updates. The Schur complement gives the reduced camera matrix HTH_T, solved by Cholesky factorisation HT=LLTH_T = LL^{T}. Following Rosinol et al.’s probabilistic volumetric fusion (WACV 2022), the marginal covariances of depths and poses come from the same factorisation:

Σd=P1+PTETΣTEP1,ΣT=(LLT)1.\mathbf{\Sigma}_{\mathbf{d}} = P^{-1} + P^{-T}E^{T}\mathbf{\Sigma}_{\mathbf{T}}EP^{-1}, \qquad \mathbf{\Sigma}_{\mathbf{T}} = (LL^{T})^{-1}.

Mapping: probabilistic volumetric NeRF. An Instant-NGP hash-grid radiance field is trained on all keyframes (no sliding window) with the mapping loss, minimised over both poses T\mathbf{T} and network parameters Θ\Theta:

LM(T,Θ)=Lrgb(T,Θ)+λDLD(T,Θ),λD=1.0,\mathcal{L}_{M}(\mathbf{T},\Theta) = \mathcal{L}_{\text{rgb}}(\mathbf{T},\Theta) + \lambda_{D}\,\mathcal{L}_{\text{D}}(\mathbf{T},\Theta), \qquad \lambda_D = 1.0,

where the depth loss is Mahalanobis-weighted by the tracking covariance,

LD(T,Θ)=DD(T,Θ)ΣD2,\mathcal{L}_{\text{D}}(\mathbf{T},\Theta) = \|D - D^{\star}(\mathbf{T},\Theta)\|^{2}_{\Sigma_{D}},

and Lrgb=II(T,Θ)2\mathcal{L}_{\text{rgb}} = \|I - I^{\star}(\mathbf{T},\Theta)\|^{2}. Rendered depth is the expected ray-termination distance under standard volume rendering,

d=iTi(1exp(σiδi))di,Ti=exp(j<iσjδj),d^{\star} = \sum_{i}\mathcal{T}_{i}\bigl(1-\exp(-\sigma_{i}\delta_{i})\bigr)d_{i}, \qquad \mathcal{T}_{i} = \exp\Bigl(-\sum_{j<i}\sigma_{j}\delta_{j}\Bigr),

with σi\sigma_i the density at sample ii, did_i its depth, and δi=di+1di\delta_i = d_{i+1} - d_i; colour composites ci\mathbf{c}_i the same way.

Thread interface. The tracking thread keeps an active window of at most 8 keyframes and spawns a keyframe whenever mean optical flow exceeds 2.5 pixels; on each new keyframe it ships poses, images, depth maps, and depth covariances to the mapper — the only inter-thread communication.

Results

On Replica (8 scenes, evaluated by depth L1 and PSNR):

Why it matters for SLAM

NeRF-SLAM (from Rosinol, of Kimera fame, with Leonard and Carlone at MIT) crystallised the hybrid recipe — estimation-theoretic SLAM for poses, geometry, and uncertainty; neural fields for the map — showing the two are complementary rather than competing. It is the counterpoint to iMAP’s purist “the network is the whole system” stance, and arguably the more influential blueprint: most practical neural and Gaussian SLAM systems today pair a robust tracker with a differentiable map exactly this way, and its uncertainty-weighted depth supervision became a recurring technique for fusing noisy estimated geometry into neural representations.