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.
Copyrights © 2026