Guided Variational Autoencoder for Disentanglement Learning

Zheng Ding, Yifan Xu, Weijian Xu, Gaurav Parmar, Yang Yang, Max Welling, Zhuowen Tu

Abstract

Variational Autoencoders (VAEs) are powerful generative models, yet their latent spaces often lack interpretability, making it difficult to isolate and control specific semantic attributes. We present Guided-VAE, a framework that introduces "guidance signals" to the latent space to achieve disentanglement without altering the core VAE architecture. By employing auxiliary tasks—such as deformable PCA for unsupervised learning and adversarial excitation/inhibition for supervised learning—Guided-VAE learns to isolate specific factors of variation, such as geometry or facial expressions, while maintaining high reconstruction quality.

Introduction

While standard VAEs excel at modeling complex data distributions, their latent representations are typically "black boxes." It is often unclear which dimensions of the latent code control specific features of the generated output, such as the thickness of a digit or the orientation of an object. Disentanglement—the process of separating these underlying factors—is critical for creating controllable and interpretable generative models.

Existing methods for disentanglement often require significant modifications to the VAE backbone or involve a trade-off where reconstruction quality diminishes as disentanglement improves. Guided-VAE addresses these challenges by treating disentanglement as a companion task to the standard VAE objective through a multi-task learning approach.

Methods

Guided-VAE introduces two primary strategies for guiding the latent space toward semantically meaningful representations:

  1. Unsupervised Guided-VAE (Deformable PCA): This approach utilizes a dual-decoder architecture. While the main decoder performs standard reconstruction, a secondary, lightweight sub-decoder ($Dec_{sub}$) forces latent variables to adhere to a "Deformable PCA" structure. The latent vector is split into geometric transformation parameters (e.g., scale, rotation) and linear basis components for content. This structure guides the encoder to organize its latent space geometrically.
  2. Supervised Guided-VAE (Adversarial Excitation & Inhibition): When attribute labels are available, an adversarial mechanism is employed. Excitation trains a specific latent variable to be highly predictive of a target attribute. Crucially, Inhibition trains the remaining latent variables to be as uninformative as possible about that same attribute. This prevents information leakage and ensures the target factor is isolated to a single dimension.
Architecture of Guided-VAE: (a) Unsupervised mode using Deformable PCA and (b) Supervised mode using Discriminative Excitation and Inhibition.

Key Insights

  • Guidance vs. Constraint: Rather than imposing rigid constraints that might degrade performance, Guided-VAE "guides" the model toward desirable solutions. Because VAEs possess a large solution space, the model can satisfy both reconstruction and semantic guidance objectives simultaneously.
  • The Role of Inhibition: In supervised settings, simply training a variable to recognize an attribute is insufficient for true disentanglement. Active inhibition is required to ensure that the attribute's information does not bleed into other latent dimensions.
  • Architecture Agnosticism: Since guidance occurs at the latent level, this framework can be integrated into various VAE-like backbones without requiring a total redesign of the neural network.

Key Results

The model was evaluated across several benchmarks, including MNIST, 2D Shapes, and CelebA. On the 2D Shapes dataset, Guided-VAE achieved a Z-Diff score of 99.2, outperforming popular baselines such as $\beta$-VAE (98.1) and FactorVAE (98.4).

In practical applications, Guided-VAE demonstrates superior controllability. On the CelebA dataset, the model successfully isolated attributes like "smiling" or "gender." As shown in the comparison below, Guided-VAE allows for smooth transitions along a single attribute dimension without unintended changes to other facial features, a common failure mode in standard $\beta$-VAEs.

Comparison of attribute manipulation on CelebA between $\beta$-VAE and Guided-VAE (Ours) for Gender and Smile attributes.

Furthermore, the latent representations proved more semantically meaningful for downstream tasks. On MNIST, using Guided-VAE latents for classification resulted in a significantly lower error rate (1.10%) compared to a standard VAE (2.98%). The model also showed strong generalization in few-shot learning scenarios, reaching 92.1% accuracy on the Omniglot 20-way 1-shot task.

Conclusion and Future Work

Guided-VAE provides a robust framework for learning disentangled representations by leveraging auxiliary guidance tasks. While the current unsupervised approach relies on affine geometric assumptions, future work could extend this to more complex, non-linear deformations. Additionally, the principles of excitation and inhibition could be applied to other generative architectures, such as GANs or flow-based models, to enhance their interpretability and utility in meta-learning tasks.

Summary updated

BibTeX
@inproceedings{ding2020guided,
  author = {Zheng Ding and Yifan Xu and Weijian Xu and Gaurav Parmar and Yang Yang and Max Welling and Zhuowen Tu},
  title = {{Guided Variational Autoencoder for Disentanglement Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00794},
}
Figure