Minibatch Discrimination
You'll learn how GANs can look at multiple generated samples together to encourage the generator to produce diverse outputs.
The Diversity Problem in GANs
When training GANs, the discriminator traditionally evaluates each sample independently—it looks at one image at a time and decides "real or fake?" This creates a blind spot: the generator can exploit this by producing a few convincing samples over and over (mode collapse), and the discriminator won't notice because each individual sample looks fine in isolation.
How Minibatch Discrimination Works
Minibatch discrimination gives the discriminator a wider view. Instead of judging samples one-by-one, it examines an entire minibatch together and measures how similar or different the samples are from each other.
Here's the key insight: real data is diverse. If you sample 64 real images of faces, you'll get 64 different faces. But a collapsed generator might produce 64 copies of the same convincing face. Minibatch discrimination catches this by computing batch statistics—measuring variation within the batch—and feeding those statistics into the discriminator's decision.
The Analogy
Think of a teacher grading essays. If they grade each essay individually, a student could submit the same excellent essay 10 times. But if the teacher looks at all submissions together, they'll immediately notice the lack of variety and penalize it.
Implementation Idea
The discriminator computes features for each sample, then calculates distances between samples in feature space. These "diversity scores" become additional inputs that help the discriminator reject generators producing repetitive outputs. The generator, in turn, learns to diversify to fool this smarter discriminator.
Key Takeaway: Minibatch discrimination helps GANs avoid mode collapse by letting the discriminator detect and penalize lack of diversity across generated samples within a batch.