Learning Disentangled Representations with the Wasserstein Autoencoder

Benoit Gaujac, Ilya Feige, David Barber

TL;DR

This paper introduces the Total Correlation Wasserstein Autoencoder (TCWAE), a novel method for learning disentangled representations. By leveraging the Wasserstein Autoencoder (WAE) framework, TCWAE offers more flexible control over the disentanglement-reconstruction trade-off and improved reconstruction quality, especially on complex datasets.

What Problem Does This Paper Address?

Learning disentangled representations is crucial for making machine learning models more interpretable and robust. The goal is to learn latent representations where each dimension corresponds to an independent underlying factor of variation in the data (e.g., in an image, one dimension might control object shape, another its color). However, existing methods often struggle to balance the fidelity of reconstructing the original data with the degree of disentanglement achieved in the latent space. This often requires delicate tuning of hyperparameters.

Methods

The core contribution is the Total Correlation Wasserstein Autoencoder (TCWAE). It builds upon the Wasserstein Autoencoder (WAE), which uses an optimal transport-based objective to match the aggregated posterior distribution of the latent variables to a prior distribution. TCWAE modifies the WAE objective by explicitly penalizing the Total Correlation (TC) of the aggregated posterior. TC measures the statistical dependence between the latent variables, so minimizing it encourages independence.

The authors propose two variants of TCWAE, differing in how they estimate the intractable KL divergence terms required for TC regularization:

  • TCWAE-MWS: Uses Minibatch-Weighted Sampling (MWS), a technique from previous work (Chen et al., 2018).
  • TCWAE-GAN: Employs an adversarial approach using a density-ratio trick, similar to how GANs are trained.

A key advantage of the WAE framework is its flexibility in choosing the reconstruction cost function. TCWAE leverages this to potentially improve reconstruction quality, especially for complex data.

Datasets

The paper evaluates TCWAE on several datasets:

  • dSprites: A synthetic dataset with known generative factors (shape, orientation, position).
  • NoisydSprites: A noisy version of dSprites.
  • ScreamdSprites: Another variation of dSprites.
  • smallNORB: A dataset of 3D objects with known generative factors (categories, lighting, elevation, azimuth).
  • 3DChairs: A real-world dataset of 3D chair models with unknown generative factors.
  • CelebA: A real-world dataset of celebrity faces with unknown generative factors.

Key Insights and Ideas

  • WAE as a natural fit for disentanglement: The WAE's objective of matching the aggregated posterior to the prior, rather than the posterior for each data point, provides a more direct way to control the overall structure of the latent space, making it amenable to disentanglement objectives like Total Correlation.
  • Explicit TC regularization in WAE: By incorporating Total Correlation penalty into the WAE objective, TCWAE directly targets the statistical independence of latent variables, offering a principled way to control disentanglement.
  • Flexibility in reconstruction cost matters: The WAE's ability to use various reconstruction costs (e.g., squared Euclidean distance) proves beneficial for complex real-world datasets where simple pixel-wise losses might not be optimal, leading to better reconstructions.
  • MWS estimator bias: The paper notes the bias of the MWS estimator, suggesting that larger batch sizes can mitigate its impact.

Key Results

  • Competitive disentanglement: TCWAE-MWS and TCWAE-GAN achieve competitive disentanglement performance on toy datasets (dSprites, NoisydSprites, ScreamdSprites, smallNORB) compared to state-of-the-art methods like β-TCVAE and FactorVAE, as measured by metrics like MIG, FactorVAE, and SAP.
  • Improved reconstruction: On more challenging datasets with unknown generative factors (3DChairs, CelebA), TCWAE methods demonstrate superior reconstruction quality (lower MSE) and sample quality (lower FID scores) compared to VAE-based methods.
  • Trade-off control: The paper shows that TCWAE allows for a more sensible trade-off between reconstruction fidelity and disentanglement, particularly with the TCWAE-GAN variant.

Limitations and Future Work

  • MWS estimator bias: The MWS estimator used in TCWAE-MWS is biased, which can affect performance, especially with smaller batch sizes.
  • Hyperparameter sensitivity: While TCWAE offers more flexibility, finding optimal hyperparameters (β and γ) still requires tuning, as evidenced by the extensive hyperparameter sweeps.
  • Future work: The paper suggests exploring other divergence functions for the WAE objective and investigating more advanced estimators for the KL terms. The flexibility in reconstruction cost also opens avenues for exploring domain-specific losses.

Summary updated

BibTeX
@inproceedings{gaujac2021learning,
  author = {Benoit Gaujac and Ilya Feige and David Barber},
  title = {{Learning Disentangled Representations with the Wasserstein Autoencoder}},
  booktitle = {ECML/PKDD},
  year = {2021},
  url = {https://openreview.net/forum?id=t4UI3NoIRh},
}
Figure