Contrastively Disentangled Sequential Variational Autoencoder

Junwen Bai, Weiran Wang, Carla P. Gomes

In the field of self-supervised learning, "disentanglement" represents a significant challenge. The goal is to develop models that can understand the underlying structure of data by separating static content (the "what") from dynamic motion (the "how"). At NeurIPS 2021, researchers from Cornell and Google introduced C-DSVAE, a framework that leverages contrastive learning to provide sequential Variational Autoencoders (VAEs) with the necessary inductive bias to organize their latent spaces effectively.

The Challenge of Latent Bleed

When observing a sequence, such as a cartoon character walking, humans naturally separate the character's identity (e.g., red hair, blue shirt) from the action (e.g., walking left). For machine learning models, this separation is non-trivial. Standard Sequential VAEs often suffer from "latent bleed," where motion variables inadvertently encode content information and vice versa. Without a specific inductive bias, there are theoretically infinite ways to encode data, most of which result in entangled representations. C-DSVAE addresses this by forcing the model to respect the dichotomy between time-invariant (static) and time-variant (dynamic) factors without requiring human-provided labels.

Methodology: Architecture and Contrastive Learning

The C-DSVAE architecture utilizes LSTMs to manage the temporal nature of sequences. However, its primary innovation lies in the objective function and the method of estimation.

  1. Principled Objective: The authors derived a novel Evidence Lower Bound (ELBO) that goes beyond standard reconstruction and KL-divergence. This objective explicitly maximizes Mutual Information (MI) between the input and latent factors while minimizing MI between static and dynamic factors to ensure independence.
  2. Contrastive Estimation: Because estimating MI in high-dimensional spaces is difficult, C-DSVAE employs contrastive estimation (similar to InfoNCE). This approach treats disentanglement as a matching problem, providing a stronger regularizer than traditional generative sampling.
  3. Strategic Augmentations: To generate the positive and negative samples required for contrastive learning, the framework uses two types of augmentations:
  4. Content Augmentation: Shuffling or reversing frames to preserve identity while destroying motion.
  5. Motion Augmentation: Applying color jitter or cropping to preserve action while altering identity.
Overview of the C-DSVAE architecture and the contrastive augmentation framework.

Experimental Evaluation

The model was evaluated across four diverse datasets to demonstrate its versatility in both video and audio domains:

  • Sprites: Cartoon characters performing various actions.
  • MUG: A facial expression dataset featuring different individuals.
  • SM-MNIST: Stochastic Moving MNIST digits.
  • TIMIT: A speech corpus used to separate speaker identity from linguistic content.

Key Results and Insights

C-DSVAE consistently outperformed state-of-the-art models like S3VAE and R-WAE. On the MUG dataset, it improved classification accuracy of fixed factors by over 10% and showed significantly lower intra-entropy, indicating more consistent generations.

One of the most compelling demonstrations of the model's success is the "swap test." By taking the identity of one subject and the motion of another, C-DSVAE can generate clean, sharp videos where the identity remains stable despite the new action. Previous models often produced blurred frames or "ghosting" effects where identity information leaked between factors.

Qualitative results of identity and motion swapping on the Sprites dataset.

Conclusion and Future Directions

C-DSVAE demonstrates that data augmentation is a powerful tool for defining inductive biases in latent space. By combining a generative VAE backbone with a discriminative contrastive "judge," the model achieves superior disentanglement.

While effective, future work could address current limitations, such as replacing LSTM backbones with Transformers to better handle long-range dependencies. Additionally, exploring more sophisticated motion-preserving augmentations could further enhance performance on complex, real-world video data. The framework holds promise for various fields, including biology and meteorology, where separating underlying traits from temporal changes is critical.

Summary updated

BibTeX
@inproceedings{bai2021contrastively,
  author = {Junwen Bai and Weiran Wang and Carla P. Gomes},
  title = {{Contrastively Disentangled Sequential Variational Autoencoder}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure