This project implements a Generative Adversarial Network (GAN) from scratch in Keras & TensorFlow to generate realistic handwritten digits similar to the MNIST dataset.
A GAN consists of two neural networks trained together:
- Generator: Learns to create synthetic digit images from random noise.
- Discriminator: Learns to distinguish between real MNIST images and fake images created by the generator.
Both models compete, and over time the generator produces increasingly realistic digits.
| Generator | Discriminator |
|---|---|
![]() |
![]() |
- Custom-built Generator and Discriminator networks using TensorFlow/Keras.
- Training loop with
tf.GradientTape. - Model checkpointing to resume or reuse training.
- Visualization of generated digits per epoch.
- Creation of a GIF animation showing generator progress.
- Export of all generated images (epochs 1–100) into a single ZIP archive.
| Input | Epoch 1 |
|---|---|
![]() |
![]() |
| Epoch 2 | Epoch 3 |
|---|---|
![]() |
![]() |
| Epoch 9 | Epoch 17 |
|---|---|
![]() |
![]() |
| Epoch 25 | Epoch 50 |
|---|---|
![]() |
![]() |
| Epoch 75 | Epoch 100 |
|---|---|
![]() |
![]() |
- Implement FID (Fréchet Inception Distance) or Inception Score for evaluation.
- Explore deeper architectures for generator and discriminator.
- Extend GAN training to color image datasets (e.g., CIFAR-10).
- Try Conditional GANs (cGANs) to generate specific digits.













