Abstract
In recent years, extending variational autoencoder's framework to learn disentangled representations has received much attention. We address this problem by proposing a framework capable of disentangling class-related and class-independent factors of variation in data. Our framework employs an attention mechanism in its latent space in order to improve the process of extracting class-related factors from data. We also deal with the multimodality of data distribution by utilizing mixture models as learnable prior distributions, as well as incorporating the Bhattacharyya coefficient in the objective function to prevent highly overlapping mixtures. Our model's encoder is further trained in a semi-supervised manner, with a small fraction of labeled data, to improve representations' interpretability. Experiments show that our framework disentangles class-related and class-independent factors of variation and learns interpretable features. Moreover, we demonstrate our model's performance with quantitative and qualitative results on various datasets.
Introduction
Representation learning aims to uncover the underlying factors of variation in data. A "disentangled" representation is one where individual units in the latent code correspond to specific, independent attributes of the data (e.g., one unit controls rotation, another controls color). While standard Variational Autoencoders (VAEs) provide a foundation for this, they often struggle to distinguish between attributes unique to a category (class-related) and those shared across all categories (class-independent). Furthermore, unsupervised methods often lack interpretability, while fully supervised methods are constrained by the high cost of labeling.
This paper introduces PartedVAE, a semi-supervised framework that explicitly partitions the latent space to handle these distinct types of variation. By integrating an attention mechanism and learnable mixture priors, the model achieves high interpretability and state-of-the-art disentanglement even with minimal supervision.
Methodology
The PartedVAE architecture partitions the latent space into three distinct variables:
- $c$: A discrete variable representing the class identity (e.g., digit identity).
- $u$: A continuous variable capturing factors exclusive to the specific class $c$ (e.g., the specific style of a '2').
- $z$: A continuous variable capturing factors shared across all classes (e.g., rotation or scale).
To effectively isolate $u$, the model employs a Latent Attention Mechanism. The discrete class $c$ generates an attention map $a$ that filters the encoder's feature vector $h$. This ensures that $u$ only receives information relevant to the selected class.
For the class-related space $u$, the authors utilize Learnable Mixture Priors (Mixture of Gaussians). To ensure these modes remain distinct and do not collapse into a single distribution, a penalty term based on the Bhattacharyya coefficient is added to the objective function. This forces the model to maintain separation between class-specific distributions in the latent space.
The model is trained using a semi-supervised objective. While primarily unsupervised, a small fraction of labeled data (as low as 0.1%) is used to anchor the discrete variable $c$ via cross-entropy loss, significantly improving the interpretability of the learned factors.
Experiments and Results
The framework was evaluated on MNIST, dSprites, and CelebA datasets to measure classification accuracy and disentanglement quality.
Quantitative Performance
On the dSprites dataset, PartedVAE demonstrated superior disentanglement. In a purely unsupervised setting, it achieved a Factor Score of 0.77, outperforming $\beta$-VAE (0.58) and FactorVAE (0.71). With only 1.35% labeled data, this score improved to 0.905.
On MNIST, the model achieved 95% classification accuracy using only 256 labeled images. In comparison, a baseline classifier with the same architecture but without the PartedVAE partitioning reached only 83% accuracy.
Qualitative Analysis
The model successfully performs attribute transfer and latent factor traversal. As shown in Figure 6, the model can smoothly vary specific attributes (like rotation or stroke style) while keeping the class identity constant. This demonstrates that the model has successfully isolated class-independent factors from the identity of the digit.
Conclusion
PartedVAE provides a robust solution for disentangling class-related and class-independent factors. By partitioning the latent space and utilizing attention and mixture priors, the model achieves high interpretability and performance with minimal supervision. Future work may involve incorporating Total Correlation (TC) penalties to further enhance the independence of latent factors and addressing potential overfitting when label counts are extremely low.
Summary updated