This project demonstrates the use of Generative Adversarial Networks (GANs) to generate fake images for the MNIST dataset. GANs consist of a generator and a discriminator, which are trained simultaneously through adversarial training. The generator tries to create realistic images, while the discriminator tries to distinguish between real and fake images. You can use the same idea for othe datasets.
Generative Adversarial Networks (GANs) are a class of artificial intelligence algorithms used in unsupervised machine learning. They were introduced by Ian Goodfellow and his colleagues in 2014. GANs consist of two neural networks, a generator, and a discriminator, which are trained simultaneously through adversarial training.
-
Generator:
- The generator takes random noise as input and tries to generate data (e.g., images).
- It learns to produce data that is indistinguishable from real data.
-
Discriminator:
- The discriminator evaluates whether a given input is real (from the actual dataset) or fake (produced by the generator).
- It is trained to improve its ability to distinguish between real and generated data.
-
Generator Training:
- The generator generates fake data.
- The discriminator evaluates the fake data.
- The generator aims to produce data that the discriminator classifies as real.
-
Discriminator Training:
- The discriminator is trained on both real and fake data.
- It learns to correctly classify real and generated data.
- The generator continues to improve based on the feedback from the discriminator.
- GANs are trained in an adversarial manner, where the generator and discriminator are in a constant competition.
- The generator's goal is to produce realistic data that can fool the discriminator.
- The discriminator's goal is to become increasingly accurate in distinguishing real from fake data.
Real | Fake |
---|---|
Real images from MNIST dataset | Fake Images Genereted by the trained GAN |
You can work with this repository in two ways:
-
Clone the repository and run the notebook
-
Open the note book in Colab: https://colab.research.google.com/github/barzansaeedpour/GAN-Fake-Image-Generation/blob/main/GAN-Fake-Image-Generation.ipynb
GAN-Fake-Image-Generation.ipynb
: Script for training the GAN on the MNIST dataset.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to contribute to the project by opening issues or submitting pull requests!