This is a basic implementation of denoising diffusion probabilistic models (Ho et al.) from scratch. The model was trained to generate unseen (non-existent) random images of dogs using the 70 Dog Breeds(n=7946) and the Stanford dogs(n=20000) image datasets. The code is inspired by this notebook by DeepFindr which implements diffusion on cars using a UNet denoiser.
The model was trained for 300 epochs. Example image generations are shown below. While it isn't state-of-the-art we still show that it's outputting images which almost look like dogs. There are some artefacts like noise and checkerboard pattern (due to transposed convs). With some further improvements to the model, we expect this to do better.
Training images:
Generated images:
Setup environment
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Generate 3 images with filenames sample{i}
cd diffusion_dogs
python generate.py --fname plots/sample -n 3