← AI Terminology
GAN - Generative Adversarial Network
GAN stands for Generative Adversarial Network: a generative model architecture introduced by Ian Goodfellow (2014) consisting of two neural networks — a generator that creates synthetic data and a discriminator that tries to distinguish real from fake — trained in an adversarial minimax game.
GANs produced the most impressive image generation results of the 2014–2021 era.
GANs produced the most impressive image generation results of the 2014–2021 era.
Why It Matters in AI
GANs demonstrated that neural networks could generate photorealistic images, video, and audio through adversarial training — a completely novel training paradigm. StyleGAN2 faces were so realistic they became a standard deepfake concern. While diffusion models have largely overtaken GANs in image quality and training stability, GANs remain widely used for fast inference (no iterative denoising) and in domains like medical image synthesis where training data is scarce.
Key Points
| Aspect | Description |
|---|---|
| Generator G | Maps random noise z to synthetic data G(z) — tries to fool the discriminator |
| Key variants | DCGAN, CycleGAN, StyleGAN (→ V2, V3), BigGAN, pix2pix, SRGAN, Pix2Pix |
| Mode collapse | Generator produces limited diversity — common failure mode; addressed by Wasserstein GAN, etc. |
| Discriminator D | Classifies inputs as real or fake — tries to catch the generator's output |
| Training signal | G minimises log(1−D(G(z))); D maximises log(D(x)) + log(1−D(G(z))) — minimax game |
| Training unstab. | Adversarial game can oscillate rather than converge — notoriously difficult to train |
Simple Analogy
A counterfeiter (generator) and a detective (discriminator) locked in a game. The counterfeiter improves their fake banknotes based on how the detective caught them; the detective improves their detection as fakes get better. Eventually, the counterfeiter produces such convincing fakes the detective can no longer tell them apart — at which point the generator has learned the data distribution.
Common Usage Examples
- StyleGAN2:
generate_image(noise_vector)— photorealistic face generation, this-person-does-not-exist.com - CycleGAN: unpaired image-to-image translation (horse → zebra, photo → painting)
- Medical imaging: GAN augments scarce training data (synthetic tumor images for classifier training)
- Pix2Pix: paired image-to-image translation (sketch → photo, aerial → map)
torchgan.losses.WassersteinGeneratorLoss()— Wasserstein GAN loss for more stable training
Summary
In short: GANs trained two networks against each other to generate realistic data — the breakthrough that launched generative AI, now largely superseded by diffusion models for image quality but still fast at inference.