Skip to content

This project uses a Generative Adversarial Network (GAN) to create synthetic images of handwritten digits from the MNIST dataset. By training the GAN, it learns to generate digit images that closely resemble real handwritten digits. These generated images can be valuable for data augmentation, image synthesis, and various computer vision tasks.

Notifications You must be signed in to change notification settings

smhasandanish/MNIST-GAN-Image-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

This project implements a Generative Adversarial Network (GAN) to generate synthetic images of handwritten digits from the MNIST dataset. The GAN is trained to produce realistic digit images that closely resemble the real data. These generated images can be useful for data augmentation, image synthesis, and various computer vision tasks.

Usage:

Run the provided code in a Python environment (e.g., Google Colab) with GPU support for faster training. The GAN will be trained for a specified number of epochs (100 epochs by default). After training, the code will generate a set of synthetic digit images and save them as PNG files. You can view the generated images to observe the GAN's performance. Dependencies:

Python 3.x TensorFlow 2.x NumPy Matplotlib

  1. Data Loading: It loads the MNIST dataset, which consists of 28x28 grayscale images of handwritten digits (0 through 9). The dataset is preprocessed and normalized to be within the range [-1, 1].

  2. Generator and Discriminator Models: It defines two neural network models:

    • Generator: This model takes random noise as input and generates fake images that are meant to resemble handwritten digits.
    • Discriminator: This model takes both real images from the dataset and fake images generated by the generator. Its task is to distinguish between real and fake images.
  3. Loss Functions: It defines loss functions for both the generator and discriminator. The generator tries to generate images that the discriminator cannot distinguish from real images, while the discriminator tries to correctly classify real and fake images.

  4. Optimizers: It specifies the optimizers (Adam in this case) for both the generator and discriminator models.

  5. Training Loop: It contains a training loop where the generator and discriminator are trained alternately. During each iteration of the loop, the generator generates fake images, and the discriminator is trained to distinguish between real and fake images.

  6. Generation of Images: After training for a specified number of epochs, the code generates a set of fake images using the trained generator. These generated images are then saved as PNG files.

About

This project uses a Generative Adversarial Network (GAN) to create synthetic images of handwritten digits from the MNIST dataset. By training the GAN, it learns to generate digit images that closely resemble real handwritten digits. These generated images can be valuable for data augmentation, image synthesis, and various computer vision tasks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages