ML-BASED TUBERCULOSIS CLASSIFICATION USING CHEST X-RAYS AND SYNTHETIC CLINICAL FEATURES: A THREE-STAGE COMPUTATIONAL EVALUATION
Keywords:
tuberculosis; chest X‑ray; machine learning; deep learning; DenseNet121; multimodal learning; synthetic clinical data; Grad‑CAM; calibration.Abstract
Chest X-ray (CXR)-based machine‑learning methods may help screen for tuberculosis (TB) and decide who needs further tests. How well they work depends on the mix of data the imbalance between normal and TB cases how the model is trained and how the tests are set up. It is hard to know how useful patient clinical data could be when we do not have real patient‑level records. This study looked at a three‑stage framework that classifies chest X‑rays as Normal or TB. It also studied how synthetic clinical predictors behave when we use clinical data or combine them with images. The Kaggle TB Chest Radiography Database had 4,200 images (3,500 700 TB). We split the data into 70 % train 10 % validation and 20 % test keeping files together using SHA‑256 hashes. Stage 1 compared DenseNet121 EfficientNetB0 and ResNet50 using CXR images. Stage 2 tested Logistic Regression, Random Forest, XGBoost (or a fallback option) and a multilayer perceptron on 18 clinical predictors in both an association scenario and a null‑control scenario. Stage 3 joined each CXR with its encoded feature vector through image and clinical branches that were trained together. All convolutional neural networks started from scratch. Were trained on a CPU only at 96 × 96 pixels. We measured performance with threshold‑dependent metrics, ROC‑AUC, average precision, calibration, uncertainty summaries, Grad‑CAM, ablation experiments and paired bootstrap/permutation tests.In the class‑weighted Stage 1 run DenseNet121 reached 92.13 % accuracy ROC‑AUC 0.948 and average precision 0.855; ResNet50 had the highest TB sensitivity at 88.00 %. In a DenseNet121 class‑weight ablation the unweighted model achieved 97.02 % accuracy, 96.67 % sensitivity ROC‑AUC 0.992 and precision 0.978. In Stage 2 association‑scenario ROC‑AUC values ranged from 0.981 to 0.986 while null‑control values ranged from 0.476 to 0.516. In Stage 3 DenseNet121 achieved 98.93 % accuracy ROC‑AUC 0.994 and average precision 0.986 in the association scenario. Its null‑control ROC‑AUC stayed at 0.992; the difference between association and null was not statistically significant after Holm adjustment. Only ResNet50 showed an adjusted difference between the Stage 3 scenarios. The framework lets us compare image‑only clinical‑only and multimodal setups in a controlled way. The experiments show that models can learn engineered associations in data but they do not prove that real clinical features make TB detection better. We still need paired patient records, patient‑level separation, repeated runs and independent external validation before the models can be trusted for clinical use.


