Learning Disentangled Representations with Semi-Supervised Deep Generative Models

N. Siddharth, Brooks Paige, Jan-Willem van de Meent, Alban Desmaison, Noah D. Goodman, Pushmeet Kohli, Frank Wood, Philip H. S. Torr

TL;DR

This paper introduces a flexible framework that combines the interpretability of probabilistic graphical models with the expressive power of deep generative models (like VAEs). By using a novel importance-sampling objective, it allows researchers to easily train semi-supervised models with arbitrary dependency structures, successfully separating distinct data features (like identity vs. lighting) into disentangled, interpretable latent variables.

What Problem Does This Paper Address?

When deep generative models like Variational Autoencoders (VAEs) learn representations of data, they typically compress all features into a single, highly entangled latent variable. For instance, a VAE trained on faces might mix up identity, lighting, and facial expression in its latent space, making it impossible to alter the lighting without accidentally changing the person's face.

Conversely, traditional Probabilistic Graphical Models (PGMs) excel at creating structured, disentangled representations, but they require tedious, domain-specific feature engineering to define exact likelihood functions. This paper bridges the gap by introducing partially-specified graphical models. The idea is to explicitly define relationships for a subset of interpretable variables (where you might have some labels) while letting deep neural networks automatically learn the messy, unannotated details.

Methods

The authors propose a generalized formulation for semi-supervised learning within structured VAEs. Their key contributions include:

  1. Partially-Specified Graph Architectures: Modellers specify the exact relationships only for the latent variables they care about (e.g., a discrete variable for a digit's identity). The remaining variations are captured by unstructured latent variables handled by deep neural networks.
  2. Generalized Importance-Sampling Objective: Standard semi-supervised VAEs are restricted to specific, simple graph factorizations because evaluating the conditional probability of latents given the data can become analytically intractable. The authors derive a new variational objective ($\hat{\mathcal{L}}^{\text{sup}}$) using self-normalised importance sampling, which accommodates arbitrary conditional dependency structures in both the generative and recognition networks.
  3. Stochastic Computation Graphs: The framework automatically compiles these complex, partially-supervised graphical models into computation graphs suitable for end-to-end training and amortized inference.
Figure 1: Semi-supervised learning in structured variational autoencoders, illustrated on MNIST digits. Top-Left: Generative model. Bottom-Left: Recognition model. Middle: Stochastic com- putation graph, showing expansion of each node to its corresponding sub-graph. Generative-model dependencies are shown in blue and recognition-model dependencies are shown in orange. See Section 2.2 for a detailed explanation. Right: learned representation.

Datasets

The framework was evaluated across several distinct domains:

  • MNIST: The standard handwritten digits dataset, used to separate digit identity from handwriting style.
  • Street-View House Numbers (SVHN): A significantly more complex real-world dataset of house number images.
  • Yale B (Intrinsic Faces): A dataset of face images under varying illumination, used to disentangle person identity from continuous lighting directions.
  • Multi-MNIST: A custom-created dataset containing a varying number of digits (1 to 3) per canvas, designed to test the model’s ability to handle stochastic dimensionality (counting) and model compositionality.

Key Insights and Ideas

  • The Power of "Partial" Knowledge: You don't need a fully labeled dataset or a fully defined graphical model to get clean, interpretable representations. Specifying just a single node (like "digit label") and providing a tiny fraction of labels forces the network to isolate that feature from the rest of the latent space.
  • Automating the Math with Importance Sampling: By reframing the supervised objective using importance sampling, practitioners no longer have to manually derive a new mathematical objective every time they change their graphical model's structure.
  • Compositionality: The authors show that a simpler, pre-trained model (like a standard MNIST VAE) can be dropped directly as a substructure into a more complex model (like Multi-MNIST), demonstrating that deep generative models can be modular.

Key Results

The framework demonstrated strong quantitative performance and impressive qualitative generative capabilities:

  • Classification Accuracy: On MNIST with only 100 labeled examples, the model achieved a classification error of 9.71%, performing on par with or better than existing multi-stage semi-supervised VAE baselines while using a simpler, single-stage training process.
  • Disentanglement: As shown in the visual analogies, the model successfully decoupled style from content. Holding the style latent variable fixed while changing the digit label generated the new digit in the exact handwriting style of the original input.
Figure 2: (a) Visual analogies for the MNIST data, partially supervised with just 100 labels (out of 50000). We infer the style variable z and then vary the label y. (b) Exploration in style space with label y held fixed and (2D) style z varied. Visual analogies for the SVHN data when (c) partially supervised with just 1000 labels, and (d) fully supervised.
  • Intrinsic Faces: With only 6 labeled images per individual, the model achieved a 3.5% error rate for identity classification and a low angular distance error for lighting regression, vastly outperforming previous specialized baselines.
  • Multi-MNIST Counting: The model successfully learned to count and decompose multi-digit images into their constituent parts, even when the number of latent variables varied dynamically.

Limitations and Future Work

While powerful, the authors note that the model is sensitive to the "supervision rate" parameter ($\rho$), which balances the weight between supervised and unsupervised data. If this parameter is tuned too high, the model overfits the labeled data and generalizes poorly to the test set.

For future work, the authors point toward extending this stochastic computation graph framework into full-blown probabilistic programming languages (PPLs). This would allow the framework to handle even more expressive architectures, such as models with open-ended recursive structures and higher-order functions.

Summary updated

Abstract

Variational autoencoders (VAEs) learn representations of data by jointly training a probabilistic encoder and decoder network. Typically these models encode all features of the data into a single variable. Here we are interested in learning disentangled representations that encode distinct aspects of the data into separate variables. We propose to learn such representations using model architectures that generalise from standard VAEs, employing a general graphical model structure in the encoder and decoder. This allows us to train partially-specified models that make relatively strong assumptions about a subset of interpretable variables and rely on the flexibility of neural networks to learn representations for the remaining variables. We further define a general objective for semi-supervised learning in this model class, which can be approximated using an importance sampling procedure. We evaluate our framework's ability to learn disentangled representations, both by qualitative exploration of its generative capacity, and quantitative evaluation of its discriminative ability on a variety of models and datasets.
BibTeX
@inproceedings{siddharth2017learning,
  author = {N. Siddharth and Brooks Paige and Jan-Willem van de Meent and Alban Desmaison and Noah D. Goodman and Pushmeet Kohli and Frank Wood and Philip H. S. Torr},
  title = {{Learning Disentangled Representations with Semi-Supervised Deep Generative Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=SJN3CdbuWB},
}
Figure