Classification and Counting of Mycobacterium Tuberculosis using YOLOv5
Downloads
Background: Indonesia is a nation with the third-highest number of tuberculosis (TB) cases worldwide, after China and India. TB detection has been facilitated using YOLOv5 deep learning framework despite previous studies not having incorporated assessment metrics recommended by International Union Against Tuberculosis and Lung Disease (IUATLD).
Objective: This study aims to present a method for classifying and enumerating Mycobacterium tuberculosis by using YOLOv5 architecture with IUATLD evaluation standards. Sputum samples served as the primary medium for identifying the presence of Mycobacterium tuberculosis. In addition, the method showed precise delineation of bacterial boundaries to minimize classification inaccuracies and improve edge clarity through YOLOv5.
Methods: Following the acquisition of microscopic images of TB, the data were resized from 1632x1442 to 640x480 pixels. Annotation was performed using YOLOv5 bounding boxes, and the model was subsequently trained as well as tested according to IUATLD guidelines.
Results: During the analysis, YOLOv5-based classification system produced optimal performance. The model achieved 84.74% accuracy, 87.31% precision, and Mean Average Precision (mAP) score of 84.98%. These metrics showed high reliability in identifying Mycobacterium tuberculosis in the image dataset.
Conclusion: The classification and quantification of Mycobacterium tuberculosis using YOLOv5 framework shows high precision, with mAP score of 84.98%, signifying strong model performance. Additionally, the counting process achieves a MAPE (Mean Absolute Percentage Error) of 0.15%, reflecting excellent prediction accuracy.
Keywords: IUATLD, Tuberculosis, YOLOv5.
[1] C. B. Kartasasmita, “Epidemiologi Tuberkulosis,” Sari Pediatri, vol. 11, no. 2, p. 124, Nov. 2016, doi: 10.14238/sp11.2.2009.124-9.
[2] Abigail Wright and Matteo Zignol, “Anti-Tuberculosis Drug Resistance in the World: Fourth Global Report : The Who/Iuatld Global Project on Anti-Tuberculosis Drug Resistance Surveillance,” 2009.
[3] Indonesian Ministry of Health, “Profil Kesehatan Indonesia 2022 ,” 2023.
[4] WHO, “Global Tuberculosis Report 2024,” 2024.
[5] Kementerian Kesehatan RI, “GERMAS Gerakan Masyarakat Hidup Sehat,” 2017.
[6] Erlina Burhan, Pedoman Nasional Pelayanan Kedokteran Tata Laksana Tuberkulosis. Kemenkes RI, 2020.
[7] D. Collins, F. Hafidz, and D. Mustikawati, “The economic burden of tuberculosis in Indonesia,” The International Journal of Tuberculosis and Lung Disease, vol. 21, no. 9, pp. 1041–1048, Sep. 2017, doi: 10.5588/ijtld.16.0898.
[8] N. Chamidah, Y. S. Yonani, E. Ana, and B. Lestari, “Identification the number of Mycobacterium tuberculosis based on sputum image using local linear estimator,” Bulletin of Electrical Engineering and Informatics, vol. 9, no. 5, pp. 2109–2116, Oct. 2020, doi: 10.11591/eei.v9i5.2021.
[9] K. K. Chopra and S. Singh, “Tuberculosis: Newer diagnostic tests: Applications and limitations,” Indian Journal of Tuberculosis, vol. 67, no. 4, pp. S86–S90, Dec. 2020, doi: 10.1016/j.ijtb.2020.09.025.
[10] T. Venkatappa et al., “Association of Mycobacterium tuberculosis infection test results with risk factors for tuberculosis transmission,” J Clin Tuberc Other Mycobact Dis, vol. 33, p. 100386, Dec. 2023, doi: 10.1016/j.jctube.2023.100386.
[11] T. N. Susilawati and R. Larasati, “A recent update of the diagnostic methods for tuberculosis and their applicability in Indonesia: a narrative review,” Medical Journal of Indonesia, vol. 28, no. 3, pp. 284–91, Oct. 2019, doi: 10.13181/mji.v28i3.2589.
[12] Nia Saurina, Nur Chamidah, Riries Rulaningtyas, and Aryati Aryati, “Improved GrabCut Algorithm for Classify Mycobacterium Tuberculosis,” Universitas Respati Yogyakarta, 2025.
[13] K. M. Tamez-Torres et al., “Mycobacterium tuberculosis complex bacteremia among HIV and non-HIV patients in a Mexican tertiary care center,” The Brazilian Journal of Infectious Diseases, vol. 22, no. 5, pp. 387–391, Sep. 2018, doi: 10.1016/j.bjid.2018.10.274.
[14] 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.
[15] N. Saurina, N. Chamidah, R. Rulaningtyas, and A. Aryati, “Multimodal deep learning from sputum image segmentation to classify <em>Mycobacterium tuberculosis</em> using IUATLD assessment,” Bulletin of Electrical Engineering and Informatics, vol. 14, no. 2, pp. 1579–1590, Apr. 2025, doi: 10.11591/eei.v14i2.9250.
[16] W. Wu et al., “Application of local fully Convolutional Neural Network combined with YOLO v5 algorithm in small target detection of remote sensing image,” PLoS One, vol. 16, no. 10, p. e0259283, Oct. 2021, doi: 10.1371/journal.pone.0259283.
[17] Y. Li, M. Ni, and Y. Lu, “Insulator defect detection for power grid based on light correction enhancement and YOLOv5 model,” Energy Reports, vol. 8, pp. 807–814, Nov. 2022, doi: 10.1016/j.egyr.2022.08.027.
[18] J. Wu, L. Su, Z. Lin, Y. Chen, J. Ji, and T. Li, “Object Detection of Flexible Objects with Arbitrary Orientation Based on Rotation-Adaptive YOLOv5,” Sensors, vol. 23, no. 10, p. 4925, May 2023, doi: 10.3390/s23104925.
[19] R. Bista et al., “Advancing Tuberculosis Detection in Chest X-rays: A YOLOv7-Based Approach,” Information, vol. 14, no. 12, p. 655, Dec. 2023, doi: 10.3390/info14120655.
[20] A. Khalfaoui, A. Badri, and I. EL Mourabit, “Comparative study of YOLOv3 and YOLOv5’s performances for real-time person detection,” in 2022 2nd International Conference on Innovative Research in Applied Science, Engineering and Technology (IRASET), IEEE, Mar. 2022, pp. 1–5. doi: 10.1109/IRASET52964.2022.9737924.
[21] Cinantya Paramita, Catur Supriyanto, Amalia, and Khalivio Rahmyanto Putra, “Comparative Analysis of YOLOv5 and YOLOv8 Cigarette Detection in Social Media Content,” Scientific Journal of Informatics, vol. 11, no. 2, pp. 341–352, May 2024, doi: 10.15294/sji.v11i2.2808.
[22] L.-D. Quach, K. N. Quoc, A. N. Quynh, and H. T. Ngoc, “Evaluating the Effectiveness of YOLO Models in Different Sized Object Detection and Feature-Based Classification of Small Objects,” Journal of Advances in Information Technology, vol. 14, no. 5, pp. 907–917, 2023, doi: 10.12720/jait.14.5.907-917.
[23] D. Reis, J. Kupec, J. Hong, and A. Daoudi, “Real-Time Flying Object Detection with YOLOv8,” May 2024.
[24] A. K. Rozi, “Evaluation of Implementation of Occupational Health Safety Management System (OHSMS) in PT. X, Magetan, East Java,” in Proceedings of the 2nd International Conference Postgraduate School, SCITEPRESS - Science and Technology Publications, 2018, pp. 550–555. doi: 10.5220/0007546805500555.
[25] J. Terven, D.-M. Córdova-Esparza, and J.-A. Romero-González, “A Comprehensive Review of YOLO Architectures in Computer Vision: From YOLOv1 to YOLOv8 and YOLO-NAS,” Mach Learn Knowl Extr, vol. 5, no. 4, pp. 1680–1716, Nov. 2023, doi: 10.3390/make5040083.
[26] Z. Z. Qin et al., “Can artificial intelligence (AI) be used to accurately detect tuberculosis (TB) from chest X-rays? An evaluation of five AI products for TB screening and triaging in a high TB burden setting,” May 2021.
[27] Tetsuya Asakawa, Riku Tsuneda, Kazuki Shimizu, Takuyuki Komoda, and Masaki Aono, “Caverns Detection and Caverns Report in Tuberculosis: lesion detection based on image using YOLO-V3 and median based multi-label multi-class classification using SRGAN,”
[28] A. N.S., S. D., and R. K. S., “Naive Bayesian fusion based deep learning networks for multisegmented classification of fishes in aquaculture industries,” Ecol Inform, vol. 61, p. 101248, Mar. 2021, doi: 10.1016/j.ecoinf.2021.101248.
[29] J. Wang et al., “Research on Improved YOLOv5 for Low-Light Environment Object Detection,” Electronics (Basel), vol. 12, no. 14, p. 3089, Jul. 2023, doi: 10.3390/electronics12143089.
[30] A. Khalfaoui, A. Badri, and I. El Mourabit, “An improved YOLOv5 for real-time human detection in infrared images,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 32, no. 2, p. 1078, Nov. 2023, doi: 10.11591/ijeecs.v32.i2.pp1078-1085.
[31] Z. Mustafa and H. Nsour, “Using Computer Vision Techniques to Automatically Detect Abnormalities in Chest X-rays,” Diagnostics, vol. 13, no. 18, p. 2979, Sep. 2023, doi: 10.3390/diagnostics13182979.
[32] G. Fekadu, Y. Wang, and J. H. S. You, “Standard diagnostics with and without urine-based lipoarabinomannan testing for tuberculosis disease in HIV-infected patients in a high-burden setting–A cost-effectiveness analysis,” PLoS One, vol. 18, no. 7, p. e0288605, Jul. 2023, doi: 10.1371/journal.pone.0288605.
[33] L. H. Thai, T. S. Hai, and N. T. Thuy, “Image Classification using Support Vector Machine and Artificial Neural Network,” International Journal of Information Technology and Computer Science, vol. 4, no. 5, pp. 32–38, May 2012, doi: 10.5815/ijitcs.2012.05.05.
[34] R. Bai, F. Shen, M. Wang, J. Lu, and Z. Zhang, “Improving Detection Capabilities of YOLOv8-n for Small Objects in Remote Sensing Imagery: Towards Better Precision with Simplified Model Complexity,” Jun. 22, 2023. doi: 10.21203/rs.3.rs-3085871/v1.
[35] D. N. B. Tran, T. T. T. Nguyen, H. V. Le, H. X. Nguyen, V. P. Tran, and D. Q. Ta, “Testing neural networks assessment based on data-driven using well log data in Cuu Long basin, offshore Vietnam,” Science & Technology Development Journal - Engineering and Technology, 2021, doi: 10.32508/stdjet.v4iSI3.584.
[36] L. P. K. Dewi, “PEMERIKSAAN BASIL TAHAN ASAM UNTUK MEMBANTU MENEGAKKAN DIAGNOSIS PENYAKIT TUBERKULOSIS,” International Journal of Applied Chemistry Research, vol. 1, no. 1, p. 16, Sep. 2020, doi: 10.23887/ijacr.v1i1.28716.
[37] 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.
[38] J. Li et al., “Forecasting the Tuberculosis Incidence Using a Novel Ensemble Empirical Mode Decomposition-Based Data-Driven Hybrid Model in Tibet, China,” Infect Drug Resist, vol. Volume 14, pp. 1941–1955, May 2021, doi: 10.2147/IDR.S299704.
[39] E. Kee, J. J. Chong, Z. J. Choong, and M. Lau, “A Comparative Analysis of Cross-Validation Techniques for a Smart and Lean Pick-and-Place Solution with Deep Learning,” Electronics (Basel), vol. 12, no. 11, p. 2371, May 2023, doi: 10.3390/electronics12112371.
Copyright (c) 2025 The Authors. Published by Universitas Airlangga.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
All accepted papers will be published under a Creative Commons Attribution 4.0 International (CC BY 4.0) License. Authors retain copyright and grant the journal right of first publication. CC-BY Licenced means lets others to Share (copy and redistribute the material in any medium or format) and Adapt (remix, transform, and build upon the material for any purpose, even commercially).