BARF
Lin 2021 · Paper
One-line summary — Bundle-Adjusting NeRF: jointly optimises a NeRF scene representation and the camera poses from imperfect or unknown initialisation, using a coarse-to-fine positional encoding schedule — the key enabling insight for NeRF-based SLAM.
Problem
NeRF synthesises photorealistic novel views, but it has a hard prerequisite: accurate camera poses for every training image, typically pre-computed with an SfM package. When poses are noisy or unknown, naive pose optimisation with NeRF “is sensitive to initialization” and “may lead to suboptimal solutions of the 3D scene representation”. Reconstruction and registration form a chicken-and-egg problem: recovering 3D structure requires known poses, while localizing requires reliable correspondences from the reconstruction. BARF tackles training NeRF from imperfect (or even unknown) camera poses — the joint problem of learning neural 3D representations and registering camera frames — as a form of photometric bundle adjustment with view synthesis as the proxy objective.
Method & architecture
BARF first analyses 2D image alignment: registering images by gradient descent on works only if the “steepest descent image” (the Jacobian chaining image gradients through the warp) gives coherent per-pixel updates — which is why classical Lucas-Kanade alignment blurs images coarse-to-fine to widen the basin of attraction. The same structure appears in 3D with NeRF. A pixel’s colour is volume-rendered through the MLP :
and BARF jointly optimises the camera poses (parameterised in the Lie algebra ) and NeRF weights over the synthesis-based objective
The obstacle is positional encoding. NeRF lifts inputs with , whose Jacobian
amplifies gradients by while flipping direction at the same frequency, so pose gradients from sampled 3D points “are incoherent … and can easily cancel out each other”. BARF’s fix is a dynamic low-pass filter: weight the -th band as with
where ramps with optimisation progress: from raw 3D input (, smooth landscape, poses move freely) to full encoding (, scene sharpens to full detail). In the NeRF experiments is ramped linearly from iteration 20K to 100K of 200K, with frequency bands, Adam on both poses and network. BARF is batch co-optimisation — not real-time or incremental, and intrinsics are assumed known — but it is exactly the tracking machinery a NeRF-based SLAM system needs.
Results
- 2D planar alignment (homography warps in ): BARF reaches warp error 0.0096 and patch PSNR 35.30, versus 0.2949 / 23.41 for full positional encoding and 0.0641 / 24.72 without encoding.
- Synthetic NeRF scenes (8 scenes, poses perturbed by ≈ 14.9° rotation, 0.26 translation): BARF achieves near-perfect registration — e.g. Chair 0.096° rotation / 0.428 translation error with PSNR 31.16 vs 31.91 for a reference NeRF trained on ground-truth poses; naive full encoding lands at 7.19° and PSNR 19.02.
- LLFF real-world forward-facing scenes, all poses initialised to identity: mean rotation error 0.573° and translation error 0.331 vs 84.509° / 31.598 for naive positional encoding; mean PSNR 23.97 vs 11.03 (naive) and 22.56 for reference NeRF trained on SfM poses.
The conclusion flags the consequence explicitly: BARF “opens up exciting avenues for rethinking visual localization for SfM/SLAM systems and self-supervised dense 3D reconstruction frameworks using view synthesis as a proxy objective.”
Why it matters for SLAM
NeRF originally consumed camera poses (from COLMAP); BARF showed poses can be estimated through the radiance field itself, opening the door to localization with neural scene representations — a direction the authors explicitly flag for SLAM. Every neural-implicit SLAM system that tracks by minimising a rendering loss is running BARF’s insight in an online loop; understanding why raw positional encoding breaks pose registration (and how coarse-to-fine fixes it) explains many design choices in that literature.