Overview

How do you make a computer creative? How do you make it paint a picture or generate a face? You make two computers fight. Generative Adversarial Networks (GANs) are the technology behind Deepfakes and AI Art.

Core Idea

The core idea is The Forger vs. The Detective.

  1. Generator (Forger): Tries to create a fake image (e.g., a fake Picasso).
  2. Discriminator (Detective): Tries to tell if it’s real or fake. They play a game. The Forger gets better at lying; the Detective gets better at spotting lies. Eventually, the Forger becomes so good that the Detective can’t tell the difference.

Formal Definition

A machine learning framework where two neural networks contest with each other in a zero-sum game.

Intuition

  • Generator: A counterfeiter printing fake money.
  • Discriminator: The police checking the money.
  • Result: Perfect counterfeit money (or in this case, perfect AI images).

Examples

  • ThisPersonDoesNotExist.com: A website that generates a photo of a person who doesn’t exist every time you refresh. The faces are perfect, but they are hallucinations of a GAN.
  • Deepfakes: Swapping faces in videos.
  • Super Resolution: Taking a blurry, low-res photo and hallucinating the details to make it 4K. (CSI “Enhance” is now real).

Common Misconceptions

  • It copies images: It doesn’t copy-paste. It learns the rules of a face (eyes go here, nose goes there) and generates a new one from scratch.
  • Latent Space: The mathematical space where the GAN “thinks.” By moving around in this space, you can morph a face from male to female or young to old.
  • Diffusion Models: The newer technology (Stable Diffusion, Midjourney) that is replacing GANs for image generation. They are more stable.

Applications

  • Art: Artists using GANs to create weird, dreamlike imagery.
  • Data Augmentation: Generating fake medical X-rays to train AI doctors when you don’t have enough real patient data.

Criticism / Limitations

  • Mode Collapse: A bug where the Generator gets lazy and just produces the same image over and over again because it knows that one fools the Discriminator.

Further Reading

  • Goodfellow, Ian. Generative Adversarial Networks. (The original paper).