Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jan 10;11(2):eads2757.
doi: 10.1126/sciadv.ads2757. Epub 2025 Jan 8.

Virtual Gram staining of label-free bacteria using dark-field microscopy and deep learning

Affiliations

Virtual Gram staining of label-free bacteria using dark-field microscopy and deep learning

Çağatay Işıl et al. Sci Adv. .

Abstract

Gram staining has been a frequently used staining protocol in microbiology. It is vulnerable to staining artifacts due to, e.g., operator errors and chemical variations. Here, we introduce virtual Gram staining of label-free bacteria using a trained neural network that digitally transforms dark-field images of unstained bacteria into their Gram-stained equivalents matching bright-field image contrast. After a one-time training, the virtual Gram staining model processes an axial stack of dark-field microscopy images of label-free bacteria (never seen before) to rapidly generate Gram staining, bypassing several chemical steps involved in the conventional staining process. We demonstrated the success of virtual Gram staining on label-free bacteria samples containing Escherichia coli and Listeria innocua by quantifying the staining accuracy of the model and comparing the chromatic and morphological features of the virtually stained bacteria against their chemically stained counterparts. This virtual bacterial staining framework bypasses the traditional Gram staining protocol and its challenges, including stain standardization, operator errors, and sensitivity to chemical variations.

PubMed Disclaimer

Figures

Fig. 1.
Fig. 1.. Virtual Gram staining of unlabeled bacteria via deep learning.
(A) Conventional Gram staining is susceptible to human errors and involves manual sample processing in contrast to virtual Gram staining, which rapidly translates the dark-field axial image stack of label-free bacteria into bright-field equivalent images, matching their Gram-stained counterparts, circumventing chemical reagents and manual processing in the staining workflow. (B) Zoomed-in ROIs comparing the results of the virtual Gram staining with the conventional chemical staining approach.
Fig. 2.
Fig. 2.. Comparison of virtual and conventional Gram staining methods on unlabeled bacteria.
(A) Sample FOVs after virtual and standard Gram staining of unlabeled bacteria. Accuracy maps demonstrate successful and failed instances of virtual Gram staining for each individual bacterium in the FOV. TP, FS, BH, and FN represent true positive, false staining, bacterial hallucination, and false negative cases, respectively. (B) Average evaluation metrics computed across all the images of the mixed test dataset containing both E. coli and L. innocua.
Fig. 3.
Fig. 3.. Comparison of chromatic and morphological features of virtually and chemically stained bacteria.
Feature distributions of segmented bacteria from target (ground truth) and virtually stained output images are illustrated, accompanied by quantitative assessments. Gram-positive (+) and Gram-negative (−) bacteria refer to L. innocua and E. coli, respectively. Four morphological features including surface area, diameter, circularity, and eccentricity and four chromatic features encompassing color intensities (red, green, and blue) as well as a color intensity ratio (red/blue) are visualized. The HD is used to quantify the similarity between the feature distributions of the segmented bacteria from chemically and virtually stained output images.
Fig. 4.
Fig. 4.. Analysis of the accuracy of the virtual Gram staining across different bacteria concentration levels.
Predicted and target concentrations of Gram+ and Gram− bacteria in monocultures (E. coli only and L. innocua only) and a mixed culture (E. coli and L. innocua) are visualized. The coefficients of determination (R2 values) for all cases are computed to quantify the goodness of fit between the predicted and ground truth bacterial concentrations for each case. Normalized NRMSEs for Gram+ and Gram− monocultures are 0.082 and 0.102, respectively. In the mixed culture, NRMSEs of Gram+ and Gram− cases are 0.080 and 0.111, respectively.
Fig. 5.
Fig. 5.. Accuracy comparison of virtual Gram staining across different size intervals of bacteria.
(Top) Distribution of total TP, FP, and FN cases across different intervals of bacteria surface area (ρ ≤ surface area ≤ ρ + 0.1 μm2, for each point ρ on the x axis). (Middle) Precision and recall values of Gram-positive (+, L. innocua) and Gram-negative (−, E. coli) bacteria are presented for different size intervals. (Bottom) Overall precision and recall values are shown across various bacteria size intervals. The median surface areas of E. coli and L. innocua, computed using Gram-stained bacteria (ground truth), were 0.892 and 0.317 μm2, respectively. Vertical dashed lines represent median surface areas for Gram-positive and Gram-negative bacteria, which were calculated using five target images containing Gram-stained bacteria (with minimal overlap of Gram-positive and Gram-negative bacteria).

Similar articles

References

    1. Gram H. C., Ueber die isolirte Farbung der Schizomyceten in Schnitt-und Trockenpraparaten. Fortschritte der Medicin 2, 185–189 (1884).
    1. Bartholomew J. W., Mittwer T., The Gram stain. Bacteriol. Rev. 16, 1–29 (1952). - PMC - PubMed
    1. B. B. Biswas, P. S. Basu, M. K. Pal, Gram Staining and Its Molecular Mechanism, in International Review of Cytology, G. H. Bourne, J. F. Danielli, K. W. Jeon, Eds. (Academic Press, 1970), vol. 29, pp. 1–27. https://www.sciencedirect.com/science/article/pii/S0074769608600315. - PubMed
    1. Froböse N. J., Bjedov S., Schuler F., Kahl B. C., Kampmeier S., Schaumburg F., Gram staining: A comparison of two automated systems and manual staining. J. Clin. Microbiol. 58, e0191420 (2020). - PMC - PubMed
    1. Beveridge T. J., Use of the Gram stain in microbiology. Biotech. Histochem. 76, 111–118 (2001). - PubMed