Hello! Welcome to the first lesson of our module on advanced 3D generation techniques.
In the last module, we explored two distinct paradigms for 3D generation:
- Implicit Generation via SDS: Using a pre-trained 2D diffusion model to guide the optimization of a NeRF from a text prompt (e.g., DreamFusion).
- Explicit Generation: Training a diffusion model directly on 3D datasets to generate point clouds or voxels in a single forward pass (e.g., Point-E, OctFusion).
Today, we bridge these worlds by focusing on a fundamental task in 3D computer vision: single-view 3D reconstruction. Instead of a text prompt or pure noise, our input will be a single 2D image. Our goal is to create a full 3D representation of the object in that image.
By the end of this lesson, you will be able to set up a framework for single-view 3D reconstruction by optimizing a Neural Radiance Field (NeRF) conditioned on an input image. This is a crucial step towards creating 3D content from specific visual references.
1. Revisiting the NeRF Paradigm
Before tackling the single-view problem, let's quickly recap the standard NeRF setup. As you'll recall, a classic NeRF is trained to represent one specific scene by "overfitting" a neural network to a dense collection of input views of that scene.
The video below gives an excellent refresher on this core concept.
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis (ML Research Paper Explained)
This video by Yannic Kilcher provides a concise explanation of the original NeRF paper. It's a great way to brush up on the fundamental principles before we extend them.
Please watch these segments to refresh your memory on the NeRF pipeline: The Core Idea (05:26 - 08:06): Focus on the concept of overfitting one neural network to one scene, making the network's weights the representation of the scene itself. Inputs and Outputs (08:06 - 10:27): Remind yourself of the 5D input (3D position + 2D direction) and 4D output (RGB color + density). Rendering Process (10:27 - 14:37): Review how an image is rendered by casting rays and integrating color and density samples. Differentiable Optimization (16:08 - 19:01): Reconnect with the key insight that the entire rendering process is differentiable, allowing for optimization via a photometric loss against ground truth images.
The key takeaway is that a standard NeRF solves the Multi-View Stereo (MVS) problem: given many images of a scene and their corresponding camera poses, it reconstructs a 3D representation.
2. The Challenge of Single-View Reconstruction
Our task is significantly harder. We are given only one image. This is an inherently ambiguous, or ill-posed, problem. The single image provides no information about the parts of the object that are occluded or on the back side.
How can a model possibly reconstruct the full 3D shape? It must rely on a learned prior. The model needs to have been trained on a large dataset of 3D objects to develop an "understanding" of what typical objects look like. For example, if it sees the front of a car, it can infer that there are probably four wheels and a back side that looks a certain way.
The question then becomes: how do we build a NeRF framework that can learn and leverage such a prior?
3. Conditional NeRFs: The Solution
The answer lies in making the NeRF model conditional. Instead of being a standalone function that only knows about one scene, we design a NeRF that takes an additional input: a conditioning signal derived from the input image.
This allows us to train a single, generalizable NeRF model across a large dataset of different objects. At inference time, we provide an image of a new object, and the model uses the conditioning signal from that image to render the specific 3D shape.
Conditional Nerf: A Comprehensive Guide for 2025
This article from ShadeCoder provides a clear definition and guide to Conditional NeRFs. It explains how to extend the basic NeRF architecture to handle external inputs.
Please read the following sections: "What Is Conditional Nerf?": Focus on the definition. The key idea is that the radiance field is conditioned on extra inputs beyond just position and direction. "How to Use Conditional Nerf": Skim the step-by-step implementation guide. Pay close attention to step 3, which lists common conditioning mechanisms like concatenation and FiLM layers. We will be focusing on a method that uses concatenation.
4. A Framework for Single-View Reconstruction: PixelNeRF
Let's make this concrete by examining a canonical framework for this task, often referred to as PixelNeRF. The pipeline below illustrates the entire process.

Let's walk through this diagram step-by-step. This is the core framework you need to understand.
-
Input View & CNN Encoder: An input image of an object is fed into a 2D Convolutional Neural Network (CNN), such as a ResNet. Instead of producing a final classification, we extract an intermediate feature grid, which we'll call
W. This grid acts as a rich, spatially-aware descriptor of the input object. -
Ray Sampling and Feature Lookup: To render a pixel in a (novel) target view, we cast a ray and sample 3D points
xalong it. For each pointx, we project its coordinates onto the feature gridWto look up the corresponding feature vector. This is the crucial conditioning step. -
Conditioned MLP: The NeRF's MLP,
f, now takes three inputs: the positionally encoded 3D pointγ(x), the positionally encoded viewing directionγ(d), and the sampled feature vectorW(πx). The MLP predicts the colorcand densityσfor that point, conditioned on what it "sees" in the input image. -
Volume Rendering & Loss: The predicted colors and densities are integrated along the ray using the standard volume rendering equation to produce a final pixel color. This rendered color is compared against the ground truth color from the target view image, and the difference (e.g., L2 loss) is backpropagated to train the weights of both the CNN encoder and the NeRF MLP.
Training vs. Inference
It's vital to distinguish the training and inference phases:
- Training: The model is trained on a large dataset where each object has multiple views. In each training step, we provide one view as the input/conditioning image and use a different view as the ground truth for the rendering loss. This forces the model to learn a generalizable prior for inferring unseen parts.
- Inference: Once trained, the model can take a single image of a completely new object and generate its 3D NeRF representation, which can then be rendered from any angle.
Test your understanding!
You are training a single-view NeRF reconstruction model. For a single object in your training set, you use view_A as the conditioning input and also as the ground truth for the rendering loss. What is the potential problem with this training strategy?
Show answer
The problem is that the model is only being asked to "reconstruct" a view it has already seen. It doesn't need to infer any occluded geometry. This encourages the model to simply learn to "copy" pixels from the input view to the output, rather than learning a meaningful 3D shape prior. The model might achieve very low loss on the training set but will likely fail to generate plausible 3D shapes or novel views at inference time, as it never learned to reason about unseen geometry. The correct strategy is to condition on one view and calculate the loss against a different view of the same object.
5. Setting Up Your Framework: Practical Steps
Given your ML engineering background, let's outline the high-level components you would need to implement this framework.
-
Data Preprocessing:
- You need a dataset of objects, each with multiple views and corresponding camera poses.
- If you start with raw videos or image sets, you'll need to run a Structure-from-Motion (SfM) tool like COLMAP to estimate camera poses. This is often a critical and challenging first step. The "NeRF in 2023" article provides practical context on using COLMAP via
NeRFStudio's helper scripts, highlighting real-world challenges like scene centering and scaling.
-
The Model Architecture:
- Image Encoder: A standard pre-trained CNN backbone (e.g., ResNet-34) is a good starting point. You'll need to modify its final layers to output a feature grid.
- Conditional NeRF MLP: A standard MLP, but its input layer must be wide enough to accept the concatenated positional encodings and the image feature vector.
-
The Training Pipeline:
- Data Loader: Must be able to sample an object, then select one conditioning view and one or more target views.
- Rendering Loop: This is the "analysis-by-synthesis" part. For each target view, you will:
- Generate rays.
- Sample points.
- Look up image features for each point.
- Query the MLP.
- Perform volume rendering.
- Loss and Optimization: A simple L2 photometric loss is standard. The optimizer (e.g., Adam) will update the parameters of the encoder and the MLP simultaneously.
This framework is a general and powerful way to learn 3D reconstruction from 2D images. While we've focused on conditioning via feature concatenation (as in PixelNeRF), more advanced methods might use FiLM layers or cross-attention to inject the conditioning information, as mentioned in the ShadeCoder resource.
Conclusion
In this lesson, we have laid out the conceptual and practical framework for single-view 3D reconstruction using conditional NeRFs.
Key Takeaways:
- Single-view reconstruction is an ill-posed problem that requires a model to learn a 3D shape prior from data.
- Conditional NeRFs solve this by taking a conditioning signal from an input image, allowing a single model to generalize across many objects.
- A typical framework involves a CNN encoder to extract image features and a NeRF MLP that uses these features to predict color and density.
- The system is trained end-to-end using an analysis-by-synthesis approach, where the model is conditioned on one view and trained to render other, novel views of the same object.
Next Lesson Preview:
This framework learns a geometric prior entirely from a dataset of multi-view images. But what if we could supplement this with the powerful generative priors learned by large-scale diffusion models? In our next lesson, we will explore how to apply a pre-trained diffusion model as a prior to guide and improve single-view NeRF optimization, adding another powerful tool to our 3D generation arsenal.