NeRF Revisited: Fixing Quadrature Instability in Volume Rendering

Mikaela Angelina Uy, Kiyohiro Nakayama, Guandao Yang, Rahul Krishna Thomas, Leonidas Guibas, Ke Li

TL;DR

This paper identifies "quadrature instability" in Neural Radiance Fields (NeRFs) caused by the standard assumption that volume density is piecewise constant along a ray. By reformulating the rendering equation to assume piecewise linear density, the authors achieve sharper textures, more accurate geometry, and better importance sampling with a simple drop-in replacement for the standard NeRF rendering formula.

What Problem Does This Paper Address?

At the heart of NeRF is volume rendering: to determine a pixel's color, you integrate light along a ray. Because we can't solve this integral analytically for a neural network, we approximate it using a finite sum of samples—a process called quadrature.

Standard NeRF implementations assume that between any two samples, the volume density (opacity) and color are constant. This seemingly minor assumption creates a significant problem called quadrature instability. Because the density is assumed constant within a "bin," the rendered result becomes highly sensitive to exactly where those samples are placed.

This leads to several issues:

  1. Conflicting Supervision: Rays hitting a surface at different angles (grazing vs. perpendicular) or from different distances will have samples placed differently. Under the piecewise constant assumption, they "see" different geometry, leading to fuzzy surfaces and blurry textures as the model tries to satisfy these conflicting signals.
  2. Imprecise Sampling: NeRFs rely on importance sampling to place more points near surfaces. The piecewise constant assumption results in a step-like, non-invertible Cumulative Distribution Function (CDF), forcing researchers to use imprecise "surrogate" functions for sampling.
  3. Vanishing Gradients: The step-like CDF has zero gradients almost everywhere, making it nearly impossible to provide direct supervision to the sample locations themselves (e.g., for depth-based losses).
Figure 1: Ray Conflicts: Grazing Angle. (Left) Illustration of conflicting ray supervision at the grazing under the piecewise constant opacity. For the constant setting, to render perpendicular rays (yellow) correctly, the model has to store the associated optical properties at a region in front of the surface as a sample takes the values of the left bin boundary. In the presence of a ray near the grazing angle, it will be crossing this region of high opacity (the gradient in front of the surface), associating it with conflicting opacity/color signals. (Middle) This results in fuzzier surfaces as shown along the side of the microphone as there is a conflict in ray supervision between the perpendicular and grazing angle rays. Our piecewise linear opacity assumption alleviates this issue and results in a clearer rendered view. (Right) As shown, the resulting PDF is peakier and the CDF is sharper for our linear setting, where the plotted distributions correspond to the ray from the marked pixel in red.

Methods

The authors propose PL-NeRF, which replaces the piecewise constant density assumption with a piecewise linear one.

  • Linear Opacity, Constant Color: While they keep color piecewise constant within bins (to keep the math tractable), they model opacity as changing linearly between sample points.
  • Closed-Form Integral: They derive a new, mathematically principled quadrature formula that corresponds to the exact integral under this piecewise linear assumption.
  • Exact Importance Sampling: Because the resulting CDF is now continuous and strictly increasing, it is analytically invertible. This allows for exact inverse transform sampling, eliminating the need for imprecise surrogate functions.
  • The "Sweet Spot" for Polynomials: The authors explored higher-order polynomials (quadratic and above). However, they discovered that degree $\ge 2$ leads to rational functions in the integral, which are numerically unstable and prone to optimization failure. Piecewise linear (degree 1) is the mathematical "sweet spot"—it resolves the instability while remaining numerically robust.
Figure 3: Illustration of opacities τ along a ray under the piecewise constant (green) and piecewise linear (orange) assumptions.

Datasets

The method was evaluated on standard NeRF benchmarks:

  • Blender: A synthetic dataset of 8 objects with complex geometry and materials.
  • LLFF (Real Forward Facing): A dataset of 8 real-world scenes captured with a handheld camera.
  • DTU: A dataset of real objects used to evaluate geometric reconstruction accuracy.

Key Insights and Ideas

  • The "Band" Effect: The core insight is that the piecewise constant assumption creates a "band" of high opacity in front of surfaces. Different rays passing through this band at different angles receive inconsistent signals, which is the root cause of many NeRF artifacts.
  • Invertibility Matters: Moving to a linear assumption makes the CDF continuous and invertible. This isn't just a mathematical nicety; it allows gradients to flow back to the sample positions, enabling much stronger depth supervision.
  • Drop-in Compatibility: The proposed formula is a direct replacement for the standard NeRF rendering equation. The authors successfully integrated it into vanilla NeRF, Mip-NeRF, and DIVeR with minimal effort.

Key Results

PL-NeRF consistently outperforms standard "constant" density models across all metrics and datasets:

  • Quantitative Improvements: On the Blender dataset, PL-NeRF improved average PSNR from 30.61 to 31.10 and significantly reduced LPIPS (a measure of perceptual error) from 5.17 to 4.39. Similar gains were seen on the LLFF and DTU datasets.
  • Qualitative Sharpness: The method produces noticeably sharper textures (e.g., the fabric of a chair or the surface of a hotdog) and cleaner edges, especially in areas viewed at grazing angles where standard NeRFs often produce "fuzz."
  • Better Geometry: When extracting 3D meshes using Marching Cubes, PL-NeRF recovers fine details (like holes in Lego bricks) that the baseline model misses or blurs.
  • Stronger Depth Supervision: In experiments using depth losses, PL-NeRF achieved significantly lower Root Mean Square Error (RMSE) in depth estimation (0.147 vs 0.178 for the baseline).

Limitations and Future Work

  • Computational Cost: The piecewise linear formulation requires more floating-point operations (FLOPS) than the constant version, resulting in a slight increase in training and rendering time (roughly 20-25% slower).
  • Zero Opacity: The current math requires opacity to be strictly positive (though it can be arbitrarily small, e.g., $10^{-6}$). The authors handle this by adding a tiny epsilon to the model output.
  • Constant Color Assumption: While density is linear, color is still assumed constant within each bin. Future work could explore integrating piecewise linear color, though this would further increase computational complexity.
  • General NeRF Limitations: The method still inherits standard NeRF requirements, such as needing precise camera poses for all training images.

Summary updated

BibTeX
@inproceedings{uy2023nerf,
  author = {Mikaela Angelina Uy and Kiyohiro Nakayama and Guandao Yang and Rahul Krishna Thomas and Leonidas Guibas and Ke Li},
  title = {{NeRF Revisited: Fixing Quadrature Instability in Volume Rendering}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=gJHAT79cZU},
}
Figure