BARF: Bundle-Adjusting Neural Radiance Fields

Chen-Hsuan Lin, Wei-Chiu Ma, Antonio Torralba, Simon Lucey

TL;DR

BARF (Bundle-Adjusting Neural Radiance Fields) enables high-quality 3D scene reconstruction from images with imperfect or even completely unknown camera poses. By gradually introducing high-frequency details through a scheduled positional encoding, it jointly optimizes for both the scene representation and camera registration, overcoming a major limitation of standard NeRF.

What Problem Does This Paper Address?

Neural Radiance Fields (NeRF) have set a new standard for photorealistic view synthesis, but they have a significant "chicken-and-egg" problem: to learn a sharp 3D representation, the model requires extremely accurate camera poses for every training image. Typically, these poses are pre-calculated using external Structure-from-Motion (SfM) tools like COLMAP.

If the initial poses are noisy or missing, standard NeRF fails to produce sharp results. While one could try to optimize the camera poses alongside the NeRF model, the high-frequency details that NeRF captures make the optimization landscape very "bumpy," causing pose optimization to get stuck in poor local minima.

Methods

The authors propose BARF, a method that treats NeRF training as a joint optimization of network weights (reconstruction) and camera pose parameters (registration).

The key innovation is a coarse-to-fine scheduling of positional encodings. Positional encoding is the mechanism that allows NeRF to represent fine details, but these high frequencies are exactly what trap pose optimization. BARF applies a smooth, time-varying mask to the frequency bands of the positional encoding:

  1. Coarse Phase: At the start of training, only low-frequency components are active. This creates a smooth optimization landscape, allowing the camera poses to find the correct general alignment (the "basin of attraction").
  2. Fine Phase: As training progresses, higher frequency bands are gradually "unmasked." This allows the model to capture sharp details once the poses are roughly correct.
Figure 1: Training NeRF requires accurate camera poses for all images. We present BARF for learning 3D scene repre- sentations from imperfect (or even unknown) camera poses by jointly optimizing for registration and reconstruction.

Datasets

The effectiveness of BARF was validated on three main benchmarks:

  • Planar Image Alignment (2D): A simplified toy problem using image patches from ImageNet to demonstrate how frequency scheduling affects the "basin of attraction" for registration.
  • Synthetic Object-Centric Scenes: The standard 8 scenes from the original NeRF dataset (e.g., Lego, Chair), where camera poses were synthetically corrupted with significant noise (up to 14.9° rotation error).
  • Real-World Forward-Facing Scenes: The LLFF dataset, where the authors tested the extreme case of starting with completely unknown camera poses (initialized to identity).

Key Insights and Ideas

  • The Positional Encoding Paradox: While high-frequency encoding is essential for high-fidelity synthesis, it is a "double-edged sword" for registration because it makes the loss landscape too complex for gradient-based pose refinement.
  • Smoothness for Alignment: Drawing from classical computer vision principles (like the Lucas-Kanade algorithm), the authors show that smoother signals provide more coherent displacement predictions, making registration more robust. Smoother signals (top) provide more coherent displacement predictions for alignment compared to complex, high-frequency signals (bottom).

  • Neural Bundle Adjustment: BARF can be viewed as a neural version of photometric bundle adjustment. Unlike traditional methods that rely on sparse point clouds, BARF optimizes against a dense, continuous neural representation.

Smoother signals (top) provide more coherent displacement predictions for alignment compared to complex, high-frequency signals (bottom).

Key Results

  • Robust Realignment: On synthetic data, BARF successfully realigned camera frames from large initial errors where naive NeRF pose optimization completely diverged. Visual comparison showing BARF successfully realigning camera poses for the 'chair' scene, while naive NeRF gets stuck.

  • Localization from Scratch: In real-world scenarios, BARF recovered camera poses starting from zero knowledge (identity initialization) that highly agreed with professional SfM packages.

  • Comparable Quality: Despite starting with bad poses, BARF achieves view synthesis quality (PSNR, SSIM) nearly identical to NeRF models trained with perfect ground-truth poses. Qualitative results on synthetic scenes show BARF (middle-right) achieves synthesis quality nearly identical to the reference NeRF (far right) despite starting with noisy poses.
Visual comparison showing BARF successfully realigning camera poses for the 'chair' scene, while naive NeRF gets stuck.
Qualitative results on synthetic scenes show BARF (middle-right) achieves synthesis quality nearly identical to the reference NeRF (far right) despite starting with noisy poses.

Limitations and Future Work

  • Computational Overhead: BARF inherits the slow training and rendering speeds of the original NeRF architecture.
  • Static Scenes: The model assumes a rigid, static world and does not currently handle moving objects or dynamic lighting.
  • Scheduling Heuristics: The coarse-to-fine frequency mask relies on a pre-defined schedule, which may need manual tuning for different types of scenes.
  • Future Directions: The authors believe BARF opens new possibilities for neural-based SLAM (Simultaneous Localization and Mapping) and self-supervised dense 3D reconstruction.

Summary updated

BibTeX
@misc{lin2021barf,
  author = {Chen-Hsuan Lin and Wei-Chiu Ma and Antonio Torralba and Simon Lucey},
  title = {{BARF: Bundle-Adjusting Neural Radiance Fields}},
  year = {2021},
  eprint = {2104.06405},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.06405},
}
Figure