Neural Radiance Fields and 3D Gaussian Splatting: Rebuilding a Scene From a Pile of Photos

Photos From Places the Camera Never Stood

Take fifty photos while walking around a statue in a park. A classic photogrammetry pipeline will turn them into a mesh with a texture painted on top, and the result usually looks fine from a distance and wrong up close: leaves become flat blobs, glass turns opaque, and anything shiny looks like plastic. The task that Neural Radiance Fields set out to solve is slightly different. The goal is not a clean mesh. The goal is to produce a new photograph from a viewpoint where nobody held a camera, and to make it look like a real photograph.

This problem is called novel view synthesis, and for decades it was handled with light fields, image-based rendering and multi-plane images. In 2020 a paper by Ben Mildenhall, Pratul Srinivasan, Matthew Tancik, Jonathan Barron, Ravi Ramamoorthi and Ren Ng changed what people expected from it. «NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis» was presented as an oral at ECCV 2020 and received a Best Paper Honorable Mention. Three years later, a very different method called 3D Gaussian Splatting reached similar quality at real-time frame rates. The two papers make opposite bets about how a scene should be stored, and comparing them is the clearest way to understand the field.

A Scene Stored Inside a Network

NeRF represents a whole scene with one fully connected network. The input is a 3D position plus a viewing direction (five numbers in total, since a direction can be written with two angles). The output is a density at that point and the color emitted from that point toward the viewer. Density depends only on position, while color is allowed to depend on direction as well, which is how the model reproduces reflections and highlights that move when the camera moves. In the original paper the network has eight layers of 256 units, and the scene lives entirely in its weights. There are no voxels, no triangles and no point cloud.

The only training data is a set of photos with known camera poses. In practice those poses usually come from a structure-from-motion tool such as COLMAP, which matches features across images and estimates where each camera was. If the poses are wrong, NeRF has no way to fix them, and the reconstruction blurs.

Volume Rendering as the Loss

To produce a pixel, NeRF shoots a ray from the camera through that pixel and samples points along it. At each point it asks the network for density and color, then blends the colors front to back, with each sample weighted by its own density and by how much light survived the samples in front of it. This is the standard volume rendering equation from computer graphics, written as a sum.

The important property is that every step of this sum is differentiable. The rendered pixel can be compared with the real pixel in the photo, and the error flows back through the blending into the network weights. Nobody tells the model where surfaces are. Surfaces appear because putting density in the right places is the only way to make every training photo come out right at the same time.

Sampling uniformly would waste most queries on empty air, so NeRF uses two networks. A coarse network evaluates 64 samples per ray, and its output guides where a fine network places 128 more samples, concentrated near the surfaces the coarse pass found.

The Positional Encoding Trick

Fed raw coordinates, an MLP produces blurry scenes. Neural networks prefer smooth functions, a tendency called spectral bias, and a photograph full of bark texture and text on signs is not smooth. NeRF’s fix is to pass each coordinate through sines and cosines at increasing frequencies before it enters the network: ten frequency bands for position and four for direction. With this mapping, small changes in position can produce large changes in the input, and the network can represent fine detail.

The authors showed in their ablations that removing this encoding visibly degrades results. A companion paper by Tancik and colleagues at NeurIPS 2020, «Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains», gave the theoretical explanation using neural tangent kernel analysis. The idea of mapping low-dimensional inputs to a high-frequency feature space has since spread to many other coordinate-based networks.

The Speed Problem

The original NeRF was slow at everything. Training a single scene took roughly one to two days on an NVIDIA V100, and rendering one image meant hundreds of network evaluations for each of hundreds of thousands of pixels. The quality was striking, but nobody was going to walk around a NeRF in a headset.

The follow-up work attacked this from several sides. Plenoxels (Fridovich-Keil and colleagues, CVPR 2022) removed the neural network entirely and optimized a sparse voxel grid directly, which showed that most of NeRF’s quality came from differentiable volume rendering rather than from the MLP. Instant-NGP by Thomas Müller, Alex Evans, Christoph Schied and Alexander Keller (SIGGRAPH 2022) replaced most of the large MLP with a multiresolution hash table of learned feature vectors feeding a very small network. Training dropped from days to seconds or minutes, and the paper won a SIGGRAPH best paper award. On the quality side, Mip-NeRF (Barron and colleagues, 2021) reasoned about cones instead of thin rays to remove aliasing, and Mip-NeRF 360 extended it to unbounded outdoor scenes. Mip-NeRF 360 gave the best images of its time, but it still needed up to 48 hours of training per scene and rendered at a small fraction of a frame per second.

Millions of Gaussians Instead of a Network

In 2023, Bernhard Kerbl, Georgios Kopanas, Thomas Leimkühler and George Drettakis published «3D Gaussian Splatting for Real-Time Radiance Field Rendering» in ACM Transactions on Graphics (SIGGRAPH 2023). It keeps the training setup of NeRF (posed photos and a rendering loss) and drops the neural network.

The scene becomes a large set of 3D Gaussians, which are ellipsoid-shaped blobs. Each Gaussian has a position, a covariance written as a rotation and a scale (so it can be stretched into a needle or flattened into a disc), an opacity, and a color stored as spherical harmonic coefficients so that it can change with viewing direction. Optimization starts from the sparse point cloud that COLMAP already produces. During training, the method clones Gaussians in regions that are under-reconstructed, splits large ones that cover too much detail, and removes ones that become nearly transparent. A finished scene often contains millions of them.

Rendering does not march rays. Each Gaussian is projected onto the screen as a 2D ellipse, the screen is divided into 16 by 16 pixel tiles, the Gaussians in each tile are sorted by depth on the GPU, and their colors are blended front to back. This is rasterization, the same family of operations that graphics hardware was built for, and the whole pipeline is still differentiable. The paper reports real-time rendering (at least 30 frames per second) at 1080p on unbounded scenes, with quality comparable to Mip-NeRF 360 and training measured in minutes.

Case: A Neighborhood From 2.8 Million Images

Scaling these methods to a city is a different problem from scaling them to a statue. Block-NeRF, a CVPR 2022 paper from Matthew Tancik and colleagues at UC Berkeley and Waymo, reconstructed a neighborhood of San Francisco from 2.8 million images collected by Waymo vehicles over about three months. A single network could not hold that, so the authors split the area into blocks, trained a separate NeRF for each one, and blended the neighboring blocks at render time.

The images were taken at different times of day, under different weather, with cars and pedestrians moving through them. Block-NeRF borrowed appearance embeddings from earlier work (NeRF in the Wild) so each image could have its own lighting without corrupting the shared geometry, and it masked out moving objects. For Waymo the use is concrete: a reconstructed street can be re-rendered from new viewpoints to test autonomous driving software in simulation.

Explicit Points Bring Explicit Problems

Gaussian splatting is fast because the scene is explicit, and that also brings the main drawbacks. Millions of Gaussians, each with dozens of spherical harmonic coefficients, take a lot of memory, and a large outdoor scene can reach hundreds of megabytes. A whole line of research now works on compressing and pruning splats. Gaussians also do not define a clean surface, so extracting a mesh for physics or 3D printing requires additional methods.

Both families share other limits. They need many photos with accurate poses, and with too few views they produce «floaters», small clouds of density hanging in the air that look right from the training cameras and wrong from anywhere else. The base methods assume a static scene. Lighting is baked into the colors, so you cannot move the sun in a reconstructed garden without extra modeling. Dynamic and relightable variants exist, but they add complexity that the original papers avoided.

On the practical side, splatting moved into products quickly. Phone apps such as Niantic’s Scaniverse, Polycam and Luma AI let people capture splats with a phone, and Zillow has started showing splat-based tours on some of its real estate listings.

A Final Observation

The neural network was the most visible part of NeRF, and it turned out to be the part that could be removed. Plenoxels removed it, and Gaussian splatting removed it more completely, yet both kept the same core: a differentiable renderer and a loss that compares rendered pixels with real photos. What NeRF contributed was the idea of reconstructing a scene by making a renderer reproduce the evidence, letting geometry fall out of that pressure. The representation inside can be a network, a grid or a cloud of ellipsoids, and the field keeps swapping it for whatever the hardware runs fastest.

By: Max Johnson B.

Comentarios

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *