Construction and validation of HBV-ACLF bacterial infection diagnosis model based on machine learning - Neng Wang; Shuai Tao; Liang Chen (BMC Infectious Diseases)
Abstract Objective To develop and validate a novel diagnostic model for detecting bacterial infections in patients with hepatitis B virus-related acute-on-chronic liver failure (HBV-ACLF) using advanced machine learning algorithms. The focus is on improving early clinical identification and interpretability. Methods We conducted a retrospective cohort study involving HBV-ACLF patients diagnosed at the Shanghai Public Health Clinical Center between January 2014 and January 2024. Patients were categorized into two groups: those with bacterial infections and those without, based on clinical assessments and microbiological evidence. Feature selection was performed in two steps: first using univariate logistic regression, followed by multivariate logistic regression with a stringent significance threshold (p < 0.05). We utilized six machine learning algorithms—Extreme Gradient Boosting (XGBoost), Support Vector Machine (SVM), Logistic Regression (LR), K-Nearest Neighbors (KNN), Random Forest (RF), and Decision Tree (DT)—to construct predictive models. The performance of each model was rigorously evaluated using metrics such as the area under the receiver operating characteristic curve (AUC), accuracy, precision, recall, and F1 score, with hyperparameter optimization conducted via grid search. The Shapley Additive Explanations (SHAP) algorithm was employed to analyze the contribution of each feature in the optimal model. Results A total of 1,124 patients with HBV-ACLF were included, and the incidence of bacterial infection was 58.48%. Among them, 786 patients were assigned to the training set, and 338 patients were assigned to the test set. The XGBoost model showed the best overall prediction performance. In the modeling cohort, the XGBoost model had an AUC of 0.940, an accuracy of 0.858, a precision of 0.881, a recall of 0.874, and an F1 score of 0.877. In the validation cohort, the XGBoost model had an AUC of 0.930, an accuracy of 0.840, a sensitivity of 0.887, a recall of 0.833, and an F1 score of 0.859. SHAP analysis revealed a unique characteristic driving the risk of bacterial infection, including apolipoprotein A1, complement C3, D-dimer, C-reactive protein (CRP), total bilirubin (TBIL), and international normalized ratio (INR), which reflected the synergistic effect of markers of inflammation, coagulation, and liver dysfunction. Subgroup analysis of XGBoost found that XGBoost also had good diagnostic performance in patients with HBV-ACLF complicated by ascites and those with HBV-ACLF complicated by SIRS. Conclusion A diagnostic model for bacterial infection in HBV-ACLF was constructed based on the XGBoost method combined with six testing indicators, which facilitates early clinical diagnosis of bacterial infection in HBV-ACLF.