
A wildlife editor has hundreds of camera-trap photos of foxes: some in green woodland, some in snow, some at dusk. Now imagine a computer that can make new fox pictures. No camera took these new pictures. Can the computer learn to make images that belong among the real photos?
A generative adversarial network, or GAN, tackles that question with two neural networks. One makes images. The other tries to tell whether each image came from the photo archive or from the image-making network. They train against each other. That is the whole idea to hold on to; the details below explain how the contest teaches them.
The image maker and the editor
Call the image-making network the generator. It starts with a short list of random numbers, called a noise vector, and turns those numbers into image pixels. Try a different vector and it may make a different fox picture. During training, the generator changes its internal weights—the numbers that control its calculations—so its pictures become more like the examples it needs to match.
Call the source-judging network the discriminator. It sees both real archive photos and generated pictures. For each image, it produces a score between 0 and 1: the higher the score, the more it currently thinks the image came from the archive. During training, it is told which source each example actually came from, so it can correct its mistakes.
| In the field-guide story | In a GAN |
|---|---|
| Camera-trap photo archive | Real training examples |
| Image maker | Generator |
| Editor deciding which source supplied a picture | Discriminator |
| A new starting brief for the image maker | A random noise vector |
The editor’s question is “Which source made this image?” It is not “Is this fox beautiful?” or “Did this scene really happen?” That distinction matters: a generated image can fool a discriminator without being a reliable record of wildlife.
One round of training
Suppose the generator makes a fox standing on a woodland path. Its fur and paws look slightly wrong. To make the learning process concrete, imagine the discriminator scores a real archive photo 0.9 and the generated picture 0.2. These numbers are invented for this example; they are not results from a trained wildlife GAN.
- Train the discriminator. Show it a batch of genuine archive photos labelled real and generated pictures labelled generated. It adjusts its weights to get better at telling the two sources apart. Perhaps it notices that the generated foxes have oddly sharp fur edges.
- Train the generator. Hold the discriminator’s weights fixed. Make another generated picture and pass it through the discriminator. A calculation called backpropagation works backward from the score to determine how small changes in the generator’s weights would affect that score. Those directions and strengths of change form a gradient. The generator adjusts its weights to make its pictures harder for this discriminator to reject.
- Repeat. Perhaps a revised fox picture receives a score of 0.7 from the discriminator while its weights are held fixed. On the next discriminator update, the judge may learn a new clue and lower the score again. Each network is learning against a changing opponent.
The generator is not given a particular real fox photo to copy in this basic GAN. Its guidance comes from the discriminator’s response to the images it makes. The original training procedure alternates updates to the two networks. Once training is over, the generator can make new pictures from fresh noise vectors without running the discriminator every time.
Why call this adversarial? The discriminator gets better by spotting generated images; the generator gets better by making that task harder. In the ideal mathematical case described in the original paper, generated images have the same overall mix of visual patterns as the archive: settings, lighting, poses and their frequencies. Researchers call that mix a distribution. With equally common real and generated inputs, the discriminator could then only guess at 0.5. Real networks have a finite number of adjustable weights and only a finite amount of training, so reaching that ideal is not guaranteed.
A believable fox is not the whole field guide
One picture can look convincing while the collection is wrong. Imagine an archive of eight fox photos: four show foxes in green woodland and four show them in snow. A generator that makes eight convincing woodland foxes may do well on individual images, yet it has learned only one setting. Its batch is 8 woodland, 0 snow rather than the archive’s 4 and 4. This loss of variety is called mode collapse.
There are other difficulties. If the discriminator rejects every early picture with high confidence, the generator may receive too little useful guidance. The original authors described this problem and proposed a generator objective that gives stronger early feedback. In 2017, Martin Arjovsky, Soumith Chintala and Léon Bottou proposed the Wasserstein GAN to improve training stability and address problems including mode collapse.
The field-guide analogy also has limits. A human editor might say, “The shadow points the wrong way.” A discriminator does not give such a sentence; training uses numerical scores and gradients. The generator does not photograph a fox or consciously fix its paws. It transforms numbers into pixels and changes its weights. And a photo that passes this particular discriminator is still synthetic: it is not evidence that a fox stood on that path.
How the idea developed
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville and Yoshua Bengio introduced the GAN framework in “Generative Adversarial Nets” in 2014. Their key move was to train a generator using feedback from a discriminator that was itself learning.
In work released in 2015 and presented at ICLR in 2016, Alec Radford, Luke Metz and Soumith Chintala developed deep convolutional GANs suited to image patterns. In 2017, Phillip Isola, Jun-Yan Zhu, Tinghui Zhou and Alexei Efros used a conditional GAN for image-to-image tasks such as turning an edge drawing into a plausible photo. In that version, the generator receives a specific input image as well as its training feedback. In 2019, Tero Karras, Samuli Laine and Timo Aila presented StyleGAN, a generator design with more control over image features at different scales.
The field-guide test gives a compact way to remember a GAN: make an image, judge its source, adjust both networks, repeat. Success means learning the archive’s range of images, not merely producing one fox photo that convinces one judge.
Sources
- Goodfellow and coauthors, “Generative Adversarial Nets”, NeurIPS, 2014. Original framework, training procedure and ideal result.
- Radford, Metz and Chintala, “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks”, released 2015; ICLR, 2016.
- Isola and coauthors, “Image-to-Image Translation with Conditional Adversarial Networks”, CVPR, 2017.
- Arjovsky, Chintala and Bottou, “Wasserstein Generative Adversarial Networks”, ICML, 2017.
- Karras, Laine and Aila, “A Style-Based Generator Architecture for Generative Adversarial Networks”, CVPR, 2019.
The photo archive, fox pictures, sample scores and eight-photo count are invented teaching examples. The feature image is AI-generated artwork, not a camera-trap record.