A transformer-based survival model for prediction of all-cause mortality in patients with heart failure: a multi-cohort study
Heart failure (HF) patients have complex health profiles that existing risk models fail to capture. We developed TRisk, a Transformer-based artificial intelligence survival model for predicting mortality using routine electronic health records (EHR) in HF patients. Using UK data from 403,534 HF patients across 1418 English general practices, we trained and validated TRisk and compared it against MAGGIC-EHR, the MAGGIC model adapted for use on routine EHR by substituting variables (e.g. left-ventricular ejection fraction) that are not routinely available. External validation was conducted on 21,767 patients from USA hospitals. In the UK cohort, TRisk achieved a concordance index (C-index): 0.845 (95% CI: 0.841, 0.849), outperforming MAGGIC-EHR (C-index: 0.728 [0.723, 0.733]) for 36-month mortality prediction. In subgroup analyses, TRisk demonstrated less variability in predictive performance by sex, age, and baseline characteristics compared to MAGGIC-EHR, suggesting less biased modelling. Evaluating TRisk in USA data via transfer learning yielded a C-index of 0.802 (0.789, 0.816). Explainability analysis revealed TRisk captured established risk factors while identifying underappreciated ones, particularly cancers and hepatic failure, with cancers maintaining prognostic utility even a decade before baseline. TRisk provides more accurate, well-calibrated mortality prediction using routine data across international healthcare settings, demonstrating potential for improved risk stratification in patients with HF.
Authors
- John G.F. Cleland (ORCID: https://orcid.org/0000-0002-1471-7016)
- Nathalie Conrad (ORCID: https://orcid.org/0000-0001-5027-5481)
- Folkert W. Asselbergs (ORCID: https://orcid.org/0000-0002-1692-8669)
- Shishir Rao (ORCID: https://orcid.org/0000-0001-7331-9416)
- Christopher Yau (ORCID: https://orcid.org/0000-0001-7615-8523)
- Huimin Su (ORCID: https://orcid.org/0009-0004-0639-9507)
- Mark Woodward
- Gholamreza Salimi-Khorshidi
- Kazem Rahimi
- Nouman Ahmed (ORCID: https://orcid.org/0009-0003-6715-5760)
- Rod Jackson
Institutions
- University of Auckland (NZ)
- The George Institute for Global Health (GB)
- UNSW Sydney (AU)
- British Heart Foundation (GB)
- University of Oxford (GB)
- The George Institute for Global Health (AU)
- Health Data Research UK (GB)
- Amsterdam University Medical Centers (NL)
- University College London (GB)
- Imperial College London (GB)
- University of Glasgow (GB)
- University of Amsterdam (NL)
- KU Leuven (BE)
Publication Details
- Journal
- npj Digital Medicine
- Published
- 2026-01-08
- DOI
- https://doi.org/10.1038/s41746-025-02296-5
- Primary Topic
- Machine Learning in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00