Multimodal Variational Autoencoder

Machine Learning
Introduced by
Wu, M. and Goodman, N.
Year
2018
Type
Generative latent-variable model
Family
Deep learning / NLP / CV

What does it do?

The Multimodal Variational Autoencoder (MVAE) is a deep generative latent-variable model for data with two or more modalities, such as images and captions.

Each modality has its own encoder, and the per-modality posteriors over a shared latent variable are combined with a product-of-experts rule. Because of this fusion, the model can infer the shared code and generate the remaining modalities when only some of them are observed.

The intuition behind the method

Imagine trying to understand a scene from only a photo, only a caption, or both. A standard VAE handles one input type at a time, whereas the MVAE learns a single shared code for all modalities. Each modality's encoder proposes a Gaussian belief about that code, and these beliefs are multiplied together under the product-of-experts rule, so modalities that agree sharpen the shared code. At test time, any observed subset of modalities can be used to decode or generate the others, which is what enables cross-modal generation and inference when some inputs are missing.

History

The Multimodal Variational Autoencoder was introduced by Wu and Goodman at NeurIPS 2018, in a paper on multimodal generative models for scalable weakly-supervised learning. It builds on the variational autoencoder framework of Kingma and Welling (2014) and fuses modality-specific posteriors with a product-of-experts rule.

When to use it

Use MVAE when your data consists of two or more aligned modalities (for example image-text pairs, audio-video recordings, or imaging combined with tabular clinical records) and you need a joint generative model that supports inference with missing modalities, cross-modal generation, or semi-supervised learning in which labels exist for only some samples. In the semi-supervised case, unlabelled samples still contribute to training through the unsupervised bound, while the way labels enter the objective is a design choice specified in the source paper and should be followed when applying the method. It is well suited when training data are partially observed across modalities. Avoid MVAE when modalities are not aligned at the sample level, when a deterministic embedding is required rather than a stochastic latent variable, or when individual latent dimensions must be interpretable. In those settings, discriminative multimodal fusion models are often the more suitable choice.

Limitations and considerations

  • Product-of-experts fusion can be dominated by modalities with lower variance posteriors, causing imbalanced learning across modalities.
  • Training is sensitive to the relative weighting of reconstruction losses across modalities; poor calibration leads to one modality being ignored.
  • Subset-based training becomes expensive as the number of modalities grows, because the number of modality subsets that could be sampled increases exponentially with the number of modalities.
  • Assumes modalities are paired at the sample level during training, which limits use with unpaired or weakly correlated multimodal datasets.
  • Separation of shared and modality-specific factors in the latent space is not guaranteed without additional constraints.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Inference with missing modalities: any observed subset of inputs can be used to infer the shared latent code and generate the rest.
  • Product-of-experts fusion has a closed form for Gaussian posteriors, so the joint posterior is computed analytically rather than by sampling a mixture.
  • Each modality has its own encoder and decoder, so the architecture can match the data type, for example convolutional networks for images and recurrent or transformer networks for text.
  • Because each modality is encoded separately, samples in which some modalities are absent can still contribute to training in a weakly supervised setting.
  • A single shared latent space allows representations of different modalities to be compared directly.

Applications

  • Cross-modal generation, such as synthesising an image from a text description or a caption from an image.
  • Semi-supervised classification in which labels are available for only a subset of samples.
  • Fusion of clinical data sources in which some modalities are unavailable for some patients.
  • Audio-visual speech processing in which either the audio or the video stream may be absent or degraded.
  • Joint embedding of paired image and text data for retrieval tasks.

How it works

How it works

1

Each modality is passed through its own dedicated encoder network that outputs parameters (mean and variance) of a Gaussian approximate posterior over the shared latent variable z. Modality-specific encoders capture the unique statistical structure of each data type, such as convolutional networks for images and recurrent or transformer networks for text, before information is merged.

2

The per-modality posteriors are fused using a product-of-experts formulation: the joint posterior is proportional to the product of the individual posteriors divided by the prior raised to the power of the number of modalities minus one. This analytically closed-form Gaussian product yields a joint posterior that is sharper and more informed than any single modality alone.

Formula
q(z|x_1,\ldots,x_M) \propto p(z)^{1-M} \prod_{m=1}^{M} q(z|x_m)
3

A single latent vector z is sampled from the fused joint posterior using the reparameterisation trick, allowing gradients to flow through the stochastic sampling step and enabling end-to-end backpropagation through the entire model.

Formula
z \sim q(z|x_1,\ldots,x_M)
4

The sampled latent code z is passed to a separate decoder for each modality, which reconstructs the observed modalities. For generation, the latent code is inferred from whichever modalities are available and then used to decode the missing ones, for example producing an image from a caption.

5

Training maximises a variational lower bound on the data likelihood. The formula in the mechanics section gives the single-input form of this bound, with one reconstruction term and a KL term that pulls the posterior toward the unit-Gaussian prior. The multimodal objective is a subset-based extension of this bound, so that bound terms are evaluated for different combinations of observed modalities, including single modalities. The exact formulation, including how the fused posterior enters, should be taken from Wu and Goodman (2018). Sub-sampling modality subsets during training is recommended so that the model also learns to infer from partial inputs.

Formula
\mathcal{L} = \mathbb{E}_{q}[\log p(x|z)] - D_{\mathrm{KL}}(q(z|x) \| p(z))

Common pitfalls

  • Training only on complete modality sets without sub-sampling modality subsets. The model is then not trained to infer from partial inputs, and performance can degrade when a modality is missing at test time.
  • Using a single reconstruction loss weight for all modalities without tuning. High-dimensional modalities such as images can dominate the loss and leave text poorly modelled.
  • Ignoring posterior collapse, a known VAE failure mode in which the KL term dominates and the decoder ignores the latent code. Per-modality reconstruction and KL terms should be checked during training.
  • Treating cross-modal generation quality as equivalent to discriminative accuracy. MVAE is a generative model, and its generated samples may lack sharpness.
  • Not verifying modality alignment. Samples across modalities must correspond to the same observation, or the joint posterior does not carry meaningful shared information.

Frequently asked questions

How does MVAE differ from a standard VAE?

A standard VAE encodes a single data type into a latent space. MVAE extends this by maintaining a separate encoder per modality and fusing the resulting posteriors through a product-of-experts rule, yielding a joint latent space that integrates information from all observed modalities simultaneously.

What is the product-of-experts fusion and why is it used?

Product-of-experts combines multiple Gaussian posteriors by multiplying their densities and renormalising, which for Gaussians gives another Gaussian in closed form. This is preferred over averaging (mixture of experts) because it produces a sharper posterior that reflects agreement among modalities rather than their average.

How should I handle imbalanced modalities during training?

Use separate, tuned reconstruction loss weights per modality to prevent high-dimensional modalities from dominating. Sub-sampling random subsets of modalities per batch forces the model to handle partial observations and improves robustness to missing data at inference time.

Is MVAE appropriate for unpaired multimodal data?

No. MVAE assumes that modalities are paired at the sample level. If your data is unpaired — for example, independent collections of images and text — consider cycle-consistent or contrastive multimodal models instead.

What evaluation metrics are used for MVAE?

Common choices include reconstruction-quality measures for each modality (for example FID for images and BLEU for text), the fidelity of cross-modal generation, and log-likelihood estimates. Accuracy of a downstream task on held-out data is also used to check whether the shared latent code is useful.

Related methods

Sources

  1. Wu, M., & Goodman, N. (2018). Multimodal Generative Models for Scalable Weakly-Supervised Learning. Advances in Neural Information Processing Systems (NeurIPS), 31.

    Open publication reference
  2. Kingma, D. P., & Welling, M. (2014). Auto-Encoding Variational Bayes. International Conference on Learning Representations (ICLR).

    Open publication reference