We use cookies to ensure our website works properly and to personalise your experience. Cookies policy
Master of Computer Applications (MCA), Bagalkot University Jamkhandi - 587301
Manual counting of bacterial colonies in Petri dishes is a time-consuming and error-prone process commonly performed in microbiology laboratories. This research proposes an automated bacterial colony counting system using image processing techniques integrated with a YOLO-based deep learning model. The AGAR_demo dataset containing Petri dish images and corresponding JSON metadata was utilized for training and evaluation. The metadata was converted into YOLO annotation format for model training. The proposed system consists of image preprocessing, colony detection, colony counting, and metadata-based accuracy evaluation. A Python GUI was developed to allow users to upload bacterial colony images, automatically detect colonies, compare the predicted count with the ground truth obtained from JSON metadata, and calculate counting accuracy. Experimental results demonstrate that the proposed approach significantly reduces manual effort while providing reliable colony counting performance suitable for microbiological laboratory applications.
Bacterial colony counting is one of the most important tasks in microbiology laboratories. It is used to estimate bacterial growth, evaluate antimicrobial activity, determine contamination levels, and perform laboratory quality analysis. Traditionally, colony counting is carried out manually, which requires considerable time and is susceptible to counting errors caused by overlapping colonies, operator fatigue, and inconsistent lighting conditions.
Recent advances in artificial intelligence and computer vision have enabled automated colony counting systems that provide faster and more accurate results. Image processing techniques improve image quality by reducing noise and enhancing colony visibility, while deep learning models such as YOLO perform automatic object detection with high precision.
This work proposes an automated bacterial colony counting system that combines classical image preprocessing with YOLO-based object detection. The AGAR_demo dataset and its accompanying JSON metadata are used for training and evaluation. A Python-based graphical user interface allows users to upload Petri dish images, automatically detect bacterial colonies, calculate colony counts, and compare the predicted results with the actual colony counts stored in metadata.
Accurate bacterial colony counting is an essential task in microbiology laboratories for estimating microbial concentration, evaluating bacterial growth, and performing clinical and food safety analysis. Traditionally, colony counting has been performed manually, which is labor-intensive, time-consuming, and susceptible to human error, particularly when dealing with large numbers of colonies or overlapping bacterial growth. To overcome these limitations, researchers have explored various automated image processing and artificial intelligence techniques for reliable colony detection and counting.
Early automated colony counting systems primarily relied on digital image processing techniques, including grayscale conversion, image enhancement, thresholding, contour detection, and segmentation. These methods significantly reduced manual intervention and improved counting speed while maintaining acceptable accuracy under controlled imaging conditions. However, their performance was highly dependent on image quality and often deteriorated when colonies overlapped or when lighting conditions were inconsistent. Although these conventional approaches provided a low-cost solution, they lacked the robustness required for complex bacterial colony images. [1], [3]
The availability of high-quality annotated datasets has played a vital role in improving automated bacterial colony detection. Researchers addressed the challenge of limited training data by generating synthetic microbial colony images using deep learning-based style transfer techniques. These artificially generated images closely resemble real bacterial colonies and help improve the training of deep learning models by increasing dataset diversity. Such approaches have enabled researchers to develop more generalized and accurate bacterial colony detection systems while reducing the dependency on manual annotation. [2]
Recent advances in deep learning have significantly improved bacterial colony counting accuracy. Density map estimation techniques and convolutional neural network architectures have been proposed to estimate colony numbers in densely populated agar plates where individual colony segmentation becomes difficult. Instead of detecting each colony separately, these methods learn the spatial distribution of colonies and generate density maps that provide accurate counting even in highly overlapping regions. These approaches have demonstrated better robustness and counting accuracy than conventional segmentation-based methods. [4]
Object detection models have further revolutionized automated bacterial colony counting by providing simultaneous colony localization and counting. Among these models, YOLO-based architectures have gained significant attention because of their high detection speed, real-time performance, and superior detection accuracy. Hybrid approaches combining image preprocessing techniques such as watershed segmentation with YOLOv5 have shown excellent performance in separating touching colonies and minimizing false detections. These methods effectively integrate the strengths of classical image processing and deep learning to achieve reliable colony counting across different bacterial species and imaging conditions. [5]
To improve colony counting performance in large-scale microbiological experiments, researchers have developed high-throughput automated systems capable of accurately identifying overlapping colonies with minimal user intervention. Advanced contour analysis and candidate region matching algorithms have substantially reduced counting errors while maintaining computational efficiency. These systems provide practical solutions for microbiology laboratories where rapid and accurate colony enumeration is essential for routine analysis. [6]
Recent research has also focused on integrating semantic segmentation and image classification networks to enhance bacterial colony detection. Deep learning models combining U2-Net segmentation with ResNet50 classification have demonstrated remarkable capability in detecting isolated as well as overlapping bacterial colonies. Image enhancement techniques further improve colony visibility before segmentation, resulting in highly accurate colony recovery under different illumination conditions and for multiple bacterial species. [7]
Apart from object detection models, intelligent optimization algorithms have been employed to improve bacterial colony classification. Feature selection techniques optimized using swarm intelligence algorithms have enhanced classification accuracy by selecting the most informative image features while reducing computational complexity. These optimization-based approaches demonstrate the growing integration of artificial intelligence into microbiological image analysis and contribute to improved automated colony detection performance. [8]
Deep learning has also been extended beyond colony counting to monitor bacterial colony growth over time. Convolutional Neural Networks (CNNs) have been successfully applied to estimate colony size and generate bacterial growth curves from sequential agar plate images. These methods provide valuable information about microbial growth dynamics while maintaining accurate colony identification throughout different growth stages. [9]
Furthermore, modern microbiological research has introduced automated platforms that integrate microfluidic technology with intelligent image analysis for bacterial quantification and growth monitoring. These systems provide compact, reusable, and highly efficient solutions capable of reducing manual intervention while supporting automated bacterial counting and live/dead cell estimation. Such developments demonstrate the future direction of intelligent microbiological analysis through the integration of imaging systems, artificial intelligence, and laboratory automation. [10]
In summary, the progression of bacterial colony counting techniques has evolved from conventional image processing methods based on thresholding, contour detection, and segmentation [1], [3] to synthetic dataset generation for improving deep learning performance [2], density map-based counting methods [4], and advanced YOLOv5-based object detection frameworks [5]. Recent studies have further enhanced colony counting accuracy through high-throughput automated systems [6], deep learning segmentation-classification pipelines [7], intelligent optimization algorithms [8], and deep neural networks for colony growth estimation [9]. Modern automated systems have also integrated microfluidic technologies with image analysis to enable efficient bacterial quantification and monitoring [10]. These advancements demonstrate the increasing adoption of artificial intelligence and deep learning for accurate, reliable, and automated bacterial colony counting. Motivated by these developments, the proposed work utilizes the AGAR dataset, JSON metadata, image processing, and YOLO-based deep learning to develop an accurate, user-friendly bacterial colony counting system that automatically detects bacterial colonies, compares the predicted count with metadata, and evaluates the overall counting accuracy.
The proposed Automated Bacteria Colony Counter is developed using a modular architecture that integrates image processing, deep learning, JSON metadata validation, and a Python Tkinter graphical user interface. The system enables users to select an agar plate image, preprocess it using OpenCV techniques such as resizing, grayscale conversion, and Gaussian blur, and then detect bacterial colonies using a trained YOLO model. The model generates bounding boxes around each detected colony and calculates the predicted colony count.
The system then reads the corresponding JSON metadata from the AGAR dataset to obtain the actual colony count and compares it with the predicted result to calculate the detection accuracy. Finally, the graphical user interface displays the original image, detected colonies, predicted colony count, actual colony count, and accuracy percentage. This modular architecture provides an efficient, accurate, and user-friendly solution for automated bacterial colony counting while supporting future improvements and scalability.
Figure 1: System Architecture
The proposed Automated Bacteria Colony Counter follows a systematic methodology to detect and count bacterial colonies using image processing and deep learning. The AGAR_demo dataset, containing agar plate images and corresponding JSON metadata, is used for training and evaluation. Initially, the input image is pre-processed using OpenCV operations such as resizing, grayscale conversion, and Gaussian blur to improve image quality and reduce noise.
A YOLO (You Only Look Once) object detection model is trained using the annotated dataset to identify bacterial colonies. During testing, the user selects an image through the Tkinter GUI, and the trained model detects colonies by generating bounding boxes around each colony. The total number of detected colonies is considered as the predicted colony count. The corresponding JSON metadata is then loaded to obtain the actual colony count, and both values are compared to evaluate the system performance. Finally, the GUI displays the original image, detected colonies, predicted count, actual count, and accuracy percentage.
Mathematical Formulation
1. Grayscale Conversion
The RGB image is converted into a grayscale image using:
Gray=0.299R+0.587G+0.114B
where:
2. Gaussian Blur
Gaussian filtering is applied to remove image noise before colony detection.
G(x,y)=12πσ2e-x2+y22σ2
where:
3. Colony Count
The predicted colony count is obtained by counting all detected bounding boxes.
Np=i=1n1=n
where:
4. Detection Accuracy
The system accuracy is calculated by comparing the predicted colony count with the actual colony count stored in the JSON metadata.
Accuracy(%)=1∣Na-Np∣Na×100
where:
The proposed Automated Bacteria Colony Counter was tested using images from the AGAR_demo dataset. The system successfully detected bacterial colonies using the trained YOLO model and automatically calculated the colony count. The predicted count was then compared with the actual colony count obtained from the corresponding JSON metadata file to evaluate the detection accuracy. The results demonstrate that the proposed system provides accurate and efficient colony detection while significantly reducing the time and effort required for manual counting.
Figure 6.1 shows the output of the developed system. The graphical user interface displays the selected agar plate image with detected colonies, along with the predicted colony count, actual colony count from the metadata, and the calculated accuracy percentage. The experimental results indicate that the proposed method is reliable and suitable for automated bacterial colony counting in microbiological applications.
Figure 2. Output of the Proposed Automated Bacteria Colony Counter
CONCLUSION
The proposed Automated Bacteria Colony Counter successfully combines OpenCV image preprocessing, YOLO-based deep learning, and JSON metadata validation to provide an efficient and accurate bacterial colony counting system. The developed Tkinter GUI enables users to easily upload agar plate images, perform automatic colony detection, and view the predicted colony count, actual colony count, and detection accuracy. Experimental results on the AGAR_demo dataset demonstrate that the proposed system achieves reliable colony detection while significantly reducing the time, effort, and errors associated with manual counting.
The modular architecture of the proposed system makes it scalable and suitable for future enhancements. Future work may include training the model with larger and more diverse datasets, improving the detection of overlapping colonies, supporting multiple bacterial species, and deploying the system for real-time laboratory and industrial microbiology applications.
REFERENCES
Vijaykumar Bellundagi*, Anjali Deshapande, Padma Yadahalli, Automated Bacteria Colony Counting Using YOLO-Based Deep Learning and Image Processing Techniques, Int. J. Sci. R. Tech., 2026, 3 (7), 90-96. https://doi.org/10.5281/zenodo.21237433
10.5281/zenodo.21237433