Generative Models
Diffusion Models Deep Dive - The Math Behind Image Generation
Diffusion models generate data by learning to reverse a gradual noising process. By training a neural network to predict and remove noise at each step, they produce state-of-the-art images that surpass GANs in both quality and diversity.
- Key point 1 - Forward process adds noise; reverse process learns to denoise step by step
- Key point 2 - Simple noise prediction loss achieves remarkable generation quality
- Key point 3 - Classifier-free guidance and latent diffusion enable text-to-image generation
"From noise, beauty emerges - one denoising step at a time."
Diffusion Models Deep Dive
What You'll Learn
- 1Write the forward marginal q(x_t | x_0) and explain what the alpha bar schedule controls
- 2Derive the simplified DDPM noise-prediction loss from the variational bound
- 3Compare linear and cosine noise schedules and pick an accelerated sampler
- 4Connect noise prediction to score matching, then scale up with classifier-free guidance and latent diffusion
Diffusion models generate data by learning to reverse a gradual noising process. They have achieved state-of-the-art image generation quality, surpassing GANs in both quality and diversity.
Forward Process (Diffusion)
The per-step variances multiply into a running product, which is why any can be drawn directly from instead of simulating transitions:
How this diagram works: This diagram shows the two processes that define diffusion models. The forward process (left, blue) is fixed and non-learned: it gradually adds Gaussian noise to the clean data over timesteps until it becomes pure noise . The noise schedule controls how quickly noise is added at each step. The reverse process (right, pink) is learned by a neural network : starting from pure noise , it iteratively denoises one step at a time, progressively recovering the clean data. The key insight is that while the forward process is simple and known, learning to reverse it - predicting and removing the noise at each step - produces a powerful generative model. During generation, we simply sample random noise and run the learned reverse process to produce realistic data.
Reverse Process (Denoising)
DDPM keeps the variance fixed rather than learned, so only the mean carries parameters:
Noise Schedule
The linear schedule is just a ramp across the steps, and DDPM used :