Abstract
Dual antiplatelet therapy (DAPT) following percutaneous coronary intervention (PCI) is traditionally guided by rule-based scores providing static, single-time-point or fixed time-interval estimates with modest discrimination (C-index 0.63–0.73), limiting individualized DAPT duration decisions. We developed Transformer-DAPT, a transformer-based deep learning survival framework designed to estimate patient-specific ischemic and bleeding risks across clinically relevant time intervals during the first year after PCI. Using electronic health records from 29,032 patients at Mayo Clinic and externally validated in 19,173 patients from the OneFlorida+ Clinical Research Consortium, Transformer-DAPT achieved time-dependent concordance indices (Ctd) of 0.84–0.87 for ischemic events and 0.81–0.88 for bleeding events, outperforming DeepSurv and DeepHit by 2%–12%. In the external cohort, Ctd ranged from 0.74–0.84 and 0.75–0.83 for ischemic and bleeding events, respectively. Transformer-DAPT demonstrated improved discrimination and calibration performance, providing a framework for multi-interval risk prediction to support personalized DAPT management after PCI.
Subject terms: Cardiology, Computational biology and bioinformatics, Diseases, Health care, Medical research
Introduction
Coronary artery disease (CAD) is a leading cause of mortality worldwide, accounting for nearly nine million deaths annually1. A key cornerstone of CAD management in patients presenting with acute and chronic coronary syndromes is timely revascularization, typically via percutaneous coronary intervention (PCI) with stent implantation2,3. Post-PCI care guidelines recommend at least 6 months of dual antiplatelet therapy (DAPT) for chronic coronary syndromes and 12 months for acute coronary syndromes (ACS)2,3. DAPT, consisting of aspirin plus a P2Y12 receptor inhibitor, reduces recurrent ischemic events after PCI, including myocardial infarction (MI) and stent thrombosis4. However, determining the optimal duration of DAPT for individual patients remains a clinical challenge2–4. Suboptimal DAPT duration may provide inadequate ischemic protection, whereas prolonged therapy may increase the risk of bleeding complications2–4. Importantly, post-PCI bleeding events are associated with an adverse prognosis comparable to recurrent MI, further underscoring the critical need for precise risk-benefit assessments5.
To facilitate clinical decision-making, several risk stratification tools have been developed. The PRECISE-DAPT score6 is commonly used to assess bleeding risk, while the DAPT score7 was designed to guide treatment duration beyond 12 months by weighing ischemic and bleeding risk. Additionally, the HAS-BLED score8,9, originally developed for patients with atrial fibrillation receiving anticoagulation, has also been applied to assess bleeding risk in post-PCI patients on DAPT. Although widely used, these tools have major limitations: they rely on rule-based thresholds and provide static estimates tied to a single decision time point. Their discriminative ability is modest, with reported C-indices ranging from 0.63 to 0.736–8,10. In addition, derivation from clinical trial populations may limit generalizability to diverse, real-world clinical settings6,7, and performance can be variable in patient populations requiring oral anticoagulation9.
Advances in stent technology and the introduction of novel and more potent antiplatelet therapies have prompted a transition from prolonged DAPT duration toward de-escalation strategies and abbreviated protocols in many patients11. Aspirin-free regimens and early P2Y12 inhibitor monotherapy have demonstrated safety and efficacy across various populations, including high-bleeding-risk, non-high-bleeding-risk, and high-ischemic-risk/post-ACS subgroups11–16.
Despite these therapeutic advances, an optimal and individualized DAPT strategy has remained uncertain. The rapid expansion of healthcare data analytics has fueled artificial intelligence (AI)-driven innovations, offering promising tools for enhancing risk stratification and clinical decision-making17,18. Machine learning has been increasingly applied to predict outcomes after PCI19–22, and recent approaches have addressed both ischemic and bleeding risk simultaneously21. Specifically, deep learning survival models such as DeepSurv23 and DeepHit24 have emerged as benchmark approaches for time-to-event analysis across various clinical domains25–27. However, existing prediction models—whether based on traditional risk scores or machine learning approaches—are typically developed, reported, and applied as static risk estimates at single, fixed time points. In clinical practice, DAPT decisions are usually made early and rarely revisited during follow-up, primarily due to the absence of clinical tools capable of providing dynamic risk estimates across multiple clinically actionable time horizons. As a result, DAPT regimens generally remain unchanged during the first 12 months unless the patient experiences an adverse event. This underscores the need for a framework that enables patient-specific risk estimation across multiple clinically relevant intervals during the first year after PCI, when DAPT decisions are most consequential.
Traditional risk scoring approaches have limited ability to account for complex, non-linear relationships among the large number of clinical variables encountered in real-world patient care. Transformer architectures offer distinct advantages for clinical data analysis, including the incorporation of self-attention mechanisms and the capacity to model complex interactions among high-dimensional clinical features. Unlike traditional models with restrictive proportional hazards assumptions, transformers are not constrained by these assumptions and can generate time-specific risk predictions across multiple time intervals.
To address these multifaceted challenges in post-PCI risk assessment, our previous research demonstrated the potential for integrating contrastive learning28 with a transformer model to predict adverse events in patients receiving DAPT29. While effective, the prior model relied on a complex architecture incorporating an autoencoder for dimensionality reduction preceding the transformer component. This design required the model to process all clinical variables simultaneously, even when most were absent for a given patient, resulting in increased computational burden and slower training. In this study, we introduce Transformer-DAPT, an optimized and streamlined deep survival framework adapted from our earlier model29. Transformer-DAPT leverages a transformer-based architecture to efficiently handle high-dimensional clinical data and generate dynamic, precise time-to-event predictions at multiple clinically relevant intervals: 1, 2, 3, 6, 9, and 12 months. This framework enables longitudinal risk estimation during the critical first year after PCI, when DAPT decisions carry the greatest clinical weight.
Results
Baseline characteristics
In the Mayo cohort (N = 29,032; mean age [SD], 67.0 [11.9] years; 71.4% male), 10,054 patients (34.6%) experienced ischemic events, while 4077 patients (14.0%) had bleeding events within the first year post-PCI. As shown in Table 1, patients who experienced ischemic events were younger (mean age: 66.2 vs. 67.5 years; p < 0.001), were more likely to have an ACS event at initial presentation, and had higher white blood cell (WBC) counts, serum creatinine, and hemoglobin levels. They also had a higher prevalence of most comorbidities, except for cancer and diabetes. Prior bleeding events and prior stroke were significantly more common among those who experienced ischemic events (p < 0.001). All evaluated medications, except for angiotensin receptor blockers (ARBs), were more commonly prescribed in those with ischemic events. However, bleeding events were associated with older age (mean age: 70.0 vs. 66.6 years; p < 0.001) and higher comorbidity burden. The group of patients who experienced bleeding events had significantly higher prescriptions for ARBs, beta-blockers, calcium channel blockers, NSAIDs, oral anticoagulants, and statins, whereas angiotensin-converting enzyme inhibitor (ACEI) use did not differ significantly between groups. Baseline characteristics of the OneFlorida+ cohort have been previously published30.
Table 1.
Baseline characteristics for patients with vs. without events (ischemic and bleeding) from 0 to 12 months in the selected cohort of Mayo Clinic dataset (N = 29,032)
| Characteristics | Ischemic event | Bleeding event | |||||
|---|---|---|---|---|---|---|---|
| Event (n = 10,054, 34.6%) | No event (n = 18,978, 65.3%) | p-value | Event (n = 4077, 14.0%) | No event (n = 24,955, 85.9%) | p-value | ||
| Age, mean (SD), years | 66.2 (12.5) | 67.5 (11.6) | <0.001 | 70.0 (11.8) | 66.6 (11.9) | <0.001 | |
| Male, no. (%) | 7005 (69.7) | 13,736 (72.4) | <0.001 | 2681 (65.8) | 18,060 (72.4) | <0.001 | |
| Ethnicity, no. (%) | Hispanic | 177 (1.8) | 366 (1.9) | <0.001 | 86 (2.1) | 457 (1.8) | 0.352 |
| NHB | 133 (1.3) | 236 (1.2) | 53 (1.3) | 316 (1.3) | |||
| NHW | 9280 (92.3) | 17,157 (90.4) | 3684 (90.4) | 22,753 (91.2) | |||
| Other | 464 (4.6) | 1219 (6.4) | 254 (6.2) | 1429 (5.7) | |||
| Presentation | Acute ischemic heart disease, No. (%) | 9022 (89.7) | 8694 (45.8) | <0.001 | 2460 (60.3) | 15,256 (61.1) | 0.334 |
| WBC count, mean (SD) | 9.58 (4.8) | 8.14 (4.0) | <0.001 | 8.76 (4.2) | 8.63 (4.4) | 0.073 | |
| Creatinine, mean (SD) | 1.19 (0.8) | 1.14 (1.0) | <0.001 | 1.42 (1.4) | 1.13 (0.8) | <0.001 | |
| Hemoglobin, mean (SD) | 13.42 (2.0) | 13.27 (1.8) | <0.001 | 12.39 (2.1) | 13.47 (1.8) | <0.001 | |
| History, no. (%) | Prior bleeding | 1301 (12.9) | 2043 (10.8) | <0.001 | 1119 (27.4) | 2225 (8.9) | <0.001 |
| Prior ischemic heart disease | 5559 (55.3) | 13,350 (70.3) | <0.001 | 3076 (75.4) | 15,833 (63.4) | <0.001 | |
| Prior Stroke | 827 (8.2) | 878 (4.6) | <0.001 | 401 (9.8) | 1304 (5.2) | <0.001 | |
| Comorbidities and risk factors, No. (%) | Anemia | 3001 (29.8) | 4617 (24.3) | <0.001 | 2362 (57.9) | 5256 (21.1) | <0.001 |
| Atrial fibrillation | 2077 (20.7) | 3611 (19.0) | <0.001 | 1410 (34.6) | 4278 (17.1) | <0.001 | |
| Cancer | 2334 (23.2) | 4272 (22.5) | 0.173 | 1472 (36.1) | 5134 (20.6) | <0.001 | |
| CHF | 4263 (42.4) | 5944 (31.3) | <0.001 | 2222 (54.5) | 7985 (32.0) | <0.001 | |
| CKD | 2766 (27.5) | 4379 (23.1) | <0.001 | 1746 (42.8) | 5399 (21.6) | <0.001 | |
| Diabetes | 3450 (34.3) | 6563 (34.6) | 0.648 | 1730 (42.4) | 8283 (33.2) | <0.001 | |
| Dyslipidemia | 9381 (93.3) | 16,821 (88.6) | <0.001 | 3741 (91.8) | 22,461 (90.0) | <0.001 | |
| Hypertension | 8561 (85.2) | 15,831 (83.4) | <0.001 | 3730 (91.5) | 20,662 (82.8) | <0.001 | |
| Liver disease | 977 (9.7) | 1500 (7.9) | <0.001 | 647 (15.9) | 1830 (7.3) | <0.001 | |
| PVD | 4052 (40.3) | 6792 (35.8) | <0.001 | 2372 (58.2) | 8472 (33.9) | <0.001 | |
| VTE | 546 (5.4) | 658 (3.5) | <0.001 | 396 (9.7) | 808 (3.2) | <0.001 | |
| Alcohol abuse | 601 (6.0) | 756 (4.0) | <0.001 | 301 (7.4) | 1056 (4.2) | <0.001 | |
| Smoking | 3341 (33.2) | 5203 (27.4) | <0.001 | 1579 (38.7) | 6965 (27.9) | <0.001 | |
| Medications, no. (%) | ACEIs | 6744 (67.1) | 9734 (51.3) | <0.001 | 2324 (57.0) | 14,154 (56.7) | 0.734 |
| ARBs | 2452 (24.4) | 4443 (23.4) | 0.063 | 1126 (27.6) | 5769 (23.1) | <0.001 | |
| Beta-blockers | 9651 (96.0) | 16,667 (87.8) | <0.001 | 3787 (92.9) | 22,531 (90.3) | <0.001 | |
| calcium channel blockers | 5849 (58.2%) | 10,694 (56.3%) | 0.003 | 2855 (70.0) | 13,688 (54.9) | <0.001 | |
| NSAIDs | 3283 (32.7) | 4734 (24.9) | <0.001 | 1471 (36.1) | 6546 (26.2) | <0.001 | |
| PPIs | 5222 (51.9) | 8489 (44.7) | <0.001 | 2713 (66.5) | 10,998 (44.1) | 0.009 | |
| Statins | 9747 (96.9) | 17,390 (91.6) | <0.001 | 3849 (94.4) | 23,288 (93.3) | <0.001 | |
| Anticoagulant usea | 1970 (19.6) | 3495 (18.4) | 0.015 | 1398 (34.3) | 4067 (16.3) | <0.001 | |
p-values were estimated by the chi-square test for categorical variables and ANOVA for continuous variables.
ACEIs, angiotensin-converting enzyme inhibitors; ARBs, angiotensin receptor blockers; CABG, coronary artery bypass graft surgery; CHF, congestive heart failure; CKD, chronic kidney disease; NHB, non-Hispanic Black; NHW, non-Hispanic White; NSAIDs, non-steroidal anti-inflammatory drugs; PPIs, proton pump inhibitors; PVD, peripheral vascular disease; VTE, venous thromboembolism.
*p ≤ 0.05 is regarded as significant.
aOral anticoagulants include warfarin and non-vitamin K antagonist oral anticoagulant.
Model performance
Within the Mayo cohort, Transformer-DAPT demonstrated strong performance for ischemic event prediction. At 1 month, it achieved a Ctd-index of 0.84 (95% CI 0.81–0.86), outperforming DeepHit (0.80, p = 0.008) and comparable to DeepSurv (0.83, p = 0.422). From month 2 onward, Transformer-DAPT consistently outperformed both benchmark models (Ctd-indices 0.85–0.87; all p < 0.001) (Fig. 1a). For bleeding events, Transformer-DAPT achieved a Ctd-index of 0.88 (95% CI 0.83–0.93) at 1 month, significantly higher than DeepSurv (0.76, p = 0.004) and with no significant difference from DeepHit (0.84, p = 0.100). Across subsequent time intervals, Transformer-DAPT maintained Ctd-index values between 0.81 and 0.87, showing superiority over both DeepSurv and DeepHit (all p < 0.001) (Fig. 1b).
Fig. 1. Performance of transformer-DAPT compared with benchmark models across time horizons (time-dependent C-index).

a Model performance of ischemic event prediction in the Mayo Clinic cohort. b Model performance of bleeding event prediction in the Mayo Clinic cohort. c Model performance of ischemic event prediction in the OneFlorida+ cohort. d Model performance of bleeding event prediction in the OneFlorida+ cohort. Transformer-DAPT consistently demonstrated superior performance over benchmark models across nearly all time intervals in both cohorts, highlighting its ability to capture complex temporal risk patterns following PCI.
In the OneFlorida+ cohort, Transformer-DAPT maintained consistent performance advantages, mirroring findings from the Mayo cohort. For ischemic events, the model achieved a Ctd-index of 0.84 (95% CI 0.74–0.92) at 1 month, with no statistically significant difference compared with DeepSurv (0.72, p = 0.118) or DeepHit (0.75, p = 0.108). Across subsequent intervals, it significantly outperformed both benchmark models, with Ctd-indices ranging from 0.74 to 0.77 (all p < 0.001, except the 2-month comparison with DeepHit, p = 0.004) (Fig. 1c). For bleeding events, the model demonstrated similar superiority, with Ctd-index values ranging from 0.75 to 0.83 across all evaluated time points. Its performance remained significantly higher than that of both benchmark models starting from 2 months and thereafter (all p < 0.001, except the 2-month comparison with DeepHit, p = 0.020) (Fig. 1d). Detailed metrics, including all p-values are provided in Tables 2 and 3. While Ctd-index values were somewhat lower than those observed in the Mayo cohort, Transformer-DAPT maintained clinically meaningful discrimination and continued to outperform both benchmark models across all evaluated intervals.
Table 2.
Survival analysis performance (Ctd-index) on the Mayo cohort test set
| Task: Ischemic | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Models | 1-M | 2-M | 3-M | 6-M | 9-M | 12-M | ||||||
| Ctd-indexa | p-valueb | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | |
| DeepSurv | 0.83 (0.80-0.85) | 0.422 | 0.84 (0.83–0.85) | <0.001 | 0.84 (0.83–0.85) | <0.001 | 0.84 (0.83–0.85) | <0.001 | 0.83 (0.82–0.84) | <0.001 | 0.82 (0.81–0.83) | <0.001 |
| DeepHit | 0.80 (0.78–0.82) | 0.008 | 0.84 (0.84–0.85) | <0.001 | 0.85 (0.84–0.86) | <0.001 | 0.85 (0.85–0.86) | <0.001 | 0.84 (0.83–0.85) | <0.001 | 0.83 (0.82–0.84) | <0.001 |
| Transformer-DAPT | 0.84 (0.81–0.86) | Reference | 0.86 (0.86–0.87) | Reference | 0.87 (0.86–0.87) | Reference | 0.87 (0.86–0.88) | Reference | 0.86 (0.85–0.86) | Reference | 0.85 (0.84–0.85) | Reference |
| Task: Bleeding | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Models | 1-M | 2-M | 3-M | 6-M | 9-M | 12-M | ||||||
| Ctd-indexa | p-valueb | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | |
| DeepSurv | 0.76 (0.66–0.85) | 0.004 | 0.77 (0.74– 0.8) | <0.001 | 0.76 (0.73–0.79) | <0.001 | 0.76 (0.74–0.78) | <0.001 | 0.73 (0.71–0.75) | <0.001 | 0.71 (0.69–0.73) | <0.001 |
| DeepHit | 0.84 (0.75–0.91) | 0.100 | 0.82 (0.79–0.84) | <0.001 | 0.81 (0.79–0.83) | <0.001 | 0.81 (0.79–0.82) | <0.001 | 0.78 (0.77–0.80) | <0.001 | 0.76 (0.74–0.77) | <0.001 |
| Transformer-DAPT | 0.88 (0.83–0.93) | Reference | 0.87 (0.86–0.89) | Reference | 0.87 (0.86–0.88) | Reference | 0.87 (0.86–0.88) | Reference | 0.84 (0.82–0.85) | Reference | 0.81 (0.79–0.82) | Reference |
Ctd-index, time-dependent concordance index.
aThe model performance (Ctd-index) was calculated by employing bootstrapping on the test dataset.
bp-values represent statistical comparison between each model and the reference model (Transformer-DAPT), determined using bootstrap-based statistical testing with 1000 resamples. Lower p-values indicate significant performance differences compared with the reference model.
Table 3.
Survival analysis performance (Ctd-index) on the OneFlorida+ cohort test set
| Task: Ischemic | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Models | 1-M | 2-M | 3-M | 6-M | 9-M | 12-M | ||||||
| Ctd-indexa | p-valueb | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | |
| DeepSurv | 0.72 (0.57–0.84) | 0.118 | 0.69 (0.66–0.72) | <0.001 | 0.71 (0.69–0.74) | <0.001 | 0.70 (0.67–0.72) | <0.001 | 0.685 (0.67–0.70) | <0.001 | 0.678 (0.66–0.70) | <0.001 |
| DeepHit | 0.75 (0.62–0.85) | 0.108 | 0.74 (0.72–0.77) | 0.004 | 0.74 (0.72–0.77) | <0.001 | 0.75 (0.73–0.76) | <0.001 | 0.73 (0.71–0.75) | <0.001 | 0.72 (0.71–0.74) | <0.001 |
| Transformer-DAPT | 0.84 (0.74–0.92) | Reference | 0.77 (0.75–0.79) | Reference | 0.77 (0.76–0.79) | Reference | 0.77 (0.76–0.79) | Reference | 0.75 (0.74–0.77) | Reference | 0.74 (0.73–0.76) | Reference |
| Task: Bleeding | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Models | 1-M | 2-M | 3-M | 6-M | 9-M | 12-M | ||||||
| Ctd-indexa | p-valueb | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | Ctd-index | p-value | |
| DeepSurv | 0.79 (0.65–0.89) | 0.424 | 0.71 (0.67–0.76) | <0.001 | 0.72 (0.69–0.75) | <0.001 | 0.72 (0.69–0.74) | <0.001 | 0.70 (0.68–0.73) | <0.001 | 0.70 (0.68–0.72) | <0.001 |
| DeepHit | 0.80 (0.72–0.88) | 0.484 | 0.75 (0.71–0.79) | 0.020 | 0.74 (0.71–0.77) | <0.001 | 0.75 (0.73–0.77) | <0.001 | 0.72 (0.70–0.74) | <0.001 | 0.71 (0.69–0.73) | <0.001 |
| Transformer-DAPT | 0.83 (0.74–0.89) | Reference | 0.79 (0.76–0.83) | Reference | 0.79 (0.76–0.81) | Reference | 0.79 (0.76–0.81) | Reference | 0.76 (0.74–0.78) | Reference | 0.75 (0.74–0.77) | Reference |
Ctd-index, time-dependent concordance index.
aThe model performance (Ctd-index) was calculated by employing bootstrapping on the test dataset.
bp-values represent statistical comparison between each model and the reference model (Transformer-DAPT), determined using bootstrap-based statistical testing with 1000 resamples. Lower p-values indicate significant performance differences compared with the reference model.
As a secondary evaluation, we assessed binary classification performance in the Mayo cohort. Transformer-DAPT demonstrated favorable discriminative ability, achieving an area under the receiver operating characteristic curve (AUROC) of 0.89 and 0.81 for ischemic and bleeding predictions, respectively. Additional metrics, including accuracy, F1-score, precision, AUPRC, sensitivity, and specificity, are summarized in Supplementary Table 1.
Static calibration (12-month)
The 12-month calibration using validation-derived isotonic regression improved the agreement between predicted and observed event probabilities on the test set. For ischemic events, the uncalibrated model showed moderate deviation from perfect calibration, particularly at mid-to-high probability ranges, with an expected calibration error (ECE) of 0.050. After calibration, this improved to an ECE of 0.016 (Fig. 2a). Bleeding risk predictions initially exhibited more pronounced miscalibration (ECE = 0.188), with marked deviation observed at higher risk levels. The ECE decreased to 0.011 after calibration (Fig. 2b). These calibration adjustments corrected event overprediction for both outcomes. For ischemic risk, calibration yielded a more evenly distributed risk spectrum across predicted probabilities. In contrast, bleeding predictions became more concentrated near zero and showed improved accuracy despite reduced dispersion.
Fig. 2. Calibration analysis of transformer-DAPT for prediction of ischemic and bleeding events at 12 months in the Mayo cohort.

a, b Static calibration curves and predicted probability distributions for ischemic (a) and bleeding (b) events before and after isotonic regression calibration. The plots in each panel compare predicted probabilities with observed event rates, with the dashed gray line representing perfect calibration. The histograms in each panel display the distribution of predicted probabilities. c, d Time-dependent calibration of ischemic (c) and bleeding (d) survival probability comparing model-predicted (dashed lines, uncalibrated; dotted lines, calibrated) with observed Kaplan–Meier estimates (solid lines) over 12 months. ECE, expected calibration error; KM, Kaplan–Meier.
Time-dependent calibration
Comparing model-predicted survival probabilities with Kaplan–Meier estimates over the 12-month follow-up period revealed close alignment with observed trajectories after calibration (Fig. 2c, d). For ischemic events, uncalibrated predictions deviated from observed Kaplan–Meier survival curves, particularly during the early high-risk period. After applying validation-derived adjustment factors, calibrated predictions showed improved alignment throughout follow-up and accurately captured the early post-PCI ischemic peak followed by more gradual progression. For bleeding events, uncalibrated predictions also exhibited deviation from the observed Kaplan–Meier survival curves, while calibrated predictions demonstrated marked improvement in temporal accuracy and effectively captured the gradual decline of the observed bleeding-free survival. This temporal calibration ensured risk predictions remained accurate across different phases of the post-PCI recovery period, supporting dynamic clinical decision-making throughout the critical first year post-PCI.
Feature importance analysis
Using Integrated Gradients, we identified distinct and clinically plausible predictors for ischemic and bleeding events (Supplementary Fig. 1). For ischemic events (Supplementary Fig. 1a), the most influential features included DAPT continuation, which reflects the known role of antiplatelet therapy in reducing ischemic complications, along with key cardiovascular comorbidities (e.g., acute ischemic heart disease, ischemic stroke, heart failure) and cardiometabolic medications (e.g., glipizide/metformin, fluvastatin). For bleeding events (Supplementary Fig. 1b), top features included kidney disease (a known risk factor for bleeding and adverse drug metabolism), DAPT continuation, atrial fibrillation (often necessitating anticoagulant therapy), prior non-traumatic bleeding, and cancer-related variables (e.g., hereditary hemochromatosis, radiation exposure, breast neoplasm, chemotherapy). These cancer-related features underscore the model’s ability to capture oncologic bleeding vulnerability. Procedural history variables such as prior coronary angiography (documented before the index PCI date) also contributed, reflecting prior procedure-related factors potentially associated with higher bleeding risk. DAPT continuation appeared among the top features for both outcomes, emphasizing its central role in post-PCI care. The identification of established risk factors alongside less recognized ones (e.g., immunologic and oncologic conditions) demonstrates that the model learns nuanced risk representations, supporting its use as a transparent tool for individualized DAPT risk stratification.
Clinical application of transformer-DAPT
To illustrate the clinical utility of Transformer-DAPT, we present two representative patients from the test cohort with distinct temporal patterns in ischemic and bleeding risk (Fig. 3). Patient 1 experienced a bleeding event on day 169 (Fig. 3a). The model estimated an early ischemic hazard peak of 3.16% at day 60, which declined to 2.88% by day 90, 1.69% at day 180, and 0.76% by day 365. In contrast, bleeding hazard rose progressively from 2.00% at day 30 to 2.82% at day 60, 3.09% at day 90, and was projected to reach 3.64% by day 180. The ischemic-to-bleeding hazard ratio decreased from 1.26 at day 30 to 1.12 at day 60, fell below 1.0 by day 90 (0.93), and further declined to 0.46 by day 180. At the time of the bleeding event (day 169), bleeding risk had already exceeded ischemic risk, with the crossover occurring between days 60 and 90. This predicted trajectory suggests that the patient transitioned into a bleeding-dominant risk phase several weeks before the adverse event, potentially providing an early signal to reconsider DAPT intensity within the broader clinical context.
Fig. 3. Predicted ischemic and bleeding hazard trajectories in two patients receiving DAPT.

a For a patient with a bleeding event on day 169, the estimated bleeding risk exceeded the estimated ischemic risk by approximately day 85. b For a patient who remained event-free through 12 months, the estimated bleeding risk surpassed the estimated ischemic risk around day 210. Vertical dashed lines denote key time points: red indicates the bleeding event (a); and orange indicates the end of follow-up at day 365 (a, b).
Patient 2 remained event-free through 12 months (Fig. 3b). This patient exhibited higher early ischemic risk, peaking at 14.43% on day 60 before declining sharply to 11.27% at day 90, 3.87% at day 180, and stabilizing at 1.64% by day 365. Bleeding risk increased gradually from 1.96% at day 30 to 2.69% at day 90, 2.62% at day 180, and 3.29% at day 365 (approximately twice the ischemic risk by the end of follow-up). The ischemic-to-bleeding hazard ratio declined from 6.19 at day 30 to 1.48 at day 180 and 0.50 at day 365, with a critical crossover around day 210 (between days 180 and 270), when the ratio fell from 1.48 to 0.63, indicating a sustained shift toward bleeding predominance. This crossover point may represent a clinically relevant time window to reassess DAPT duration in the context of the patient’s overall ischemic and bleeding risk profile. Quantitative hazard values for both patients at key time points are presented in Supplementary Table 2.
Discussion
Our study advances dynamic post-PCI risk assessment by introducing Transformer-DAPT, a streamlined survival modeling framework that provides individualized ischemic and bleeding risk predictions across multiple clinically relevant intervals. Here, dynamic refers to the model’s ability to generate risk estimates at successive time points (1, 2, 3, 6, 9, and 12 months), allowing for time-specific decision-making throughout the first year after PCI. This framework addresses the evolving need for individualized, time-dependent optimization of DAPT management, particularly in light of recent evidence and guidelines supporting de-escalation strategies and shortened regimens to reduce bleeding risk in certain high-risk patients2,3,31,32. Transformer-DAPT demonstrated robust, generalizable performance across two large cohorts and produced well-calibrated predictions, supporting its potential role in clinical decision support.
Building on our prior work29, Transformer-DAPT incorporates a simplified architecture with robust predictive capacity. Its design enables more accurate and efficient modeling through custom input processing, attention-based interaction modeling, multi-loss optimization, and multi-task output—collectively supporting improved predictive performance.
The modest reduction in performance observed in the external cohort (OneFlorida + ) likely reflects expected variability in cross-system validation. Differences in patient populations, data capture practices across a federated network of independent healthcare systems, and temporal changes in PCI techniques and DAPT regimens may have contributed to this attenuation. The higher exclusion rate in the OneFlorida+ cohort reflects data completeness challenges inherent to federated healthcare networks, including prescription records filled outside participating systems and variability in EHR capture across independent institutions. As a result, the retained cohort represents patients with complete records available within the network. This is an important limitation of the external validation, as inadvertent selection bias cannot be fully excluded. Despite these differences, Transformer-DAPT maintained clinically meaningful discrimination in the external cohort and outperformed the evaluated deep learning benchmark models. These findings provide evidence of cross-system generalizability in a subgroup of patients with complete data within the federated network. The attenuation in performance relative to the Mayo cohort should be interpreted in the context of this data availability constraint and should not be viewed as a definitive estimate of real-world performance across the full federated population.
From a clinical utility perspective, Transformer-DAPT addresses a scope not covered by existing rule-based tools. PRECISE-DAPT is applied at hospital discharge to guide initial DAPT duration based on bleeding risk alone, and the DAPT score was designed for the separate decision of whether to extend therapy beyond 12 months. Neither tool provides dynamic, simultaneous ischemic and bleeding risk estimates during the first year post-PCI, when DAPT decisions are most actively managed. Transformer-DAPT fills this gap by generating time-specific ischemic and bleeding risk trajectories across multiple intervals from 1 to 12 months.
Because the available risk scores address different clinical questions, a direct head-to-head comparison with Transformer-DAPT is not strictly appropriate. We nevertheless computed both scores on the Mayo Clinic cohort as a contextual reference, with full results in Supplementary Note 1 and Supplementary Table 3. These results should be interpreted with two caveats: the scores were applied outside their intended clinical scope, and traditional scores use the standard C-index, whereas Transformer-DAPT uses the time-dependent Ctd-index, so the values are not directly comparable.
This time-specific approach is clinically relevant because of the growing realization that a fixed, upfront DAPT decision is often not well-suited to all patients. Ideally, such decisions should be revisited at follow-up encounters where clinicians can consider de-escalation, continuation, or discontinuation based on the predicted ischemic and bleeding risk. The case studies in Fig. 3 illustrate this practical advantage: one patient exhibits an earlier transition to a bleeding-dominant risk phase (with predicted bleeding risk exceeding ischemic risk well before the bleeding event), whereas another patient demonstrates higher early ischemic risk with a later crossover point. Such individualized crossover windows provide a clear and actionable opportunity to identify when bleeding risk may begin to outweigh ischemic benefit, supporting time-specific consideration of therapy modification, including earlier de-escalation or discontinuation versus continued DAPT.
An important consideration regarding clinical implementation is the absence of a universal decision threshold. No universally validated quantitative trigger for DAPT de-escalation currently exists, and established tools, including PRECISE-DAPT and the DAPT score, employ population-derived cutoffs applied as pragmatic guides6,7. The crossover point, defined as the time at which the ischemic-to-bleeding hazard ratio falls below 1.0, serves as a time- and patient-specific signal within a shared clinical decision-making framework, consistent with ACC/AHA guideline recommendations for individualized DAPT duration assessment4. A clinician observing an early crossover at a scheduled follow-up visit may use this signal to initiate a structured de-escalation discussion, interpreted in conjunction with individual patient context, including procedure-related considerations, bleeding history, renal function, concomitant medications, and patient preferences. A late or absent crossover can support decisions to continue DAPT. Similarly, a trajectory in which the ischemic-to-bleeding ratio rises above 1.0 after an initial period of bleeding predominance may signal a shift back toward ischemic risk, informing decisions to maintain or reassess therapy duration. Prospective evaluation of threshold-based decision rules derived from Transformer-DAPT outputs represents an important direction for future work.
Traditional modeling methods, such as the Cox proportional hazards model, provide a well-established framework for survival analysis but are limited in their ability to handle high-dimensional clinical datasets and complex non-linear feature interactions. Deep learning-based survival models, such as DeepSurv and DeepHit, address some of these constraints by employing neural architectures that capture intricate relationships within large-scale EHR data. Notably, Transformer-DAPT leverages an attention-based architecture to model complex interactions among high-dimensional structured EHR features and demonstrated consistently strong discrimination across multiple evaluation time points, surpassing DeepSurv and DeepHit. We employed the Ctd-index metric, which appropriately adjusts for censoring and addresses methodological limitations of the traditional C-index33. Our preliminary benchmarking suggested that conventional Cox models and an adapted implementation of SurvTRACE34 were less effective in handling high-dimensional data because of scalability limitations, underscoring Transformer-DAPT’s scalability and predictive advantage.
Yet beyond accurate risk discrimination, reliable clinical implementation also depends on well-calibrated predictions, ensuring that estimated risks closely reflect actual event probabilities. Our calibration strategy confirmed that Transformer-DAPT generates well-aligned and clinically reliable risk estimates, particularly after recalibration. This level of calibration is essential for safe deployment in real-world decision-support settings. Improved alignment between predicted and observed risks substantially enhances the reliability of patient-specific predictions, strengthening clinician confidence in using the model to guide DAPT-related decisions, such as extending, de-escalating, or discontinuing therapy. Without proper calibration, even highly discriminative models may yield misleading risk estimates that undermine clinical utility. By addressing this challenge, our framework supports trustworthy, individualized risk stratification that aligns with the evolving demands of precision cardiovascular care.
Some limitations should be acknowledged. First, the quality and completeness of the underlying structured EHR data posed challenges, particularly regarding missing details such as stent characteristics, bleeding severity, and start and stop dates of relevant medications. It is also important to note that medication prescriptions documented in the EHR do not necessarily guarantee patient adherence. As with many EHR-based studies, outcome ascertainment is limited to encounters documented within participating healthcare networks, and events occurring entirely outside participating institutions may not be observed. This inherent constraint may modestly influence observed event rates and calibration. In future work, linkage to external claims-based sources with sensitivity analyses focused on patients with stronger evidence of continued in-network follow-up could help further quantify this effect. Nonetheless, EHR data reflect real-world clinical scenarios and the information available to healthcare professionals at the time of clinical decision-making.
Related to data ascertainment, the composite ischemic endpoint used in this study was intentionally designed to capture the full spectrum of acute ischemic events following PCI and is therefore broader than the hard endpoints typically reported in clinical trials, which are often limited to myocardial infarction, stroke, and death. The ischemic composite includes codes for unstable angina and intermediate coronary syndromes, transient ischemic attack, cardiac arrest, and repeat coronary revascularization, in addition to acute myocardial infarction and completed ischemic stroke. This breadth, combined with code-based ascertainment without additional manual clinical adjudication, likely contributes to the higher observed 1-year ischemic event rate (34.6%) compared with adjudicated trial-reported MACE rates. As such, these results should be interpreted as reflecting a broader post-PCI ischemic burden rather than a rate directly comparable to trial-reported endpoints.
Second, because our cohorts span prolonged calendar periods (Mayo: 2002–2024; OneFlorida + : 2012–2020), secular changes in PCI techniques, stent technology, and practice patterns may introduce temporal drift that could influence baseline risk distributions and model performance. While some temporal evolution may be partially reflected in structured EHR features (e.g., medication patterns and diagnosis/procedure coding at baseline), important procedural drivers (e.g., intracoronary imaging/physiology, access strategy, atherectomy/device use) may not be fully captured in structured data. We did not perform discrimination or calibration analyses stratified by year of PCI in this study and therefore acknowledge potential era effects as a limitation. Future work will evaluate temporal stability by incorporating PCI year/era as an explicit feature and/or performing era-specific recalibration or periodic retraining to maintain alignment with contemporary practice.
Third, the high exclusion rate in the OneFlorida+ external validation cohort (71% vs. 15% in the Mayo cohort) represents an important limitation of the external validation. This exclusion was primarily driven by the data completeness requirements necessary for model evaluation, though selection bias cannot be fully excluded. Future work should explore alternative strategies for handling missing data, relaxed inclusion criteria with sensitivity analyses, and linkage to claims-based data sources to improve broader real-world applicability.
Fourth, model calibration for bleeding risk remained suboptimal at the extreme probabilities, highlighting the need for improved handling of rare events. Although validation-derived isotonic calibration improved overall agreement, extreme bleeding probabilities should be interpreted alongside clinical context rather than in isolation.
Several key enhancements are planned to address these limitations, including the incorporation of multimodal data, such as clinical notes and reports, to provide complementary, contextually rich information; improvement of data quality through normalization and natural language processing-based extraction to provide more accurate information regarding diagnoses and medications (such as DAPT duration); exploration of rare-event–aware training and recalibration targeted at the extreme-probability ranges where bleeding calibration remained suboptimal; and refinement of our feature selection strategy to eliminate clinically irrelevant or low-importance variables, thereby further improving model efficiency and interpretability. These efforts aim to enhance model robustness and facilitate its integration in real-world clinical systems.
In summary, we developed and evaluated Transformer-DAPT, a robust dynamic prediction model designed to assess longitudinal risks of adverse outcomes in patients treated with DAPT following PCI. By leveraging the strengths of transformer-based architecture and real-world clinical data, our approach provides an AI- and data-driven foundation for advancing personalized antiplatelet therapy. Its favorable balance of predictive power, computational efficiency, and interpretability supports its potential integration into clinical workflows to enhance decision-making, optimize treatment strategies, and ultimately improve patient outcomes.
Methods
Data source and study cohort
The primary data source for this study was the Mayo Clinic electronic health records (EHRs), hosted on the Mayo Clinic Cloud, a comprehensive repository comprising records of over 12 million patients since 1907. This longitudinal EHR environment has been previously described as a semantically integrated research data infrastructure and has also supported prior cardiovascular outcomes and risk prediction studies35,36. We identified 34,041 patients who underwent PCI with DES implantation between 2002 and 2024 and received a prescription for DAPT following index PCI. After applying exclusion criteria, including age <18 or >95 years, incomplete records (missing sex, race, or absence of diagnosis/medication records following the index PCI procedure), and clinical follow-up of less than 30 days after the index procedure, a final cohort of 29,032 patients was established (Fig. 4a). Patients with incomplete follow-up, diagnosis, or medication records were excluded because complete follow-up data were required for ascertainment of ischemic and bleeding events (study outcomes) and to confirm DAPT receipt and duration.
Fig. 4. Study cohort selection and framework of the Transformer-DAPT predictive model.

a Study cohort selection for development, internal and external validation of the predictive model. b Schematic representation of the Transformer-DAPT framework, comprising input processing, feature encoding with multi-head attention, feature aggregation, multi-task output, and multi-loss optimization for risk prediction. PC-Hazard, piecewise constant hazard; BCE loss, binary cross-entropy loss.
To perform external validation and confirmatory analyses, we utilized the OneFlorida+ Clinical Research Consortium database, a component of PCORnet37,38, containing EHR data for 16.8 million individuals since 2012. Applying the same inclusion and exclusion criteria, we identified a final cohort of 19,173 eligible patients from 66,870 adults who had at least one PCI with DES implantation (2012–2020) (Fig. 4a). The higher exclusion rate in OneFlorida+ (71%) compared with Mayo Clinic (15%) primarily reflected data completeness challenges in a federated healthcare network: absence of documented P2Y12 inhibitor prescriptions during follow-up (n = 35,902, 54% of the initial cohort), likely due to prescriptions filled outside participating systems or incomplete medication reconciliation; and missing diagnosis or medication records during follow-up (n = 19,980, 30%), reflecting variability in data capture across multiple independent healthcare systems.
The study was approved by the Mayo Clinic Institutional Review Board (IRB ID 24-001183) and the University of Florida Institutional Review Board (IRB ID 202000875), with a waiver of informed consent due to the retrospective design. All data were accessed in accordance with institutional policies governing research authorization and patient privacy. This study adheres to the Transparent Reporting of a Multivariable Prediction Model for Individual Prognosis or Diagnosis (TRIPOD + AI) reporting guidelines39.
Study outcomes, prediction tasks, and patient characteristics
This study targeted two primary adverse outcomes: ischemic events and bleeding events. The ischemic endpoint was defined as a composite of acute ischemic heart diseases (including acute myocardial infarction, unstable angina/intermediate coronary syndromes, and cardiac arrest), ischemic stroke and transient ischemic attack, multiple drug-eluting stent implantation after the index procedure, and coronary artery bypass grafting within 12 months post-PCI. The bleeding outcome comprised spontaneous bleeding and blood transfusion, indicative of clinically significant bleeding. ICD-9-CM/ICD-10-CM code-based algorithms for these endpoints were adapted from previously validated approaches for acute myocardial infarction40 and ischemic stroke41, with endpoint definitions aligned with ACC/AHA cardiovascular and stroke endpoint standards42. Prior systematic reviews have reported positive predictive values ≥ 93% for ICD-coded acute MI43 and ≥82% for ICD-9 434/ICD-10 I63 for ischemic stroke44. Complete code-based definitions are provided in Supplementary Tables 4 and 5, with further details provided in the previously published study30.
The prediction window was established as 1 year post-PCI. The prediction task involved dynamically estimating risks of the adverse outcomes (ischemia and bleeding) across multiple clinically relevant intervals, specifically at 1, 2, 3, 6, 9, and 12 months. In alignment with the PRECISE-DAPT methodology, event prediction started on day 8 post-PCI, excluding in-hospital endpoints to allow for a 7-day ACS-related hospitalization window. DAPT was defined as aspirin combined with a P2Y12 inhibitor (clopidogrel, prasugrel, or ticagrelor). DAPT continuation status was ascertained using a predefined lookback rule: a patient was classified as on DAPT if at least one qualifying prescription record was present within the 6 months preceding the outcome event, or within the 6-month to 1-year follow-up window for patients who remained event-free. The index date was defined as the date of the initial DES implantation in a coronary vessel. For patients who had multiple PCI procedures with DES implantation, subsequent procedures were counted as ischemic events.
Baseline characteristics included sociodemographic variables (age at index PCI date, sex, and race/ethnicity); medical history (prior myocardial infarction, ischemic stroke, bleeding, and coronary revascularization procedures, including PCI and CABG); presentation characteristics (acute MI and laboratory values such as white blood cell count, creatinine, and hemoglobin); comorbidities and risk factors (atrial fibrillation, cancer, chronic kidney disease, chronic heart failure, diabetes mellitus, dyslipidemia, hypertension, liver disease, peripheral vascular disease, anemia, smoking-related conditions, venous thromboembolism, and alcohol abuse); and concomitant medications (ACE inhibitors, angiotensin receptor blockers, beta-blockers, calcium channel blockers, NSAIDs, statins, and oral anticoagulants). Definitions and coding algorithms for these characteristics were consistent with those applied in our previous study30.
Data preparation
To build a comprehensive predictor set, we integrated baseline characteristics with structured clinical records—including diagnoses, medications, and procedures—collected within 2 years preceding the index date. To reduce dimensionality and ensure consistency across datasets, we applied a three-component preprocessing strategy. First, diagnostic codes (ICD-9-CM/ICD-10-CM) were standardized by removing invalid entries, correcting misclassified codes, and converting to unified phecodes using the Phenome-wide Association Studies (PheWAS) framework45,46. Second, procedural data (ICD-9-PCS/ICD-10-PCS, CPT, HCPCS) were validated and mapped to single-level categories using Clinical Classifications Software (CCS/CCSR)47. Third, medications were standardized through direct mapping of RxNorm48-coded entries to generic names, with non-RxNorm medications mapped using medication descriptions. This mapping strategy ensures alignment in terminology and concept granularity across datasets, facilitating consistent feature representation in both internal and external validation cohorts.
Following standardization, diagnostic features from ICD codes, generic medication names, CCS procedure categories, and demographic variables were consolidated into a unified feature vocabulary used for model input. For each patient, a binary vector of length 3445 was constructed, with positions corresponding to features documented within the 2-year window preceding the index PCI date set to 1 and all others set to 0, yielding a sparse multi-hot representation. This vocabulary was fixed for model development and then applied to the external cohort, such that shared features were encoded in the same positions, features not present for a given patient remained 0, and features not represented in the development vocabulary were not assigned positions in the binary vector and therefore did not appear in the extracted active feature index sequence. To handle sparsity efficiently, only the indices of active features were extracted and passed to the model as a compact index sequence. These sequences were padded to a uniform maximum length for batch processing, with attention masks distinguishing real features from padding tokens, as described in the “Model Architecture section.”
Predictive modeling
This study presents a deep learning framework for predicting adverse outcomes in patients receiving DAPT post-PCI. The framework combined multi-head attention mechanisms optimized for sparse clinical features, contrastive learning for enhanced feature representation, and a multi-task output generating both time-to-event survival analysis and binary classification predictions (Fig. 4b).
Model architecture
Our architecture comprised three core modules: input representation, feature encoding with multi-head attention, and multi-task output with integrated optimization. Each patient’s clinical records were encoded as a multi-hot binary vector, where each position indicates the presence (1) or absence (0) of a clinical feature. To handle sparse data efficiently, these binary vectors were converted into sequences of active feature indices. For example, a patient with 150 active features at positions [0, 2, 4, …, 3444] would have the record represented as this index sequence. To enable batch processing, sequences were padded to a uniform maximum length with attention masks to differentiate actual features from padding tokens. These sequences were then passed through an embedding layer (dimension d) to produce dense, learnable feature vectors that capture semantic relationships among clinical features (Fig. 5).
Fig. 5. Data preprocessing pipeline for Transformer-DAPT.

Diagram showing the transformation of multi-hot encoded clinical data into padded sequences of active feature indices with attention masks. This process enables efficient batch processing within Transformer-DAPT and preserves key clinical information for representation learning.
The embedded representations were transformed through a feature encoder comprising four sequential operations: linear transformation, layer normalization to stabilize training dynamics, ReLU activation, and dropout regularization. The encoded features were then processed by a multi-head attention mechanism that computed query, key, and value projections to learn dependencies among clinical features. The attention outputs underwent batch normalization with dropout to enhance stability and prevent overfitting.
The attended features were concatenated and flattened into a unified high-dimensional representation, with a final dropout layer. This shared representation fed into two specialized prediction heads that operated in parallel. The survival prediction head used the piecewise-constant hazard framework to estimate time-dependent survival probabilities across six follow-up intervals (1, 2, 3, 6, 9, and 12 months). The binary classification head generated a single logit, transformed via sigmoid activation, to predict 1-year event risk.
To enhance overall predictive performance, we employed a multi-loss optimization strategy combining three weighted components: piecewise-constant hazard loss for survival analysis, binary cross-entropy loss for classification, and triplet loss for contrastive learning. Triplet loss was incorporated to address a specific limitation of the survival and classification losses: optimizing for prediction accuracy does not explicitly constrain how the model organizes patient representations in its embedding space. While the index-based input representation efficiently handles input sparsity by operating only on active clinical features, the resulting learned embedding space remains high-dimensional and complex. Patients with overlapping active feature sets may still have fundamentally different outcomes due to subtle interactions among clinical variables. Triplet loss enforces that patients sharing the same outcome are represented more similarly to each other than to patients with different outcomes, using sampled patient embeddings as anchors and mean class embeddings as positive and negative reference representations, providing stability across patients with varying numbers of active features. A margin parameter maintains meaningful separation between outcome classes, preventing embedding collapse in high-dimensional spaces. This enhances the model’s discriminative capacity beyond what the survival and classification losses alone achieve, as confirmed by ablation analysis in which removal of the triplet loss component led to consistently worse discrimination performance across both prediction tasks. Loss weights were determined through systematic hyperparameter tuning.
Additional details about feature encoding, attention mechanism, multi-task output architecture, and loss functions are provided in Supplementary Note 2.
Model development
The dataset was split into training (70%), validation (10%), and test (20%) sets using stratified sampling to maintain consistent event rates. To address class imbalance, we applied upsampling to the minority class (patients with events) in the training set only, while validation and test sets retained original distributions. Hyperparameter tuning was performed using Optuna, a Bayesian optimization framework49 employing Tree-structured Parzen Estimators (TPE) for efficient systematic parameter search, over 1000 trials. The search space encompassed neural architecture parameters, training parameters, and loss function weights. Additional details are provided in Supplementary Table 6.
Training incorporated several strategies to prevent overfitting and ensure robust model performance: early stopping with patience of 15 epochs based on validation loss, MedianPruner to terminate underperforming trials during optimization, and OneCycleLR scheduler for dynamic learning rate adjustment throughout training. Final model selection was based on a time-dependent concordance index (Ctd-index)33 computed on the validation set, which reflects the model’s ability to accurately rank predicted survival times. Optimal hyperparameter configurations for ischemic and bleeding event prediction are provided in Supplementary Tables 7 and 8. Detailed optimization procedures are provided in Supplementary Note 2.
Model performance evaluation
Model performance was evaluated through discrimination, calibration, and comparative analysis. Discrimination was assessed using the Ctd-index at multiple time points (1, 2, 3, 6, 9, and 12 months), with 95% confidence intervals (CIs) computed using bootstrap resampling50. Calibration was evaluated using isotonic regression with calibration parameters derived from the validation set and then applied to the test set to assess generalizability. Two approaches were used: (1) static calibration at 12 months, comparing predicted and observed event probabilities using ECE; and (2) time-dependent calibration, comparing predicted survival probabilities with Kaplan–Meier estimates across the follow-up period.
For comparative analysis, we benchmarked Transformer-DAPT against DeepSurv and DeepHit, two established deep learning survival models with complementary approaches to temporal risk modeling. DeepSurv implements a neural network adaptation of the Cox model, which is effective for datasets adhering to proportional hazards assumptions. DeepHit directly models the distribution of survival times, offering flexibility in capturing non-linear and time-dependent risk relationships. All three models—Transformer-DAPT, DeepSurv, and DeepHit—were trained and evaluated using identical input features, data splits, and preprocessing pipelines to ensure a fair and reproducible comparison.
As a secondary evaluation, we derived binary classification metrics for comparison across models. Since DeepSurv and DeepHit are inherently designed for survival analysis rather than binary classification, a standardized post-processing approach was applied to enable consistent evaluation. Specifically, for each patient, the 12-month (365-day) survival probability was extracted and transformed into a risk score via the negative logarithm, with higher scores indicating greater predicted risk. The median risk score within the cohort was used as the classification threshold to distinguish high- from low-risk patients. Binary predictions were then compared with observed outcomes to compute accuracy, F1-score, AUROC, AUPRC, precision, sensitivity, and specificity, ensuring a uniform evaluation framework across all models.
Model interpretability
We applied Integrated Gradients (IG)51, an attribution method that quantifies each input feature’s contribution to model predictions by comparing outputs between a baseline state (absence of features) and actual patient data. Interpretability was evaluated at two levels: population-level feature importance to identify consistently influential clinical predictors and validation against established clinical knowledge. Feature importance scores were aggregated and normalized across the test set, providing ranked importance profiles that reflect both established and potentially novel risk factors.
Statistical analysis
For descriptive analysis of baseline characteristics, categorical variables are reported as counts (percentages), and continuous variables as mean (standard deviation, SD). Group comparisons were conducted using the chi-square test for categorical variables and the analysis of variance (ANOVA) for continuous variables. To compare model performance between Transformer-DAPT and benchmark models, 1000 bootstrap resampling iterations50 were performed to estimate 95% CIs and p-values for pairwise comparisons of Ctd-index. A two-sided p ≤ 0.05 was considered statistically significant.
Supplementary information
Acknowledgements
This study was supported by the American Heart Association under Award No. 19GPSGC35180031, the National Institute on Aging under R01AG083039 and U01AG088076, and the National Institute of Allergy and Infectious Diseases under R01AI175699. The funders had no role in study design, data collection, analysis, interpretation, manuscript writing, or the decision to submit for publication.
Author contributions
C.T. and F.L. conceived, designed, and supervised the study. Y.Y., A.A., Z.S., J.H., X.H., Y.D., J.L., H.L., and J.F. acquired and processed data. A.A. and Z.S. developed the model and implemented benchmark models. A.A., F.L., M.G., and D.A. analyzed and interpreted data. A.A., Z.S., F.L., and X.H. prepared the visualizations. A.A., Z.S., Y.Y., and D.A. drafted the manuscript. C.T., F.L., D.A., M.G., L.R., D.Z., and J.B. critically reviewed the manuscript. C.T., D.Z., and J.B. obtained funding. J.F. provided administrative support. All authors reviewed the results and approved the final version of the manuscript.
Data availability
The dataset for this study is not publicly available due to privacy and ethical restrictions. Data supporting the findings of this study are available from the corresponding authors upon reasonable request.
Code availability
The Python code used in this study is available at the public GitHub repository (https://github.com/Tao-AI-group/Transformer-DAPT).
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
These authors contributed equally: Ahmed Abdelhameed, Zenan Sun.
Contributor Information
Fang Li, Email: li.fang@mayo.edu.
Cui Tao, Email: tao.cui@mayo.edu.
Supplementary information
The online version contains supplementary material available at https://doi.org/10.1038/s41746-026-02977-9.
References
- 1.American Heart Association. 2025Heart Disease and Stroke Statistics Update Fact Sheet. https://professional.heart.org/-/media/phd-files-2/science-news/2/2025-heart-and-stroke-stat-update/factsheets/2025-stats-update-fact-sheet-global-burden-of-disease.pdf (2025).
- 2.Vrints, C. et al. 2024 ESC Guidelines for the management of chronic coronary syndromes. Eur. Heart J.45, 3415–3537 (2024). [DOI] [PubMed] [Google Scholar]
- 3.Rao, S. V. et al. 2025 ACC/AHA/ACEP/NAEMSP/SCAI Guideline for the Management of Patients With Acute Coronary Syndromes: a report of the American College of Cardiology/American Heart Association Joint Committee on Clinical Practice Guidelines. Circulation151, e771–e862 (2025). [DOI] [PubMed] [Google Scholar]
- 4.Levine, G. N. et al. 2016 ACC/AHA guideline focused update on duration of dual antiplatelet therapy in patients with coronary artery disease. J. Am. Coll. Cardiol.68, 1082–1115 (2016). [Google Scholar]
- 5.Marquis-Gravel, G. et al. Post-discharge bleeding and mortality following acute coronary syndromes with or without PCI. J. Am. Coll. Cardiol.76, 162–171 (2020). [DOI] [PubMed] [Google Scholar]
- 6.Costa, F. et al. Derivation and validation of the predicting bleeding complications in patients undergoing stent implantation and subsequent dual antiplatelet therapy (PRECISE-DAPT) score: a pooled analysis of individual-patient datasets from clinical trials. Lancet Lond. Engl.389, 1025–1034 (2017). [DOI] [PubMed] [Google Scholar]
- 7.Yeh, R. W. et al. Development and validation of a prediction rule for benefit and harm of dual antiplatelet therapy beyond 1 year after percutaneous coronary intervention. JAMA315, 1735–1749 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Pisters, R. et al. A novel user-friendly score (HAS-BLED) to assess 1-year risk of major bleeding in patients with atrial fibrillation: the Euro Heart Survey. Chest138, 1093–1100 (2010). [DOI] [PubMed] [Google Scholar]
- 9.Yoshida, R. et al. Performance of HAS-BLED, ORBIT, PRECISE-DAPT, and PARIS risk score for predicting long-term bleeding events in patients taking an oral anticoagulant undergoing percutaneous coronary intervention. J. Cardiol.73, 479–487 (2019). [DOI] [PubMed] [Google Scholar]
- 10.Wester, A. et al. Validation of the 4-Item PRECISE-DAPT score: a SWEDEHEART study. J. Am. Heart Assoc.10, e020974 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Gorog, D. A. et al. De-escalation or abbreviation of dual antiplatelet therapy in acute coronary syndromes and percutaneous coronary intervention: a consensus statement from an international expert panel on coronary thrombosis. Nat. Rev. Cardiol.20, 830–844 (2023). [DOI] [PubMed] [Google Scholar]
- 12.Ge, Z. et al. Ticagrelor alone versus ticagrelor plus aspirin from month 1 to month 12 after percutaneous coronary intervention in patients with acute coronary syndromes (ULTIMATE-DAPT): a randomised, placebo-controlled, double-blind clinical trial. Lancet403, 1866–1878 (2024). [DOI] [PubMed] [Google Scholar]
- 13.Valgimigli, M. et al. Dual antiplatelet therapy after PCI in patients at high bleeding risk. N. Engl. J. Med.385, 1643–1655 (2021). [DOI] [PubMed] [Google Scholar]
- 14.Mehran, R. et al. Ticagrelor with or without aspirin in high-risk patients after PCI. N. Engl. J. Med.381, 2032–2042 (2019). [DOI] [PubMed] [Google Scholar]
- 15.Vranckx, P. et al. Ticagrelor plus aspirin for 1 month, followed by ticagrelor monotherapy for 23 months vs aspirin plus clopidogrel or ticagrelor for 12 months, followed by aspirin monotherapy for 12 months after implantation of a drug-eluting stent: a multicentre, open-label, randomised superiority trial. Lancet392, 940–949 (2018). [DOI] [PubMed] [Google Scholar]
- 16.Tarantini, G. et al. Early discontinuation of aspirin after PCI in low-risk acute myocardial infarction. N. Engl. J. Med.393, 2083–2094 (2025). [DOI] [PubMed] [Google Scholar]
- 17.Krittanawong, C., Kaplin, S. & Sharma, S. K. in Artificial Intelligence in Clinical Practice. 51–63 (Elsevier, 2024).
- 18.Ben Ali, W. et al. Implementing machine learning in interventional cardiology: the benefits are worth the trouble. Front. Cardiovasc. Med.8, 711401 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Niimi, N. et al. Machine learning models for prediction of adverse events after percutaneous coronary intervention. Sci. Rep.12, 6262 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Galimzhanov, A., Matetic, A., Tenekecioglu, E. & Mamas, M. A. Prediction of clinical outcomes after percutaneous coronary intervention: machine-learning analysis of the National Inpatient Sample. Int. J. Cardiol.392, 131339 (2023). [DOI] [PubMed] [Google Scholar]
- 21.Shi, B. et al. Prognostic value of machine-learning-based PRAISE score for ischemic and bleeding events in patients with acute coronary syndrome undergoing percutaneous coronary intervention. J. Am. Heart Assoc.12, e025812 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Călburean, P.-A. et al. Prediction of 3-year all-cause and cardiovascular cause mortality in a prospective percutaneous coronary intervention registry: machine learning model outperforms conventional clinical risk scores. Atherosclerosis350, 33–40 (2022). [DOI] [PubMed] [Google Scholar]
- 23.Katzman, J. L. et al. DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC Med. Res. Methodol.18, 24 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Lee, C., Zame, W., Yoon, J., & van der Schaar, M. (2018). DeepHit: a deep learning approach to survival analysis with competing risks. Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 32(1). 10.1609/aaai.v32i1.11842 (2018). [DOI]
- 25.Aharonu, M. & Ramasamy, L. Design of an integrated model using U-Net, DeepSurv, and cross-attention for lung cancer classification and survival prediction. Sci. Rep.16, 369 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Teshale, A. B., Htun, H. L., Vered, M., Owen, A. J. & Freak-Poli, R. A systematic review of artificial intelligence models for time-to-event outcome applied in cardiovascular disease risk prediction. J. Med. Syst.48, 68 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Barraclough, J. Y. et al. Predicting cardiovascular events from routine mammograms using machine learning. 10.1136/heartjnl-2025-325705 (2026). [DOI] [PubMed]
- 28.Chen, T., Kornblith, S., Norouzi, M. & Hinton, G. A simple framework for contrastive learning of visual representations. In Proceedings of the 37th International Conference on Machine Learning. Vol. 119, 1597–1607 (PMLR, 2020).
- 29.Li, F. et al. Contrastive learning with transformer for adverse endpoint prediction in patients on DAPT post-coronary stent implantation. Front. Cardiovasc. Med. 11, 1460354 (2025). [DOI] [PMC free article] [PubMed]
- 30.Li, F. et al. Dynamic prognosis prediction for patients on DAPT after drug-eluting stent implantation: model development and validation. J. Am. Heart Assoc. 10.1161/JAHA.123.029900 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Arai, R. et al. Trends in antithrombotic therapy and clinical outcomes for percutaneous coronary intervention in Japan following the 2020 JCS guideline focused update: findings from the SAKURA PCI2 Antithrombotic Registry. Heart Vessels 10.1007/s00380-024-02493-4 (2024). [DOI] [PubMed] [Google Scholar]
- 32.Park, D. Y. et al. Shorter dual antiplatelet therapy for older adults after percutaneous coronary intervention: a systematic review and network meta-analysis. JAMA Netw. Open7, e244000 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Antolini, L., Boracchi, P. & Biganzoli, E. A time-dependent discrimination index for survival data. Stat. Med.24, 3927–3944 (2005). [DOI] [PubMed] [Google Scholar]
- 34.Wang, Z. & Sun, J. SurvTRACE: Transformers for survival analysis with competing events. In Proceedings of the 13th ACM International Conference on Bioinformatics, Computational Biology and Health Informatics 1–9 10.1145/3535508.3545521 (ACM, 2022). [DOI]
- 35.Chute, C. G., Beck, S. A., Fisk, T. B. & Mohr, D. N. The Enterprise Data Trust at Mayo Clinic: a semantically integrated warehouse of biomedical data. J. Am. Med. Inform. Assoc. JAMIA17, 131–135 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Awasthi, S. et al. Identification and risk stratification of coronary disease by artificial intelligence-enabled ECG. eClinicalMedicine65, 102259 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Li, Q. et al. Early prediction of Alzheimer’s disease and related dementias using real-world electronic health records. Alzheimers Dement. J. Alzheimers Assoc.19, 3506–3518 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.OneFlorida+ Consortium. Data – OneFlorida+. https://onefloridaconsortium.org/data/ (accessed 2025).
- 39.Collins, G. S. et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ385, e078378 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Saunders-Hastings, P. et al. Acute myocardial infarction: development and application of an ICD-10-CM-based algorithm to a large U.S. healthcare claims-based database. PLoS One16, e0253580 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 41.Goldstein, L. B. Accuracy of ICD-9-CM coding for the identification of patients with acute ischemic stroke. Stroke29, 1602–1604 (1998). [DOI] [PubMed] [Google Scholar]
- 42.Hicks, K. A. et al. 2017 cardiovascular and stroke endpoint definitions for clinical trials. Circulation137, 961–972 (2018). [DOI] [PubMed] [Google Scholar]
- 43.McCormick, N., Lacaille, D., Bhole, V. & Avina-Zubieta, J. A. Validity of myocardial infarction diagnoses in administrative databases: a systematic Review. PLoS One9, e92286 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.McCormick, N., Bhole, V., Lacaille, D. & Avina-Zubieta, J. A. Validity of diagnostic codes for acute stroke in administrative databases: a systematic review. PLoS One10, e0135834 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 45.Wei, W.-Q. et al. Evaluating phecodes, clinical classification software, and ICD-9-CM codes for phenome-wide association studies in the electronic health record. PLoS One12, e0175508 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Wu, P. et al. Mapping ICD-10 and ICD-10-CM codes to phecodes: workflow development and initial evaluation. JMIR Med. Inform.7, e14325 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Agency for Healthcare Research and Quality. Clinical Classifications Software Refined (CCSR) for ICD-10-PCS Procedures. Healthcare Cost and Utilization Project (HCUP). https://hcup-us.ahrq.gov/toolssoftware/ccsr/ccs_refined.jsp#overprocedures (accessed 2025).
- 48.RxNorm. Unified Medical Language System® (UMLS®). https://www.nlm.nih.gov/research/umls/rxnorm/index.html (accessed 2025).
- 49.Akiba, T., Sano, S., Yanase, T., Ohta, T. & Koyama, M. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2623–2631. 10.1145/3292500.3330701 (Association for Computing Machinery, New York, NY, USA, 2019). [DOI]
- 50.Efron, B. & Tibshirani, R. J. An Introduction to the Bootstrap. (Chapman and Hall/CRC, New York, 1994).
- 51.Sundararajan, M., Taly, A. & Yan, Q. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, 3319–3328 (JMLR.org, Sydney, NSW, Australia, 2017).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The dataset for this study is not publicly available due to privacy and ethical restrictions. Data supporting the findings of this study are available from the corresponding authors upon reasonable request.
The Python code used in this study is available at the public GitHub repository (https://github.com/Tao-AI-group/Transformer-DAPT).
