Assignment 3 — Neural Radiance Fields

Course16‑825 (Learning for 3D Vision)
Assignment3
StudentKunwoo Lee

Part A: Neural Volume Rendering


0. Transmittance Calculation (10 points)

Compute the transmittance of a ray going through a non-homogeneous medium.

Transmittance calculation
Transmittance calculation derivation.

1. Differentiable Volume Rendering (30 points)

1.3. Ray Sampling (5 points)

Implement: get_pixels_from_image and get_rays_from_pixels in ray_utils.py.

Ray visualization
Visualization of camera rays in world space.
XY grid
XY grid of pixel coordinates.

1.4. Point Sampling (5 points)

Implement: StratifiedSampler.forward in sampler.py.

Sample points
3D points sampled along rays.
Depth visualization
Depth map visualization (normalized).

1.5. Volume Rendering (20 points)

Implement: VolumeRenderer._compute_weights, VolumeRenderer._aggregate, and depth rendering in renderer.py.

Volume rendering
Spiral rendering of box volume from multiple viewpoints.

2. Optimizing a Basic Implicit Volume (10 points)

2.1. Random Ray Sampling (5 points)

Implement: get_random_pixels_from_image in ray_utils.py.

2.2. Loss and Training (5 points)

Implement: MSE loss in the train function in volume_rendering_main.py.

Training Progress

Before training view 0
Before training (view 0).
Before training view 1
Before training (view 1).
Before training view 2
Before training (view 2).
Before training view 3
Before training (view 3).
After training view 0
After training (view 0).
After training view 1
After training (view 1).
After training view 2
After training (view 2).
After training view 3
After training (view 3).
Training animation
Spiral rendering after optimization.

3. Optimizing a Neural Radiance Field (NeRF) (20 points)

Implement: NeuralRadianceField MLP in implicit.py and loss in train_nerf.

View-Independent NeRF

Basic NeRF implementation without view dependence, trained on the lego bulldozer dataset.

View-independent 10 epochs
View-independent: 10 epochs
View-independent 20 epochs
View-independent: 20 epochs
View-independent 180 epochs
View-independent: 180 epochs

4. NeRF Extras (10 points)

4.1. View Dependence (10 points)

Extended NeRF to handle view-dependent effects. The network now takes viewing direction as input, allowing it to model specular highlights and reflections on the lego pieces.

View-dependent 10 epochs
View-dependent: 10 epochs
View-dependent 20 epochs
View-dependent: 20 epochs
View-dependent 180 epochs
View-dependent: 180 epochs

Analysis

The view-dependent NeRF produces more photorealistic results with accurate specular reflections, especially visible on the metallic and glossy surfaces of the bulldozer. However, there's a trade-off: the increased capacity can lead to overfitting on training views if not properly regularized. The view-independent variant generalizes better to novel views but lacks realistic reflections.

4.2. Coarse/Fine Sampling (Extra Credit)

[Optional: Implement hierarchical sampling with coarse and fine networks. Discuss speed/quality trade-offs.]


Part B: Neural Surface Rendering


5. Sphere Tracing (10 points)

Implement: sphere_tracing function in renderer.py.

Sphere tracing torus
Torus rendered using sphere tracing.

Implementation notes: Sphere tracing iteratively steps along each ray by the distance to the nearest surface (given by the SDF). This allows efficient rendering of implicit surfaces without uniform sampling. The algorithm terminates when either the ray gets very close to the surface (intersection found) or exceeds the maximum number of steps.

6. Optimizing a Neural SDF (15 points)

Implement: NeuralSurface.get_distance in implicit.py and eikonal_loss in losses.py.

Input point cloud
Input point cloud for training.
Predicted surface
Reconstructed surface from neural SDF.

7. VolSDF (15 points)

Implement: NeuralSurface.get_distance_color, get_color in implicit.py and sdf_to_density in renderer.py.

Extracted geometry
Extracted surface geometry from VolSDF.
Rendered with color
VolSDF rendering with learned colors.

SDF to Density Conversion

The VolSDF paper introduces parameters α (alpha) and β (beta) for converting SDF to density:

Analysis Questions

  1. High vs Low β bias: High β biases the SDF to be very sharp near surfaces, creating a thin shell of density. Low β allows more diffuse density distributions.
  2. Training difficulty: Low β is easier to train initially because gradients flow through a larger region. High β requires more precise SDF predictions early in training.
  3. Surface accuracy: High β leads to more accurate surfaces once converged, as it enforces tighter constraints on where density exists. Low β may result in "bloated" surfaces.

Hyperparameter Settings

Best results achieved with: alpha: 50.0, beta: 0.1. By increasing beta, the model produced sharper surfaces with better-defined geometry, while a moderate alpha helped maintain stable training dynamics.

8. Neural Surface Extras (10 points)

8.1. Render a Large Scene with Sphere Tracing (10 points)

Complex scene composed subtraction of multiple primitives. This shape, which has cube-like holes inside a sphere, shows how sphere tracing can be efficient, but can fail when some of the features can't be reached due to occlusion, such as the inner cube incut here.

Complex scene
Complex scene with multiple primitives rendered using sphere tracing.

Conclusion & Reflections

This assignment explored both volume-based and surface-based neural 3D representations: