TL;DR
LeGAN (Likelihood Estimation for GANs) is a simple, plug-and-play metric that assesses the quality of generated images by modeling the distribution of internal discriminator embeddings. Unlike other metrics, it doesn't require pre-trained models or large sample sizes, and it can be applied to any GAN architecture without changing the training objective.
What Problem Does This Paper Address?
Generative Adversarial Networks (GANs) are fantastic at creating realistic data, but they are notoriously difficult to evaluate. Because GANs learn an "implicit" probability distribution, they don't naturally provide a likelihood score for the images they produce.
Existing solutions have significant drawbacks:
- Inception Score (IS): Requires a model pre-trained on ImageNet and a massive number of samples (often 50,000) to be reliable.
- WGAN/MMD-GAN: These build evaluation metrics directly into their training objectives, meaning you can't easily port their "goodness" measures to a standard Vanilla GAN or LSGAN.
The authors sought a general "measure of fitness" that correlates with perceived image quality, works across different GAN types, and doesn't interfere with the learning process.
Methods
The core idea of LeGAN is to treat the discriminator's internal features as a representation space where "realness" can be statistically modeled.
- Extract Embeddings: The authors look at the activations of the discriminator's last layer before the final sigmoid nonlinearity. Let's call these embeddings $a$.
- Model the "Real" Distribution: They assume the embeddings of real images ($a_r$) follow a Gaussian distribution, $\mathcal{N}(\mu_r, \sigma_r^2)$. This is justified by the Central Limit Theorem, as these embeddings are sums of many previous layer activations.
- Calculate Likelihood: For any generated image, they pass it through the discriminator to get its embedding $a_f$ and calculate its likelihood under the "real" Gaussian model.
- Proposed Metrics: They define two measures:
- $\ell_{diff}$: The difference between the average likelihood of real images and fake images.
- $\ell_{ratio}$: The ratio between the likelihoods of real and fake images.
To ensure that distances in this embedding space actually correspond to visual similarity, the authors enforce 1-Lipschitz continuity on the discriminator using weight clipping and L2 norm penalties. This prevents the discriminator from becoming too "sharp" and ensures the embedding space remains well-behaved.
Datasets
The authors evaluated their method using the CIFAR-10 dataset, a standard benchmark consisting of 60,000 32x32 color images in 10 classes. They tested LeGAN across three different architectures:
- Vanilla GAN
- Least Squares GAN (LSGAN)
- Wasserstein GAN (WGAN)
Key Insights and Ideas
- The Discriminator is a Feature Extractor: Even if we don't care about the discriminator's final classification, its internal layers learn a rich representation of what "real" looks like. LeGAN taps into this existing knowledge.
- Lipschitz Continuity is Crucial: Without weight clipping, the distributions of real and fake embeddings often stay separated and don't converge, even as image quality improves. Enforcing a Lipschitz constraint allows the distributions to overlap as the generator gets better at fooling the discriminator.
- Plug-and-Play: Because LeGAN is an external observer of the discriminator's activations, you can add it to almost any existing GAN pipeline to monitor training progress in real-time.
Key Results
The empirical results show a strong correlation between LeGAN measures and the visual quality of generated samples:
- Training Progress: As training epochs increase and images become more recognizable, $\ell_{diff}$ steadily decreases while $\ell_{ratio}$ increases toward 1.0.
- Consistency: This trend held true for both Vanilla GANs and LSGANs, which typically lack an internal fitness measure.
- WGAN Correlation: In experiments with Wasserstein GANs, the LeGAN measures showed a strong correlation with the Wasserstein distance, validating it against established theoretical metrics.
Limitations and Future Work
- The Gaussian Assumption: While the authors argue for a Gaussian distribution based on the Central Limit Theorem, they acknowledge that other distributions could be used. The performance of LeGAN might vary if the embedding distribution is highly non-Gaussian.
- Weight Clipping Side Effects: The authors noted that weight clipping reduces the power of the discriminator, requiring it to be updated more frequently (e.g., 5 times for every 1 generator update) to maintain balance.
- Scale: The experiments were limited to CIFAR-10 (32x32 images). Future work could explore how these likelihood measures scale to high-resolution image generation.
Summary updated