Interpretable machine learning to predict postoperative adverse outcomes in cardiac surgery Authors: Li lei, Dengkang Qin, Mengxue Liu, Die Ma, Xia Lei, Si Zeng, Zheng Chen, Qian Lei Published: 2026 ABSTRACT BackgroundCardiac surgery is associated with significant mortality and complication risks. This study aims to develop an interpretable machine learning (ML) model to predict adverse outcomes (AOs) after cardiac surgery, and to explore the associations between relevant characteristics and predicted outcomes.MethodsPatients who underwent cardiopulmonary bypass (CPB) cardiac surgery between January 2013 and December 2022 at a tertiary hospital were included. Perioperative data were collected, and a predictive model was constructed using the light gradient boosting machine (LightGBM) algorithm. To assess whether incorporating intraoperative and early postoperative data could improve risk prediction at the time of intensive care unit (ICU) admission, we compared the performance of this model with that of the preoperative European system for cardiac operative risk evaluation (EuroSCORE). The EuroSCORE was used as a baseline preoperative risk assessment tool, while the LightGBM model aimed to provide an updated risk estimate upon ICU admission. Model performance was evaluated using the area under the receiver operating characteristic curve (AUROC) on a validation dataset. Additionally, counterfactual explanations (CE), an explainable artificial intelligence technique, were employed to enhance the model’s applicability and credibility in real-world clinical settings.ResultsA total of 3,270 patients who underwent cardiac surgery under CPB were included in this study, of which 203 experienced AOs postoperatively. The LightGBM model built on perioperative data demonstrated good predictive performance (AUROC = 0.807), outperforming the traditional EuroSCORE assessment system (AUROC = 0.722). The application of the CE method to the ML model indicated that characteristics such as initial B-type natriuretic peptide (BNP) levels upon intensive care unit (ICU) admission, aortic cross-clamp time, CPB duration, initial urea levels upon ICU admission, and operation duration were key predictors of postoperative AOs.ConclusionThe ML model shows potential in improving risk assessment for AOs after cardiac surgery in patients. The application of CE provides the model with more detailed and practical interpretability, enhancing the credibility of its predictions and promoting transparency and personalization in the clinical decision-making process.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12871-026-03929-2. Introduction Cardiac surgery is one of the cornerstone treatments for cardiovascular diseases. According to a report submitted to the adult cardiac surgery database of the society of thoracic surgeons in 2019, the vast majority of over 300,000 cardiac surgeries were assisted using cardiopulmonary bypass (CPB) technology, underscoring its widespread application and significance in cardiac surgery [1, 2]. Due to the unique characteristics of surgical patients, these surgeries are considered high-risk procedures, with a heightened likelihood of a series of severe postoperative complications [3–12], further complicating treatment. Currently, the most widely used risk assessment system for cardiac surgery is the European system for cardiac operative risk evaluation (EuroSCORE) [13, 14], which comprehensively considers 17 key indicators related to the patient’s general condition, cardiac status, and surgical factors [15]. However, with the continuous advancement of cardiac surgical techniques and significant improvements in surgical outcomes, EuroSCORE has gradually revealed numerous limitations, potentially overestimating the actual risks of contemporary cardiac surgeries [16, 17]. With the rapid development of artificial intelligence technology, machine learning (ML) models have been extensively applied in predicting postoperative complications and mortality risks following cardiac surgery [18–21]. These models have demonstrated significant potential in predictive performance. Nevertheless, the “black box” nature of ML models makes it difficult for both doctors and patients to understand the decision-making logic of complex models, and this opacity undermines the clinical utility of the models. This study aims to construct a predictive model that balances predictive performance with interpretability. This approach is intended to enhance the accuracy of prognostic assessment in cardiac surgery and strengthen its application value in clinical practice. Methods Research design This study adhered to the Declaration of Helsinki and received approval from the medical ethics committee of Sichuan Academy of Medical Sciences & Sichuan Provincial People’s Hospital (Approval No.: 2023 541). This study has been registered on the relevant clinical research registration platform with the registration number ChiCTR2400087322. Given that this study did not involve any form of therapeutic intervention and posed no potential risks to the participants, the requirement for informed consent was waived upon review by the ethics committee. The study design and reporting followed the STROBE guidelines. Patients who underwent cardiac surgery under CPB were included. The exclusion criteria were as follows: (1) surgeries performed using off-pump techniques under CPB; (2) cases with a significant number of missing values in relevant laboratory tests and examination results, or missing key prognostic information; (3) patients who were pregnant. The specific workflow is illustrated in Fig. 1. Fig. 1Flow chart Flow chart Data collection The medical data for this study were sourced from a clinical research big data system, which was established based on the hospital’s electronic medical record system and follow-up system. This system encompassed electronic health records of 3,270 patients. The collected data included patients’ general demographic characteristics, past medical history, various characteristics of the EuroSCORE, surgical procedure types, the latest laboratory test results before surgery, intraoperative data, the first laboratory test results on the day of postoperative admission to the intensive care unit (ICU), and postoperative outcomes, among other relevant information. Endpoint events After a comprehensive analysis of the postoperative prognostic status of patients undergoing cardiac surgery in this research center, five types of key adverse outcomes (AOs) were ultimately identified as the endpoint events for the study. These are: acute myocardial infarction (defined as the need for percutaneous coronary intervention or redo coronary artery bypass grafting), cardiac arrest (defined as the need for cardiopulmonary resuscitation), stroke (defined as embolic, thrombotic, or hemorrhagic cerebral events accompanied by persistent motor, sensory, or cognitive dysfunction), renal failure (requiring renal replacement therapy), and death. Data preprocessing Initially, data encoding was performed to convert all textual information into numerical values, and laboratory test data were transformed into numerical types. Missing values were uniformly marked. To handle missing data, we employed a two‑step approach. First, samples with > 30% missing values across all candidate predictor variables were excluded to avoid excessive imputation bias. For the remaining samples, missing values were imputed using multiple imputation by chained equations (MICE) [22], with predictive mean matching for continuous variables and logistic regression for binary variables, generating 10 imputed datasets. For range data, inequality symbols were removed, and the data were converted into floating‑point numbers. For data with identical names, such as the last preoperative laboratory test results and the first postoperative laboratory test results upon ICU admission, a suffix “*” was added to the postoperative data to distinguish them. Finally, based on the occurrence of AOs, the samples were categorized into an AO group and a non-AO group. Model development Given the large number of characteristics and the presence of numerous missing values in the dataset, this study ultimately selected the light gradient boosting machine (LightGBM) as the predictive model. This choice was based not only on the model’s fast training speed and ease of parameter tuning but also on its unique advantages in handling complex datasets. Depending on the input characteristics, three models were designed for training: when only the EuroSCORE value was used as the input characteristic, the model was named LightGBM-Eurolinear; when all 17 EuroSCORE sub-characteristics (detailed in Table 1) were used as input characteristics, the model was named LightGBM-EuroSCORE; and when all available variables collected in this study (detailed in Table 2) were used as input characteristics, the model was named LightGBM-all. A series of AOs, including acute myocardial infarction, cardiac arrest, stroke, renal failure, and death, were listed as key output characteristics. Table 1Sub-item characteristics and scores of EuroSCOREPatient-related factorsCardiac-related factorsSurgical-related factorsAge ≥ 60 years (1 point/5 years)Unstable angina (3 points)Emergency (2 points)Female (1 point)LVEF: 30–50% (1 point); LVEF < 30% (3 points)CABG combined with other cardiac surgeries (2 points)Chronic pulmonary disease(1 point)Recent myocardial infarct(2 points)Thoracic aortic surgery(3 points)Extra-cardiac arteriopathy(2 points)Pulmonary hypertension(2 points)Post-myocardial infarction ventricular septal defect(4 points)Neurological dysfunction(2 points)Previous cardiac surgery(3 points)Serum creatinine > 200 mmol/L (2 points)Active endocarditis (3 points)Critical pre-operative state(3 points)EuroSCORE European system for cardiac operative risk evaluation, LVEF Left ventricular ejection fraction, CABG Coronary artery bypass grafting Table 1Sub-item characteristics and scores of EuroSCOREPatient-related factorsCardiac-related factorsSurgical-related factorsAge ≥ 60 years (1 point/5 years)Unstable angina (3 points)Emergency (2 points)Female (1 point)LVEF: 30–50% (1 point); LVEF < 30% (3 points)CABG combined with other cardiac surgeries (2 points)Chronic pulmonary disease(1 point)Recent myocardial infarct(2 points)Thoracic aortic surgery(3 points)Extra-cardiac arteriopathy(2 points)Pulmonary hypertension(2 points)Post-myocardial infarction ventricular septal defect(4 points)Neurological dysfunction(2 points)Previous cardiac surgery(3 points)Serum creatinine > 200 mmol/L (2 points)Active endocarditis (3 points)Critical pre-operative state(3 points)EuroSCORE European system for cardiac operative risk evaluation, LVEF Left ventricular ejection fraction, CABG Coronary artery bypass grafting Sub-item characteristics and scores of EuroSCORE Chronic pulmonary disease (1 point) Recent myocardial infarct (2 points) Thoracic aortic surgery (3 points) Extra-cardiac arteriopathy (2 points) Pulmonary hypertension (2 points) Post-myocardial infarction ventricular septal defect (4 points) Neurological dysfunction (2 points) Previous cardiac surgery (3 points) Critical pre-operative state (3 points) EuroSCORE European system for cardiac operative risk evaluation, LVEF Left ventricular ejection fraction, CABG Coronary artery bypass grafting Table 2Input characteristics of LightGBM-allInput categoriesInput itemsPreoperative variablesGender, age, height, weight, BMI, EuroSCORE, ASA classification, NYHA classification, diabetes, hypertension, RRT, heart rate, WBC, NEUT%, HGB, HCT, PLT, Hs-CRP, CK-MB, Hs-TnI, urea, Cr, AST, ALT, BNP, LVEF, LacIntraoperative variablesCPB duration, operation duration, aortic cross-clamp time, DHCA, spontaneous beating, defibrillations, re-aortic cross-clamping, blood transfusion quantity, salvaged autotransfusion, infusion quantity, Lac after CPBFirst lab test results on ICU admissionWBC*, NEUT%*, HGB*, HCT*, PLT*, Hs-CRP*, CK-MB*, Hs-TnI*, urea*, Cr*, AST*, ALT*, BNP*, Lac*BMI Body mass index, EuroSCORE European system for cardiac operative risk evaluation, ASA American Society of Anesthesiologists, NYHA New York Heart Association, RRT Renal replacement therapy, WBC White blood cell, NEUT% Neutrophil percentage, HGB Hemoglobin, HCT Hematocrit, PLT Platelet, Hs-CRP High-sensitivity C-reactive protein, CK-MB Creatine kinase MB isoenzyme, Hs-TnI High-sensitivity troponin I, Cr Creatinine, AST Aspartate aminotransferase, ALT Alanine aminotransferase, BNP B-type natriuretic peptide, LVEF Left ventricular ejection fraction, Lac Lactic acid, CPB Cardiopulmonary bypass, DHCA Deep hypothermia circulatory arrest, ICU Intensive care unitThe suffix “*” represents the first lab test results on ICU admission Table 2Input characteristics of LightGBM-allInput categoriesInput itemsPreoperative variablesGender, age, height, weight, BMI, EuroSCORE, ASA classification, NYHA classification, diabetes, hypertension, RRT, heart rate, WBC, NEUT%, HGB, HCT, PLT, Hs-CRP, CK-MB, Hs-TnI, urea, Cr, AST, ALT, BNP, LVEF, LacIntraoperative variablesCPB duration, operation duration, aortic cross-clamp time, DHCA, spontaneous beating, defibrillations, re-aortic cross-clamping, blood transfusion quantity, salvaged autotransfusion, infusion quantity, Lac after CPBFirst lab test results on ICU admissionWBC*, NEUT%*, HGB*, HCT*, PLT*, Hs-CRP*, CK-MB*, Hs-TnI*, urea*, Cr*, AST*, ALT*, BNP*, Lac*BMI Body mass index, EuroSCORE European system for cardiac operative risk evaluation, ASA American Society of Anesthesiologists, NYHA New York Heart Association, RRT Renal replacement therapy, WBC White blood cell, NEUT% Neutrophil percentage, HGB Hemoglobin, HCT Hematocrit, PLT Platelet, Hs-CRP High-sensitivity C-reactive protein, CK-MB Creatine kinase MB isoenzyme, Hs-TnI High-sensitivity troponin I, Cr Creatinine, AST Aspartate aminotransferase, ALT Alanine aminotransferase, BNP B-type natriuretic peptide, LVEF Left ventricular ejection fraction, Lac Lactic acid, CPB Cardiopulmonary bypass, DHCA Deep hypothermia circulatory arrest, ICU Intensive care unitThe suffix “*” represents the first lab test results on ICU admission Input characteristics of LightGBM-all BMI Body mass index, EuroSCORE European system for cardiac operative risk evaluation, ASA American Society of Anesthesiologists, NYHA New York Heart Association, RRT Renal replacement therapy, WBC White blood cell, NEUT% Neutrophil percentage, HGB Hemoglobin, HCT Hematocrit, PLT Platelet, Hs-CRP High-sensitivity C-reactive protein, CK-MB Creatine kinase MB isoenzyme, Hs-TnI High-sensitivity troponin I, Cr Creatinine, AST Aspartate aminotransferase, ALT Alanine aminotransferase, BNP B-type natriuretic peptide, LVEF Left ventricular ejection fraction, Lac Lactic acid, CPB Cardiopulmonary bypass, DHCA Deep hypothermia circulatory arrest, ICU Intensive care unit The suffix “*” represents the first lab test results on ICU admission Prior to the actual training process, the Fast and Lightweight AutoML (FLAML) [23] library, which is efficient and lightweight, was used to select a set of parameters that minimized the loss for the dataset under the guidance of an objective function, thereby preparing for the formal training of the LightGBM model. To build a more reliable predictive model and avoid result bias and overfitting, the data were split into a training set and a validation set at a ratio of 8:2. A 5-fold cross-validation (CV) was employed, and weights were assigned to both sample types during the training process. To ensure that the model had high generalization ability and prevent overfitting, this study used a specific formula \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\:Object=1-{F}_{2}+{\left({F}_{1}-{F}_{2}\right)}^{2}$$\end{document} as the basis for selecting model parameters. Model interpretability and quantitative metrics This study innovatively combines the characteristic attribution analysis methods of local interpretable model-agnostic explanations (LIME), SHapley additive exPlanations (SHAP), and counterfactual explanations (CE) to identify characteristics that have a significant impact on model predictions and directly guide the practical adjustment of model decisions (Detailed information can be found in the supplementary material). LIME [24] is a local interpretability technique that generates a new dataset by slightly perturbing the input data and observing changes in the black-box model’s output. An approximate model is trained using this new dataset, and the importance of each characteristic is calculated by analyzing the coefficients of this model. SHAP [25] is a global interpretation method that determines characteristic attributions by estimating Shapley values. The CE method can find counterfactual examples for a given sample, where minimal modifications to characteristics result in a change in the prediction outcome. By elucidating the model through changes between the sample and counterfactual examples, this method provides different explanations compared to static characteristic importance numerical methods. Diverse counterfactual explanations (DICE) proposes a method that utilizes determinantal point processes to generate and evaluate multiple counterfactual explanations, adjusting the model’s output through diverse and feasible perturbations. Furthermore, this study introduces the sufficiency and necessity metrics for characteristics [26] to evaluate model interpretability by constraining each characteristic based on a sample-based approach (Detailed information can be found in the supplementary material). Necessity refers to allowing only one characteristic to change while all other characteristics remain constant in the sample. Sufficiency refers to fixing specific characteristic while allowing other characteristics to change. In the context of this study, calculating necessity only requires changing one characteristic, which may lead to a reversal of the model’s prediction outcome (from AO to non-AO). However, in reality, it is often difficult to change one characteristic without affecting others. Therefore, necessity can be used to measure the extent to which a particular characteristic should be considered under ideal cardiac surgery conditions. Calculating sufficiency involves restricting specific characteristic to remain constant. Higher sufficiency implies fewer generated counterfactual samples, indicating that the characteristic tends to change in conjunction with multiple other characteristics, leading to a reversal of the outcome. Statistical analysis All data analyses were conducted using Python software (version 3.6) with the following packages: DICE_ML, FLAML, LightGBM, LIME, Matplotlib, Numpy, Pandas, Scikit_Learn, Scipy, and Shap. For measurement data conforming to a normal distribution, the mean (standard deviation) was used for representation, while for measurement data not conforming to a normal distribution, the median (interquartile range) was used. Categorical data were presented as frequencies (percentages). In terms of inter-group difference testing, for continuous variables conforming to a normal distribution, the two independent samples t-test was employed for comparison, whereas for data not conforming to a normal distribution, the Mann-Whitney U test was used. For frequency data, the chi-square test or Fisher’s exact probability method was adopted. All P-values were two-sided, and a P-value < 0.05 indicated a statistically significant difference. Results Patient characteristics Among the 3,270 patients included in the study, a total of 203 patients (6.2%) experienced AOs, with 62 patients (1.9%) dying during the hospitalization period. Univariate analysis revealed significant differences between the AO group and the non-AO group in 43 variables, including age, hypertension, American Society of Anesthesiologists (ASA) physical status classification, New York Heart Association (NYHA) functional classification, left ventricular ejection fraction (LVEF), heart rate, EuroSCORE values, preoperative laboratory test results, intraoperative data, and the first postoperative laboratory test results upon admission to the ICU (detailed in Table 3). Table 3Cardiac surgery patient characteristics and perioperative variablesVariablesAO group(n = 203)Non-AO group(n = 3067)Z/X2P valueDemographics Age (yr)54(45, 63)50(41, 59)-3.856<0.001 female, n (%)121(59.6%)1723(56.2%)0.9090.34 Weight (kg)55(47, 65)57(50, 65)1.5080.132 Height (cm)159(152.5, 165)160(154, 165)1.4870.137 BMI(Kg/cm2)22.2(19.1, 24.3)22.3(20, 24.6)1.0130.311Preoperative variables Hypertension, n (%)48(23.6%)449(14.6%)11.981<0.001 Diabetes, n (%)12(5.9%)151(4.9%)0.3920.531 RRT, n (%)5(2.5%)5(0.2%)14.673<0.001ASA classification, n (%) Ⅰ2(1.0%)8(0.3%)-7.61<0.001 Ⅱ6(3.0%)482(15.7%) Ⅲ136(67.0%)2215(72.2%) Ⅳ55(27.1%)355(11.6%) Ⅴ4(2.0%)7(0.2%)NYHA classification, n (%) Ⅰ5(2.5%)136(4.4%)-5.979<0.001 Ⅱ38(18.7%)857(27.9%) Ⅲ105(51.7%)1783(58.1%) Ⅳ55(27.1%)291(9.5%)LVEF0.64(0.55, 0.68)0.65(0.59, 0.69)1.9740.048Heart rate (bpm)87(74, 105)82(71, 100)-2.9450.003EuroSCORE3(1, 4)1(1, 2)-9.722<0.001Preoperative lab test results WBC (109·L − 1)6.62(5.10, 8.59)6.06(4.95, 7.45)-3.353<0.001 NEUT (%)66(55.4, 74.9)60.2(52.35, 67.6)-5.493<0.001 HGB (g·L − 1)127(108, 142)134(122, 145)4.314<0.001 HCT (%)38.4(33.75, 42.5)40.6(37.1, 43.8)4.487<0.001 PLT (109·L − 1)158(121, 200)173(131, 220)3.1010.002 Hs-CRP (mg·L − 1)3.89(0.89, 23.99)1.04(0.5, 3.96)-5.264<0.001 CK-MB (U·L − 1)12.05(9.7, 17.3)11.9(9.3, 15.2)-1.4830.138 Hs-TnI (ng·mL − 1)1.15(0.02, 24.2)2.6(0.03, 9.65)-0.6530.514 Urea (mmol·L − 1)6.74(5, 9.73)5.66(4.56, 7.13)-5.497<0.001 Cr (µmol·L − 1)70.9(57.7, 101.65)65.8(54.2, 78.7)-4.556<0.001 AST (U·L − 1)30(23.5, 44)28(22, 37)-2.8280.005 ALT (U·L − 1)21(15, 37)22(14, 34)-0.6790.497 BNP (pg·mL − 1)314.3(126.8, 846.2)157.2(61.45, 370.4)-6.053<0.001 Lac (mmol·L − 1)1(0.7, 1.3)0.9(0.7, 1.2)-2.0530.04Intraoperative variables CPB duration(min)161(115.5, 227.5)123(90, 159)-8.559<0.001 Operation duration (min)380(290, 462.5)290(240, 350)-9.62<0.001 Aortic cross-clamp time (min)104(68.5, 144.5)79(53, 112)-6.514<0.001 Defibrillation0(0, 0)0(0, 0)-2.8090.005Blood products Erythrocyte (U)3.5(0, 7.5)0(0, 2)-10.584<0.001 Plasma (mL)400(350, 600)300(400, 550)-3.120.002 Platelet (U)0(0, 1)0(0, 0)-14.92<0.001 Cryoprecipitat (U)0(0, 0)0(0, 0)-5.012<0.001 Salvaged autotransfusion (mL)270(0, 401.5)200(0, 350)-4.672<0.001 Blood transfusion quantity (mL)650(400, 1035)500(360, 780)-5.538<0.001 Infusion quantity (mL)800(500, 1000)700(500, 900)-1.460.144 Lac after CPB (mmol·L − 1)3.45(2.1, 5.9)2.3(1.5, 3.5)-7.51<0.001 DHCA, n (%)13(6.4%)26(0.8%)45.275<0.001 Spontaneous beating, n (%)152(74.9%)2561(83.5%)10.0220.002 Re-aortic cross-clamping, n (%)10(5.4%)43(1.5%)12.8455<0.001First lab test results on ICU admission WBC* (109·L − 1)14.3(10.38, 17.42)13.91(10.78, 17.52)0.1230.902 NEUT* (%)88.65(82.55, 90.3)88.1(83.6, 91.3)2.3740.018 HGB* (g·L − 1)107(95, 117)108(98, 120)1.9430.052 HCT* (%)32.2(29.15, 35.05)32.9(29.8, 36)2.2320.026 PLT* (109·L − 1)116(85, 153)128(101, 165)4.089<0.001 Hs-CRP* (mg·L − 1)7.6(1.1, 32.6)1.395(0.5, 11.42)-5.598<0.001 CK-MB* (U·L − 1)76.85(48.25, 119.7)71(47.05, 100, 9)-1.9450.052 Hs-TnI* (ng·mL − 1)41.16(9.77, 5130.2)22.33(6.01, 4596.7)-1.8950.058 Urea* (mmol·L − 1)7.88(6.08, 10.34)6.42(5.15, 8.02)-7.136<0.001 Cr* (µmol·L − 1)80.5(60.8, 116.2)64.7(52.2, 80.6)-7.704<0.001 AST* (U·L − 1)102(75, 168)82(61, 111)-6.793<0.001 ALT* (U·L − 1)25(16, 44)22(16, 33)-2.4880.013 BNP* (pg·mL − 1)531.2(195.5, 1215.4)141.4(57.55, 353.2)-9.85<0.001 Lac* (mmol·L − 1)4.5(2.5, 8.7)3(1.7, 5.3)-6.755<0.001BMI Body mass index, RRT Renal replacement therapy, ASA American Society of Anesthesiologists, NYHA New York Heart Association, LVEF Left ventricular ejection fraction, EuroSCORE European system for cardiac operative risk evaluation, WBC White blood cell, NEUT% Neutrophil percentage, HGB Hemoglobin, HCT Hematocrit, PLT Platelet, Hs-CRP High-sensitivity C-reactive protein, CK-MB Creatine kinase MB isoenzyme, Hs-TnI High-sensitivity troponin I, Cr Creatinine, AST Aspartate aminotransferase, ALT Alanine aminotransferase, BNP B-type natriuretic peptide, Lac Lactic acid, CPB Cardiopulmonary bypass, DHCA Deep hypothermia circulatory arrestThe suffix “*” represents the first lab test results on ICU admission Table 3Cardiac surgery patient characteristics and perioperative variablesVariablesAO group(n = 203)Non-AO group(n = 3067)Z/X2P valueDemographics Age (yr)54(45, 63)50(41, 59)-3.856<0.001 female, n (%)121(59.6%)1723(56.2%)0.9090.34 Weight (kg)55(47, 65)57(50, 65)1.5080.132 Height (cm)159(152.5, 165)160(154, 165)1.4870.137 BMI(Kg/cm2)22.2(19.1, 24.3)22.3(20, 24.6)1.0130.311Preoperative variables Hypertension, n (%)48(23.6%)449(14.6%)11.981<0.001 Diabetes, n (%)12(5.9%)151(4.9%)0.3920.531 RRT, n (%)5(2.5%)5(0.2%)14.673<0.001ASA classification, n (%) Ⅰ2(1.0%)8(0.3%)-7.61<0.001 Ⅱ6(3.0%)482(15.7%) Ⅲ136(67.0%)2215(72.2%) Ⅳ55(27.1%)355(11.6%) Ⅴ4(2.0%)7(0.2%)NYHA classification, n (%) Ⅰ5(2.5%)136(4.4%)-5.979<0.001 Ⅱ38(18.7%)857(27.9%) Ⅲ105(51.7%)1783(58.1%) Ⅳ55(27.1%)291(9.5%)LVEF0.64(0.55, 0.68)0.65(0.59, 0.69)1.9740.048Heart rate (bpm)87(74, 105)82(71, 100)-2.9450.003EuroSCORE3(1, 4)1(1, 2)-9.722<0.001Preoperative lab test results WBC (109·L − 1)6.62(5.10, 8.59)6.06(4.95, 7.45)-3.353<0.001 NEUT (%)66(55.4, 74.9)60.2(52.35, 67.6)-5.493<0.001 HGB (g·L − 1)127(108, 142)134(122, 145)4.314<0.001 HCT (%)38.4(33.75, 42.5)40.6(37.1, 43.8)4.487<0.001 PLT (109·L − 1)158(121, 200)173(131, 220)3.1010.002 Hs-CRP (mg·L − 1)3.89(0.89, 23.99)1.04(0.5, 3.96)-5.264<0.001 CK-MB (U·L − 1)12.05(9.7, 17.3)11.9(9.3, 15.2)-1.4830.138 Hs-TnI (ng·mL − 1)1.15(0.02, 24.2)2.6(0.03, 9.65)-0.6530.514 Urea (mmol·L − 1)6.74(5, 9.73)5.66(4.56, 7.13)-5.497<0.001 Cr (µmol·L − 1)70.9(57.7, 101.65)65.8(54.2, 78.7)-4.556<0.001 AST (U·L − 1)30(23.5, 44)28(22, 37)-2.8280.005 ALT (U·L − 1)21(15, 37)22(14, 34)-0.6790.497 BNP (pg·mL − 1)314.3(126.8, 846.2)157.2(61.45, 370.4)-6.053<0.001 Lac (mmol·L − 1)1(0.7, 1.3)0.9(0.7, 1.2)-2.0530.04Intraoperative variables CPB duration(min)161(115.5, 227.5)123(90, 159)-8.559<0.001 Operation duration (min)380(290, 462.5)290(240, 350)-9.62<0.001 Aortic cross-clamp time (min)104(68.5, 144.5)79(53, 112)-6.514<0.001 Defibrillation0(0, 0)0(0, 0)-2.8090.005Blood products Erythrocyte (U)3.5(0, 7.5)0(0, 2)-10.584<0.001 Plasma (mL)400(350, 600)300(400, 550)-3.120.002 Platelet (U)0(0, 1)0(0, 0)-14.92<0.001 Cryoprecipitat (U)0(0, 0)0(0, 0)-5.012<0.001 Salvaged autotransfusion (mL)270(0, 401.5)200(0, 350)-4.672<0.001 Blood transfusion quantity (mL)650(400, 1035)500(360, 780)-5.538<0.001 Infusion quantity (mL)800(500, 1000)700(500, 900)-1.460.144 Lac after CPB (mmol·L − 1)3.45(2.1, 5.9)2.3(1.5, 3.5)-7.51<0.001 DHCA, n (%)13(6.4%)26(0.8%)45.275<0.001 Spontaneous beating, n (%)152(74.9%)2561(83.5%)10.0220.002 Re-aortic cross-clamping, n (%)10(5.4%)43(1.5%)12.8455<0.001First lab test results on ICU admission WBC* (109·L − 1)14.3(10.38, 17.42)13.91(10.78, 17.52)0.1230.902 NEUT* (%)88.65(82.55, 90.3)88.1(83.6, 91.3)2.3740.018 HGB* (g·L − 1)107(95, 117)108(98, 120)1.9430.052 HCT* (%)32.2(29.15, 35.05)32.9(29.8, 36)2.2320.026 PLT* (109·L − 1)116(85, 153)128(101, 165)4.089<0.001 Hs-CRP* (mg·L − 1)7.6(1.1, 32.6)1.395(0.5, 11.42)-5.598<0.001 CK-MB* (U·L − 1)76.85(48.25, 119.7)71(47.05, 100, 9)-1.9450.052 Hs-TnI* (ng·mL − 1)41.16(9.77, 5130.2)22.33(6.01, 4596.7)-1.8950.058 Urea* (mmol·L − 1)7.88(6.08, 10.34)6.42(5.15, 8.02)-7.136<0.001 Cr* (µmol·L − 1)80.5(60.8, 116.2)64.7(52.2, 80.6)-7.704<0.001 AST* (U·L − 1)102(75, 168)82(61, 111)-6.793<0.001 ALT* (U·L − 1)25(16, 44)22(16, 33)-2.4880.013 BNP* (pg·mL − 1)531.2(195.5, 1215.4)141.4(57.55, 353.2)-9.85<0.001 Lac* (mmol·L − 1)4.5(2.5, 8.7)3(1.7, 5.3)-6.755<0.001BMI Body mass index, RRT Renal replacement therapy, ASA American Society of Anesthesiologists, NYHA New York Heart Association, LVEF Left ventricular ejection fraction, EuroSCORE European system for cardiac operative risk evaluation, WBC White blood cell, NEUT% Neutrophil percentage, HGB Hemoglobin, HCT Hematocrit, PLT Platelet, Hs-CRP High-sensitivity C-reactive protein, CK-MB Creatine kinase MB isoenzyme, Hs-TnI High-sensitivity troponin I, Cr Creatinine, AST Aspartate aminotransferase, ALT Alanine aminotransferase, BNP B-type natriuretic peptide, Lac Lactic acid, CPB Cardiopulmonary bypass, DHCA Deep hypothermia circulatory arrestThe suffix “*” represents the first lab test results on ICU admission Cardiac surgery patient characteristics and perioperative variables BMI Body mass index, RRT Renal replacement therapy, ASA American Society of Anesthesiologists, NYHA New York Heart Association, LVEF Left ventricular ejection fraction, EuroSCORE European system for cardiac operative risk evaluation, WBC White blood cell, NEUT% Neutrophil percentage, HGB Hemoglobin, HCT Hematocrit, PLT Platelet, Hs-CRP High-sensitivity C-reactive protein, CK-MB Creatine kinase MB isoenzyme, Hs-TnI High-sensitivity troponin I, Cr Creatinine, AST Aspartate aminotransferase, ALT Alanine aminotransferase, BNP B-type natriuretic peptide, Lac Lactic acid, CPB Cardiopulmonary bypass, DHCA Deep hypothermia circulatory arrest The suffix “*” represents the first lab test results on ICU admission Model performance analysis In this study, the performance of each model was evaluated using the area under the receiver operating characteristic curve (AUROC) value on the validation dataset. The AUROC value is commonly employed to assess the relationship between a model’s sensitivity and specificity, reflecting its discriminative ability. In this research, after undergoing 5-fold CV, the LightGBM-all model demonstrated the highest average AUROC value of 0.807. The LightGBM-Eurolinear model achieved an average AUROC value of 0.713, while the LightGBM-EuroSCORE model had an average AUROC value of 0.722. (Detailed information is presented in Fig. 2). Fig. 2a the ROC curve of LightGBM-Eurolinear model after 5-fold cross validation; b the ROC curve of LightGBM-EuroSCORE model after 5-fold cross validation; c the ROC curve of LightGBM-all model after 5-fold cross validation; d average ROC curves for the three models a the ROC curve of LightGBM-Eurolinear model after 5-fold cross validation; b the ROC curve of LightGBM-EuroSCORE model after 5-fold cross validation; c the ROC curve of LightGBM-all model after 5-fold cross validation; d average ROC curves for the three models Interpretability analysis results To interpret the models, this study introduced the DICE method in addition to the LIME and SHAP interpretation approaches. Initially, through sample selection, risk factors that may lead to postoperative AOs were identified. In CE, the focus was on patients who experienced AOs postoperatively, exploring how to adjust their characteristics to avoid AOs under the model. For comparison, the LightGBM-Eurolinear model was selected, and samples that were judged as true positives in the LightGBM-all model but predicted as negatives in the LightGBM-Eurolinear model were chosen for CE. In the characteristic importance analysis, the specific rankings of characteristics under the three interpretability methods (LIME, SHAP, and DICE) are detailed in Table 4. Additionally, the importance percentages of these characteristics across the three methods on the LightGBM-all model are illustrated in Fig. 3. These visualizations and rankings provide a comprehensive understanding of which characteristics contribute most significantly to the model’s predictive performance, thereby aiding in the interpretation and refinement of the model for clinical applications. Table 4Ranking of important characteristics of the three interpretation methodsCharacteristicsRank for different methodsRank for Necessity and SufficiencyLIMESHAPDICENecessityRankSufficiencyRankBNP*1110.38910.1822Urea*3240.25120.0556Aortic cross-clamp time4320.25130.0715CPB duration8530.20140.0278EuroSCORE24160.03917012HGB56110.1745012Operation duration10850.09113012Cr*61190.14360.0278AST*77100.14170.0278Lac after CPB1110120.089140.0934BNP1312130.097120.2561Blood transfusion quantity171680.098110.0556AST151770.08115012Erythrocyte1215140.07616012WBC*189150.10490.0993NYHA918180.02419012PLT*1613170.11280.0278HCT191960.03818012Urea1414190.09810012LIME Local interpretable model-agnostic explanations, SHAP SHapley additive exPlanations, DICE Diverse counterfactual explanations, BNP B-type natriuretic peptide, CPB Cardiopulmonary bypass, EuroSCORE European system for cardiac operative risk evaluation, HGB Hemoglobin, Cr Creatinine, AST Aspartate aminotransferase, WBC White blood cell, NYHA New York Heart Association, PLT Platelet, HCT HematocritThe suffix “*” represents the first lab test results on ICU admission Table 4Ranking of important characteristics of the three interpretation methodsCharacteristicsRank for different methodsRank for Necessity and SufficiencyLIMESHAPDICENecessityRankSufficiencyRankBNP*1110.38910.1822Urea*3240.25120.0556Aortic cross-clamp time4320.25130.0715CPB duration8530.20140.0278EuroSCORE24160.03917012HGB56110.1745012Operation duration10850.09113012Cr*61190.14360.0278AST*77100.14170.0278Lac after CPB1110120.089140.0934BNP1312130.097120.2561Blood transfusion quantity171680.098110.0556AST151770.08115012Erythrocyte1215140.07616012WBC*189150.10490.0993NYHA918180.02419012PLT*1613170.11280.0278HCT191960.03818012Urea1414190.09810012LIME Local interpretable model-agnostic explanations, SHAP SHapley additive exPlanations, DICE Diverse counterfactual explanations, BNP B-type natriuretic peptide, CPB Cardiopulmonary bypass, EuroSCORE European system for cardiac operative risk evaluation, HGB Hemoglobin, Cr Creatinine, AST Aspartate aminotransferase, WBC White blood cell, NYHA New York Heart Association, PLT Platelet, HCT HematocritThe suffix “*” represents the first lab test results on ICU admission Ranking of important characteristics of the three interpretation methods LIME Local interpretable model-agnostic explanations, SHAP SHapley additive exPlanations, DICE Diverse counterfactual explanations, BNP B-type natriuretic peptide, CPB Cardiopulmonary bypass, EuroSCORE European system for cardiac operative risk evaluation, HGB Hemoglobin, Cr Creatinine, AST Aspartate aminotransferase, WBC White blood cell, NYHA New York Heart Association, PLT Platelet, HCT Hematocrit The suffix “*” represents the first lab test results on ICU admission Fig. 3Characteristics ranking diagram of the three interpretation methods. The suffix “*” represents the first lab test results on ICU admission. The order of characteristics in the x-axis is the average order of characteristics under the three methods, and the y-axis represents the importance index of characteristics Characteristics ranking diagram of the three interpretation methods. The suffix “*” represents the first lab test results on ICU admission. The order of characteristics in the x-axis is the average order of characteristics under the three methods, and the y-axis represents the importance index of characteristics Discussion This study represents the first attempt to integrate the LightGBM algorithm with the DICE method for predicting cardiac surgery outcomes. This innovation not only provides a more precise tool for predicting cardiac surgery risks but also opens up new avenues and directions for future research in related fields. The interpretability methods employed in this study identified low preoperative hematocrit and hemoglobin levels as important predictors of postoperative AOs, highlighting the potential value of preoperative anemia management. Surgical-related factors, including aortic cross-clamp time, CPB duration, operation duration, and intraoperative blood transfusion quantity, all increase the risk of postoperative AOs. These findings are highly consistent with previous studies, reflecting the cumulative effects of ischemia-reperfusion injury and systemic inflammatory responses. Additionally, some early postoperative biochemical markers, such as B-type natriuretic peptide (BNP), urea, creatinine, and aspartate aminotransferase (AST), which reflect the function of vital organs, further validate the clinical value of early postoperative organ function monitoring. These findings have distinct clinical implications compared with the preoperative EuroSCORE. The EuroSCORE is designed to inform preoperative decision‑making, such as whether to proceed with surgery, choice of procedure, and obtaining informed consent. In contrast, our LightGBM‑all model provides an updated risk assessment upon ICU admission after surgery, incorporating intraoperative and early postoperative data. This allows clinicians to: Triage monitoring intensity (e.g., more frequent vital sign checks, invasive hemodynamic monitoring); guide early postoperative interventions (e.g., renal replacement therapy, vasoactive support, targeted heart failure management); inform ICU resource allocation (e.g., anticipated length of stay, specialist consultations). Thus, while the EuroSCORE helps decide whether to operate, our model helps determine how to manage the patient in the immediate postoperative period to prevent adverse outcomes. This real‑time risk stratification has direct implications for personalized postoperative care and may improve resource utilization. Preoperative management guidance The results of this study suggest that preoperative hematocrit and hemoglobin levels are important predictors associated with postoperative outcomes. Preoperative anemia was associated with a higher likelihood of postoperative tissue hypoxia, particularly in the high oxygen-consuming state of cardiac surgery. Preoperative hemoglobin level ranked fifth in necessity but had a low sufficiency metric, suggesting that abnormal hemoglobin levels are associated with postoperative AOs; however, correcting hemoglobin levels alone may not be sufficient to prevent AOs. Preoperative anemia management remains a key focus for preoperative optimization, although its causal role in reducing AOs cannot be established from this observational study. AST was listed as the seventh most important characteristic, indicating that changes in its levels may significantly impact the model’s prediction of postoperative AOs. When heart failure occurs, an increase in central venous pressure can lead to hepatic blood stasis and local hepatic ischemia. Since the central zone of the hepatic lobule is relatively distant from the blood supply of the hepatic artery and portal vein, it is often more susceptible to ischemic conditions [27, 28]. AST enzyme is primarily localized in the central zone of the hepatic lobule. Therefore, the detection of AST levels before and after cardiac surgery can serve as an important reference indicator for assessing cardiac function status and, consequently, reflecting the impact of cardiac surgery on patients. Intraoperative process optimization The findings of this study indicate that prolonged aortic cross-clamp time, CPB duration, operation duration, and substantial intraoperative blood transfusion were associated with a higher risk of AOs. The importance rankings of aortic cross-clamp time, CPB duration, and operation duration in the DICE method were higher than those in SHAP and LIME. DICE generates counterfactual examples by minimally altering characteristics to change the model’s predictions, thereby identifying key features. These three temporal parameters are clinically controllable variables and often exhibit high correlation. While these observations align with previous research [29–34], the associations identified here should not be interpreted as causal. The DICE method offers a computational approach to highlight potentially modifiable factors, but prospective studies are needed to determine whether interventions targeting these parameters can improve surgical outcomes. Substantial blood transfusion is frequently associated with surgical complexity and blood loss volume. As the eighth-ranked characteristic indicator in DICE, the relative importance of blood transfusion quantity is lower than parameters such as aortic cross-clamp time and CPB duration. This indicates that it is less amenable to regulation and is often employed as an intervention measure in emergency situations, such as intraoperative massive hemorrhage or hypovolemia. Li and his team [35] constructed a ML model to predict the risk of perioperative erythrocyte transfusion in cardiac surgery. This model confirmed that preoperative low hemoglobin levels, low body mass index, advanced age, and female gender increase the risk of erythrocyte transfusion. This finding further underscores the importance of preoperative anemia improvement. Postoperative organ function monitoring The first postoperative BNP measured upon ICU admission ranked highest in feature importance across LIME, SHAP, and DICE. However, because this measurement is taken after surgery and may coincide with the early phase of adverse outcome development, it should be interpreted as an early risk marker rather than a preoperative predictor. Its high priority in DICE suggests that elevated BNP identifies patients at higher risk, which could enable closer monitoring and earlier supportive interventions. Importantly, this finding should not be interpreted as evidence that BNP itself is a direct therapeutic target; rather, it reflects an association that may be confounded by underlying disease severity and other unmeasured factors. Urea serves as a sensitive marker for renal dysfunction. This study reveals that the necessity ranking of postoperative first urea is higher than that of creatinine, which may be attributed to the kinetic differences and pathophysiological characteristics of urea. Additionally, urea levels are directly influenced by renal blood flow and tubular function [36], whereas creatinine levels are subject to interference from factors such as muscle metabolism, age, and gender [37–39]. Furthermore, Demirjian et al. [40] found a U-shaped association between perioperative creatinine changes and the risk of acute kidney injury (AKI), indicating that both excessively low and high creatinine levels can increase the risk of AKI. Postoperative first urea ranks fourth in the DICE interpretability method, suggesting that regulating urea levels could help reduce the risk of AKI. Lactate concentration plays a crucial clinical role in cardiac surgery, as changes in its levels can reflect the perfusion status of systemic organs [41]. In this study, the sufficiency ranking of post-CPB lactate is fourth overall but drops to twelfth in the DICE method, indicating that the feasibility of interventions for elevated lactate levels is limited. This is because elevated lactate is typically a secondary phenomenon, and its regulation relies more on etiological treatment rather than direct intervention on lactate itself, which restricts its optimization potential in DICE. Clinical implications of the AUC improvement The increase in AUROC from 0.722 to 0.807 corresponds to a modest but consistent improvement in discriminative ability. However, the clinical significance of this improvement depends on whether it translates into meaningful changes in risk classification and subsequent management. In the context of cardiac surgery, where baseline risk is often high, even moderate improvements in discrimination may help identify a subset of patients at substantially elevated risk who could benefit from intensified monitoring or early intervention. Importantly, the biomarkers used in our model (e.g., BNP, urea, AST) are routinely collected in most cardiac surgery ICUs; thus, the additional resource burden is minimal in settings where these tests are already standard. Nonetheless, we acknowledge that implementing the model in centers without routine postoperative biomarker measurement would incur additional costs. Future cost-effectiveness analyses and prospective trials are needed to determine whether the incremental improvement in risk prediction justifies the resources required. To contextualize our model’s performance, we compared it with relevant published studies. A systematic review and meta‑analysis by Aftab et al. reported pooled AUCs of 0.83 (training) and 0.76 (validation) for machine learning models predicting acute kidney injury after cardiac surgery [42]. In the broader context of postoperative adverse outcomes, the prospective Roux‑MMC model achieved AUCs ranging from 0.818 to 0.911 across eight endpoints, including mortality (0.882) and renal failure (0.878) [43]. Additionally, Sinha et al. demonstrated an improvement in discrimination from EuroSCORE II (AUC 0.817–0.818) to XGBoost (AUC 0.833–0.834) in a national cohort of > 220,000 patients [19], a trend consistent with our finding that the LightGBM‑all model outperformed EuroSCORE (0.722 vs. 0.807). Other studies have reported AUCs of approximately 0.83–0.85 for composite adverse outcomes [20, 44]. Although cross‑study comparisons are limited by heterogeneity in outcome definitions, populations, and validation methods, our model’s AUC of 0.807 lies within the reported range (approximately 0.76–0.85) for machine learning‑based risk prediction after cardiac surgery, supporting its potential utility for postoperative risk stratification. Potential clinical workflow Here we describe a practical workflow for integrating the entire LightGBM-all model into postoperative management, which was developed based on the current clinical practices of our institution. Additionally, we have outlined a future optimized version that is expected to achieve earlier risk stratification. Current workflow (as implemented in this study):Preoperative phase - The anesthesiologist calculates the EuroSCORE to assess baseline surgical risk.Intraoperative phase - Key parameters (CPB duration, aortic cross‑clamp time, blood transfusion volume, etc.) are recorded in the electronic anesthesia record.Postoperative phase (upon ICU admission) - Routine blood samples (including BNP, urea, AST, lactate) are drawn immediately after the patient arrives in the ICU. Results are typically available within 30–60 min. The anesthesiologist or ICU physician enters these values together with the intraoperative parameters into the LightGBM‑all model. The model instantly outputs a risk score (0-100) for the composite adverse outcome.Risk‑based action - If the predicted risk exceeds a pre‑defined threshold (e.g., 20%), the clinical team is alerted to implement proactive measures: increasing monitoring frequency, initiating early renal protective therapy, optimizing volume status, and consulting specialists earlier than routine. Preoperative phase - The anesthesiologist calculates the EuroSCORE to assess baseline surgical risk. Preoperative phase - The anesthesiologist calculates the EuroSCORE to assess baseline surgical risk. Intraoperative phase - Key parameters (CPB duration, aortic cross‑clamp time, blood transfusion volume, etc.) are recorded in the electronic anesthesia record. Intraoperative phase - Key parameters (CPB duration, aortic cross‑clamp time, blood transfusion volume, etc.) are recorded in the electronic anesthesia record. Postoperative phase (upon ICU admission) - Routine blood samples (including BNP, urea, AST, lactate) are drawn immediately after the patient arrives in the ICU. Results are typically available within 30–60 min. The anesthesiologist or ICU physician enters these values together with the intraoperative parameters into the LightGBM‑all model. The model instantly outputs a risk score (0-100) for the composite adverse outcome. Postoperative phase (upon ICU admission) - Routine blood samples (including BNP, urea, AST, lactate) are drawn immediately after the patient arrives in the ICU. Results are typically available within 30–60 min. The anesthesiologist or ICU physician enters these values together with the intraoperative parameters into the LightGBM‑all model. The model instantly outputs a risk score (0-100) for the composite adverse outcome. Risk‑based action - If the predicted risk exceeds a pre‑defined threshold (e.g., 20%), the clinical team is alerted to implement proactive measures: increasing monitoring frequency, initiating early renal protective therapy, optimizing volume status, and consulting specialists earlier than routine. Risk‑based action - If the predicted risk exceeds a pre‑defined threshold (e.g., 20%), the clinical team is alerted to implement proactive measures: increasing monitoring frequency, initiating early renal protective therapy, optimizing volume status, and consulting specialists earlier than routine. To enable earlier intervention, we propose collecting blood samples during skin closure while the patient is still in the operating room. This would make the risk score available upon ICU admission, allowing preemptive interventions. Although not yet standard at our institution, this represents a promising future direction. Importantly, even if we follow the current process (i.e., taking samples when the patient enters the intensive care unit), this model can provide updated and real-time risk assessment, which is superior to using only the preoperative European scoring system. It is also can be readily adapted to adapt to the existing clinical routine procedures. The prediction results of this model can be recalculated based on new laboratory test results, enabling dynamic risk stratification during intensive care. Limitations This study has several limitations. Firstly, as this is a retrospective single-center study, there may be potential biases in the data collection process, and the research results may not be universally applicable. Secondly, due to the limitations of the electronic medical record system, some adverse consequences may not have been fully recorded. Additionally, the hospital’s electronic medical record system was upgraded in 2016, and since then, data collection has significantly improved. Variables recorded before 2016, including some laboratory indicators (such as BNP, Hs-CRP, and lactate), had relatively high missing values. Although the model performance results we obtained in the analysis excluding data from the pre-upgrade period were not significantly different (AUROC was 0.810 and 0.807 respectively), the differences in data integrity over time remain an inherent limitation of retrospective studies using historical electronic medical record data. Thirdly, the multi-task joint prediction model may mask the biological specificity of individual outcome predictors. Fourthly, we used the original cumulative European scoring system instead of EuroSCORE II. During the data extraction process, the hospital’s electronic medical record system failed to fully record all 18 variables required for calculating EuroSCORE II, while the original cumulative EuroSCORE variables were always fully recorded. Therefore, to maintain the consistency and integrity of the study, we used the original EuroSCORE as the baseline indicator for preoperative risk assessment. Fifthly, unmeasured and residual confounding factors cannot be excluded. Unmeasured confounding factors - such as the degree of valve calcification, anatomical complexity, or the surgeon’s experience - may be associated with intraoperative parameters (such as cardiopulmonary bypass time) and postoperative outcomes. Moreover, due to the presence of other unmeasured factors (such as socioeconomic status, frailty, medication history, institutional protocols), residual confounding factors may still exist. Therefore, all observed associations should be regarded as exploratory statistical associations rather than causal effects. Finally, due to the lack of external validation, our findings are exploratory studies; a prospective multicenter study with standardized data collection protocols is needed to confirm clinical applicability. Conclusions The LightGBM model developed in this study shows potential for improving postoperative risk stratification after cardiac surgery, with an AUROC of 0.807 on internal validation. The model’s interpretability features may assist clinicians in identifying high-risk patients early in the postoperative course. However, prospective external validation and cost-effectiveness studies are required before clinical implementation. Supplementary Information Supplementary Material 1. Supplementary Material 1.