Wasserstein GAN

Martín Arjovsky, Soumith Chintala, Léon BottouarXiv 2017

Abstract

Generative Adversarial Networks (GANs) have revolutionized generative modeling but remain notoriously difficult to train due to instabilities and mode collapse. We present the Wasserstein GAN (WGAN), an alternative to traditional GAN training. By minimizing the Earth Mover (EM) distance rather than the Jensen-Shannon divergence, WGAN provides a smooth, continuous loss function that yields reliable gradients even when the model and target distributions are disjoint. Our approach significantly improves training stability and provides a meaningful loss metric that correlates with sample quality.

Introduction

The original GAN framework defines a minimax game where a discriminator distinguishes between real and synthetic data. This process effectively minimizes the Jensen-Shannon (JS) divergence between the real and generated data distributions. However, in high-dimensional spaces, data often resides on low-dimensional manifolds. If these manifolds do not overlap perfectly, the JS divergence becomes locally constant at its maximum value. This results in the "vanishing gradient" problem: the discriminator becomes too accurate too quickly, providing zero useful feedback to the generator. Consequently, training standard GANs requires a delicate, often unstable balance between the two networks.

The Earth Mover Distance

To address these issues, we propose using the Earth Mover (EM) distance, also known as the Wasserstein-1 distance. Intuitively, the EM distance represents the minimum cost of transporting mass to transform one distribution into another. Unlike JS divergence, the EM distance is continuous and differentiable almost everywhere.

Comparison of Wasserstein distance (left) and JS divergence (right) for two distributions separated by distance theta. The EM distance provides a smooth gradient, whereas JSD is constant for non-zero theta.

As shown in the figure above, when two distributions are disjoint (separated by distance $\theta$), the JS divergence is a step function that provides no gradient information for $\theta \neq 0$. In contrast, the Wasserstein distance grows linearly with $\theta$, providing a constant gradient that guides the generator toward the target distribution regardless of the initial overlap.

Implementation and Stability

Implementing WGAN requires three primary modifications to the standard GAN architecture:

  1. The Critic: The discriminator is replaced by a "critic" that outputs a scalar score rather than a probability. Unlike a discriminator, the critic can be trained to optimality without causing gradients to vanish.
  2. Lipschitz Constraint: To satisfy the mathematical requirements of the EM distance (via Kantorovich-Rubinstein duality), the critic must be a 1-Lipschitz function, meaning its gradients are bounded.
  3. Weight Clipping: To enforce this Lipschitz constraint, we clip the critic's weights to a small fixed range (e.g., $[-0.01, 0.01]$) after every update.

Results and Discussion

We evaluated WGAN on the LSUN-Bedrooms dataset and compared it against standard DCGAN architectures. WGAN demonstrated remarkable stability, successfully training on architectures (such as deep MLPs without batch normalization) where standard GANs failed completely.

Crucially, the WGAN loss metric showed a strong correlation with visual sample quality. In standard GANs, the loss curve is often uninformative; in WGAN, as the critic's loss decreases, the generated images visibly improve. Furthermore, we observed a significant reduction in mode collapse, with the generator consistently covering the target distribution's diversity across all experiments.

While weight clipping is a simple method to enforce the Lipschitz constraint, it can lead to optimization challenges such as vanishing or exploding gradients if the clipping window is not tuned perfectly. Future work should explore more sophisticated constraints, such as gradient penalties. Nevertheless, WGAN represents a fundamental shift in GAN training, moving from a fragile adversarial game to a stable optimization of a meaningful distance metric.

Summary updated

BibTeX
@misc{arjovsky2017wasserstein,
  author = {Martín Arjovsky and Soumith Chintala and Léon Bottou},
  title = {{Wasserstein GAN}},
  year = {2017},
  eprint = {1701.07875},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1701.07875},
}
Figure