...

/

What Are Diffusion Models?

What Are Diffusion Models?

Learn about diffusion models and their different components.

Overview

Consider the scenario of dispersing an ink drop into a container of water. Initially, the drop remains easily distinguishable. However, if given ample time, the molecules will progressively disperse uniformly throughout the container, resulting in a noticeable alteration of the water’s color. This is a fundamental illustration of the principles governing diffusion. Now, let’s explore how the concept of diffusion serves as a source of inspiration for diffusion models.

Press + to interact
Ink drop dissolving into a water container
Ink drop dissolving into a water container

Diffusion models

Let’s assume we want to generate images, and the water container represents one image. We’ll also assume that the ink drop is noise, which we gradually add to the image. What will happen at each step? We’ll keep adding the noise to the image till the image becomes pure noise. The idea is to learn the distribution of images by gradually undoing the addition of noise.

Press + to interact
Overview of diffusion models
Overview of diffusion models

Components of a diffusion model

Let’s discuss the two parts of a diffusion model.

Forward process

The forward process in a diffusion model starts with a sample taken from input data. We apply the diffusion transformations, such as adding noise iteratively till the data becomes pure noise, to this sample. We usually consider Gaussian noise (normal distribution) in diffusion models. Consider an image xox_otaken randomly from our data. We add noise εN(0,I)\varepsilon \sim \mathcal{N}(0,I) (sampled from normal distribution with mean 0 and varience 1) to xox_o in TT steps, which will result in a sequence of noisy samples x1,x2,,xTx_1, x_2, \dots, x_T.

Press + to interact
Forward process: Adding noise to an image step by step
Forward process: Adding noise to an image step by step

We model the relationship between xtx_t and xt1x_{t-1} as the Gaussian distribution, where q(x0)q(x_0) is the real data distribution:

q(xtxt1)N(xt;1βt xt1,βtI)q(x_t|x_{t-1}) \coloneqq \mathcal{N}(x_t ; \sqrt{1-\beta_t } \space x_{t-1}, \beta_t I) ...

Access this course and 1400+ top-rated courses and projects.