An explainable machine learning pipeline using XGBoost and SHAP to identify factors associated with tuberculosis treatment adherence in a district health center
Tuberculosis (TB) treatment adherence is critical for preventing disease relapse and the emergence of multidrug-resistant strains. Understanding factors associated with non-adherent behavioral profiles can guide targeted counseling interventions, particularly in resource-constrained public health settings. We conducted an exploratory cross-sectional study utilizing survey data from 379 TB outpatients at a district-level medical center. Following the 80/20 split, mode imputation parameters and Boruta feature selection were derived exclusively from the training partition, with training-derived mode values subsequently applied to missing observations in the hold-out test set. SMOTE was applied exclusively to the training data. The performance of an eXtreme Gradient Boosting (XGBoost) classifier was compared against a SMOTE-balanced Logistic Regression baseline on the independent hold-out test set. The proposed XGBoost + SMOTE model achieved an AUC-ROC of 0.768 (95% CI: 0.623-−0.896), a Sensitivity of 47.1% (95% CI: 23.1-−73.3%), and a Specificity of 89.8% (95% CI: 82.0-−96.7%). McNemar’s test ( $$p = 0.4545$$ ) indicated no statistically significant difference in classification performance compared to the SMOTE-balanced Logistic Regression. However, SHAP (SHapley Additive exPlanations) analysis provided deeper interpretable insights, revealing that patients’ comprehension of periodic testing schedules and core treatment principles were most strongly associated with adherence behaviors. By identifying non-linear interactions between sociodemographic factors and specific knowledge deficits, the explainable AI framework maps associative risk profiles. This empowers healthcare workers to precisely target educational gaps and prioritize behavioral interventions, serving as a foundation for future longitudinal predictive systems.
Authors
- Phạm Thị Ngọc Hương
- Nguyễn Thị Tâm (ORCID: https://orcid.org/0000-0002-1685-9640)
- Thị Kim Bằng Nguyễn
- Tran Le Thi Ngoc Thao
- Thị Phụng Nguyễn
- Huynh Thi Phuong (ORCID: https://orcid.org/0009-0009-5059-2124)
- Thân Thị Thu Ba
- Nguyen Quoc Viet (ORCID: https://orcid.org/0009-0001-8679-810X)
- Tran Thi Thuy Trang
- Tran Thu Nguyet
- Tran Thi Anh Loan
- Le Quoc Thinh
Institutions
- Ho Chi Minh City University of Science (VN)
- University of Medicine and Pharmacy at Ho Chi Minh City (VN)
- Trường ĐH Nguyễn Tất Thành (VN)
- Hong Bang International University (VN)
- Oxford University Clinical Research Unit (VN)
- Trường Đại học Gia Định (VN)
- Trường Đại học Khoa học Sức khỏe (VN)
Publication Details
- Journal
- Discover Public Health
- Published
- 2026-10-30
- DOI
- https://doi.org/10.1186/s12982-026-03199-w
- Primary Topic
- Tuberculosis Research and Epidemiology
- Type
- article
- Field-Weighted Citation Impact
- 0.00