From Basic to Extra Features: Hypergraph Transformer Pretrain-then-Finetuning for Balanced Clinical Predictions on EHR

Ran Xu, Yiwen Lu, Chang Liu, Yong Chen, Yan Sun, Xiao Hu, Joyce C. Ho, Carl Yang

Introduction

Electronic Health Records (EHR) often exhibit significant heterogeneity in feature availability. While most patients possess a "basic" set of features—such as common diagnoses and medications—specialized clinics or research studies may collect "extra" features (e.g., air pollution exposure, sleep data, or advanced cardiac monitoring) for only a small subset of the population.

Standard machine learning approaches struggle with this disparity due to two primary factors: dimension mismatch, where models require fixed input sizes and rely on confusing zero-padding, and catastrophic forgetting, where finetuning on specialized subgroups degrades the model's performance on the broader population. The HTP-Star framework addresses these challenges by seamlessly integrating extra features to enhance predictions for all patients.

Methodology: The HTP-Star Framework

The authors introduce HTP-Star (Hypergraph Transformer Pretrain-then-Finetuning), which relies on three core innovations to handle clinical data diversity.

Hypergraph Representation

Instead of treating patient visits as flat vectors, HTP-Star models them as hyperedges in a graph. Medical codes serve as nodes, and a single visit is represented as a hyperedge connecting all relevant nodes. This flexible structure naturally accommodates a variable number of features; adding "extra" features is as simple as connecting additional nodes to the existing hyperedge, avoiding the pitfalls of zero-padding.

Hypergraph representation of patient visits where medical codes are nodes and visits are hyperedges connecting basic and extra features.

Smoothness-inducing Regularization and Reweighting

To prevent catastrophic forgetting during the finetuning phase, the framework maintains an exponential moving average of model weights as a stable baseline. A consistency loss (KL-divergence) ensures the active model's predictions remain aligned with this baseline. Additionally, a group-balanced reweighting scheme balances gradients between basic-only and extra-feature patient groups, ensuring specialized data does not negatively impact general medical knowledge optimization.

Experimental Setup

The framework was evaluated on two major EHR datasets:

  1. UK Biobank: Focused on predicting cardiovascular disease (CVD) outcomes for patients with Type 2 Diabetes, using sleep duration and cardiac monitoring as "extra" features.
  2. MIMIC-III: A phenotyping benchmark for 25 acute conditions, where medications and procedures were treated as "extra" features to simulate high-dimensional sparsity.

Results and Discussion

HTP-Star consistently outperformed standard Transformers and state-of-the-art transfer learning methods. A key insight from the study is the "Both" trap: simply training on a combined dataset with zero-padding often yields worse results than training on basic features alone, highlighting the need for specialized architectures.

AUROC performance comparison on UK Biobank and MIMIC-III, illustrating the performance gains of HTP-Star and the pitfalls of naive data combination.

On the UK Biobank dataset, HTP-Star achieved an AUROC of 60.11 for the basic group, a significant improvement over the vanilla pretrain-finetune baseline (~56.79). Crucially, the model maintained balanced performance across both subgroups, avoiding the performance "dip" typically seen in the majority group after exposure to specialized data. Ablation studies confirmed that both the regularization and reweighting components are essential for maintaining this robustness.

Conclusion and Future Work

HTP-Star demonstrates that hypergraph structures combined with active gradient balancing can effectively integrate specialized clinical data without sacrificing general model performance. While currently focused on categorical medical codes, future work aims to incorporate unstructured data like clinical notes and medical imaging. Addressing the computational overhead of hypergraph transformers and scaling to millions of unique codes across multi-center studies remain ongoing challenges.

Summary updated

Abstract

Electronic Health Records (EHRs) contain rich patient information and are crucial for clinical research and practice. In recent years, deep learning models have been applied to EHRs, but they often rely on massive features, which may not be readily available for all patients. We propose \ours{}\footnote{Short for \textbf{H}ypergraph \textbf{T}ransformer \textbf{P}retrain-then-Finetuning with \textbf{S}moo\textbf{t}hness-induced regularization \textbf{a}nd \textbf{R}eweighting.}, which leverages hypergraph structures with a pretrain-then-finetune framework for modeling EHR data, enabling seamless integration of additional features. Additionally, we design two techniques, namely (1) \emph{Smoothness-inducing Regularization} and (2) \emph{Group-balanced Reweighting}, to enhance the model’s robustness during finetuning. Through experiments conducted on two real EHR datasets, we demonstrate that \ours{} consistently outperforms va
BibTeX
@inproceedings{xu2024from,
  author = {Ran Xu and Yiwen Lu and Chang Liu and Yong Chen and Yan Sun and Xiao Hu and Joyce C. Ho and Carl Yang},
  title = {{From Basic to Extra Features: Hypergraph Transformer Pretrain-then-Finetuning for Balanced Clinical Predictions on EHR}},
  booktitle = {CHIL},
  year = {2024},
  url = {https://openreview.net/forum?id=fPfwUXGoXR},
}
Figure