AI glossary

GAN (generative adversarial network)

In one sentence A GAN trains two networks against each other, one making fakes and one spotting fakes, until the fakes look real.

By Updated

A GAN, or generative adversarial network, is two networks trained against each other: one produces fake data, the other tries to catch it, and both get better as a result.

Picture a forger and a detective who start on the same day. The forger paints something clumsy; the detective spots it instantly and says why. The forger tries again. Months later the detective is very hard to fool, which means the forgeries have become very good. Neither could have reached that level alone — each one's progress is the other's training data.

The two halves have names. The generator takes random noise and turns it into an image. The discriminator takes an image and answers one question: real, or made up? The generator never sees the real photographs directly. Its only feedback is whether the discriminator was fooled.

The setup

random noise → Generator → fake image ─┐
                                       ├→ Discriminator → "real" or "fake"
real photos ───────────────────────────┘
                                       │
        both networks learn from that verdict

GANs produced the first photorealistic faces of people who do not exist, and they are still used for super-resolution, image-to-image translation and cheap synthetic training data. They are also famously hard to train. The two networks have to improve at roughly the same rate, and the classic failure is mode collapse: the generator finds one image that fools the discriminator and produces that one thing forever.

That difficulty is a large part of why diffusion models took over most image generation after about 2021 — they train with a stable, straightforward objective. The original GAN paper is Goodfellow et al., 2014.

Where to go next

Learn this properly

Full lessons that use this term in context.

  • Deep Learning

    GANs

    A GAN trains two networks against each other, one inventing fakes and one catching them, so the invented data gets better without anyone ever writing down what good looks like.

Back to the glossary