Automated Detection and Grading of Tuberculosis Bacilli in Ziehl Neelsen-Stained Sputum Using YOLO with IUATLD-Based Classification
Abstract
Tuberculosis (TB) remains one of the most pressing global health challenges, particularly in low- and middle-income countries, where diagnostic capacity is often limited. Accurate and efficient detection of Mycobacterium tuberculosis bacilli in sputum smear samples stained with Ziehl-Neelsen remains the cornerstone of TB diagnosis. However, conventional microscopic examination is inherently labor-intensive, subject to interobserver variability and prone to human error, leading to inconsistent diagnostic outcomes. Addressing these limitations, this study proposes the development of an automated bacilli detection and quantification system utilizing the YOLO (You Only Look Once) object detection framework, specifically the YOLOv8 architecture, to improve diagnostic accuracy, consistency, and efficiency in TB identification. The research methodology encompasses image acquisition of Ziehl Neelsen-stained sputum samples from the Microbiology Laboratory of Universitas Airlangga Hospital (RSUA) and publicly available repositories, followed by meticulous annotation using Roboflow. The annotated dataset was employed to train the YOLOv8 model, and performance was evaluated through key metrics, including accuracy, precision, and error rate. The developed model achieved an overall accuracy of 73.33%, with class-wise accuracies of 100% for BTA 1+, 80% for BTA 2+, and 40% for BTA 3+ categories, conforming to IUATLD classification standards. The suboptimal performance observed in the BTA 3+ category was attributed to discrepancies in Field of View (FOV) alignment between the microscope’s ocular lens and the attached digital camera, affecting image consistency. Despite this limitation, the results demonstrate the potential of YOLO-based automated detection systems to reduce dependence on manual analysis, enhance diagnostic objectivity, and accelerate TB screening workflows. Future work should prioritize hardware calibration, particularly FOV synchronization, and dataset diversification to further refine model performance and clinical applicability. The proposed approach represents a significant step towards scalable, rapid, and reliable TB diagnosis, with implications for broader adoption in resource-constrained healthcare environments.
Downloads
References
R. Rulaningtyas, A. B. Suksmono, and T. L. R. Mengko, “Automatic classification of tuberculosis bacteria using neural network,” Proc. 2011 Int. Conf. Electr. Eng. Informatics, ICEEI 2011, no. July, pp. 17–20, 2011, doi: 10.1109/ICEEI.2011.6021502.
R. Rulaningtyas, A. B. Suksmono, T. L. R. Mengko, and P. Saptawati, “Identification of mycobacterium tuberculosis in sputum smear slide using automatic scanning microscope,” AIP Conf. Proc., vol. 1656, 2015, doi: 10.1063/1.4917142.
Y. Akram et al., “Biochemical profiling of tuberculosis patients co-infected with hepatitis C virus,” 2017, doi: 10.1177/1721727X16688697.
L. An, K. Peng, X. Yang, P. Feng, and P. Huang, “Automated Detection of Tuberculosis Bacilli Using Deep Neural Networks with Sputum Smear Images,” in 2022 5th International Conference on Pattern Recognition and Artificial Intelligence (PRAI), IEEE, Aug. 2022, pp. 1040–1045. doi: 10.1109/PRAI55851.2022.9904085.
M. G. F. Costa, C. F. F. C. Filho, A. Kimura, P. C. Levy, C. M. Xavier, and L. B. Fujimoto, “A sputum smear microscopy image database for automatic bacilli detection in conventional microscopy,” 2014 36th Annu. Int. Conf. IEEE Eng. Med. Biol. Soc. EMBC 2014, pp. 2841–2844, 2014, doi: 10.1109/EMBC.2014.6944215.
World Health Organization, Global Tuberculosis Report 2023. 2023. [Online]. Available: https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2023
R. Khutlang, S. Krishnan, A. Whitelaw, and T. S. Douglas, “Detection of tuberculosis in sputum smear images using two one-class classifiers,” Proc. - 2009 IEEE Int. Symp. Biomed. Imaging From Nano to Macro, ISBI 2009, pp. 1007–1010, 2009, doi: 10.1109/ISBI.2009.5193225.
M. K. Osman, M. Y. Mashor, and H. Jaafar, “Detection of mycobacterium tuberculosis in Ziehl-Neelsen stained tissue images using Zernike moments and hybrid multilayered perceptron network,” Conf. Proc. - IEEE Int. Conf. Syst. Man Cybern., pp. 4049–4055, 2010, doi: 10.1109/ICSMC.2010.5642191.
A. Fandriyanto, N. P. Utama, and D. Danudirdjo, “Development of AI-Based Field-Of-View Scanning Microscope for Automatic Detection of Tuberculosis,” in 2024 7th International Conference on Informatics and Computational Sciences (ICICoS), 2024, pp. 267–272. doi: 10.1109/ICICoS62600.2024.10636910.
C. F. F. C. Filho, M. G. F. Costa, and A. K. Júnior, “Autofocus functions for tuberculosis diagnosis with conventional sputum smear microscopy,” pp. 13–20, 2012.
R. O. Panicker, K. S. Kalmady, J. Rajan, and M. K. Sabu, “Automatic detection of tuberculosis bacilli from microscopic sputum smear images using deep learning methods,” Biocybern. Biomed. Eng., vol. 38, no. 3, pp. 691–699, 2018, doi: 10.1016/j.bbe.2018.05.007.
K. S. Mithra and W. R. Sam Emmanuel, “Automatic Methods for Mycobacterium Detection on Stained Sputum Smear Images: a Survey,” Pattern Recognit. Image Anal., vol. 28, no. 2, pp. 310–320, 2018, doi: 10.1134/S105466181802013X.
K. Veropoulos, C. Campbell, and J. Simpson, “The Automated Identification of Tubercle Bacilli using Image Processing and Neural Computing Techniques”.
R. O. Panicker, B. Soman, G. Saini, and J. Rajan, “A Review of Automatic Methods Based on Image Processing Techniques for Tuberculosis Detection from Microscopic Sputum Smear Images,” 2016, doi: 10.1007/s10916-015-0388-y.
M. Bhalla, Z. Sidiq, P. P. Sharma, R. Singhal, and V. P. Myneedu, “Performance of light-emitting diode fluorescence microscope for diagnosis of tuberculosis,” Int. J. Mycobacteriology, vol. 2, no. 3, pp. 174–178, 2013, doi: 10.1016/j.ijmyco.2013.05.001.
T. F. Mota Carvalho et al., “A systematic review and repeatability study on the use of deep learning for classifying and detecting tuberculosis bacilli in microscopic images,” Prog. Biophys. Mol. Biol., vol. 180–181, no. April, pp. 1–18, 2023, doi: 10.1016/j.pbiomolbio.2023.03.002.
A. Rachmacl, N. Chamidah, and R. Rulaningtyas, “Classification of mycobacterium tuberculosis based on color feature extraction using adaptive boosting method,” AIP Conf. Proc., vol. 2329, no. February, 2021, doi: 10.1063/5.0042283.
K. S. Mithra and W. R. Sam Emmanuel, “GFNN: Gaussian-Fuzzy-Neural network for diagnosis of tuberculosis using sputum smear microscopic images,” J. King Saud Univ. - Comput. Inf. Sci., vol. 33, no. 9, pp. 1084–1095, 2021, doi: 10.1016/j.jksuci.2018.08.004.
B. Lv and H. Lan, “Improved YOLOv5-based detection model for Mycobacterium,” 2023 IEEE 7th Inf. Technol. Mechatronics Eng. Conf., vol. 7, pp. 1360–1364, 2023, doi: 10.1109/ITOEC57671.2023.10291703.
J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You Only Look Once: Unified, Real-Time Object Detection,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, Jun. 2016, pp. 779–788. doi: 10.1109/CVPR.2016.91.
Y. Li, C. Zhou, J. Wan, and B. Wang, “Detection of Tubercle Bacilli by Fusion with YOLOv5s and ESRGAN,” Proc. 2023 IEEE 3rd Int. Conf. Inf. Technol. Big Data Artif. Intell. ICIBA 2023, vol. 3, no. Iciba, pp. 659–663, 2023, doi: 10.1109/ICIBA56860.2023.10165501.
C. Liang, Z. Zhang, X. Zhou, B. Li, S. Zhu, and W. Hu, “Rethinking the Competition Between Detection and ReID in Multiobject Tracking,” IEEE Trans. Image Process., vol. 31, pp. 3182–3196, 2022, doi: 10.1109/TIP.2022.3165376.
M. L. Ali and Z. Zhang, “The YOLO Framework: A Comprehensive Review of Evolution, Applications, and Benchmarks in Object Detection,” Computers, vol. 13, p. 336, 2024, doi: 10.3390/computers13120336.
A. Awad and S. A. Aly, “Early Diagnosis of Acute Lymphoblastic Leukemia Using YOLOv8 and YOLOv11 Deep Learning Models,” 2024, [Online]. Available: https://arxiv.org/pdf/2410.10701
Y. Luo, Y. Du, Z. Wang, J. Mo, W. Yu, and S. Dou, “DScanNet: Packaging Defect Detection Algorithm Based on Selective State Space Models,” Algorithms, vol. 18, no. 6, p. 370, 2025, doi: 10.3390/a18060370.
W. Haolin, “CSDN: A Context-Gated Self-Adaptive Detection Network for Real-Time Object Detection,” 2025, [Online]. Available: http://arxiv.org/abs/2506.17679
H. Chen, G. Zhou, and H. Jiang, “Student Behavior Detection in the Classroom Based on Improved YOLOv8,” 2023.
R. Sapkota, Z. Meng, M. Churuvija, X. Du, Z. Ma, and M. Karkee, “Comprehensive performance evaluation of yolov12, yolo11, yolov10, yolov9 and yolov8 on detecting and counting fruitlet in complex orchard environments,” arXiv Prepr. arXiv2407.12040, 2024.
M. Tiwari, M. Patankar, V. Chaurasia, M. Shandilya, A. Kumar, and A. Potnis, “Detection of Tuberculosis Bacilli Using Deep Learning,” 1st IEEE Int. Conf. Innov. High Speed Commun. Signal Process. IHCSP 2023, pp. 492–496, 2023, doi: 10.1109/IHCSP56702.2023.10127220.
S. Aulia, A. B. Suksmono, T. R. Mengko, and B. Alisjahbana, “A Novel Digitized Microscopic Images of ZN-Stained Sputum Smear and Its Classification Based on IUATLD Grades,” IEEE Access, vol. 12, pp. 51364–51380, 2024, doi: 10.1109/ACCESS.2024.3386208.
H. A. Devon et al., “A psychometric toolbox for testing validity and reliability,” J. Nurs. Scholarsh., vol. 39, no. 2, pp. 155–164, 2007, doi: 10.1111/j.1547-5069.2007.00161.x.
Detection TB, “Tuberculosis 2 Dataset,” Roboflow Universe.
G. Jun et al., “A Novel real-time arrhythmia detection model using YOLOv8,” pp. 1–17.
D. Grantor, “Application of Computer Vision for Underwater Litter Detection APPLICATION OF COMPUTER VISION FOR UNDERWATER LITTER DETECTION MASTER ’ S THESIS,” 2025.
R.-W. Bello, P. A. Owolawi, E. A. van Wyk, and C. Tu, “Object Detection Algorithms for Digital Imaging Applications: A Review,” Image Sensors - Digit. Imaging Syst. Appl. [Working Title], no. Cv, 2025, doi: 10.5772/intechopen.1010205.
M. Lei et al., “SoftHGNN: Soft Hypergraph Neural Networks for General Visual Recognition,” pp. 1–13, 2025, [Online]. Available: http://arxiv.org/abs/2505.15325
Y. Li et al., “Lite-YOLOv8: a more lightweight algorithm for Tubercle Bacilli detection,” Med. Biol. Eng. Comput., vol. 63, no. 1, pp. 195–211, 2025, doi: 10.1007/s11517-024-03187-9.
S. Gupta, R. Jindal, C. L. Biji, and J. Dheeba, “Enhanced Tuberculosis Detection Using Deep Neural Network on Microscopic Images,” in Fifth Congress on Intelligent Systems, S. Kumar, E. A. Mary Anita, J. H. Kim, and A. Nagar, Eds., Singapore: Springer Nature Singapore, 2025, pp. 173–188.
R. Y. Ju and W. Cai, “Fracture detection in pediatric wrist trauma X-ray images using YOLOv8 algorithm,” Sci. Rep., vol. 13, no. 1, pp. 1–15, 2023, doi: 10.1038/s41598-023-47460-7.
X. Li et al., “Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection,” in Advances in Neural Information Processing Systems, 2020, pp. 1–14.
R. Blakemore et al., “A multisite assessment of the quantitative capabilities of the Xpert MTB/RIF assay.,” Am. J. Respir. Crit. Care Med., vol. 184, no. 9, pp. 1076–1084, Nov. 2011, doi: 10.1164/rccm.201103-0536OC.
A. B. Witarto et al., “AI-Based Analysis of Ziehl-Neelsen-Stained Sputum Smears for Mycobacterium tuberculosis as a Screening Method for Active Tuberculosis.,” Life (Basel, Switzerland), vol. 14, no. 11, Nov. 2024, doi: 10.3390/life14111418.
A. W. Setiawan and M. I. Rusydi, “Detection of Mycobacterium Tuberculosis Using Residual Neural Network,” 2022 Int. Semin. Intell. Technol. Its Appl. Adv. Innov. Electr. Syst. Humanit. ISITIA 2022 - Proceeding, pp. 7–11, 2022, doi: 10.1109/ISITIA56226.2022.9855300.
S. Aulia, A. B. Suksmono, T. R. Mengko, and B. Alisjahbana, “A Novel Digitized Microscopic Images of ZN-Stained Sputum Smear and Its Classification Based on IUATLD Grades,” IEEE Access, vol. 12, pp. 51364–51380, 2024, doi: 10.1109/ACCESS.2024.3386208.
Copyright (c) 2026 Syevana Dita Musvika, Riries Rulaningtyas , Khusnul Ain , Pepy Dwi Endraswari, Annie Anak Joseph

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlikel 4.0 International (CC BY-SA 4.0) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).


.png)
.png)
.png)
.png)
.png)