Interpretable machine learning prediction model for postoperative pneumonia after cardiac surgery based on real-world data: a retrospective single-center study
摘要
Postoperative pneumonia (POP) is a common and clinically important complication following cardiac surgery. This study aimed to develop and internally evaluate an interpretable machine learning prediction model for 30-day POP after cardiac surgery using routinely collected real-world clinical data, and to describe a prototype decision-support application for potential perioperative risk stratification.
MethodsWe conducted a retrospective single-center cohort study using electronic medical record data from Nanjing Drum Tower Hospital. Adult patients undergoing cardiac surgery between January 2012 and December 2023 were screened; patients with massive missing clinical data, definite preoperative infection, or age < 18 years were excluded. The outcome was POP within 30 days after surgery. The final cohort was partitioned into training and held-out test sets using stratified random sampling at a 7:3 ratio before feature selection, augmentation, model fitting, and model evaluation. To reduce information leakage, preprocessing steps were fitted within the training workflow and the test set was reserved for final internal evaluation. Missing data were handled using MICE, class imbalance was addressed with Borderline-SMOTE and class weighting, predictors were selected using Boruta with recall impact over 50 iterations, and Bayesian optimization was used for hyperparameter tuning. Six machine learning algorithms (RF, SVM, XGBoost, LR, DT, and CatBoost) were compared. Model performance was assessed using discrimination, precision-recall performance, calibration, and overall classification metrics, including AUC, AP, recall, precision, accuracy, F1-score, calibration curves, and Brier score. SHAP was used for model interpretation.
ResultsAmong 10,109 eligible patients, 1,018 (10.07%) developed POP and 9,091 did not. Seven predictors were retained in the final model: ejection fraction (EF), cardiopulmonary bypass (CPB) time, serum creatinine (SCr), intraoperative blood loss, gender, total bilirubin (TBIL), and platelet-to-white blood cell ratio (PWR). CatBoost showed the best overall internal performance, with validation-set AUC of 0.9873 (95% CI: 0.9820–0.9926), AP of 0.9519 (95% CI: 0.9315–0.9722), accuracy of 0.9528 (95% CI: 0.9422–0.9635), recall of 0.9324 (95% CI: 0.9011–0.9636), and F1-score of 0.8996 (95% CI: 0.8754–0.9234). In the held-out test set, CatBoost achieved AUC of 0.9810, AP of 0.8600, accuracy of 0.9555, recall of 0.9258, precision of 0.7007, and F1-score of 0.7977. SHAP analysis showed that EF, CPB duration, SCr, and intraoperative blood loss were major contributors to predicted POP risk. A prototype web application was developed to illustrate potential perioperative use.
ConclusionThis study develops and internally evaluates an interpretable machine learning model for perioperative prediction of 30-day POP after cardiac surgery. The model demonstrated high internal discrimination and precision-recall performance, but the retrospective single-center design, absence of external validation, and inclusion of intraoperative predictors mean that it should be considered a perioperative risk-stratification model requiring external and prospective evaluation before routine clinical use.
RegistrationThis retrospective prediction-model study was not registered.