Case Report - (2024) Volume 3, Issue 3
The Role of Artificial Intelligence in Medical Bacteriology: A Case Study
2Head of Anesthesiology Service, Cardiothoracic An-esthesiology, Avicenna Military Hospital, Marrakech, Morocco. Faculty of Medicine and Pharmacy, Cadi Ayyad University, Marrakech, Morocco
3Professor of Higher Education in Microbiology-Virology, Dean of the Faculty of Medicine and Pharmacy of Marrakech, Morocco
4Professor of Higher Education in Orthopedic Trau-matology, Chief Medical Oficer of Avicenna Military Hospital, Marrakech, Morocco
Received Date: Dec 01, 2024 / Accepted Date: Dec 20, 2024 / Published Date: Dec 31, 2024
Copyright: ©©2024 Mehdi Nabil, et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Citation: Mehdi, N., Zouhair, S., Chagar, B., Khallikane, S. (2024). The Role of Artificial Intelligence in Medical Bacteriology: A Case Study. Archives Clin Med Microbiol, 3(3), 01-06.
Abstract
This study evaluates the application of artificial intelligence (AI) in the classification of bacterial species within medical bacteriology. Utilizing the DIBaS (Digital Images of Bacteria Species) database from the Jagiellonian University in Kraków, Poland, this research focuses on Enterococcus and Lactobacillus species, demonstrating the efficacy of AI in diagnostic applications. Results indicate an accuracy rate exceeding 80% for Enterococcus and over 90% for Lactobacillus, highlighting AI's potential as a rapid and reliable tool for bacterial identification in clinical settings.
Keywords
Artificial Intelligence, Detection, Microorganisms, Microscopy
Introduction
The increasing prevalence of antibiotic-resistant infections necessitates accurate and rapid diagnostic methods in microbiology. In response to these challenges, artificial intelligence has emerged as a transformative tool in advancing microbiological diagnostics. This study leverages AI to classify different species of Enterococcus and Lactobacillus, using image data to train and validate an AI model for microbiological diagnostics.
Materials and Methods
In this study, we implemented an AI-based classifier model utilizing MATLAB (MATrix LABoratory) in a 64-bit Windows environment (CPU 2.16 GHz, 4GB) to differentiate between two Enterococcus species, four Lactobacillus species, and three distinct bacterial families: Lactobacillus, Staphylococcus, and Streptococcus. The "ResNet" package was employed, which is specifically designed for image processing and convolutional neural network operations. This approach eliminates the need for manual feature engineering by autonomously extracting essential attributes from bacterial images. This package autonomously extracts the essential attributes required to distinguish the various bacterial images ( Figure 1).
The initial layer of the neural network is responsible for learning filters that capture primitive image characteristics, including edges, shapes, and colors. These features are then processed by subsequent, deeper layers, which integrate the initial characteristics to form higher-level features. These advanced features provide a more suitable representation for effective recognition tasks by combining all primitive elements into a richer image representation [1].
The dataset for this research was sourced from the DIBaS (Digital Images of Bacteria Species) database, collected by the Chair of Microbiology at Jagiellonian University in Kraków, Poland [2]. This database includes 33 species of bacteria, each represented by 20 images. For this study, we selected species based on their clinical significance and relevance to diagnostic challenges, ensuring robust validation of the AI model.
Figure 1: The Selection Attributes of the Bacteria
Results
Case Study I: Enterococcus
In this case, a simple binary classification is tested on two bacteria belonging to the Enterococcus family, namely E. faecalis and E. faecium. A description of this family of bacteria will be introduced, followed by the results of the analysis using artificial intelligence.
Description of Enterococcus: Species of the genus Enterococcus are Gram-positive cocci, facultative anaerobes, catalase-negative, found either isolated, in pairs, or in short chains [3,4]. The optimal growth temperature for E. faecalis and E. faecium is 35°C [4]. E. faecalis and E. faecium are part of the normal flora of the gastrointestinal tract, the female genital tract, and, to a lesser extent, the oral cavity [3–5].
Enterococci can lead to urinary tract infections, wound infections, and soft tissue infections [3]. They are also associated with bacteremia that can lead to endocarditis in the presence of already damaged heart valves [5]. E. faecalis is the species most commonly isolated from human intestinal samples (80 to 90%), while E. faecium represents 5 to 10% of the isolates [4-5]. Recent studies have highlighted their increasing role as nosocomial pathogens, particularly in cases involving multidrug resistance.
Enterococci are opportunistic pathogens that infect elderly patients with underlying conditions, as well as other immunocompromised patients who have been hospitalized for extended periods, and those treated with refractory methods or broad-spectrum antibiotics [4]. Enterococci are common nosocomial pathogens, responsible for 10% of infections acquired in healthcare settings in the United States [6]. They consistently rank as the second or third most frequent agent in urinary tract infections, wound infections, and cases of bacteremia in hospitals, accounting for approximately 16% of nosocomial urinary tract infections [4].
Results: The simulation implemented via MATLAB displays a sample of each Enterococcus species studied (Figure 2). Furthermore, the simulation provides satisfactory results, as demonstrated in the confusion matrix (Table 1). In fact, the system is able to associate the image with its corresponding true class with a success rate exceeding 80%. Therefore, we conclude that the system encounters no difficulties in producing a very good diagnosis regarding Enterococcus. An attribute map is transmitted to the AI system, where the attributes are identified one by one through convolution. The results of this detection are sent to the neural network, which calculates the probabilities of classification. Finally, the SVM model provides the predicted name of the bacterium. (Figure 3).
Figure 2 : Microscopic Images of Different Types of Enterococcus
|
Pr(Prediction/Reality) |
Prediction |
|
|
|
Faecalis |
Faecium |
||
|
Reality |
Aureus Saprophiticus |
81.25 |
18.75 |
|
18.75 |
81.25 |
||
Table 1: Confusion Matrix of The Different Enterococcus Bacteria

Figure 3 : Demonstrates The Step-By-Step Process Of Identification Carried Out In Case Study I, Showcasing The Methodology Used For Precise Bacterial Classification
Case Study II: Lactobacillus
In this case, a multi-class classification is tested on four bacteria belonging to the Lactobacillus family, namely L. plantarum, L. reuteri, L. rhamnosus, and L. salivarius. A description of this family of bacteria will be provided.
Description of Lactobacillus: Lactobacillus (a scientific term of Latin origin referring to lactic acid bacteria) are bacteria that occur in significant quantities in the human body. Lactobacilli are found in the intestinal, oral, and vaginal mucosa, as well as on certain plants and in plant-based foods. Their roles in probiotics and therapeutic applications underscore their importance in both clinical and nutritional sciences.
Lactobacillus is widely used in food production. They are included in the composition of fermented products such as yogurt, cheese, wine, sauerkraut, pickles, and sourdough bread. Fermented milk is also extremely rich in Lactobacillus. Therapeutically, Lactobacillus is used to balance the gut flora and are more commonly referred to as probiotics (dietary supplements). They are most often employed to combat lactose intolerance, to prevent and relieve diarrhea (especially in cases of gastroenteritis), to fight against gastric ulcers, and to address Crohn's disease.
Lactobacillus can help rebalance the gut flora by improving its natural functioning. They exert a symbiotic effect that allows the gut flora to select non-pathogenic bacteria. In food production, Lactobacillus contributes to the coagulation of milk by acidifying it, and they also play a role in the maturation process. In bread and wine, Lactobacillus exhibit their fermentative properties (participating in the deacidification of wine and contributing to its characteristic flavor). Furthermore, Lactobacillus can also alter foods (such as causing greening of meats), which is utilized in the production of alcoholic beverages like cider and whiskey. In the body, Lactobacillus serves a protective role against infections. Lactobacillus may have adverse effects in patients with infectious conditions. Additionally, they are not recommended in cases of severe acute pancreatitis. No other confirmed adverse effects have been reported [7].
Results: The simulation implemented via MATLAB displays a sample of each Lactobacillus species studied (Figure 4).
Figure 4: Microscopic Images of Different Types Of Lactobacillus
Furthermore, simulation provides satisfactory results, as clearly shown in the confusion matrix (Table 2). In fact, the system is able to associate the image with its corresponding true class with a success rate exceeding 80% for L. plantarum and L. reuteri, while perfectly recognizing L. rhamnosus and L. salivarius. These findings highlight the model's capability in differentiating closely related bacterial species.
|
Pr(Prediction/Reality) |
Prediction |
||||
|
Plantarum |
Reuteri |
Rhamnosus |
Salivarius |
||
|
Reality |
Plantarum |
87.50 |
6.25 |
6.25 |
0.00 |
|
Reuteri |
0.00 |
81.25 |
12.50 |
6.25 |
|
|
Rhamnosus |
0.00 |
0.00 |
100.00 |
0.00 |
|
|
Salivarius |
0.00 |
0.00 |
0.00 |
100.00 |
|
Table 2 : Confusion Matrix Of The Different Lactobacillus Bacteria
Case Study III: Three Different Families
In this case, the intelligent model obtained will be tested with three different families: Lactobacillus, Staphylococcus, and Streptococcus.
Description of Staphylococcus: Staphylococci are Gram-positive cocci typically arranged in clusters. Currently, 44 species are recognized. The species S. aureus (commonly known as golden staph) is generally distinguished from other staphylococci, referred to as coagulase-negative staphylococci (CNS), by the presence of coagulase. S. aureus is a significant pathogen in both community-acquired and nosocomial infections.
The natural reservoir of staphylococci is humans and warm- blooded animals. However, when eliminated into the external environment, these highly resistant bacteria are frequently found in various environments. The preferred colonization site of S. aureus in humans is the nasal mucosa. Approximately 30% of adults permanently carry S. aureus, 50% intermittently, and 20% are never carriers. From these sites, S. aureus colonizes skin areas, particularly moist regions (e.g., armpits, perineum) and hands.
CNS are the primary skin commensals alongside corynebacteria and propionibacteria. The density of colonization is higher in moist areas such as the anterior nares, perineum, axillary folds, and groin creases. They can also be isolated from mucosal surfaces. S.epidermidis is the most frequently isolated species. As such, S.epidermidis can contaminate superficial samples or those obtained through skin punctures, such as blood cultures. Transmission between individuals is typically through direct contact (manual handling) and, less commonly, indirectly from environmental sources (e.g., clothing, bedding, medical equipment). Staphylococci are a frequent cause of skin infections (e.g., boils), respiratory diseases (e.g., sinusitis), and food poisoning [8].
Description of Streptococcus: Streptococcus is a genus of Gram-positive cocci (spherical bacteria) that belong to the family Streptococcaceae, within the order Lactobacillales (lactic acid bacteria), and the phylum Firmicutes [9]. Infections caused by Streptococcus pyogenes, also known as group A streptococci (GAS), and Streptococcus agalactiae, known as group B streptococci (GBS), are common. These infections are often benign and non-invasive but can also be very severe and lead to invasive infections. GAS causes mild infections (such as pharyngitis and impetigo) as well as invasive infections that can sometimes be fatal (e.g., toxic shock syndrome and necrotizing fasciitis). GBS is a significant cause of severe invasive infections in newborns and pregnant women, often being fatal in adults outside of pregnancy, particularly affecting elderly individuals with underlying risk factors [10].
Results
The simulation implemented via MATLAB displays a sample of each bacterial family studied (Figure 5).
<img src="https://www.opastpublishers.com/scholarly-images/8549-69e715bf91d2c-the-role-of-artificial-intelligence-in-medical-bacteriology-.png" width="550" height="450">
Figure 5: Microscopic Images of Three Different Bacterial Families
Furthermore, the simulation provides satisfactory results, as clearly shown in the confusion matrix (Table 3). In fact, the system is able to associate the image with its corresponding true class, achieving a success rate exceeding 85% for Streptococcus and 90% for Staphylococcus, with perfect recognition for Lactobacillus. Therefore, we conclude that the system encounters no difficulties in producing a very good diagnosis.
|
Pr(Prediction/Reality) |
Prediction |
|||
|
Lactobacillus reuteri |
Staphylococcus aureus |
Streptococcus agalactiae |
||
|
Reality |
Lactobacillus reuteri |
100.00 |
0.00 |
0.00 |
|
|
Staphylococcus aureus |
0.00 |
93.75 |
6.25 |
|
|
Streptococcus agalactiae |
0.00 |
12.50 |
87.50 |
Table 3: Confusion Matrix Of Lactobacillus, Staphylococcus, And Streptococcus
Discussion
The results obtained from the three case studies clearly demonstrate the value of using artificial intelligence as a decision-support tool. Indeed, this tool allows us to distinguish the subtypes of each bacterial family from one another, despite the many morphological similarities that exist between them.
Furthermore, the study enabled the differentiation of Staphylococcus and Streptococcus with unparalleled success, even though both have spherical shapes and are nearly the same size. Previously, it was necessary to wait for the division of these bacteria to differentiate them since Streptococcus divides linearly and Staphylococcus divides in clusters. Despite using static images (snapshots) for diagnosis, artificial intelligence was able to identify the attributes that characterize each bacterium.
In addition to diagnostic accuracy, the established model exhibits significant time efficiency, validating images in under one second and rendering new diagnostics with remarkable speed. It performs self-learning in less than 16 seconds (for 48 images), validates the model (for 12 images) in under one second (approximately 0.79 seconds), and renders new diagnostics (for 1 image) in less than one second as well (0.38 seconds). Overall, artificial intelligence has once again proven to be a reliable and ultra-fast tool that aids medical professionals in making accurate decisions and alleviating the burden placed on them in very short timeframes.
Conclusion
This study highlights several conclusions regarding the use of artificial intelligence in what is termed "new microbiology," demonstrating its ability to:
• Increase analysis accuracy,
• Enhance microorganism detection,
• Classify microorganisms,
• Mitigate diagnostic errors,
• Save time and reduce analysis costs.
However, a debate arises regarding the potential for AI to replace human involvement. Experts at a Franco-Swiss conference held on May 28, 2019, emphasized that AI should not supplant human judgment but rather serve as a decision-support tool, hence the term "collaborative intelligence."
Finally, this work could be improved by incorporating additional bacterial species and increasing the sample size for each species to enhance generalizability. While similar techniques exist abroad, this study opens new avenues for medical research in Morocco, which is currently undergoing a digital transformation. The integration of artificial intelligence could extend to spectroscopy, medical imaging, and other areas of medical research.
References
- Donahue, J., Jia, Y., Vinyals, O., Hoffman, J., Zhang, N., Tzeng, E., & Darrell, T. (2014, January). Decaf: A deep convolutional activation feature for generic visual recognition. In International conference on machine learning (pp. 647-655). PMLR.
- Zielinski, B., Plichta, A., Misztal, K., Spurek, P., Brzychczy-WIoch, M., & Ochonska, D. (2017). Deep learning approach to bacterial colony classification. PloS one, 12(9), e0184554.
- Nannin, E. C., Murray, B. E., Gillespie, S. H., & Hawkey,P. M. (2006). Enterococcus spp. Principles and practice of clinical bacteriology, 59, 71.
- Teixeira, L, M., & Merquior, V. L. C. (2013). Enterococcus.Mol. Typing Bact. Infect., Springer; p. 17–26.
- Sweet, R. L., & Gibbs, R. S. (Eds.). (2009). Infectious diseases of the female genital tract. Lippincott Williams & Wilkins.
- Giraffa, G. (2002). Enterococci from foods. FEMS microbiology reviews, 26(2), 163-171.
- Jean-François, Pillou, P. H. (2019). .Lactobacillus -Indications, posologie et effets secondaires. Santé-Médecine, Le J Des Femmes.
- Isabelle Verdier, Gérard Lina Y. G., et F.V. Cours de Bactériologie Médicale : Staphylococcus n.d.
- Ray, C. G., Ryan, K. J. (2004). Sherris medical microbiology: an introduction to infectious diseases. McGraw-Hill.
- Institut Pasteur. (2013) Streptococcus agalactiae à la surface de cellules épithéliales pulmonaires humaines (microscopie électronique à balayage).

