Discriminative Regularization for Generative Models

Alex Lamb, Vincent Dumoulin, Aaron C. CourvillearXiv 2016

Abstract

Variational Autoencoders (VAEs) are widely utilized in generative modeling for their stable training and tractable inference. However, they are frequently criticized for producing "blurry" samples. This paper identifies the reliance on pixel-wise reconstruction losses, such as $L^2$, as the primary cause of this lack of sharpness. We present "discriminative regularization," a method that augments the VAE objective by matching the feature representations of a pre-trained classifier. This approach forces the model to prioritize semantically meaningful features and high-frequency details, resulting in significantly sharper and more coherent image generation across standard benchmarks.

Introduction

Variational Autoencoders (VAEs) have become a cornerstone of deep generative modeling. While they offer a principled probabilistic framework, the images they generate often lack the crispness and detail found in real data or samples from Generative Adversarial Networks (GANs). This "blurriness" problem is not merely an aesthetic issue but a fundamental limitation of how these models perceive and reconstruct data. In "Discriminative Regularization for Generative Models," Lamb et al. propose a solution that bridges the gap between pixel-level reconstruction and semantic understanding.

The Problem: Pixel-Wise Loss and Human Perception

The authors argue that standard VAEs fail to produce sharp images due to two main factors:

  1. Missing High-Frequency Information: Most VAEs assume a Gaussian distribution over pixels, leading to a mean squared error ($L^2$) reconstruction loss. Because $L^2$ is minimized by the mean of the conditional distribution, the model often "averages" possible pixel values in uncertain regions, resulting in a smoothed, blurry output.
  2. Missing Semantic Information: Pixel-wise losses do not account for the spatial or semantic structure of objects. A small spatial shift in an image can result in a large $L^2$ error, even if the image is perceptually identical. Conversely, significant semantic changes (like altering a person's identity) might involve minimal pixel changes that the $L^2$ loss fails to penalize sufficiently.

Methodology: Discriminative Regularization

To address these limitations, the authors introduce a discriminative regularization term. The core idea is to move beyond comparing raw pixels and instead compare the "features" of the images as perceived by a high-quality, pre-trained classifier.

The proposed architecture integrates a pre-trained classifier to provide discriminative regularization across multiple layers.

As shown in the architecture above, the training process involves passing both the original image $x$ and its reconstruction $x'$ through a fixed, pre-trained classifier (such as a VGG network). The difference between the activations in the classifier's hidden layers for both images is then added as a penalty to the VAE’s loss function. By matching these hidden representations, the VAE is incentivized to preserve the features that the classifier deems important—ranging from low-level edges in early layers to high-level identity and objectness in deeper layers.

Datasets and Evaluation

The effectiveness of discriminative regularization was evaluated on three diverse datasets:

  • SVHN (Street View House Numbers): Focused on structured, low-resolution digits.
  • CIFAR-10: A benchmark for general object categories (e.g., animals, vehicles).
  • CelebA: A large-scale dataset of celebrity faces, used to test the model's ability to preserve complex semantic attributes like gender and expression.

Key Results and Discussion

The regularized models demonstrated a clear qualitative superiority over standard VAEs. On the CelebA dataset, reconstructions were noticeably sharper, particularly in high-contrast areas like the eyes and mouth. On CIFAR-10, the vague "blobs" typical of standard VAE outputs were replaced by recognizable objects with coherent structures.

Regularized VAE samples on CIFAR-10 demonstrate significantly improved sharpness and structural coherence compared to standard VAE outputs.

The Likelihood Paradox

A significant finding of the study is the "Likelihood Paradox": regularized models often achieved worse log-likelihood scores than standard VAEs, despite being judged as much higher quality by human observers. This highlights a critical disconnect in generative modeling: pixel-wise likelihood is a poor proxy for perceptual and semantic quality.

Latent Space Properties

Crucially, the addition of the discriminative penalty did not disrupt the VAE's latent space. Interpolations between latent points remained smooth and continuous, indicating that the model successfully learned a structured manifold while improving local reconstruction quality.

Conclusion

Discriminative regularization provides a powerful and stable alternative to the adversarial training found in GANs. By leveraging the "expert knowledge" embedded in pre-trained classifiers, VAEs can be taught to care about the same features that humans do. While some visual artifacts remain, this work represents a major step toward generative models that are both mathematically tractable and perceptually accurate.

Summary updated

BibTeX
@misc{lamb2016discriminative,
  author = {Alex Lamb and Vincent Dumoulin and Aaron C. Courville},
  title = {{Discriminative Regularization for Generative Models}},
  year = {2016},
  eprint = {1602.03220},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1602.03220},
}
Figure