BEVERLY QIN

Back to Projects

Neural Radiance Fields

my role

Developer

year

2026

contribution

Neural Rendering, Model Implementation, Training

tools

Python, PyTorch, NumPy, Matplotlib, Viser

team

Individual project

Overview

Implemented neural fields in two settings: mapping 2D pixel coordinates to image color, then learning a Neural Radiance Field (NeRF) for novel-view synthesis of a multi-view Lego scene reconstructed by COLMAP.

Implementation choices and results are documented below.

Part 1: Fit a 2D Neural Field

A sinusoidal positional encoder transforms a pixel coordinate (u, v) into 42 dimensions using the original coordinates plus sine/cosine terms through L=10. A four-layer width-256 MLP with ReLU activations maps the encoding to RGB through a Sigmoid output.

At each iteration, 10,000 normalized pixel coordinates and colors are sampled. Adam (lr 1e-2) and MSE loss train the model for 3,000 iterations. Reconstructions become recognizable around iteration 300, resolve finer details by 1,000, and reach approximately 27 dB PSNR by 3,000.

A 2×2 sweep showed that L=1 produces only low-frequency blurry results regardless of width; L=10 with width 16 lacks capacity and artifacts remain; L=10 with width 256 captures the sharpest high-frequency detail.

Training image one
Training image one
Training image two
Training image two
Training progression: sample one
Training progression: sample one
PSNR: sample one
PSNR: sample one
Training progression: sample two
Training progression: sample two
PSNR: sample two
PSNR: sample two
Hyperparameter grid: sample one
Hyperparameter grid: sample one
Hyperparameter grid: sample two
Hyperparameter grid: sample two

Part 2: Multi-View Neural Radiance Field

Using 100 training images, pixel centers are converted to rays with camera intrinsics K and camera-to-world matrices. Rays use a 0.5 coordinate offset, and are sampled between near=2.0 and far=6.0. Training perturbs samples within each interval, while inference uses fixed positions for consistent rendering.

RaysData precomputes all origins, directions, and RGB targets. The NeRF encodes 3D positions with L=10 (63 dimensions) and view directions with L=4 (27 dimensions), then uses two four-layer width-256 ReLU blocks with a position skip connection. Separate density (ReLU) and color (Sigmoid) heads predict per-sample radiance and density.

Volume rendering composites colors with transmittance-weighted accumulation. Adam (lr 5e-4), MSE, 10,000 rays/iteration, and 32 samples/ray trained for 5,000 iterations. PSNR rose from roughly 11 dB to ~21 dB near iteration 700 and finished around 24.8 dB, above the 23 dB target.

Ray sampling visualization
Ray sampling visualization
Validation render
Validation render
NeRF training progression
NeRF training progression
Spherical novel-view render
Spherical novel-view render