Deep learning

generative adversarial network

/ JEN-ur-uh-tiv ad-vur-SAIR-ee-ul NET-wurk /

A generative adversarial network, or GAN, learns to create realistic fakes by pitting two networks against each other in a contest. One, the generator, plays a forger: starting from random noise, it tries to produce convincing fake images (or sounds, or data). The other, the discriminator, plays a detective: it is shown a mix of real examples and the forger's fakes, and must judge which is which. The forger wants to fool the detective; the detective wants to catch the forger. They train together, each pushing the other to improve.

The beauty is that neither side needs a human grading every output. The detective learns from being told, after each guess, whether it was right — ordinary supervised learning. The forger never sees real data directly; it learns only from the detective's verdicts, adjusting itself to make fakes that slip through. As the rounds go by, the detective gets sharper at spotting flaws, which forces the forger to fix those flaws, which forces the detective to find subtler ones. In the ideal end state, the forger's output is so realistic the detective can do no better than a coin flip — a moving target chasing a moving target.

GANs, introduced in 2014, produced the first strikingly photorealistic synthetic faces and powered a wave of image generation, style transfer, and super-resolution. But honesty demands the caveats. GANs are notoriously hard to train: the two-player game can spiral out of balance, and a common failure called mode collapse has the forger giving up on variety and churning out the same few convincing images. They also need care to avoid being abused — the word "deepfake" comes from this technology. And for the very highest-quality, most controllable image generation, diffusion models have largely overtaken GANs in recent years, though the adversarial idea remains influential.

Train a GAN on thousands of celebrity photos. Early on, the generator's faces are blobby and the discriminator catches them easily. After many rounds, the generator produces portraits of people who never existed, realistic enough that the discriminator — and often a casual human viewer — can no longer tell them from real photos.

Forger vs. detective: each gets better only by trying to beat the other.

A GAN's two networks improve only by competing, so training is delicate — it can collapse into producing the same few images ("mode collapse"). And the technology behind impressive synthetic faces is the same one behind deepfakes; the capability is neutral, its uses are not.

Also called
GAN生成对抗网络生成對抗網路对抗生成网络