Generative Adversarial Network GAN
The Generative Adversarial Network (GAN), proposed by Ian Goodfellow in 2014, is one of the most creative architectures in deep learning. It learns a data distribution through a game between two networks: one produces fakes and the other detects them.
Core Principles
A GAN contains two roles:
The generator takes a random noise vector and outputs a fake image (or audio, or text). Its goal is to fool the discriminator into judging the fake as real.
The discriminator takes an image and decides whether it is real data or produced by the generator. Its goal is to tell real from fake accurately.
Training is a minimax game: the generator tries to minimize the discriminator's accuracy, and the discriminator tries to maximize it. The theoretical Nash equilibrium is the point where the generator reproduces the real data distribution exactly and the discriminator can only guess at random (50% accuracy).
Key Points
Training GANs is notoriously unstable. A common failure is mode collapse: the generator finds that one particular image reliably fools the discriminator, so it produces only that kind and output diversity is lost. Training oscillation shows up as the two networks' losses bouncing back and forth without converging.
Remedies include Wasserstein GAN, which replaces the JS divergence with the Earth Mover distance and provides smoother gradients; spectral normalization, which constrains the Lipschitz constant of the discriminator; and progressive growing, which raises resolution from low to high step by step.
Relationship to Diffusion Models
After 2022, diffusion models surpassed GANs in image generation quality and became the foundation of Midjourney and Stable Diffusion. But the GAN advantage is extremely fast inference: a single forward pass produces an image, while diffusion needs dozens of denoising steps. So GANs remain irreplaceable in real-time generation, such as live face swapping and real-time super-resolution.
Applications
Face generation (This Person Does Not Exist), image super-resolution, old photo restoration, style transfer, data augmentation (generating scarce samples to train medical models), and deepfake detection research.