Optimizing In-Hospital Mortality Prediction After Cardiac Surgery: A Machine Learning Approach Using Feature Engineering for Imbalanced Data
Po-Cheng Kao, Chih-Cheng Wu, Jung-Chun YehBackground/Objectives: Cardiac surgery involves unique complexities that differ from those of general ICU populations. Traditional scoring systems often underperform due to the significant class imbalance between survival and mortality. This study utilized the MIMIC-IV database, integrating machine learning (ML) and feature engineering to develop an in-hospital mortality prediction model specifically for open-heart surgery patients. Methods: We included 6941 cases (mortality: 76, 1.095%). Sixty-eight variables from the first ICU day were extracted. Following data preprocessing and imputation, four ML models—logistic regression, random forest (RF), XGBoost, and multilayer perceptron (MLP)—were constructed using stratified 10-fold cross-validation. SMOTE was applied to address class imbalance. A streamlined 17-variable model was developed and compared against the Sequential Organ Failure Assessment (SOFA) and the Oxford Acute Severity of Illness Score (OASIS). Results: Among the 68-variable models, RF achieved the highest area under the receiver operating characteristic curve (AUROC) of 0.915 (95% CI, 0.855–0.966). For the 17-variable models, MLP performed best (AUROC: 0.920; 95% CI, 0.865–0.964), significantly outperforming SOFA (0.688) and OASIS (0.690). Regarding the area under the precision-recall curve (AUCPR), the 17-variable MLP also yielded the highest score (0.203; 95% CI, 0.060–0.389) compared with SOFA (0.161) and OASIS (0.046). SHapley Additive exPlanations (SHAP) analysis identified bicarbonate levels, mechanical ventilation, and mean pulmonary arterial pressure as the top predictors, consistent with clinical expectations. Conclusions: The streamlined MLP model significantly outperforms traditional scoring systems and may serve as a useful tool for early postoperative risk stratification after open-heart surgery.