Generative modeling of clinical time series via latent stochastic differential equations

Muhammad Aslanimoghanloo, Ahmed ElGazzar, Marcel van Gerven

TL;DR

Researchers have developed a generative modeling framework using Latent Neural Stochastic Differential Equations (SDEs) to predict patient health trajectories. By combining continuous-time modeling with explicit stochasticity, the model outperforms traditional LSTMs and Neural ODEs in accuracy and—crucially—uncertainty quantification, even when data is sparse or noisy.

What Problem Does This Paper Address?

Clinical data is notoriously "messy." Electronic Health Records (EHRs) and ICU monitors produce time series that are irregularly sampled (vitals aren't taken on a perfect clock), full of missing values, and influenced by complex, hidden physiological processes.

Existing tools have significant gaps:

  • RNNs and LSTMs operate in discrete "steps," making it difficult for them to handle irregular intervals without awkward data padding or resampling.
  • Neural Ordinary Differential Equations (ODEs) solve the timing problem by modeling change continuously, but they are deterministic. They assume that if you know the starting state, the future is set in stone.

In medicine, however, biology is inherently stochastic (random). Two patients starting in the same state might respond differently to the same drug due to unobserved factors. This paper addresses the need for a model that is both continuous-time and probabilistic.

Methods

The authors propose a Latent SDE framework based on a variational encoder-decoder architecture:

  1. Encoders: One encoder maps discrete observations and patient covariates (like age/weight) into a latent space. A second encoder transforms treatment sequences (like chemotherapy schedules) into a continuous-time control signal.
  2. Latent Dynamics (The Core): Instead of a simple path, the model learns a "Generative SDE" consisting of two parts:
  3. Drift: The deterministic trend of the disease or recovery.
  4. Diffusion: The stochastic "noise" or inherent randomness in the system.
  5. Variational Inference: Because calculating the exact probability of these random paths is mathematically impossible, they use an "Augmented SDE" to approximate the posterior distribution, optimized via an Evidence Lower Bound (ELBO) and Girsanov’s theorem.
  6. Decoder: Projects the latent "hidden" states back into the real-world data space (e.g., predicting actual heart rate or tumor volume).

Datasets

The framework was validated on two distinct types of data:

  • Synthetic PKPD Model: A simulated lung cancer model (Pharmacokinetic-Pharmacodynamic). The authors extended a standard model to include immune system response and overall health status, providing a "ground truth" to test if the model could recover unobserved latent variables (like actual tumor size) from noisy cell counts.
  • PhysioNet 2012 (ICU Data): A real-world dataset of 12,000 intensive care unit stays. The authors focused on forecasting three vital signs: Heart Rate (HR), Mean Arterial Pressure (MAP), and Body Temperature (BT).

Key Insights and Ideas

  • The Power of Diffusion: The "aha moment" is that the diffusion term isn't just "noise"—it captures inter-patient variability and the inherent unpredictability of biological systems. This allows the model to produce a distribution of possible futures rather than a single, likely-wrong guess.
  • Robustness to "Data Holes": Because the model defines the derivative of the state, it doesn't care if a measurement is missing for six hours. It simply integrates the SDE over that gap.
  • Uncertainty as a Feature: In a clinical setting, knowing that a model is uncertain is as important as the prediction itself. The Latent SDE provides well-calibrated confidence intervals, which could help clinicians decide when to intervene vs. when to wait for more data.

Key Results

The Latent SDE consistently outperformed Latent ODEs and LSTMs:

  • Synthetic Data: The SDE achieved significantly lower Continuous Ranked Probability Score (CRPS) and Negative Log-Likelihood (NLL). For example, in cell count prediction, the Latent SDE achieved an NLL of 0.08, compared to 0.11 for ODEs and 0.13 for LSTMs.
  • Real-World ICU Data: The model was superior in forecasting Heart Rate and Body Temperature. Interestingly, all models performed similarly on Mean Arterial Pressure, which the authors attribute to MAP being more tightly controlled by medical interventions in the ICU, reducing its natural stochasticity.
  • Stress Testing: When the authors intentionally removed up to 80% of the data, the Latent SDE remained stable, while the performance of the discrete-time LSTM degraded sharply.

Limitations and Future Work

  • Computational Cost: Training SDEs is significantly more "heavy" and time-consuming than training ODEs or standard neural networks. This might limit their use in resource-constrained settings.
  • Markovian Assumption: The model assumes the future depends only on the current latent state. In reality, some medical conditions might have long-term "memory" or non-stationary effects not fully captured here.
  • Short-Term Focus: The ICU evaluation focused on a 24-hour window. It remains to be seen how well these models scale to months or years of outpatient data.
  • Future Directions: The authors suggest integrating "expert-designed" ODEs (incorporating known medical laws) into the neural framework to improve interpretability.

Summary updated

BibTeX
@article{aslanimoghanloo2026generative,
  author = {Muhammad Aslanimoghanloo and Ahmed ElGazzar and Marcel van Gerven},
  title = {{Generative modeling of clinical time series via latent stochastic differential equations}},
  journal = {J. Biomed. Informatics},
  year = {2026},
  doi = {10.1016/j.jbi.2026.105043},
}
Figure