DETECTION AND CLASSIFICATION OF GRAM-STAINED BACTERIA IN MICROSCOPIC IMAGES USING YOLOV8 WITH CBAM

Karyna Budi Sanjaya, Daniel Martomanggolo Wonohadidjojo

Abstract


Bloodstream infection accounts for approximately 11 million deaths annually, and yet conventional blood culture methods require 40-48 hours to complete pathogen identification which delays definitive therapeutic decisions. Gram staining does provide preliminary bacterial classification within hours, but manual interpretation still remains a labor-intensive task and is prone to variability. This study develops an automated bacterial detection and classification system by integrating CBAM into the YOLOv8 architecture. The model was trained on Gram-stained microscopic images across four bacterial categories: Gram-positive cocci, Gram-negative cocci, Gram-positive bacilli, and Gram-negative bacilli. Dataset preprocessing involved quality selection, noise reduction, and targeted augmentation to address severe class imbalances. The inclusion of CBAM improved feature discrimination and localization performance, with an increase of 1.4% in mAP@0.5:0.95 (from 70.8% to 72.2%). The proposed model also reduced cross-class misclassifications, particularly among morphologically similar cocci. These findings demonstrate that integrating lightweight attention mechanisms can enhance bacterial detection reliability in microscopic imaging and support the development of automated systems for faster, more consistent preliminary bacterial identification.

References


K. E. Rudd et al., “Global, regional, and national sepsis incidence and mortality, 1990–2017: analysis for the Global Burden of Disease Study,” The Lancet, vol. 395, no. 10219, pp. 200–211, Jan. 2020, doi: 10.1016/S0140-6736(19)32989-7.

M. Verway et al., “Prevalence and Mortality Associated with Bloodstream Organisms: a Population-Wide Retrospective Cohort Study,” J Clin Microbiol, vol. 60, no. 4, pp. e02429-21, Apr. 2022, doi: 10.1128/jcm.02429-21.

C. P. Fischer, E. Kastoft, B. R. S. Olesen, and B. Myrup, “Delayed Treatment of Bloodstream Infection at Admission is Associated With Initial Low Early Warning Score and Increased Mortality,” Critical Care Explorations, vol. 5, no. 9, p. e0959, Aug. 2023, doi: 10.1097/CCE.0000000000000959.

M. Demir and G. Hazırolan, “Rapid Bacterial Identification from Positive Blood Cultures by MALDI-TOF MS Following Short-Term Incubation on Solid Media,” Infect Dis Clin Microbiol, vol. 6, no. 2, pp. 141–146, Jun. 2024, doi: 10.36519/idcm.2024.319.

H. Ito, Y. Tomura, J. Oshida, S. Fukui, T. Kodama, and D. Kobayashi, “The role of gram stain in reducing broad-spectrum antibiotic use: A systematic literature review and meta-analysis,” Infectious Diseases Now, vol. 53, no. 6, p. 104764, Sep. 2023, doi: 10.1016/j.idnow.2023.104764.

K. Yamamoto et al., “Accuracy of classification of urinary Gram-stain findings by a computer-aided diagnosis app compared with microbiology specialists,” Journal of Medical Microbiology, vol. 74, no. 4, Apr. 2025, doi: 10.1099/jmm.0.002008.

S. Tian et al., “Clinical characteristics of Gram-negative and Gram-positive bacterial infection in acute cholangitis: a retrospective observational study,” BMC Infect Dis, vol. 22, no. 1, p. 269, Dec. 2022, doi: 10.1186/s12879-021-06964-1.

J. McMahon et al., “A novel framework for the automated characterization of Gram-stained blood culture slides using a large-scale vision transformer,” J Clin Microbiol, vol. 63, no. 3, pp. e01514-24, Mar. 2025, doi: 10.1128/jcm.01514-24.

G. Jocher, A. Chaurasia, and J. Qiu, “YOLO by Ultralytics,” GitHub repository, 2023. [Online]. Available: https://github.com/ultralytics/ultralytics

S. Y. Chin et al., “Bacterial image analysis using multi-task deep learning approaches for clinical microscopy,” PeerJ Computer Science, vol. 10, p. e2180, Aug. 2024, doi: 10.7717/peerj-cs.2180.

N. A. Megantara and E. Utami, “Object Detection Using YOLOv8 : A Systematic Review,” Sistemasi: Jurnal Sistem Informasi, vol. 14, no. 3, pp. 1186–1193, May 2025, doi: 10.32520/stmsi.v14i3.5081.

L. Kincaid, “Microbial colony species recognition using an enhanced YOLOv4 algorithm with CBAM and k-means++ optimization,” Transactions on Computational and Scientific Methods, vol 4, no.10, Oct. 2024. Available: https://pspress.org/index.php/tcsm/article/view/134.

X. Wang, “Clinical Bacteria DataSet.” Zenodo, Jan. 18, 2024. doi: 10.5281/ZENODO.10526360.

S. Woo, J. Park, J.-Y. Lee, and I. S. Kweon, “CBAM: Convolutional Block Attention Module,” in Computer Vision – ECCV 2018, vol. 11211, V. Ferrari, M. Hebert, C. Sminchisescu, and Y. Weiss, Eds., in Lecture Notes in Computer Science, vol. 11211. , Cham: Springer International Publishing, 2018, pp. 3–19. doi: 10.1007/978-3-030-01234-2_1.

G. Yao, S. Zhu, L. Zhang, and M. Qi, “HP-YOLOv8: High-Precision Small Object Detection Algorithm for Remote Sensing Images,” Sensors, vol. 24, no. 15, p. 4858, Jul. 2024, doi: 10.3390/s24154858.

J. Yan et al., “Enhanced object detection in pediatric bronchoscopy images using YOLO-based algorithms with CBAM attention mechanism,” Heliyon, vol. 10, no. 12, p. e32678, Jun. 2024, doi: 10.1016/j.heliyon.2024.e32678.

C. P. Fischer, E. Kastoft, B. R. S. Olesen, and B. Myrup, “Delayed Treatment of Bloodstream Infection at Admission is Associated With Initial Low Early Warning Score and Increased Mortality,” Critical Care Explorations, vol. 5, no. 9, p. e0959, Aug. 2023, doi: 10.1097/CCE.0000000000000959.

T. Jiang, C. Li, M. Yang, and Z. Wang, “An Improved YOLOv5s Algorithm for Object Detection with an Attention Mechanism,” Electronics, vol. 11, no. 16, p. 2494, Aug. 2022, doi: 10.3390/electronics11162494.

U. Kashino, K. Taira, and K. Hirata, “Detecting Bacteria from Gram Stained Smears Images by the Family of YOLOs,” in Proceedings of the 2024 7th International Conference on Digital Medicine and Image Processing, Osaka Japan: ACM, Nov. 2024, pp. 6–10. doi: 10.1145/3705927.3705929.

X. Wang et al., “A Clinical Bacterial Dataset for Deep Learning in Microbiological Rapid On-Site Evaluation,” Sci Data, vol. 11, no. 1, p. 608, Jun. 2024, doi: 10.1038/s41597-024-03370-5.

X. Zhao, L. Wang, Y. Zhang, X. Han, M. Deveci, and M. Parmar, “A review of convolutional neural networks in computer vision,” Artif Intell Rev, vol. 57, no. 4, p. 99, Mar. 2024, doi: 10.1007/s10462-024-10721-6.




DOI: https://doi.org/10.33387/jiko.v8i3.10891

Refbacks

  • There are currently no refbacks.