Table of Contents
Fetching ...

DynaGraph: Interpretable Multi-Label Prediction from EHRs via Dynamic Graph Learning and Contrastive Augmentation

Munib Mesinovic, Soheila Molaei, Peter Watkinson, Tingting Zhu

TL;DR

DynaGraph tackles the challenge of modeling temporal trajectories and inter-feature dependencies in multivariate EHR time-series while preserving interpretability for clinical use. It learns dynamic, data-driven graphs across time windows, combines LSTM temporal embeddings with a pseudo-attentive interpretability mechanism, and uses a contrastive learning framework with targeted losses to handle imbalanced multi-label tasks. The method is validated on four real-world datasets, demonstrating superior predictive performance and robust time-resolved interpretability that aligns with clinical knowledge. The work offers a practical, end-to-end framework for reliable, explainable multi-label predictions in healthcare, with potential to aid decision-making and resource allocation.

Abstract

Learning from longitudinal electronic health records is limited if it does not capture the temporal trajectories of the patient's state in a clinical setting. Graph models allow us to capture the hidden dependencies of the multivariate time-series when the graphs are constructed in a similar dynamic manner. Previous dynamic graph models require a pre-defined and/or static graph structure, which is unknown in most cases, or they only capture the spatial relations between the features. Furthermore in healthcare, the interpretability of the model is an essential requirement to build trust with clinicians. In addition to previously proposed attention mechanisms, there has not been an interpretable dynamic graph framework for data from multivariate electronic health records (EHRs). Here, we propose DynaGraph, an end-to-end interpretable contrastive graph model that learns the dynamics of multivariate time-series EHRs as part of optimisation. We validate our model in four real-world clinical datasets, ranging from primary care to secondary care settings with broad demographics, in challenging settings where tasks are imbalanced and multi-labelled. Compared to state-of-the-art models, DynaGraph achieves significant improvements in balanced accuracy and sensitivity over the nearest complex competitors in time-series or dynamic graph modelling across three ICU and one primary care datasets. Through a pseudo-attention approach to graph construction, our model also indicates the importance of clinical covariates over time, providing means for clinical validation.

DynaGraph: Interpretable Multi-Label Prediction from EHRs via Dynamic Graph Learning and Contrastive Augmentation

TL;DR

DynaGraph tackles the challenge of modeling temporal trajectories and inter-feature dependencies in multivariate EHR time-series while preserving interpretability for clinical use. It learns dynamic, data-driven graphs across time windows, combines LSTM temporal embeddings with a pseudo-attentive interpretability mechanism, and uses a contrastive learning framework with targeted losses to handle imbalanced multi-label tasks. The method is validated on four real-world datasets, demonstrating superior predictive performance and robust time-resolved interpretability that aligns with clinical knowledge. The work offers a practical, end-to-end framework for reliable, explainable multi-label predictions in healthcare, with potential to aid decision-making and resource allocation.

Abstract

Learning from longitudinal electronic health records is limited if it does not capture the temporal trajectories of the patient's state in a clinical setting. Graph models allow us to capture the hidden dependencies of the multivariate time-series when the graphs are constructed in a similar dynamic manner. Previous dynamic graph models require a pre-defined and/or static graph structure, which is unknown in most cases, or they only capture the spatial relations between the features. Furthermore in healthcare, the interpretability of the model is an essential requirement to build trust with clinicians. In addition to previously proposed attention mechanisms, there has not been an interpretable dynamic graph framework for data from multivariate electronic health records (EHRs). Here, we propose DynaGraph, an end-to-end interpretable contrastive graph model that learns the dynamics of multivariate time-series EHRs as part of optimisation. We validate our model in four real-world clinical datasets, ranging from primary care to secondary care settings with broad demographics, in challenging settings where tasks are imbalanced and multi-labelled. Compared to state-of-the-art models, DynaGraph achieves significant improvements in balanced accuracy and sensitivity over the nearest complex competitors in time-series or dynamic graph modelling across three ICU and one primary care datasets. Through a pseudo-attention approach to graph construction, our model also indicates the importance of clinical covariates over time, providing means for clinical validation.

Paper Structure

This paper contains 18 sections, 11 equations, 5 figures, 1 table.

Figures (5)

  • Figure 1: Our DynaGraph model framework. The multivariate time-series $x_1, x_2, \ldots, x_d$ are divided into s equal-length time windows $t_1, t_2, \ldots, t_s$. A: Each window $t_1, t_2, \ldots, t_s$ has a corresponding feature matrix represented by a dynamic graph $A_1, A_2, \ldots, A_s$, whose adjacency matrices are learnable through information propagation. The node and edge vectors of the previous graph slice, $\theta_{t-1}, \psi_{t-1}$, respectively, inform the corresponding nodes and edges of the next graph slice $\theta_{t}, \psi_{t}$. The connection (expressed as dotted lines) from node to node between graph slices corresponds to information propagation across time. An embedding matrix from the LSTM output $E_1, E_2, ..., E_s$ for the same time windows as for the graph construction ensures the pairing between the graphs and the temporal embeddings. B: The adjacency matrix is paired with an interpretability weight matrix $I$ whose weights are learnable for every slice with a Hadamard product. The interpretability weights measure the impact of the different parts of the graph on the final loss $\mathcal{L}_{\text{total}}$. The adjacency matrix is also augmented with graph augmentation techniques for contrastive loss computation, such as shuffling across the $s$ time dimension, random node masking, and edge perturbations. The adjacency matrix, interpretability matrix, and embeddings are aggregated to produce the final spatio-temporal graph representation of the multivariate time-series, namely $G_1, G_2, \ldots, G_s$. C: Finally, $G_s$ is passed through a VGAE with GINs as the encoder-decoder and its output graph representation is clustered temporally with CNNs before being flattened for a standard MLP for multi-label classification.
  • Figure 2: Heatmaps of the pseudo-attention weight matrices for DynaGraph during training on (a) MIMIC-III, (b) eICU, and (c) HiRID datasets, highlighting the globally top 10 features. The weights are normalized and smoothed using a Gaussian kernel ($\sigma=0.6$). Higher values indicate greater feature importance for the corresponding time-period in the final multi-label prediction tasks: heart attack complications (eICU), phenotype classification (MIMIC-III), and ICU mortality with heart/respiratory failure prediction (HiRID).
  • Figure 3: Learned graph representations during DynaGraph training on the MIMIC-III dataset at two distinct timesteps: (a) $t=1$, (b) $t=4$, and (c) $t=6$, each corresponding to the first, fourth, and last 4-hour interval of a 24-hour ICU stay. The visualization highlights the evolving patterns captured by the model, including changes in individual feature importance and correlations between features. Node size corresponds to node weight magnitude, while edge darkness reflects edge weight magnitude, as derived from the interpretability matrices. These representations demonstrate the model's ability to dynamically adapt to temporal changes in the data.
  • Figure 4: The ablation studies for (a) eICU, (b) MIMIC-III, (c) HiRID-ICU, and (d) EHRSHOT datasets under the balanced accuracy metric. The x-axis contains the different modules excluded for the ablations, namely, AUG for graph augmentation and contrastive loss, FOC for the focal loss, LSTM for the LSTM embedding module, REG for the regularisation loss, STRUC for the structural loss, and TGP for the temporal graph pooling. The legend contains the name of the dataset used, wout stands for the model performance without that module included, and Ref is the best-performing model with all the modules included.
  • Figure 5: Generalisation performance of DynaGraph and MedGNN on out-of-distribution (OOD) settings, evaluated using balanced accuracy. OOD test sets were constructed by excluding specific subgroups like age groups: $<20$ to $>80$; gender: male and female; and time quartiles: Q1 (first 6 hours of stay) to Q4 (last 6 hours of stay) from the training data on the eICU and MIMIC-III datasets. DynaGraph demonstrates superior robustness across all OOD scenarios compared to MedGNN.