DuETT: Dual Event Time Transformer for Electronic Health Records

Alex Labach, Aslesha Pokhrel, Xiao Shi Huang, Saba Zuberi, Seung Eun Yi, Maksims Volkovs, Tomi Poutanen, Rahul G. Krishnan · DOI

Abstract

Electronic Health Records (EHR) present a significant challenge for standard machine learning architectures due to their inherent sparsity, irregular sampling, and high-dimensional nature. We present DuETT (Dual Event Time Transformer), a novel architecture designed to model the complex temporal and semantic relationships within clinical data. By alternating attention between time and event dimensions and employing a specialized self-supervised pre-training scheme that treats data missingness as a signal, DuETT achieves state-of-the-art performance across multiple clinical benchmarks, notably outperforming highly-tuned gradient-boosted tree models.

1. Introduction

Clinical data within Electronic Health Records is notoriously difficult to model. Unlike the regular sequences found in natural language or the structured grids of computer vision, EHR data consists of multivariate time series—including vitals, laboratory results, and treatments—that are characterized by three primary difficulties:

  1. High Sparsity: Most physiological parameters are not measured most of the time.
  2. Irregular Sampling: Observations occur at varying frequencies; for instance, heart rate may be monitored continuously, while specific blood panels are conducted only once daily.
  3. High Dimensionality: There are hundreds of potential "event types" (e.g., different medications or lab tests) that may occur during a patient stay.

Standard Transformer architectures often struggle with this data format. Naive implementations typically treat all events at a single timestamp as a single vector, which ignores the semantic relationships between different types of medical observations. Furthermore, the quadratic scaling of self-attention makes processing long, detailed patient histories computationally prohibitive. DuETT addresses these limitations by decomposing the attention mechanism into two distinct dimensions: time and event type.

2. Methods

2.1 Input Binning and Aggregation

To manage irregular sampling, DuETT first aggregates raw events into fixed-length time bins. This transforms the irregular data into a regular grid while preserving critical information regarding "missingness" (whether a measurement occurred) and "frequency" (the count of measurements within that bin). Static variables, such as age and sex, are embedded and fused into every time bin to provide constant patient context throughout the model layers.

2.2 Dual Attention Architecture

The core of the DuETT layer is a dual-attention mechanism that alternates between two sub-layers:

  • Event Transformer: This component attends across different event types within the same time bin. It allows the model to learn correlations between disparate clinical signals, such as how a spike in heart rate relates to a specific laboratory result.
  • Time Transformer: This component attends across different time bins for the same event type, capturing the longitudinal evolution of a patient’s physiological state.

By alternating attention ($O(n_t^2 + n_e^2)$) rather than attending over every individual event ($O(n_p^2)$), DuETT achieves greater computational efficiency, allowing for deeper architectures and longer sequence processing.

2.3 Self-Supervised Learning (SSL)

Before fine-tuning on specific clinical outcomes, DuETT undergoes self-supervised pre-training using a "masked modeling" task. Crucially, the model is trained to predict both the value of a masked measurement and its presence. In a clinical context, the decision by medical staff to order a specific test is often as informative as the result itself, reflecting clinical priors and hidden hypotheses.

3. Experimental Results

3.1 Performance Benchmarks

DuETT was evaluated on three major benchmarks: MIMIC-IV ICU (mortality and phenotyping), MIMIC-IV ED (emergency department to ICU transfer), and PhysioNet-2012 (in-hospital mortality). The model achieved state-of-the-art (SOTA) results across all tasks.

In the MIMIC-IV ICU mortality task, DuETT achieved a PR-AUC of 0.627, significantly outperforming the previous best deep learning model, STraTS (0.552), and even surpassing a well-tuned XGBoost baseline (0.593). This is a notable achievement, as gradient-boosted trees have traditionally been difficult to beat in tabular and clinical domains.

3.2 Low-Data Robustness

The impact of DuETT’s SSL pre-training is most evident in low-data regimes. When trained on only 10% of available labeled data, DuETT’s performance remained robust, and the performance gap between DuETT and baseline models actually widened as labeled data became scarcer.

4. Discussion and Conclusion

DuETT demonstrates that treating "Event Type" as a semantic dimension equivalent to "Time" allows models to capture complex cross-variable correlations often lost in flatter architectures. Furthermore, by explicitly modeling data missingness, the architecture captures the "clinical signal" inherent in medical decision-making processes.

While the current iteration of DuETT focuses on single-stay numeric and categorical data, future work will explore the integration of multi-modal data—such as clinical notes and medical imaging—and the expansion of the model to handle longitudinal histories across multiple hospital encounters. Despite these current limitations, DuETT represents a significant step forward in applying deep learning to the messy reality of healthcare data.

Summary updated

BibTeX
@inproceedings{labach2023duett,
  author = {Alex Labach and Aslesha Pokhrel and Xiao Shi Huang and Saba Zuberi and Seung Eun Yi and Maksims Volkovs and Tomi Poutanen and Rahul G. Krishnan},
  title = {{DuETT: Dual Event Time Transformer for Electronic Health Records}},
  booktitle = {MLHC},
  year = {2023},
  url = {https://openreview.net/forum?id=MDns2TRuvT},
}
Figure