cGANs with Projection Discriminator

Takeru Miyato, Masanori Koyama

TL;DR

This paper introduces a "projection-based" discriminator for Conditional GANs (cGANs) that incorporates class labels via an inner product rather than simple concatenation. By aligning the discriminator's architecture with the underlying probabilistic math of density ratios, the authors achieved a new state-of-the-art in high-resolution, multi-class image generation on ImageNet.

What Problem Does This Paper Address?

In a standard Generative Adversarial Network (GAN), the discriminator's job is to distinguish "real" data from "fake" data. In a conditional GAN (cGAN), we add a label (like "dog" or "mushroom") to tell the model exactly what to generate.

Historically, researchers handled these labels in the discriminator in one of two "naive" ways:

  1. Concatenation: Simply sticking the label vector onto the image feature vector. This is computationally easy but lacks a strong theoretical justification.
  2. Auxiliary Classifiers (AC-GAN): Adding a separate task where the discriminator must also predict the class of the image. While this helps the model learn, it often leads to "mode collapse," where the generator produces very recognizable but nearly identical images to satisfy the classifier, sacrificing diversity.

The authors argue that these methods don't respect the actual probabilistic role that a label should play in determining whether an image is "real" given its class.

Methods

The core innovation is the Projection Discriminator. Instead of just appending a label, the authors derived a new functional form for the discriminator based on the log-likelihood ratio of the data distributions.

Proposed Projection Discriminator

Mathematically, they show that if you assume the class-conditional distributions are simple (like Gaussians), the optimal discriminator should take the form of an inner product (a projection) between the image features and a learned embedding of the class label, added to a label-independent score.

The architecture looks like this:

  • Generator: Uses "Conditional Batch Normalization," which allows the class label to shift and scale the activations throughout the network.
  • Discriminator: Extracts a feature vector $\phi(x)$ from the image. It then calculates two things: a global "is this a real image?" score and a "does this image match this specific label?" score via an inner product.
  • Stability: To keep training stable, they utilize Spectral Normalization (a technique previously developed by the lead author) to constrain the Lipschitz constant of the discriminator.

Datasets

The authors evaluated their method on several standard benchmarks:

  • ILSVRC2012 (ImageNet): A massive dataset with 1,000 classes. They focused on 128x128 resolution.
  • CIFAR-10 and CIFAR-100: Smaller datasets used for hyperparameter sweeps and preliminary testing.
  • Super-Resolution Task: They used ImageNet to test if the projection method could help "hallucinate" high-resolution details from low-resolution inputs.

Key Insights and Ideas

  • The Discriminator as a Density Ratio Estimator: The biggest "aha" moment is treating the discriminator not as an arbitrary neural network, but as a specific mathematical tool for measuring the ratio between the "real" and "fake" distributions.
  • Inner Products > Concatenation: By using a projection (inner product), the model explicitly learns how specific image features correlate with specific classes. This is more geometrically meaningful than just concatenating vectors and hoping the network figures out the relationship.
  • Diversity over Classification: Unlike AC-GANs, which force the generator to be "easy to classify," the projection method encourages the generator to match the full distribution of the class. This leads to much higher image diversity and lower "Intra-class FID" scores.
  • Category Morphing: Because the labels are handled through structured embeddings, the model can smoothly "morph" between categories (e.g., turning a "Tibetan terrier" into a "mushroom") by interpolating the class vectors.
Category morphing between classes

Key Results

The projection discriminator significantly outperformed previous methods on the challenging 1,000-class ImageNet task:

  • Inception Score (IS): Achieved 29.7, compared to 21.1 for the concatenation method and 28.5 for AC-GAN. With extended training, this rose to 36.8.
  • FID (Frechet Inception Distance): Their "Intra-FID" (measuring quality and diversity within classes) was 103.1, vastly better than AC-GAN's 260.0, which suffered from severe mode collapse.
  • Super-Resolution: In a head-to-head comparison, the projection method produced images that were both more visually faithful to the original and more easily recognized by pre-trained classifiers than standard bicubic or concatenation-based methods.

Limitations and Future Work

While the results are impressive, the authors note a few areas for improvement:

  • Theoretical Gap: While the projection form is motivated by simple probabilistic models (like Gaussians), real-world image distributions are far more complex. There is still a theoretical gap in understanding exactly why this specific regularization helps the generator so much.
  • Complex Objects: The model still struggles with classes featuring highly complex or varied structures (like humans), where the FID scores remained higher.
  • Expansion: The authors suggest extending this projection approach to other conditional tasks, such as semantic segmentation and image-to-image translation.

Summary updated

BibTeX
@inproceedings{miyato2018cgans,
  author = {Takeru Miyato and Masanori Koyama},
  title = {{cGANs with Projection Discriminator}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=ByS1VpgRZ},
}
Figure