Ana Cisnal, María Lourdes Ruiz Rebollo, César Flórez-Pardo, Jessica Matesanz-Isabel, Javier Pérez Turiel, Juan Carlos Fraile
Background Acute pancreatitis (AP) progresses to severe forms in about 20 % of cases, leading to high morbidity and mortality. Traditional clinical scoring systems for severity prediction (e.g., Ranson, BISAP), are limited by delayed applicability, and suboptimal diagnostic accuracy. Aims To develop and validate machine learning (ML) models for early prediction of moderately severe and severe acute pancreatitis (MSAP-SAP), and to compare them with conventional scores. Methods A retrospective cohort of 816 patients (2014–2023) was analyzed. ML models were developed using admission (24-hour) and early (48-hour) data. Models were trained and tested using an 80:20 stratified split and evaluated based on ROC-AUC. F-Anova, Mutual Information and SHapley Additive exPlanations (SHAP) were used for feature selection. SHAP was also used for model interpretability. Results The XGBoost model with SHAP-based feature selection (XGB SH ) achieved the highest predictive performance with ROC-AUCs of 0.89 (24-hour) and 0.94 (48-hour) on the test cohort. Key predictive features included SIRS, BUN, CRP, creatinine, and pleural effusion. Compared to Ranson and BISAP (both ROC-AUC = 0.72), the XGB SH models demonstrated superior accuracy and allowed flexible, threshold-based classification. Conclusion The proposed SHAP-enhanced XGBoost model offers a reliable and interpretable tool for early prediction of AP severity, improving clinical decision-making and patient management.