Created by
Sakhaa Alsaedi1 and Sara Althubaiti.1
King Abdullah University of Science and Technology (KAUST)1
This repository contains code for building a diffusion model to compress the FossilNET dataset and generate imges. This can generally be useful for high quality samples, or for model diversity.
Diffusion models are a type of generative model used in machine learning to generate data that is similar to the data on which they are trained . They work by adding noise to the available training data and then gradually reducing the noise until the generated data closely resembles the training data. Diffusion models are a rising class of generative models because of their power-generating ability and tractability . They can also improve upon existing generative models, such as Generative Adversarial Networks (GANs), by being less reliant on adversarial training.
- Step 1: The forward process ==> Noise scheduler
- Step 2: Parameterized backward process ==> NN Model U-Net (autoencoder)
- step 3: Positional Encoding ==> timestep encoding
We will be using the FossilNET Image dataset that had been collected and curated by Matt Hall and consists of 3000 colour images at 224x224 resolution, split over 10 classes:
- Ammonites
- Bivalues
- Corals
- Dinosaurs
- Echinoderms
- Fishes
- Forams
- Gastropods
- Plants
- Trilobites
Recognizing the Digits from 0-9 using their pixel values as attributes, using Deep Learning Model to Classify the Digits. The original dataset is in a format that is difficult for beginners to use. This dataset uses the work of Joseph Redmon to provide the MNIST dataset in a CSV format. The mnist_train.csv file contains the 60,000 training examples and labels. The mnist_test.csv contains 10,000 test examples and labels. Each row consists of 785 values: the first value is the label (a number from 0 to 9) and the remaining 784 values are the pixel values (a number from 0 to 255).
The dataset consists of two files:
- Mnist_train.csv
- Mnist_test.csv
- Mnist_train.csv
- Utilize the
dataloader_fossilnet.py
script in the notebook 1. - Use MNIST dataset loader from PyTorch in the notebook 2.
Google Colab provides all the necessary dependencies for running the code in this repository. You do not need to install any additional packages.
Notebook | Open in Colab |
---|---|
Notebook 1 | |
Notebook 2 |
- ▬▬▬▬▬▬ Resources and Materials ▬▬▬▬▬▬
- Github implementation Denoising Diffusion Pytorch
- Niels Rogge, Kashif Rasul, Huggingface notebook
- Diffusion model tutorial 2 by Rogge & Rasul and follows the paper by He et al.
- Awesome Diffusion Models Github
- Outlier Diffusion Model Video: Paper Explanation | Math Explained
- Positional Embeddings
- ▬▬▬▬▬▬▬ Papers ▬▬▬▬▬▬▬
- Papers on Diffusion models ([Dhariwal, Nichol, 2021], [Ho et al., 2020] ect.)
- DDPM
- DDPM Improved