Demystifying MMD GANs

Mikołaj Bińkowski, Danica J. Sutherland, Michael Arbel, Arthur Gretton

Overview

Training Generative Adversarial Networks (GANs) is notoriously difficult. Standard objectives often provide uninformative gradients when the generated and real data distributions do not overlap. While researchers have turned to Integral Probability Metrics (IPMs) like the Wasserstein distance to secure smoother gradients, debates have persisted regarding gradient bias and the reliability of evaluation metrics.

This paper provides a rigorous theoretical and empirical examination of MMD GANs—networks that use Maximum Mean Discrepancy (MMD) as the critic. The authors prove that MMD GANs are as theoretically sound as Wasserstein GANs, clarify the ongoing "gradient bias" debate, and demonstrate that MMD GANs can achieve state-of-the-art results with significantly smaller critic networks. Furthermore, they introduce the Kernel Inception Distance (KID), a reliable, unbiased metric for evaluating generative models.

The Gradient Bias Debate

Recent literature has suggested that certain GAN losses (like Wasserstein) suffer from biased gradients that lead to incorrect convergence, while others (like the Energy Distance used in Cramér GANs) do not.

The authors resolve this by proving that for a fixed critic, gradients are unbiased for both WGANs and MMD GANs. The bias only enters the equation when the critic is learned from finite samples. Crucially, they show that the "unbiased" claims surrounding the Cramér GAN were based on an incomplete proof; in reality, all these models suffer from similar sample-based bias.

Methods: Enhancing MMD GANs

To make MMD GANs highly competitive, the authors introduce several key technical improvements:

  • Gradient Regularization: They adapt the gradient penalty strategy from WGAN-GP to the MMD witness function. This prevents the critic from collapsing and ensures stable training.
  • Kernel Engineering: The standard Gaussian (RBF) kernel is often poor for high-dimensional GAN training because its gradients vanish too quickly. To fix this, the authors propose using the Rational Quadratic (RQ) kernel, which features heavier tails and maintains useful gradients over longer distances.
  • Adaptive Learning Rates: Leveraging their new evaluation metric (KID), they implement a "reduce learning rate on plateau" strategy—a technique common in supervised learning but historically difficult to apply to GANs.

Evaluating Generative Models: FID vs. KID

A major contribution of this work is addressing the flaws in standard evaluation metrics. The widely used Fréchet Inception Distance (FID) is highly biased; its value changes drastically depending on the number of samples used to calculate it. This makes it incredibly difficult to compare models fairly if they were evaluated with different sample sizes.

FID is biased downward as sample size increases.

To solve this, the authors propose the Kernel Inception Distance (KID). KID computes the squared MMD between Inception features using a simple polynomial kernel. Unlike FID, KID is an unbiased estimator, yielding consistent expected results regardless of the sample size.

KID provides an unbiased estimator, remaining consistent across sample sizes.

Experimental Results

The models were evaluated on standard benchmarks including MNIST, CIFAR-10, LSUN Bedrooms, and CelebA.

  • Performance vs. Size: Because MMD essentially compares distributions in an infinite-dimensional feature space via the kernel, the neural network used as the "critic" can be remarkably small. On the LSUN Bedrooms dataset, an MMD GAN with only 16 filters in its first layer outperformed a WGAN-GP of the same size (KID of 0.091 vs 0.370). To match the MMD GAN's performance, the WGAN-GP required a much larger network (64 filters).
  • Convergence: The Rational Quadratic (RQ) kernel consistently outperformed RBF and linear kernels, particularly in the early stages of training.
  • Metric Reliability: When testing robustness by adding noise or blur to images, KID showed a much smoother and more monotonic response than the Inception Score, proving to be a better proxy for human judgment of image degradation.

Limitations and Future Work

While MMD GANs show immense promise, some challenges remain:

  • Kernel Selection: Despite the improvements from the RQ kernel, MMD GAN performance remains sensitive to the choice of kernel and its hyperparameters. Discovering a truly "universal" kernel is an open challenge.
  • Feature Space Dependence: Like FID, KID relies on the pre-trained Inception-v3 network. If Inception features fail to capture specific artifacts (e.g., certain textures or pixel-level noise), KID will not reflect those degradations.
  • Theoretical Gaps: While the paper clarifies the mechanics of gradient bias, exploring why unbiased gradients of the squared MMD might be more meaningful for optimization than the biased gradients of the Wasserstein distance remains a promising area for future research.

Summary updated

BibTeX
@inproceedings{binkowski2018demystifying,
  author = {Mikołaj Bińkowski and Danica J. Sutherland and Michael Arbel and Arthur Gretton},
  title = {{Demystifying MMD GANs}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=r1lUOzWCW},
}
Figure