← All lessons
0220

GANs

Before diffusion, the leading way to generate realistic images was a GAN: two networks trained against each other, one making fakes and one trying to catch them.

The generator turns random noise into an image. The discriminator sees a mix of real and generated images and guesses which is which. Each round, the generator is rewarded for fooling the critic and the critic for catching fakes, so both improve together. This adversarial pressure pushes the generator toward images realistic enough to pass. Step through the rounds to watch it close the gap.

generatormakes fakesdiscriminatorreal or fake?realism 15%

fake ✗

generator is crude

1/4
Variants & real-world flavors

DCGAN (2015) established the convolutional recipe that made GAN training stable enough to be practical. Conditional GANs add a label to both networks so you can ask for a specific class — generate a 7, not just a digit. StyleGAN made faces indistinguishable from photographs and gave per-layer style knobs, enabling controlled edits like age or pose — this powered the this-person-does-not-exist era and early deepfakes. CycleGAN learns translation between unpaired image sets (horses to zebras, photos to Monet) using a cycle-consistency trick. GANs' chronic ailment is mode collapse — the generator finds a few images that fool the critic and produces only those — one reason diffusion, slower but more diverse and stable, displaced them for open-ended generation. GANs survive where a single fast forward pass matters: upscaling, face editing, real-time filters.

Check yourself

Neither network is told what a good image looks like. How does competition alone produce realistic results?

Go deeper (free): Google — GAN overview (free course)

Next: Overfitting