Generative Adversarial Networks
GANs pit a generator against a discriminator in a game, training the generator to produce data realistic enough to fool its critic.
The adversarial game
A generative adversarial network trains two networks in competition. The generator maps random noise to synthetic samples. The discriminator tries to tell real data from the generator's fakes. The generator's goal is to fool the discriminator; the discriminator's goal is not to be fooled. As they train against each other, the generator is pushed to produce increasingly realistic samples. At the ideal equilibrium, the fakes are indistinguishable from real data.
The minimax objective
The two networks optimize opposing objectives, formalized as a minimax game: the discriminator maximizes its ability to classify real versus fake, while the generator minimizes the discriminator's success. In practice the generator is trained with a modified objective that provides stronger gradients early in training, when its samples are easy to detect and the original loss saturates.
# alternating GAN updates (sketch)
# 1) train D: maximize log D(x_real) + log(1 - D(G(z)))
# 2) train G: maximize log D(G(z)) # fool the discriminator
# repeat, sampling noise z each step
Training instability
GANs are notoriously hard to train. The two networks must stay balanced; if the discriminator becomes too strong, the generator receives vanishing gradients and stops improving. Mode collapse occurs when the generator produces only a few outputs that reliably fool the discriminator, ignoring the full data variety. Remedies include the Wasserstein loss with gradient penalty, spectral normalization, and careful architecture and learning-rate tuning.
Architectural milestones
- DCGAN: convolutional generator and discriminator, a stable baseline for images.
- Conditional GAN: condition generation on a label or input for controllable output.
- CycleGAN: unpaired image-to-image translation using cycle-consistency.
- StyleGAN: style-based generator giving fine control and high-fidelity faces.
Uses and current standing
GANs produce sharp, high-resolution images and are used for image synthesis, super-resolution, image-to-image translation, and data augmentation, including generating synthetic training data where real examples are scarce. For general image and audio generation, diffusion models have largely overtaken GANs on quality and training stability, but GANs remain valuable where fast single-step generation or specific style control is needed.
- Generator and discriminator train in opposition.
- Equilibrium yields indistinguishable fakes.
- Instability and mode collapse are the main hazards.
- Sharp outputs; largely succeeded by diffusion for generation.