~ / projects /

Building a Diffusion Model

A diffusion model learns to generate by learning to undo destruction. The forward process is fixed and needs no learning: add Gaussian noise to a sample, step by step, until nothing is left. The reverse process is the model. It predicts what was removed at each step, and running it from pure noise produces a new sample.

This project builds that machinery and then pushes it into three dimensions, generating 3D objects rather than images from text prompts.

From 2D generation to 3D objects

The hard part of going 3D is supervision. No dataset of 3D objects is large enough to train a diffusion model the way image models are trained. The way around it is to keep the diffusion model in 2D, where the data is, and put the 3D representation behind it: optimize a neural radiance field so that its renderings look right to a pretrained image diffusion model, from every angle it is asked about.

Score Distillation Sampling (SDS). Render the NeRF from a random camera, add noise to the rendering, and ask the frozen 2D diffusion model to predict that noise given the text prompt. The gap between its prediction and the noise that was actually added is a gradient pointing toward “more like the prompt”, and it is backpropagated through the renderer into the NeRF’s weights. The 3D structure is never supervised directly. It emerges because the only way to satisfy a 2D critic from every viewpoint at once is to be consistent in three dimensions.

The same loss works on a plain image first, which makes a useful sanity check: optimize pixels directly against the prompt, with and without SDS guidance.

Table of four prompts (a standing corgi dog, a dragon, a hamburger, a golden cocker retriever) with two images each: a flat brown texture without SDS guidance, and a recognizable image of the prompt with SDS guidance.
SDS on 2D images. Without SDS guidance (middle) the optimized image stays a flat texture; with it (right) each prompt resolves into a recognizable object.

Results

Each prompt below was optimized into a NeRF, then rendered as an orbiting view. The depth map is the one to watch: it shows whether real geometry was recovered, or whether the model found a flat shortcut that only looks right from the training viewpoints.

Prompt Depth RGB

A standing corgi dog

Castle on a hill

Race car

Where this sits

Several groups are attacking the same supervision problem from different angles. RenderDiffusion puts an intermediate 3D representation inside each denoising step, so a single model both generates and renders, trained from monocular 2D data alone. Denoising Diffusion via Image-Based Rendering learns a prior over IB-planes, a scene representation designed to scale to large scenes. GSD swaps the representation again, diffusing over sets of Gaussian splats to reconstruct an object from a single view.

None of them supervise 3D directly. They differ in what the 3D representation is and where it sits in the pipeline.

Coursework for 16-825, Learning for 3D Vision.

References

  1. Anciukevičius, T., et al. RenderDiffusion: Image Diffusion for 3D Reconstruction, Inpainting and Generation. CVPR 2023. arXiv:2211.09869
  2. Henderson, P., et al. Denoising Diffusion via Image-Based Rendering. ICLR 2024. arXiv:2402.03445
  3. Mu, Y., et al. GSD: View-Guided Gaussian Splatting Diffusion for 3D Reconstruction. 2024. arXiv:2407.04237
  • Computer Vision
  • Deep Learning