A Variational Autoencoder for Heterogeneous Temporal and Longitudinal Data

Mine Ögretir, Siddharth Ramchandran, Dimitrios Papatheodorou, Harri Lähdesmäki

TL;DR

The Heterogeneous Longitudinal Variational Autoencoder (HL-VAE) is a new generative model designed to handle complex real-world datasets that are both longitudinal (repeated measurements over time) and heterogeneous (mixed data types like continuous, categorical, and ordinal). By combining Gaussian Process priors with specialized likelihood decoders, HL-VAE significantly improves missing value imputation and future-state prediction in clinical and simulated settings.

What Problem Does This Paper Address?

Most deep learning models for data analysis assume that data points are independent and identically distributed (i.i.d.). However, in fields like healthcare, data is rarely that simple. It is often longitudinal, meaning we track the same patients over multiple years, creating strong temporal correlations. Furthermore, this data is heterogeneous: a single patient record might include continuous values (blood pressure), counts (number of hospital visits), categorical labels (gender), and ordinal scales (pain levels from 1-10).

Existing Variational Autoencoders (VAEs) usually fail in one of two ways:

  1. Temporal models (like L-VAE) capture longitudinal correlations using Gaussian Processes but assume all data is normally distributed (Gaussian), which fails for discrete or skewed data.
  2. Heterogeneous models (like HI-VAE) handle mixed data types beautifully but treat every time point as independent, ignoring the rich information contained in a patient's history.

HL-VAE bridges this gap, providing a unified framework that respects both the temporal structure and the diverse nature of the data.

Methods

HL-VAE builds on the standard VAE architecture—an encoder that compresses data into a latent space and a decoder that reconstructs it—but introduces two critical modifications:

  1. Multi-output Additive GP Prior: Instead of the standard Gaussian prior ($N(0, I)$), the latent space is governed by a Gaussian Process (GP). This GP uses an additive covariance function to model shared trends across all subjects as well as individual-specific "random effects." This allows the model to understand how a patient’s state evolves over time relative to others.
  2. Heterogeneous Decoder with Link Functions: The decoder doesn't just output a single vector. It maps latent variables to a "homogeneous layer," which then branches into specific "link functions" tailored to different data types. For example, it uses a sigmoid for data in the [0,1] range, a softplus for positive counts (Poisson), and a multinomial logit for categorical data.
The HL-VAE architecture: A GP prior handles temporal correlations in the latent space, while a specialized decoder handles mixed data types via link functions.

To handle missing data, the authors modify the Evidence Lower Bound (ELBO) objective to only calculate reconstruction loss over the observed features, allowing the model to learn effectively even from sparse clinical records.

Datasets

The authors evaluated HL-VAE on two primary benchmarks:

  • Longitudinal MNIST: A simulated dataset where MNIST digits are rotated and shifted over "time." The images are divided into regions, with some regions treated as continuous pixels and others discretized into categorical classes to simulate heterogeneity.
  • PPMI (Parkinson’s Progression Markers Initiative): A real-world clinical dataset containing 80 heterogeneous metrics (Gaussian, log-normal, Poisson, ordinal, and categorical) from 545 participants monitored over five years.
The simulated MNIST setup, where different regions of the digit are assigned different likelihood models (Real vs. Categorical).

Key Insights and Ideas

  • Likelihood Choice is Crucial: The paper demonstrates that forcing categorical or count data into a Gaussian model (as L-VAE does) leads to significant errors. By simply matching the likelihood model to the data type, the model becomes much more expressive.
  • Temporal Context Aids Imputation: Because HL-VAE models the latent dynamics over time, it can "borrow" information from a patient's past or future visits to fill in missing values at a current visit. This makes it superior to static models like HI-VAE.
  • Scalability via Inducing Points: Modeling GPs for large datasets is traditionally $O(N^3)$. The authors utilize a mini-batch compatible inference scheme with inducing points, making the model practical for high-dimensional longitudinal studies.

Key Results

HL-VAE consistently outperformed both L-VAE (which lacks heterogeneity) and HI-VAE (which lacks temporal modeling):

  • On MNIST: HL-VAE achieved lower Negative Log-Likelihood (NLL) and lower prediction error, particularly in the categorical regions of the images.
  • On PPMI: In missing value imputation tasks (ranging from 10% to 50% missingness), HL-VAE showed lower Normalized Root Mean Squared Error (NRMSE) for numerical data and higher accuracy for categorical data compared to its predecessors.
Comparison of missing value prediction errors on the PPMI dataset. HL-VAE (red) consistently shows lower error across various data types compared to HI-VAE variants.

Limitations and Future Work

The authors note that HL-VAE assumes data is Missing Completely at Random (MCAR). In actual clinical practice, data is often "Missing Not at Random" (MNAR)—for instance, a patient might skip a visit because they are too ill. Future work could involve incorporating more complex missingness mechanisms. Additionally, while the model is expressive, exploring how to make the latent GP components more interpretable for clinicians remains an open challenge.

Summary updated

BibTeX
@inproceedings{ogretir2022variational,
  author = {Mine Ögretir and Siddharth Ramchandran and Dimitrios Papatheodorou and Harri Lähdesmäki},
  title = {{A Variational Autoencoder for Heterogeneous Temporal and Longitudinal Data}},
  booktitle = {ICMLA},
  year = {2022},
  url = {https://openreview.net/forum?id=ZrVMu1jzSN},
}
Figure