Diffusion Models for Image Data Generation
An application of Denoising Diffusion Probabilistic Models (DDPM) to generate high-quality synthetic training data for an image classifier using the CIFAR-10 dataset.
Github Link to the project - Link
In the age of Deep Learning, there is a huge need for data collection for efficiently training these models. but collecting high-quality datasets is often expensive, time-consuming, or even impractical. Synthetic data generation offers a solution to this problem—creating realistic, artificial data to train models effectively.
This project discusses the implementation of a particular method of generation of artifical data - namely Diffusion Models. The aim of this project is to use Diffusion Models to generate high-quality synthetic training data for an image classifier using the CIFAR-10 dataset.
Principle behind Diffusion Models
Diffusion Models work by adding noise to an image step by step until it becomes pure randomness. Then, they learn to reverse this process, gradually reconstructing meaningful images from noise. Mathematically, this involves two key steps:
-
Forward Process (Noise Addition):
\[q(x_t \mid x_{t-1}) = \mathcal{N}(x_t; \sqrt{1 - \beta_t} x_{t-1}, \beta_t I)\]
A controlled amount of Gaussian noise is added at each step, following a Markov chain:where \(\beta_t\) is a small noise variance.
-
Reverse Process (Denoising):
\[p(x_{t-1} \mid x_t) = \mathcal{N}(x_{t-1}; \mu_\theta(x_t, t), \sigma_t^2 I)\]
A neural network learns to predict and remove this noise to reconstruct the original image:where \(\mu_\theta\) is the learned mean function.
</div>
</div>
Results
From the above pipeline, images were generated for all 10 classes and the generated images are as follows.
This is a plot of the performance of a very basic CNN classifier model before and after the data augmentation. The validation accuracy of the model improved from 54% to 57.12% after augmentation.