Generative Modeling Using the Sliced Wasserstein Distance

Ishan Deshpande, Ziyu Zhang, Alexander G. Schwing

Abstract

Generative Adversarial Nets (GANs) are very successful at modeling distributions from given samples, even in the high-dimensional case. However, their formulation is also known to be hard to optimize and often not stable. While this is particularly true for early GAN formulations, there has been significant empirically motivated and theoretically founded progress to improve stability, for instance, by using the Wasserstein distance rather than the Jenson-Shannon divergence. Here, we consider an alternative formulation for generative modeling based on random projections which, in its simplest form, results in a single objective rather than a saddle-point formulation. By augmenting this approach with a discriminator we improve its accuracy. We found our approach to be significantly more stable compared to even the improved Wasserstein GAN. Further, unlike the traditional GAN loss, the loss formulated in our method is a good measure of the actual distance between the distributions and, for the first time for GAN training, we are able to show estimates for the same.

Introduction

Generative Adversarial Networks (GANs) have revolutionized the generation of realistic synthetic data. However, they are notoriously difficult to train. Traditional GANs rely on a two-player saddle-point optimization where a generator and a discriminator compete. This setup frequently suffers from training instability, where the balance between networks is lost; mode collapse, where the generator produces limited varieties of data; and a lack of interpretable loss metrics. While the Wasserstein GAN (WGAN) addressed some of these issues by utilizing the Earth Mover's distance, it still requires complex constraints like weight clipping or gradient penalties to maintain the saddle-point equilibrium.

The Sliced Wasserstein Approach

The core innovation of this work is the Sliced Wasserstein Generator (SWG). The method leverages the Sliced Wasserstein Distance (SWD) to transform the complex high-dimensional distribution matching problem into a series of simple one-dimensional tasks.

The 1D Sorting Trick

In high dimensions, calculating the Wasserstein distance is computationally prohibitive. However, in one dimension, the optimal transport problem has a closed-form solution: one simply sorts the samples from both distributions and calculates the distance between corresponding pairs.

Visualization of the 1D Wasserstein distance calculation via sorting.

To apply this to high-dimensional images, the data is projected onto numerous random 1D directions (slices). The 1D Wasserstein distance is computed for each slice, and the results are averaged. This "sliced" version provides a mathematically rigorous metric that can be estimated directly from samples, allowing the generator to minimize a single objective without the inherent instability of a two-player game.

Scaling to Complex Data

For high-resolution datasets like CelebA or LSUN, purely random projections may fail to capture intricate features. The authors introduce a hybrid model where a discriminator maps samples into a lower-dimensional feature space. The SWD is then calculated within this learned space, providing a more informative learning signal for the generator.

Experimental Results

The SWG was evaluated across standard benchmarks including MNIST, CIFAR-10, the Toronto Face Dataset (TFD), LSUN Bedrooms, and CelebA.

Training Stability and Robustness

A key finding is the remarkable robustness of SWG across different neural architectures. In head-to-head comparisons on MNIST, SWG consistently produced high-quality samples across fully connected (FC) and convolutional (Conv) architectures, even without Batch Normalization (BN). In contrast, standard GANs and WGANs often failed to converge or suffered from severe artifacts in these configurations.

Comparison of training stability across GAN, WGAN, and SWG for various architectures.

Performance and Convergence

Beyond stability, the SWD loss serves as a reliable metric for convergence. Unlike the oscillating loss of traditional GANs, the SWD loss decreases monotonically as image quality improves. While the sorting step introduces a slight overhead (making generator updates 1.5x to 2x slower), the overall training process is often faster because SWG does not require the multiple discriminator updates per generator step typically needed for WGANs.

Conclusion

The Sliced Wasserstein Generator offers a stable, theoretically grounded alternative to traditional GAN training. By replacing the saddle-point problem with a single-objective minimization based on random projections and sorting, it mitigates common issues like mode collapse and training divergence while providing a meaningful metric to track progress.

Summary updated

BibTeX
@inproceedings{deshpande2018generative,
  author = {Ishan Deshpande and Ziyu Zhang and Alexander G. Schwing},
  title = {{Generative Modeling Using the Sliced Wasserstein Distance}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=rkZALpWdWr},
}
Figure