Generative Adversarial Networks (GANs)
Generative Adversarial Networks (GANs) are a class of machine learning frameworks designed by Ian Goodfellow and his colleagues in 2014. GANs consist of two neural networks, a Generator (G) and a Discriminator (D), that are trained together in a game-theoretic scenario. The Generator creates data that mimics a particular distribution, while the Discriminator tries to distinguish between real data (from the training set) and fake data (created by the Generator).
Components of GANs
- Generator (G):
- Takes random noise (usually from a normal distribution) as input and generates data.
- Its goal is to create data that is indistinguishable from real data.
- Discriminator (D):
- Takes input from both real data and fake data generated by G.
- Its goal is to correctly classify input data as real or fake.
How GANs Work
- The Generator starts with random noise and tries to generate data that resembles the real data.
- The Discriminator evaluates the generated data against the real data and attempts to classify them.
- The Generator and Discriminator are trained simultaneously:
- The Generator aims to maximize the Discriminator’s error rate (i.e., “fool” the Discriminator).
- The Discriminator aims to minimize its classification error rate.
This adversarial process continues until the Generator produces data that is indistinguishable from real data.
Real-Life Example: Image Generation
One popular application of GANs is generating realistic images. For example, GANs can be used to generate images of human faces that do not belong to any real person.
- Generator:
- Inputs: Random noise vector (e.g., a 100-dimensional vector sampled from a Gaussian distribution).
- Outputs: A generated image.
- Discriminator:
- Inputs: An image (either from the real dataset or generated by the Generator).
- Outputs: A probability indicating whether the input image is real or fake.
The goal is for the Generator to create images that the Discriminator cannot distinguish from real images.