Machine Learning-Based Interpretable Screening for Osteoporosis in Tuberculosis Spondylitis Patients Using Blood Test Data: Development and External Validation of a Novel Web-Based Risk Calculator with Explainable Artificial Intelligence (XAI) - Yasin P; Ding L; Mamat M; Guo W; Song X (Infection and Drug Resistance)
Parhat Yasin,1 Liwen Ding,2 Mardan Mamat,3 Wei Guo,4 Xinghua Song1,5 1Department of Spine Surgery, The Sixth Affiliated Hospital of Xinjiang Medical University, Urumqi, Xinjiang, 830000, People’s Republic of China; 2College of Pediatrics, Xinjiang Medical University, Urumqi, Xinjiang, 830000, People’s Republic of China; 3Department of Spine Surgery, The First Affiliated Hospital of Xinjiang Medical University, Urumqi, Xinjiang, 830000, People’s Republic of China; 4Department of Orthopedic Oncology, People’s Hospital, Peking University, Beijing, 100871, People’s Republic of China; 5The First People’s Hospital of Kashi & Xinjiang Key Laboratory of Artificial Intelligence Assisted Imaging Diagnosis, Kashi, Xinjiang, 844000, People’s Republic of ChinaCorrespondence: Xinghua Song, Email songxinghua19@163.comBackground: Tuberculosis spondylitis (TS), also known as Pott’s disease, is the most common destructive form of musculoskeletal tuberculosis and poses significant clinical challenges, particularly when complicated by osteoporosis. Osteoporosis exacerbates surgical outcomes and increases the risk of complications, making its accurate prediction crucial for effective patient management.Methods: This retrospective study included 906 TS patients from two medical centers between January 2016 and November 2022. We collected demographic information and blood test data from routine examinations. To address class imbalance, the synthetic minority oversampling technique (SMOTE) was applied. Feature selection was performed using LASSO, Boruta, and Recursive Feature Elimination (RFE) to identify key predictors of osteoporosis. Multiple machine learning (ML) algorithms, including logistic regression, random forest, and XGBoost, were trained and optimized using nested cross-validation and hyperparameter tuning. The optimal model was further refined through threshold tuning to enhance performance metrics. Model interpretability was achieved using SHapley Additive exPlanations (SHAP), and an online web application was developed for real-time clinical use.Results: Out of 906 patients, 60 were diagnosed with osteoporosis based on Dual-energy X-ray absorptiometry (DXA) measurements. Feature selection identified hemoglobin (HB), estimated glomerular filtration rate (eGFR), and cystatin C (CYS_C) as significant predictors. The logistic regression model exhibited the highest performance with an area under the receiver operating characteristic curve (AUC) of 0.826, which was externally validated with an AUC of 0.796. Threshold tuning optimized the decision threshold to 0.32, improving the F1-score and balancing sensitivity and specificity. SHAP analysis highlighted the critical roles of HB, eGFR, and CYS_C in osteoporosis prediction. The developed web application facilitates the model’s integration into clinical workflows, enabling healthcare professionals to make informed decisions at the bedside.Conclusion: This study successfully developed and validated an ML-based tool for predicting osteoporosis in TS patients using readily available clinical data. The model demonstrated robust predictive performance and was effectively integrated into a user-friendly online application, offering a practical solution to enhance surgical decision-making and improve patient outcomes in real-time clinical settings.Keywords: tuberculosis spondylitis, osteoporosis, machine learning, threshold tuning, logistic regression