Classification of Gram-Stained Microscopy Images of Bacteria Cultured on Multiple Media Using Frozen and Fine-Tuned ResNet-50 Transfer Learning: A Comparative Study

Authors

  • Daniel Martomanggolo Wonohadidjojo Department of Informatics, School of Information Technology, Universitas Ciputra, Surabaya, East Java, Indonesia
  • Lidya Handayani Department of Medical Microbiology, School of Medicine, Universitas Ciputra, Surabaya, East Java, Indonesia

DOI:

https://doi.org/10.34148/teknika.v15i2.1507

Keywords:

Gram Staining, Bacterial Image Classification, ResNet-50, Transfer Learning, Culture Media

Abstract

The accurate and rapid identification of pathogenic bacteria is critical in clinical microbiology for guiding appropriate antibiotic therapy and infection control. This study proposes an automated classification system for Gram-stained bacterial microscopy images representing four clinically significant Gram-negative pathogenic species — Enterobacter cloacae, Escherichia coli, Klebsiella pneumoniae, and Pseudomonas aeruginosa — cultivated on five different culture media: Blood Agar Plate (BAP), MacConkey agar (MAC), Mueller-Hinton agar (MHA), Mueller-Hinton broth (MHB), and Nutrient agar (NA), yielding a 20-class classification problem. A primary dataset of 166 images was collected from clinical isolates using a standardized Gram staining protocol and imaged at 1000× magnification using a Leica DM500 trinocular microscope. Two ResNet-50 transfer learning strategies were compared under stratified 5-fold cross-validation: Experiment A using a frozen ResNet-50 as a fixed feature extractor, and Experiment B using a fully fine-tuned ResNet-50. Experiment B (fine-tuned) outperformed Experiment A (frozen) overall, achieving mean accuracy of 0.5832 ± 0.1109 and macro F1-score of 0.5409 ± 0.1231 compared to 0.5601 ± 0.0603 and 0.5010 ± 0.0935 respectively. The highest per-class F1-score was 0.9333 for E. coli on MAC and MHA in both experiments. Culture medium type is identified as a key determinant of classification difficulty, with selective and differential media yielding superior results over non-selective general-purpose media. Although fine-tuning improved performance, the relatively small dataset size and moderate overall accuracy indicate that larger-scale validation is required before clinical deployment.

Downloads

Download data is not yet available.

References

[1] World Health Organization, "Global antimicrobial resistance and use surveillance system (GLASS) report 2022," WHO, Geneva, Switzerland, 2022.

[2] H. C. Gram, "Ueber die isolirte Färbung der Schizomyceten," Fortschritte der Medicin, vol. 2, pp. 185–189, 1884.

[3] C. A. Petti, C. R. Polage, T. C. Quinn, A. R. Ronald, and M. A. Sande, "Laboratory medicine in Africa: a barrier to effective health care," Clin. Infect. Dis., vol. 42, no. 3, pp. 377–382, 2006.

[4] M. Z. Alom et al., "A state-of-the-art survey on deep learning theory and architectures," Electronics, vol. 8, no. 3, p. 292, 2019.

[5] S. J. Pan and Q. Yang, "A survey on transfer learning," IEEE Trans. Knowl. Data Eng., vol. 22, no. 10, pp. 1345–1359, 2010.

[6] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proc. IEEE Conf. Comput. Vis. Pattern Recognit., 2016, pp. 770–778.

[7] A. Mairi, L. Hamza, and A. Touati, “Artificial intelligence and its application in clinical microbiology,” Expert Rev. Anti-infect. Ther., vol. 23, no. 7, pp. 469–490, Mar. 2025, doi: 10.1080/14787210.2025.2484284.

[8] K. P. Smith and J. E. Kirby, “Image analysis and artificial intelligence in infectious disease diagnostics,” Clin. Microbiol. Infect., vol. 26, no. 10, pp. 1318–1323, 2020.

[9] J. Dien Bard et al., “Proceedings of the Clinical Microbiology Open 2024: Artificial intelligence applications in clinical microbiology,” J. Clin. Microbiol., 2025, doi: 10.1128/jcm.01965-24.

[10] B. Zielinski et al., "Deep learning approach to bacterial colony classification," PLOS ONE, vol. 12, no. 9, p. e0184554, 2017.

[11] S. Visitsattaponge, M. Bunkum, C. Pintavirooj, and M. P. Paing, “A deep learning model for bacterial classification using Big Transfer (BiT),” IEEE Access, vol. 12, pp. 15609–15621, 2024, doi: 10.1109/ACCESS.2024.3358671.

[12] A. J. Abougarair, A. Oun, S. I. Sawan, and A. Maʼarif, “Deep learning-based automated approach for classifying bacterial images,” Int. J. Robot. Control Syst., vol. 4, no. 2, pp. 849–876, Jun. 2024.

[13] E. Gullu, S. Bora, and B. Beynek, “Exploiting image processing and artificial intelligence techniques for the determination of antimicrobial susceptibility,” Appl. Sci., vol. 14, no. 9, 2024, doi: 10.3390/app14093950.

[14] V. Shwetha et al., “Vision transformer based bacteria classification model for Gram-stained direct smear images,” Multimed. Tools Appl., vol. 84, pp. 20289–20309, 2025, doi: 10.1007/s11042-025-20742-0.

[15] M.-H. Lee, Y.-T. Tsai, T.-Y. Huang, D.-J. Liew, I. Candia, and Y.-C. Chang,, “Alignment-free bacterial pathogen identification using vision transformer and image augmentation techniques in high-resolution microscopy,” Chinese J. Chem. Eng., vol. 88, pp. 142–151, 2025.

[16] S. Y. Chin, J. Dong, K. Hasikin, R. Ngui, K. W. Lai, P. S. Q. Yeoh, and X. Wu, “Bacterial image analysis using multi-task deep learning approaches for clinical microscopy,” PeerJ Comput. Sci., vol. 10, p. e2180, Aug. 2024, doi: 10.7717/peerj-cs.2180.

[17] M. Talo, "Automated classification of histopathology images using transfer learning," Artif. Intell. Med., vol. 101, p. 101743, 2019.

[18] K. Simonyan and A. Zisserman, "Very deep convolutional networks for large-scale image recognition," in Proc. Int. Conf. Learn. Represent., 2015.

[19] C. Szegedy et al., "Going deeper with convolutions," in Proc. IEEE Conf. Comput. Vis. Pattern Recognit., 2015, pp. 1–9.

[20] N. Bayramoglu and J. Heikkilä, "Transfer learning for cell nuclei classification in histopathology images," in Proc. Eur. Conf. Comput. Vis. Workshops, 2016, pp. 532–539.

[21] J. Yosinski, J. Clune, Y. Bengio, and H. Lipson, "How transferable are features in deep neural networks?" Adv. Neural Inf. Process. Syst., vol. 27, pp. 3320–3328, 2014.

[22] R. Kohavi, "A study of cross-validation and bootstrap for accuracy estimation and model selection," in Proc. Int. Joint Conf. Artif. Intell., vol. 14, no. 2, 1995, pp. 1137–1145.

[23] P. R. Murray, K. S. Rosenthal, and M. A. Pfaller, Medical Microbiology, 9th ed. Amsterdam, Netherlands: Elsevier, 2021.

[24] A. Telea, "An image inpainting technique based on the fast marching method," J. Graph. Tools, vol. 9, no. 1, pp. 23–34, 2004.

[25] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. Cambridge, MA, USA: MIT Press, 2016.

[26] O. Russakovsky et al., "ImageNet large scale visual recognition challenge," Int. J. Comput. Vis., vol. 115, no. 3, pp. 211–252, 2015.

[27] A. Chaddad et al., “Generalizable and explainable deep learning for medical image computing: An overview,” Curr. Opin. Biomed. Eng., vol. 34, p. 100581, 2025.

[28] R. R. Selvaraju et al., "Grad-CAM: Visual explanations from deep networks via gradient-based localization," in Proc. IEEE Int. Conf. Comput. Vis., 2017, pp. 618–626.

Classification of Gram-Stained Microscopy Images of Bacteria Cultured on Multiple Media Using Frozen and Fine-Tuned ResNet-50 Transfer Learning: A Comparative Study

Downloads

Published

2026-07-08

Issue

Section

Articles

How to Cite

Classification of Gram-Stained Microscopy Images of Bacteria Cultured on Multiple Media Using Frozen and Fine-Tuned ResNet-50 Transfer Learning: A Comparative Study. (2026). Teknika, 15(2), 357-369. https://doi.org/10.34148/teknika.v15i2.1507