AI, Healthcare
AI Model Predicts Heart Failure Patient Risk at Discharge to Guide Care Planning
Researchers developed a Transformer-based system that analyzes hospital records to identify heart failure patients most likely to deteriorate or die within a year after discharge.
Determining which heart failure patients face the highest risk of complications or death after leaving the hospital remains a persistent clinical challenge, yet accurate predictions drawn from standard electronic health records have proved elusive. A team has now created a machine learning approach designed to fill this gap by analyzing the full arc of a patient's hospital stay.
How the system works#
The new method, called trajectory-guided discharge stratification for heart failure (TGDS-HF), processes a patient's in-hospital journey—encompassing diagnoses, vital signs, lab results, medications, and procedures—using a compact short-context autoregressive Transformer model. Rather than processing vast amounts of historical data, it focuses on the clinical record directly relevant to discharge planning, then assigns risk scores for two key outcomes: clinical instability (captured through rehospitalization patterns) and mortality over the following year.
The system incorporates three design elements: category-level tokenization to represent clinical concepts, recency-weighted temporal representation to emphasize more recent events, and a carefully tuned Transformer configuration optimized for speed and accuracy.
Performance and validation#
The researchers tested TGDS-HF on a Swedish cohort of more than 42,000 heart failure patients, comparing it against traditional machine learning baselines including XGBoost and BERT-based EHR models. The new approach achieved area under the precision-recall curve (AUPRC) scores of 0.555 for instability and 0.574 for mortality using default settings, with further refinements pushing the mortality prediction to 0.582.
Critically, the model maintained strong performance even when certain clinical data points were unavailable or when training datasets were limited—a practical advantage in real-world deployment where data completeness varies.
Clinical potential#
The authors suggest that dual predictions of instability and mortality could support clinicians in crafting personalized discharge plans, ranging from routine follow-up in primary care through specialist-led management to palliative care where appropriate. By identifying the highest-risk patients at the moment of discharge, the system may help hospitals allocate resources more effectively and improve outcomes for one of medicine's most challenging populations.

