Abstract
Infected pancreatic necrosis (IPN) is a life-threatening complication of acute pancreatitis (AP), and its early prediction remains challenging. This study aimed to develop and externally validate interpretable machine learning models for individualized IPN risk prediction. A total of 728 patients with AP admitted to Xuanwu Hospital, Capital Medical University, between 2017 and 2023 were retrospectively analyzed. Embedded feature selection was incorporated within model training using regularized linear and tree-based algorithms to enhance interpretability and prevent overfitting. Five machine learning algorithms and one neural network model were evaluated through nested cross-validation and an independent temporal external cohort consisting of 166 AP patients admitted to Xuanwu Hospital, Capital Medical University, between 2022 and 2023. Model discrimination, precision–recall, and probability calibration were assessed, and model explainability was analyzed using Shapley Additive Explanations (SHAP). The Random Forest model achieved the best overall performance, achieving an external AUC of 0.764 (95% CI 0.696–0.830, \(P < 0.001\)), precision of 0.893, recall of 0.604, and the lowest Brier score, indicating reliable probability calibration. SHAP analysis identified Fibrinogen, APACHE II score, D-dimer, IL-6, and C-reactive protein as key predictors associated with increased IPN risk, while higher Lymphocyte count, and Hematocrit were protective. These findings are consistent clinical pathophysiology. The interpretable Random Forest model demonstrated robust discrimination and calibration for IPN prediction, providing a transparent and data-driven framework for early risk stratification in acute pancreatitis. Prospective multicenter validation is warranted before clinical implementation.
Similar content being viewed by others
Data availability
The datasets generated and/or analyzed during the current study are not publicly available due to institutional data use policies but are available from the corresponding author on reasonable request.
Abbreviations
- AP:
-
Acute pancreatitis
- IPN:
-
Infected pancreatic necrosis
- BISAP:
-
Bedside index for severity in acute pancreatitis
- MCTSI:
-
Modified computed tomography severity index
- APACHE II:
-
Acute physiology and chronic health evaluation II
- PASS:
-
Pancreatitis activity scoring system
- CSSS:
-
Chinese simple severity score
- ML:
-
Machine learning
- DL:
-
Deep learning
- LR:
-
Logistic regression
- FCNN:
-
Fully connected neural network
- XGB:
-
Extreme gradient boosting
- SAP:
-
Severe acute pancreatitis
- XAI:
-
Explainable artificial intelligence
- SHAP:
-
Shapley additive explanations
- RF:
-
Random forest
- LDA:
-
Linear discriminant analysis
- ANN:
-
Artificial neural network
- LIME:
-
Local interpretable model-agnostic explanations
- ICE:
-
Individual conditional expectation
- CT:
-
Computed tomography
- GBM:
-
Gradient boosting machine
- SVM:
-
Support vector machine
- ROC-AUC:
-
Area under the receiver operating characteristic curve
- PR:
-
Precision–recall
- ROC:
-
Receiver operating characteristic
- Neut:
-
Neutrophil count
- INR:
-
International normalized ratio
References
Peery, A. F. et al. Burden of gastrointestinal disease in the United States: 2012 update. Gastroenterology143, 1179-1187.e3. https://doi.org/10.1053/j.gastro.2012.08.002 (2012).
Garg, S. K. et al. Incidence, admission rates, and economic burden of adult emergency visits for chronic pancreatitis: Data from the National Emergency Department Sample, 2006 to 2012. J. Clin. Gastroenterol. 53, e328–e333. https://doi.org/10.1097/MCG.0000000000001096 (2019).
Banks, P. A. et al. Classification of acute pancreatitis-2012: Revision of the Atlanta classification and definitions by international consensus. Gut 62, 102–111. https://doi.org/10.1136/gutjnl-2012-302779 (2013).
Shah, J., Fernandez Y Viesca, M., Jagodzinski, R. & Arvanitakis, M. Infected pancreatic necrosis-current trends in management. Indian J. Gastroenterol.43, 578–591. https://doi.org/10.1007/s12664-023-01506-w (2024).
de-Madaria, E. & Buxbaum, J. L. Advances in the management of acute pancreatitis. Nat. Rev. Gastroenterol. Hepatol.20, 691–692. https://doi.org/10.1038/s41575-023-00808-w (2023).
Kumar, A. H. & Griwan, M. S. A comparison of APACHE II, BISAP, Ranson’s score and modified CTSI in predicting the severity of acute pancreatitis based on the 2012 revised Atlanta classification. Gastroenterol. Rep. 6, 127–131. https://doi.org/10.1093/gastro/gox029 (2018).
Gao, W., Yang, H. X. & Ma, C. E. The value of BISAP score for predicting mortality and severity in acute pancreatitis: A systematic review and meta-analysis. PLoS One 10, e0130412. https://doi.org/10.1371/journal.pone.0130412 (2015).
Alberti, P. et al. Evaluation of the modified computed tomography severity index (MCTSI) and computed tomography severity index (CTSI) in predicting severity and clinical outcomes in acute pancreatitis. J. Dig. Dis. 22, 41–48. https://doi.org/10.1111/1751-2980.12961 (2021).
Knaus, W. A., Draper, E. A., Wagner, D. P. & Zimmerman, J. E. APACHE II: A severity of disease classification system. Crit. Care Med. 13, 818–829 (1985).
Mao, W. et al. Prediction of infected pancreatic necrosis in acute necrotizing pancreatitis by the modified pancreatitis activity scoring system. United Eur. Gastroenterol. J. 11, 69–78. https://doi.org/10.1002/ueg2.12353 (2023).
Wang, L. et al. A simple new scoring system for predicting the mortality of severe acute pancreatitis: A retrospective clinical study. Medicine(Baltimore) 99, e20646. https://doi.org/10.1097/MD.0000000000020646 (2020).
Sadr, H. et al. Unveiling the potential of artificial intelligence in revolutionizing disease diagnosis and prediction: A comprehensive review of machine learning and deep learning approaches. Eur. J. Med. Res. 30, 418. https://doi.org/10.1186/s40001-025-02680-7 (2025).
Thapa, R. et al. Early prediction of severe acute pancreatitis using machine learning. Pancreatology 22, 43–50. https://doi.org/10.1016/j.pan.2021.10.003 (2022).
Das, K. et al. Optimized feature-driven dengue diagnosis using explainable machine learning approaches. In Proceeding International Conference Quantum Photonics, Artificial Intelligence, and Networking (QPAIN), Rangpur, Bangladesh,1–6 (2025).https://doi.org/10.1109/QPAIN66474.2025.11171726
Mamun, M., Hussain, M. I., Ali, M. S., Alam Chowdhury, M. S., Chowdhury, S. H. & Hossain, M. M. An explainable ensemble learning framework with feature optimization for accurate maternal health risk prediction. In Proceeding International Conference Quantum Photonics, Artificial Intelligence, and Networking (QPAIN), Rangpur, Bangladesh, 1–6 (2025). https://doi.org/10.1109/QPAIN66474.2025.11172243
Chowdhury, S. H. et al. Hepatitis C detection from blood donor data using hybrid deep feature synthesis and interpretable machine learning. In Proceeding 2nd International Conference Next-Generation Computing, IoT and Machine Learning (NCIM), Gazipur, Bangladesh, 1–6 (2025). https://doi.org/10.1109/NCIM65934.2025.11160156
Mamun, M., Chowdhury, S. H., Hossain, M. M., Khatun, M. R. & Iqbal, S. Explainability-enhanced liver disease diagnosis technique using tree selection and stacking ensemble-based random forest model. Inform. Health 2, 17–40. https://doi.org/10.1016/j.infoh.2025.01.001 (2025).
Chowdhury, S. H. et al. An ensemble approach for artificial neural network-based liver disease identification from optimal features through hybrid modeling integrated with advanced explainable AI. Medinformatics 2, 107–119. https://doi.org/10.47852/bonviewMEDIN52024744 (2025).
Párniczky, A. et al. International association of Pancreatology revised guidelines on acute pancreatitis 2025: Supported and endorsed by the American pancreatic association, European Pancreatic Club, Indian Pancreas Club, and Japan Pancreas Society. Pancreatology 25(6), 770–814. https://doi.org/10.1016/j.pan.2025.04.020 (2025).
Wiese, M. L. et al. Identification of early predictors for infected necrosis in acute pancreatitis. BMC Gastroenterol. 22, 405. https://doi.org/10.1186/s12876-022-02490-9 (2022).
Muhammad, D. & Bendechache, M. Unveiling the black box: A systematic review of explainable artificial intelligence in medical image analysis. Comput. Struct. Biotechnol. J. 24, 542–560. https://doi.org/10.1016/j.csbj.2024.08.005 (2024).
Zhang, H. et al. Tree-based ensemble machine learning models in the prediction of acute respiratory distress syndrome following cardiac surgery: a multicenter cohort study. J. Transl. Med. 22, 772. https://doi.org/10.1186/s12967-024-05395-1 (2024).
Shakeri, E. et al. Explaining eye diseases detected by machine learning using SHAP: A case study of diabetic retinopathy and choroidal nevus. SN Comput. Sci. 4, 433. https://doi.org/10.1007/s42979-023-01859-1 (2023).
Rao, S., Mehta, S., Kulkarni, S., Dalvi, H., Katre, N. & Narvekar, M. A study of LIME and SHAP model explainers for autonomous disease predictions. In Proceeding IEEE Bombay Section Signature Conference (IBSSC), Mumbai, India, 1–6 (2022). https://doi.org/10.1109/IBSSC56953.2022.10037324
Sahu, B. et al. Severity assessment of acute pancreatitis using CT severity index and modified CT severity index: Correlation with clinical outcomes and severity grading as per the Revised Atlanta classification. Indian J. Radiol. Imaging 27, 152–160. https://doi.org/10.4103/ijri.IJRI_300_16 (2017).
Wan, J. et al. Serum D-dimer levels at admission for prediction of outcomes in acute pancreatitis. BMC Gastroenterol. 19, 67. https://doi.org/10.1186/s12876-019-0989-x (2019).
Funding
This work was financially supported by two grants: the Hebei Natural Science Foundation (Grant No. H2024112019) and the S&T Program of Xiongan New Area (Grant No. XA202401102001K).
Author information
Authors and Affiliations
Contributions
Xin Li was responsible for code implementation, data preprocessing, model optimization, manuscript writing, and submission. Yixuan Ding contributed to clinical data collection, assisted with data preprocessing, and participated in manuscript revision and polishing. Bohan Huang participated in data collection, developed inclusion criteria, and contributed to data processing. Yunheng Shen assisted with early-stage code development and model debugging. Hairong Lv supported model tuning and performance optimization. Feng Cao provided clinical supervision, contributed to the study design, and revised the manuscript. Tong Yu polished the manuscript and contributed to language refinement. Fei Li, Xiaolu Fei, and Jia Li served as corresponding authors, supervised the overall project, and provided critical revision of the manuscript. All authors read and approved the final manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare that they have no competing interests.
Ethical approval and consent to participate
This retrospective study was approved by the Ethics Committee of Xuanwu Hospital, Capital Medical University (Approval No.: XA Lin Yan Shen [KS2025] 002-001). The study used pre-existing, fully anonymized clinical data; therefore, the requirement for individual informed consent was waived by the ethics committee.
Consent for publication
Not applicable.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Xin, L., Yixuan, D., Bohan, H. et al. Predicting infected pancreatic necrosis in acute pancreatitis using machine learning models and feature selection. Sci Rep (2026). https://doi.org/10.1038/s41598-026-38410-0
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-026-38410-0


