TrajSurv: Learning Continuous Latent Trajectories from Electronic Health Records for Trustworthy Survival Prediction

Sihang Zeng, Lucas Jing Liu, Jun Wen, Meliha Yetisgen, Ruth Etzioni, Gang LuoarXiv 2025 · DOI

Abstract

Predicting survival in clinical settings is often hampered by the irregular and sparse nature of Electronic Health Records (EHRs). TrajSurv is a novel deep learning framework that addresses these challenges by modeling patient health as a continuous "latent trajectory" rather than a series of discrete snapshots. By combining Neural Controlled Differential Equations (NCDEs) with a time-aware contrastive learning objective, TrajSurv achieves state-of-the-art survival predictions while providing clinicians with a transparent, "divide-and-conquer" look at how specific clinical changes drive a patient's risk.

Introduction

Predicting survival (time-to-event) in a hospital setting is critical for triaging patients, but EHR data is notoriously messy and irregularly sampled. Standard models like Recurrent Neural Networks (RNNs) often discretize this data, effectively ignoring what happens between observations. While newer models using Neural Ordinary Differential Equations (NODEs) attempt continuity, they often fail to align their internal "latent states" with actual clinical reality, leading to a "black box" problem. TrajSurv aims to bridge this gap by capturing the continuous "kinetics" of disease—how fast a patient is deteriorating—to provide both high-accuracy predictions and clinical interpretability.

Methodology

TrajSurv relies on three main technical pillars to model patient health trajectories:

  1. Neural Controlled Differential Equations (NCDEs): Unlike standard models that update states only when new data arrives, NCDEs treat irregularly sampled EHR data as a continuous "control signal." This allows the model to evolve a patient's latent state smoothly over time.
  2. Time-Aware Contrastive Learning (TACL): To ensure the model's internal representations reflect health status, TACL forces latent states to align with established clinical severity scores (e.g., SOFA). It uses a "time mask" to account for temporal drift, ensuring that states close together in time and clinical severity are mapped near each other in the latent space.
  3. Two-Step Interpretation: The model uses a "divide-and-conquer" approach to transparency. First, it analyzes the NCDE Vector Field to show how specific features drive the "velocity" of a patient's trajectory. Second, it uses Latent Trajectory Clustering to group patients into distinct progression patterns.
Overview of the TrajSurv framework, including NCDE vector fields, time-aware contrastive learning, and latent trajectory clustering.

Experiments and Results

The model was evaluated on two massive, real-world ICU datasets: MIMIC-III (over 20,000 admissions) and eICU (over 116,000 admissions). In both cases, the task was to predict in-hospital mortality based on the first 36 hours of data after admission.

  • State-of-the-Art Accuracy: On MIMIC-III, TrajSurv achieved a C-index of 0.803, significantly outperforming deep learning baselines like SurvLatentODE and Dynamic-DeepHit, which ranged from 0.762 to 0.772.
  • Robustness: In cross-cohort evaluations (training on MIMIC-III and testing on eICU), the model maintained strong performance, demonstrating its ability to generalize across different hospital systems.
  • Clinical Grouping: Clustering identified four distinct "patient journeys" with statistically significant differences in survival probability, offering a high-level prognostic tool for clinicians.

Discussion and Insights

By modeling health as a continuous flow, TrajSurv captures the rate of change in clinical features, which is often more informative than static lab values. Forcing the model to learn representations that correlate with clinical scores acts as a powerful regularizer, preventing the model from getting lost in high-dimensional noise and improving overall accuracy.

The "Vector Field Perspective" allows researchers to treat the model's internal weights as a physical map. By examining the columns of the vector field, the authors identified which labs were most influential (Feature Importance) and which moved in tandem (Feature Relevance), matching known medical knowledge such as the relationship between creatinine and urea nitrogen in kidney failure.

Conclusion and Future Work

TrajSurv provides a robust and interpretable framework for survival prediction in the ICU. However, it currently relies on existing clinical scores (like SOFA) to anchor its learning. Future work may explore more adaptable labels, such as knowledge graphs or key clinical variables, to define patient states more comprehensively in diverse settings where standard scores may not be available. Additionally, while the vector field analysis provides population-level insights, further refinement is needed to ensure these patterns apply accurately to every individual case.

Summary updated

BibTeX
@misc{zeng2025trajsurv,
  author = {Sihang Zeng and Lucas Jing Liu and Jun Wen and Meliha Yetisgen and Ruth Etzioni and Gang Luo},
  title = {{TrajSurv: Learning Continuous Latent Trajectories from Electronic Health Records for Trustworthy Survival Prediction}},
  year = {2025},
  eprint = {2508.00657},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.00657},
}
Figure