Classification and Counting of Mycobacterium Tuberculosis using YOLOv5

Authors

July 22, 2025

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.