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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

An explainable machine learning pipeline using XGBoost and SHAP to identify factors associated with tuberculosis treatment adherence in a district health center

Phạm Thị Ngọc Hương, Nguyễn Thị Tâm, Thị Kim Bằng Nguyễn, Tran Le Thi Ngoc Thao et al.
3 links
Discover Public Health
Tuberculosis Research and Epidemiology
article

An explainable machine learning pipeline using XGBoost and SHAP to identify factors associated with tuberculosis treatment adherence in a district health center

Phạm Thị Ngọc Hương, Nguyễn Thị Tâm, Thị Kim Bằng Nguyễn, Tran Le Thi Ngoc Thao, Thị Phụng Nguyễn, Huynh Thi Phuong, Thân Thị Thu Ba, Nguyen Quoc Viet, Tran Thi Thuy Trang, Tran Thu Nguyet, Tran Thi Anh Loan, Le Quoc Thinh
article en

Abstract

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.

Discover Public HealthVol. 23(1)
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)
Good health and well-being, Reduced inequalities
Openalex Percentile: Top 12%
Tuberculosis Research and Epidemiology
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon