Validation of an AI-Driven Sputum Analysis Platform for Accurate and Reliable Tuberculosis Detection in South-Western Uganda
Ziehl-Neelsen (ZN) sputum smear microscopy remains an accessible method for detecting acid-fast bacilli (AFB), but its interpretation is dependent on specimen quality and trained microscopy personnel. Artificial intelligence (AI) may provide a microscopy reading aid that supports consistent identification of AFB-positive and AFB-negative smear images. To evaluate transfer-learning deep learning models for classification of AFB-positive and AFB-negative digitized ZN-stained sputum smear images generated in a Ugan…

In brief
Researchers trained three pretrained deep learning models on 512 archived digitized Ziehl-Neelsen sputum smear images from Mbarara Regional Referral Hospital in south-western Uganda. The images were split evenly between AFB-positive and AFB-negative, and the models were tested on a held-out set of 77 images.
The result points to a possible way to support consistent smear reading where trained microscopy staff and specimen quality limit interpretation. Yet the evidence is early: the test set was small and from one centre, and the labels came from routine microscopy, so the system is not shown to be a stand-alone diagnostic tool.
Main points
- The dataset held 256 AFB-positive and 256 AFB-negative images, split into training (358), validation (77) and test (77) sets.
- Swin Transformer-Tiny reached ROC-AUC 0.9939 on the internal test set.
- DenseNet-121 reached 88.31% accuracy and ResNet-50 V2 reached 85.71% accuracy.
- The authors describe the platform as an AI-assisted reading aid, not an autonomous diagnostic.
The gain
A Swin Transformer-Tiny model separated AFB-positive from AFB-negative Ziehl-Neelsen smear images with 97.40% accuracy on an internal test set, suggesting a possible microscopy reading aid.
The rundown
The study was a retrospective, laboratory-based cross-sectional analysis. ResNet-50 V2, DenseNet-121 and Swin Transformer-Tiny were trained with ImageNet-pretrained weights in PyTorch, and performance was judged by sensitivity, specificity, accuracy, PPV, NPV, F1-score and ROC-AUC, with Wilson 95% confidence intervals for threshold-based metrics.
Swin Transformer-Tiny posted sensitivity of 97.37% and specificity of 97.44%, while DenseNet-121 had sensitivity of 84.21% and specificity of 92.31%. ResNet-50 V2 had sensitivity of 81.58% and specificity of 89.74%, so the transformer model led on every reported measure.
The authors call for prospective, multicentre evaluation with patient or specimen-level separation, independent microbiological reference standards and multiple blinded readers before any clinical deployment.
Sources
- Peer-reviewedMedical Devices: Evidence and Research2026-10-15
ace
The debate