Keywords

1 Introduction

We have all globally experienced the COVID-19 pandemic in the past 3 years. But how many do we know about antibiotic resistance that is knocking at our door as a silent pandemic, and how many are we aware of this impending pandemic? As defined by international institutions such as the World Health Organization (WHO); AMR is cited as one of the most important issues to health, food security, and development worldwide [1]. Although AMR occurs naturally, the wrong and unnecessary use of antibiotics on humans and animals accelerates this process. All over the world, bacterial diseases such as pneumonia, tuberculosis, gonorrhea, Staphylococcus aureus-related resistance and salmonella are becoming increasingly difficult to treat due to the diminishing effects of antibiotics. In addition, basic antibiotics are 15% less effective against common pathogens. On the other hand, despite the decrease in drug costs of antibiotics, the tests required to determine which bacteria they originate from are more expensive than these antibiotics, which makes the use of wrong antibiotics more widespread [2].

The majority of currently in use techniques are polymerase chain reaction (PCR) or antibody-based techniques like enzyme-linked immunosorbent assays (ELISA), which have some drawbacks, like high-cost procedures, time-consuming processes, and requiring trained personnel [3, 4]. Thus, rapid and reliable methods for detecting resistance and susceptibility to these infections are therefore essential for effective treatment and prevention.

Surface-enhanced Raman spectroscopy (SERS) is a vibrational technique based on inelastic scattering of laser light, which comes from noble metal nanostructures [5,6,7]. This technique can be used in a label-free manner. Thus, it is capable of directly identifying life-threatening bacteria. SERS can be used not only for the identification of different bacteria but also for the discrimination of antibiotic-resistant and susceptible strains of bacteria [8]. However, the SERS spectra of the antibiotic-resistant and susceptible bacteria show only subtle differences due to the high molecular similarity of the bacterial strains. Machine learning techniques are indispensable to detect minor spectral differences and can discriminate bacteria at the strain level [9]. These techniques can successfully reveal subtle differences which are extremely difficult to distinguish with the naked eye.

In this study, we used SERS to detect methicillin-resistant and susceptible S. aureus (MRSA and MSSA, respectively), and applied a range of machine learning algorithms, including deep learning and traditional approaches, to distinguish between the two bacterial species (Scheme 1). Among all classifiers used, the U-Net deep learning model performed best with an average accuracy of 99.04 ± 0.003%. The Random Forest traditional machine learning algorithm also performed well, with an average accuracy of 97.8 ± 0.371%.

Scheme 1.
scheme 1

Schematic illustration of detection of MSSA and MRSA with SERS and artificial intelligence

2 Methods

In this research, we analyzed a set of 22 bacterial samples, 19 of which were MRSA and the remaining 3 were MSSA. We grew these bacteria on agar plates at 37 degrees Celsius for 24 h. Following that, using sterile inoculating loops, we collected the bacterial specimens. After washing, we mixed these specimens with a 4X concentration of silver nanoparticles (AgNPs). This prepared sample was then placed on a CaF2 slide for SERS analysis.

A Raman microscopy system with a 785 nm diode laser as the excitation source was used to capture the SERS spectra. We focused on the 550–1650 cm−1 Raman shift range and gathered a total of 33,975 spectra. Among these, MRSA samples accounted for 29,475 spectra, and the remaining 4,500 belonged to MSSA.

Our goal was to classify these bacteria based on their antibiotic resistance or susceptibility. For this, we utilized a variety of classification methods, including deep learning models like U-Net and VGG-16, as well as conventional machine learning algorithms such as Random Forest (RF), Support Vector Machine (SVM), k-Nearest Neighbor (kNN), and naïve Bayes (NB).

We employed a 10-fold cross-validation strategy to prevent overfitting. For training the deep learning models, we used the Adam optimizer. The learning rates for the U-Net and VGG-16 models were set at 0.000001 and 0.000005 respectively. All the classification algorithms were run in Python using TensorFlow and Keras, with computations performed on a Google Colab GPU.

3 Results and Discussion

3.1 AgNPs Characterization and SERS Spectra

The silver nanoparticles were characterized using UV/Vis spectrophotometry for absorbance, Zetasizer for hydrodynamic size distribution and surface charge (zeta potential). The results show maximum absorption at 418 nm, a size of approximately 60 nm, and a zeta potential of -41 mV. The particles interact with the bacterium cell wall, which contains lipids, polysaccharides, phosphate, and nucleic acids. SERS spectra for MRSA and MSSA were also obtained, which showed similar spectral features with slight differences in peak intensity as seen Fig. 1. Specific peaks in the range of 550–1650 cm−1, such as 658, 732, 1333, 1450, and 1576 cm−1, were identified as fingerprints for bacteria cell wall components.

Fig.1.
figure 1

SERS spectra of MRSA and MSSA

3.2 Deep Learning Models’ Performance

The U-Net architecture was selected for its ability to extract features from both the encoder and decoder and has shown good results in antibiotic resistance and susceptibility classification [10]. After training using 10-fold cross-validation on the data, the U-Net model achieved an average accuracy of 99.04 ± 0.003% and a high precision and sensitivity as it can be seen in the confusion matrix (Fig. 2a). The specificity was not as high due to the imbalance between the two classes. The AUC of the ROC curve was 0.99, indicating excellent performance. The U-Net model was also efficient in terms of training and testing time, taking only around two hours to complete.

Fig. 2.
figure 2

Confusion matrix of a) U-Net b) VGG-16

The VGG-16 model was used for its well-known performance and advantages. It achieved an average accuracy of 98.86 ± 0.01% and an AUC of 0.98, see Fig. 2b. The confusion matrix showed lower misclassification in the first class compared to the U-Net model, resulting in higher precision and specificity. However, the U-Net model had superiority in other statistical measurements. The training and testing time for VGG-16 was longer than the U-Net model, taking approximately 4.5 h.

3.3 Traditional Machine Learning Algorithms’ Performances

The performances of traditional machine learning algorithms (SVM with three kernel functions, kNN, RF, and LR) were evaluated for classifying MRSA and MSSA. RF had the best accuracy (97.8%) and AUC (0.95), while kNN was faster and had good results. Among the three kernel functions of the SVM, Gaussian performed the best, but it took a long time. LR also had good results with an average accuracy of 94.8%. The sensitivity and precision of the models were high, but the specificity was low due to the imbalance of data. The deep learning models performed well due to the massive data of SERS for antibiotic-resistant and susceptible S. aureus. The proposed method showed good results overall and could be extended to clinical practice. Table 1 demonstrates the overall results of the deep learning and machine learning algorithms used in this study.

Table 1. Comparison between deep learning models and machine learning algorithms

4 Conclusion

This study used SERS and machine learning to accurately detect antibiotic resistance and susceptibility in S. aureus. The results showed that deep learning was more effective than traditional machine learning, and the method has potential for clinical use, although further studies are needed to address data imbalance and other bacterial resistances.