Disentanglement with factor quantized variational autoencoders

Gulcin Baykal, Melih Kandemir, Gozde Unal

TL;DR

This paper introduces FactorQVAE, a novel approach to disentangled representation learning that combines discrete latent variables with a factorization regularizer. By using scalar quantization with a global codebook and a total correlation penalty, FactorQVAE achieves state-of-the-art performance in disentanglement while maintaining good reconstruction quality, addressing limitations of previous methods.

What Problem Does This Paper Address?

Representation learning aims to extract meaningful features from data. A key goal in this field is "disentanglement," where the underlying generative factors of data (e.g., object shape, color, orientation) are represented independently in different dimensions of a latent space. This is crucial for interpretability and downstream tasks like fairness and recommendation. However, achieving true disentanglement, especially in an unsupervised manner, is challenging due to the ill-posed nature of the problem and the lack of knowledge about true generative factors. Existing methods often struggle with trade-offs between reconstruction fidelity and disentanglement, or rely on restrictive assumptions. This paper specifically addresses the limitations of previous discrete VAE approaches, which can be restrictive in their capacity to represent factors with diverse cardinalities and can lead to inefficiencies.

Methods

The core of FactorQVAE lies in its novel combination of techniques:

  • Discrete Latent Variables: Instead of continuous latent representations, FactorQVAE uses discrete ones. This is motivated by the success of discrete representations in large generative models and the idea that discrete variables can act as a stronger inductive bias for disentanglement.
  • Scalar Quantization with Global Codebook: Unlike prior methods that might use per-dimension codebooks (like QLAE), FactorQVAE employs scalar quantization using a single, global codebook. This approach is designed to overcome the representational inefficiencies and limitations of fixed, per-dimension codebooks when dealing with generative factors that have varying numbers of possible values.
  • Factorization Regularizer (Total Correlation): The paper incorporates a total correlation term into the loss function. This term, inspired by Kim and Mnih's FactorVAE, encourages statistical independence among latent variables, thereby promoting disentanglement.
  • Stochastic Categorical Posterior and Gumbel-Softmax: To enable end-to-end training with the discrete latent variables and the total correlation term, the authors use a stochastic categorical posterior and the Gumbel-Softmax trick for differentiable sampling.

Datasets

The authors evaluate their method on three standard 3D object datasets:

  • Shapes3D: A dataset with 6 generative factors and relatively simple complexity.
  • Isaac3D: A dataset with 9 generative factors, representing a synthetic robot arm holding objects, offering medium complexity.
  • MPI3D (Complex variant): A dataset with 7 generative factors, capturing real-world scenarios with varying backgrounds and lighting, representing a challenging complexity.

Key Insights and Ideas

  • Discrete is Better (for Disentanglement): The paper strongly advocates for discrete representations over continuous ones for disentanglement, showing consistent outperformance across metrics and datasets. This suggests that the inherent structure of discrete variables provides a more suitable inductive bias.
  • Global Codebook Efficiency: The use of a single, global codebook for scalar quantization is shown to be more efficient and flexible than per-dimension codebooks, especially when generative factors have different cardinalities. This allows the model to learn how to partition the latent space more effectively.
  • Factorization is Key: Combining factorization (via total correlation) with discrete representations significantly boosts disentanglement performance, highlighting the synergistic effect of these two components.
  • Trade-off Management: The authors acknowledge the inherent trade-off between disentanglement (modularity) and completeness (compactness) and prioritize modularity, aligning with common practice and the problem's nature.

Key Results

  • State-of-the-Art Performance: FactorQVAE consistently outperforms previous state-of-the-art disentanglement models (B-VAE, FactorVAE, BioAE, α-TCVAE, QLAE) on the DCI and InfoMEC metrics across all three datasets.
  • Balanced Performance: FactorQVAE achieves strong disentanglement scores while maintaining reconstruction performance comparable to models with the best reconstruction capabilities.
  • Improved Reconstruction: Compared to QLAE, FactorQVAE produces cleaner reconstructions with fewer artifacts, as demonstrated in qualitative evaluations.
  • Robustness: The performance of FactorQVAE is shown to be relatively resistant to the number of scalar values in the codebook.

Limitations and Future Work

  • Challenging Settings: The paper acknowledges that achieving acceptable disentanglement remains a challenge in complex, real-world environments like the MPI3D dataset, where generative factors might be more intricate and interdependent than assumed.
  • Future Directions: The authors suggest exploring combinations of discrete and continuous representations to better handle complex, interdependent generative factors. Extending FactorQVAE to less structured datasets or non-visual modalities is also proposed as a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{baykal2024disentanglement,
  author = {Gulcin Baykal and Melih Kandemir and Gozde Unal},
  title = {{Disentanglement with factor quantized variational autoencoders}},
  booktitle = {Neurocomputing},
  year = {2024},
}
Figure