Variational Autoencoder with Arbitrary Conditioning

Oleg Ivanov, Michael Figurnov, Dmitry P. Vetrov

TL;DR

VAEAC (Variational Autoencoder with Arbitrary Conditioning) is a generative model capable of conditioning on any arbitrary subset of features to sample the remaining missing values in a single "one-shot" pass. By learning a prior distribution that adapts to observed data, it provides a fast, flexible, and probabilistic solution for complex feature imputation and diverse image inpainting.

The Problem: Incomplete Data and Fixed Conditioning

In many real-world scenarios, we deal with incomplete data where the pattern of missingness isn't fixed. For example, in a medical database, one patient might be missing a blood pressure reading, while another is missing a cholesterol score. Traditional Conditional VAEs (CVAEs) are designed for fixed conditioning (e.g., "generate an image given a specific class label").

Existing solutions for "arbitrary" conditioning often fall into two camps:

  1. Autoregressive models: These are flexible but painfully slow because they generate features one by one (e.g., pixel-by-pixel).
  2. Optimization-based GANs: These require a costly optimization process at test time to find the right latent code for every single missing-data instance.

To address these limitations, the authors propose a "single-shot" probabilistic model that can handle any combination of observed features and generate multiple, diverse, and realistic completions for the missing ones.

Methods: The VAEAC Architecture

The core innovation is the VAEAC architecture, which consists of three neural networks:

  • The Prior Network: Unlike a standard VAE (where the prior is a fixed Gaussian), VAEAC uses a network to produce a prior $p(z | x_{observed}, b)$ conditioned on the observed features and a binary mask ($b$) indicating what is missing.
  • The Proposal Network: Used only during training, this network $q(z | x, b)$ sees the full data to help the model learn an efficient latent representation.
  • The Generative Network (Decoder): This network $p(x_{missing} | z, x_{observed}, b)$ reconstructs the missing features based on the latent variable and the known observations.

Key Technical Details: * Stochastic Variational Bayes: The model is trained by maximizing a modified Variational Lower Bound (ELBO) that accounts for the arbitrary mask $b$. * Normal-Gamma Prior: To prevent numerical instabilities where the prior parameters might blow up, the authors introduce a Normal-Gamma prior as a regularizer. * Handling Missing Data at Training: The authors propose a modification to the objective function that allows the model to be trained even on datasets that already have missing values (by marginalizing them out of the reconstruction loss).

Key Insights

  • The "One-Shot" Advantage: Because VAEAC generates all missing features simultaneously from a single latent sample, it is orders of magnitude faster than autoregressive models or optimization-based GAN approaches at inference time.
  • Capturing Multi-modality: Many imputation methods produce a single "average" guess, which leads to blurry results in images. VAEAC learns the full conditional distribution. If an image of a face has the eyes covered, VAEAC can sample different eye colors or shapes that are all "realistic" given the rest of the face.
  • Prior Adaptation: By making the prior a function of the observed features, the latent space $z$ only needs to encode the "uncertainty" remaining after accounting for what we already know.
  • Generalization: VAEAC is a mathematical generalization of both the standard VAE (where nothing is observed) and the CVAE (where the observed set is fixed).

Key Results

The authors evaluated VAEAC across several domains, including tabular data from the UCI Machine Learning Repository, image datasets (MNIST, Omniglot, CelebA), and synthetic 2D data.

Feature Imputation

VAEAC outperformed or matched classical methods like MICE and MissForest, as well as the GAN-based GAIN model, on most UCI datasets in terms of Normalized Root Mean Squared Error (NRMSE).

NRMSE for feature imputation on UCI datasets

Image Inpainting

On the CelebA dataset, VAEAC achieved higher Peak Signal-to-Noise Ratio (PSNR) than previous state-of-the-art models like Context Encoders. Specifically, when taking the best of 10 samples, VAEAC significantly outperformed deterministic baselines across various masking strategies (Center, Pattern, Random, and Half).

PSNR on CelebA dataset for different masking strategies

Efficiency and Multimodality

  • Speed: Compared to the "Universal Marginalizer" (a competing flexible model), VAEAC was roughly 1,400 times faster at generating 100 samples (0.7ms vs 1s on MNIST).
  • Multimodal Success: Synthetic tests showed that while other models collapsed to the mean of the data, VAEAC successfully identified and sampled from all distinct modes of the distribution.

Limitations and Future Work

  • Mask Distribution Sensitivity: The model performs best when the distribution of missingness (the masks) seen during training matches the distribution at test time. If the test-time "missingness" is radically different from training, performance may degrade.
  • Sample Blurriness: While VAEAC captures diversity better than deterministic models, it still suffers from the typical VAE "blurriness" compared to GANs. The authors suggest that adding an adversarial loss to the VAEAC framework could resolve this.
  • Conditional Independence: The decoder assumes that missing features are conditionally independent given the latent variable $z$. While $z$ captures global structure, this assumption might struggle with extremely fine-grained local correlations in very high-resolution data.

Summary updated

BibTeX
@inproceedings{ivanov2019variational,
  author = {Oleg Ivanov and Michael Figurnov and Dmitry P. Vetrov},
  title = {{Variational Autoencoder with Arbitrary Conditioning}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=rJNCgZEF35},
}
Figure