Stacked Wasserstein Autoencoder

Wenju Xu, Shawn Shahriar Keshmiri, Guanghui Wang

Abstract

Generative modeling often faces a fundamental trade-off between high-fidelity reconstruction and the ability to sample realistic new data. While Variational Autoencoders (VAEs) excel at reconstruction and Generative Adversarial Networks (GANs) produce sharp samples, existing hybrid approaches like the Wasserstein Autoencoder (WAE) often struggle with high-dimensional data manifolds. This paper introduces the Stacked Wasserstein Autoencoder (SWAE), a hierarchical framework that decomposes the generative task into two manageable stages: learning a flexible data representation and matching that representation to a simple prior. By decoupling these objectives, SWAE achieves state-of-the-art performance in both reconstruction accuracy and generation quality on benchmarks like CelebA.

1. Introduction

The field of generative modeling is characterized by a persistent tension between reconstruction and generation. VAEs, which optimize a lower bound on the log-likelihood, typically produce blurry samples because they attempt to map complex, high-dimensional data manifolds to simple Gaussian priors in a single, highly constrained step. Conversely, GANs produce sharp, realistic images but lack an explicit inference mechanism (encoder), making them difficult to use for downstream tasks like image manipulation or latent space analysis.

While the original Wasserstein Autoencoder (WAE) attempted to bridge this gap using optimal transport, it often oversimplifies the latent space, leading to a loss of detail or "mode collapse" when dealing with natural images. The SWAE addresses these limitations through a "divide and conquer" strategy that separates representation learning from probabilistic mapping.

2. Methodology: The Two-Stage Framework

SWAE decomposes the learning process into two distinct, stacked stages to minimize optimal transport constraints at different scales.

2.1 Stage I: Flexible Representation Learning

In the first stage, the model learns a flexible autoencoder pair ($E_1, G_1$) alongside an adversarial discriminator ($D_1$). Unlike standard VAEs, Stage I does not immediately force the latent space to match a specific prior. Instead, it focuses on capturing the "true" geometry of the data manifold. The discriminator $D_1$ ensures that the generated images match the distribution of the training data, which is critical for maintaining image sharpness and texture. The resulting intermediate latent space ($h_0$) is continuous and information-rich but lacks the structure necessary for direct sampling.

2.2 Stage II: Prior Matching

The second stage involves a secondary autoencoder ($E_2, G_2$) stacked atop the first. This stage is dedicated to mapping the distribution of the intermediate latent space $h_0$ to an explicit, simple prior distribution, such as a Gaussian or Uniform distribution. By isolating the probabilistic mapping task, the model can enforce the prior without compromising the reconstruction fidelity established in Stage I.

3. Experimental Evaluation

The SWAE framework was evaluated on three standard datasets: MNIST, CIFAR-10, and CelebA. For CelebA, images were cropped and resized to $64 \times 64$ pixels to test high-dimensional performance.

3.1 Quantitative Results

SWAE demonstrates superior performance across both reconstruction and generation metrics. On the CelebA dataset, SWAE achieved a Mean Squared Error (MSE) of 0.066, a significant improvement over the 0.281 MSE reported for Adversarially Learned Inference (ALI). In terms of generation quality, SWAE reached a Frechet Inception Distance (FID) of 17.14 (using a uniform prior), vastly outperforming the original WAE's score of 98.78.

3.2 Qualitative Analysis

Visual inspection confirms that SWAE produces sharp, detailed images that avoid the typical blurriness of VAEs. The model also learns a semantically meaningful latent space. Interpolations between latent vectors result in smooth transitions between faces, and specific directions in the latent space correspond to attribute changes (e.g., adding a smile or changing gender) despite the absence of attribute labels during training.

Example of a high-quality face reconstruction/generation using SWAE on the CelebA dataset.

4. Discussion and Conclusion

The success of SWAE stems from its "Divide and Conquer" approach to the latent space. By introducing an intermediate, unconstrained representation, the model preserves the variance and complexity of the data. The inclusion of the Stage I discriminator is identified as the "secret sauce" for achieving image sharpness. Furthermore, the model's prior-agnostic nature allows it to perform well regardless of whether the target distribution is Gaussian or Uniform.

Despite these strengths, the model requires careful tuning. The authors noted a trade-off between reconstruction faithfulness and generation quality, suggesting that early stopping is often necessary to balance these goals. Future work remains to scale this hierarchical architecture to ultra-high-resolution images, where the complexity of the data manifold is even greater. In conclusion, the Stacked Wasserstein Autoencoder provides a robust framework for high-quality generative modeling, successfully decoupling the competing demands of reconstruction and sampling.

Summary updated

BibTeX
@article{xu2019stacked,
  author = {Wenju Xu and Shawn Shahriar Keshmiri and Guanghui Wang},
  title = {{Stacked Wasserstein Autoencoder}},
  journal = {Neurocomputing},
  year = {2019},
  doi = {10.1016/j.neucom.2019.06.096},
}
Figure