Symmetric Wasserstein Autoencoders

Sun Sun, Hongyu Guo

Abstract

Leveraging the framework of Optimal Transport, we introduce a new family of generative autoencoders with a learnable prior, called Symmetric Wasserstein Autoencoders (SWAEs). We propose to symmetrically match the joint distributions of the observed data and the latent representation induced by the encoder and the decoder. The resulting algorithm jointly optimizes the modelling losses in both the data and the latent spaces with the loss in the data space leading to the denoising effect. With the symmetric treatment of the data and the latent representation, the algorithm implicitly preserves the local structure of the data in the latent space. To further improve the quality of the latent representation, we incorporate a reconstruction loss into the objective, which significantly benefits both the generation and reconstruction. We empirically show the superior performance of SWAEs over the state-of-the-art generative autoencoders in terms of classification, reconstruction, and generation.

Introduction

Deep generative models like Variational Autoencoders (VAEs) typically aim to maximize the marginal likelihood of the observed data. However, this focus often comes at the expense of the latent representation's quality. Because VAEs use an asymmetric objective (the KL divergence), they often produce "unrealistic" samples or fail to capture the intricate local relationships between data points in the latent space.

Existing "symmetric" models (like BiGAN or ALI) try to fix this by matching joint distributions, but they often rely on unstable adversarial training or complex approximations of mutual information. The authors of this paper sought a more stable, mathematically grounded framework to treat the encoder (data to latent) and decoder (latent to data) with equal importance.

Methods

The core innovation is the Symmetric Wasserstein Autoencoder (SWAE). Instead of matching marginal distributions, SWAEs minimize the $p$-th Wasserstein distance between two joint distributions: the encoding distribution (real data and encoder-produced codes) and the decoding distribution (prior-sampled codes and decoder-generated data).

The SWAE framework incorporates a learnable conditional prior based on pseudo-inputs, matching joint distributions in both data and latent spaces.

By leveraging Optimal Transport (OT) theory, the authors transform this complex optimization problem into a tractable objective function that decomposes into two main parts:

  • The x-loss: Measures discrepancy in the data space. This term is mathematically related to Denoising Autoencoders, giving the model an inherent ability to clean up noisy data.
  • The z-loss: Measures discrepancy in the latent space, ensuring the encoder's output matches the prior.

To further boost performance, they implement a learnable prior based on "pseudo-inputs" (avoiding the over-regularization common with simple Gaussian priors) and a weighted reconstruction loss to balance the trade-off between generating high-quality new samples and accurately reconstructing existing ones.

Key Results

The authors evaluated SWAEs against several state-of-the-art models (VAE, WAE-GAN, WAE-MMD, VampPrior, and MIM) using benchmark datasets including MNIST, Fashion-MNIST, Coil20, and CIFAR10-sub.

t-SNE visualizations of the latent space for various models on MNIST. SWAE variants (a, b) demonstrate superior cluster separation compared to standard VAE (c) and other WAE implementations.
  • Superior Latent Representations: In KNN classification tests, SWAE consistently outperformed competitors. For example, on MNIST with a latent dimension of 80, SWAE achieved 0.97 accuracy, while a standard VAE dropped to 0.60.
  • Better Generation Quality: Using the Fréchet Inception Distance (FID), SWAE achieved the lowest (best) scores on complex datasets like Coil20 and CIFAR10-sub.
  • Visual Clarity: t-SNE visualizations showed that SWAE creates much tighter, more distinct clusters for different data classes compared to VAEs or other WAE variants, confirming that the model implicitly preserves the "topology" of the data.
  • Implicit Denoising: Qualitative results showed that SWAE (with $\beta=1$) could successfully recover clean images from inputs corrupted with Gaussian noise, a feat the other generative benchmarks struggled to replicate.

Conclusion

SWAEs introduce a robust way to train generative models by symmetrically matching joint distributions via Optimal Transport. While finding the "closest pseudo-input" during training can be computationally expensive as the number of pseudo-inputs increases, the benefits in latent space organization and denoising are significant. Future work may explore more flexible priors, such as Normalizing Flows, to further improve the model's expressive power.

Summary updated

BibTeX
@inproceedings{sun2021symmetric,
  author = {Sun Sun and Hongyu Guo},
  title = {{Symmetric Wasserstein Autoencoders}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2021},
}
Figure