Demystifying MMD GANs

Mikolaj Binkowski, Danica J. Sutherland, Michael Arbel, Arthur Gretton

Abstract

We investigate the training and performance of generative adversarial networks using the Maximum Mean Discrepancy (MMD) as critic, termed MMD GANs. As our main theoretical contribution, we clarify the situation with bias in GAN loss functions raised by recent work: we show that gradient estimators used in the optimization process for both MMD GANs and Wasserstein GANs are unbiased, but learning a discriminator based on samples leads to biased gradients for the generator parameters. We also discuss the issue of kernel choice for the MMD critic, and characterize the kernel corresponding to the energy distance used for the Cramer GAN critic. Being an integral probability metric, the MMD benefits from training strategies recently developed for Wasserstein GANs. In experiments, the MMD GAN is able to employ a smaller critic network than the Wasserstein GAN, resulting in a simpler and faster-training algorithm with matching performance. We also propose an improved measure of GAN convergence, the Kernel Inception Distance, and show how to use it to dynamically adapt learning rates during GAN training.

Introduction

Generative Adversarial Networks (GANs) are powerful but notoriously difficult to train. Original loss functions, such as the Jensen-Shannon divergence, often fail when the distributions of real and generated data do not overlap. While the Wasserstein GAN (WGAN) addressed this by using a "critic" to measure distance, it typically requires large, computationally expensive networks to achieve high performance. Furthermore, the research community has faced confusion regarding gradient bias in GAN variants and the reliability of standard evaluation metrics like the Fréchet Inception Distance (FID). This work demystifies MMD GANs, showing they can match WGAN performance with smaller networks, and introduces the Kernel Inception Distance (KID) as a more robust evaluation metric.

Theoretical Contributions: Clarifying Gradient Bias

A significant portion of recent GAN research has debated the existence of "unbiased" GANs. This paper provides a rigorous proof clarifying that for a fixed critic, gradient estimators for both MMD and WGANs are unbiased. However, because the critic itself is learned from samples, the overall gradient for the generator parameters becomes biased in practice. While no current GAN is truly unbiased during the learning process, MMD GANs exhibit a "lesser" bias that prevents the generator from diverging, providing a more stable training signal.

Methods: Improving MMD GANs

The authors propose three key enhancements to MMD GANs:

  1. Gradient Penalties: Adapting the gradient penalty strategy from WGAN-GP to the MMD witness function stabilizes gradients and prevents critic collapse.
  2. Rational Quadratic (RQ) Kernels: Unlike standard Gaussian RBF kernels that decay too quickly in high dimensions, RQ kernels have "heavier tails." This ensures the generator receives useful signals even when producing poor-quality initial samples.
  3. Kernel Inception Distance (KID): A new metric that computes the squared MMD between Inception-v3 features using a polynomial kernel. Unlike FID, KID has a cubic unbiased estimator, making it reliable across varying sample sizes.

Experimental Results

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

Efficiency and Performance

MMD GANs demonstrated significant efficiency gains, training roughly twice as fast as WGAN-GP. This is because MMD utilizes an infinite-dimensional feature space via the kernel trick, allowing the neural network component of the critic to be much simpler. For instance, an MMD GAN with only 16 filters in its critic matched the performance of a WGAN requiring 64 filters. On LSUN and CelebA datasets, MMD GANs with RQ kernels outperformed both WGAN-GP and Cramér GANs.

Metric Reliability: FID vs. KID

A critical finding of this work is the instability of the FID metric. As shown in Figure 1, the FID score for a single model can drop significantly (from 30 to 8) simply by increasing the number of samples used for evaluation. This makes fair comparison between models difficult if sample sizes differ.

FID scores are heavily dependent on the number of samples n, showing significant bias.

In contrast, the proposed KID metric remains unbiased. As illustrated in Figure 2, while the variance of the KID estimate decreases with more samples, the mean remains centered, providing a consistent "ruler" for model evaluation regardless of sample size. This unbiased nature also allows KID to be used for dynamic learning rate adjustment during training.

KID is an unbiased estimator; its mean remains constant as the sample size n increases.

Conclusion

MMD GANs offer a faster, more efficient alternative to WGANs by leveraging kernel methods to simplify critic architectures. By introducing KID, this work also provides the community with a more reliable metric for GAN evaluation that is robust to sample size. Future work may explore optimal kernel families for different data modalities and further optimize the computational cost of KID.

Summary updated

BibTeX
@inproceedings{binkowski2018demystifying,
  author = {Mikolaj Binkowski 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