Label-free identification of bacterial species using adapted vision transformers
Abstract
Antibiotic resistance is an increasingly serious problem worldwide. Identifying the bacterial species can help guide antibiotic selection and improve patient outcomes. In sepsis, where every minute counts, rapid identification is particularly important, and new approaches are needed. In this study, deep learning models were trained to identify bacterial species from phase-contrast time-lapse images of cells growing in microfluidic traps, without fluorescent labels. We demonstrated this approach in two previous studies using laboratory strains. Here, the previous work is extended to clinical bacterial isolates, evaluating performance on isolates not seen during training. Furthermore, it was tested whether autofluorescence could aid species identification. Two validation sets were acquired in separate experiments from the training data, the first containing clinical-isolate traps with five species (Escherichia coli, Enterococcus faecalis, Klebsiella pneumoniae, Staphylococcus aureus and Enterobacter cloacae), imaged every two minutes, and the second containing clinical isolates of two species (E. coli and K. pneumoniae) recovered from spiked donor blood, imaged every minute. Training with the best previous CNN method achieved unsatisfactory results. Therefore, vision transformers were explored, and a self-supervised adaptation procedure was developed for pretrained DINOv3 using a frozen teacher, followed by supervised classification using time-lapse montages. Mean macro-F1 was 93.6 {+/-} 1.3% for isolates precultured in Mueller-Hinton medium using 60 frames (118 minutes) and 87.2 {+/-} 2.7% for isolates precultured in blood using 55 frames (54 minutes) (mean {+/-} sample standard deviation across training seeds). Performance was evaluated over time by increasing the number of frames available to the model during testing, and Fourier-domain filtering approximated reduced numerical aperture. The results are promising and suggest that the aperture can be decreased while retaining good results. However, further evaluation on independent isolates, experiments and patient samples is needed to establish generalization. Together with previous findings, these results bring us closer to rapid image-based diagnostics that could transform the initial treatment of acute bacterial infections by enabling better-informed antibiotic selection.
Related
- Vision Transformers versus convolutional neural networks for fine-grained orchid genus identification in a species-rich, data-poor flora: a controlled benchmark on the Orchidaceae of New Guinea
- Vision Transformers Enable Advanced Plant Phenotyping in Controlled Environments
- Biologically grounded locality priors close the data gap for vision transformers in neural prediction
- BananaVLM: A Domain-Adapted Vision Language Model for Banana Crop Disease Diagnosis
- Exploring emotion identification and categorisation in simulated central vision loss: an event-related potential study.
BibTeX
@misc{hallstrom2026labelfree,
title = {{Label-free identification of bacterial species using adapted vision transformers}},
author = {E. Hallström and V. Kandavalli and M. H. Marino Miguelez and J. Elf and C. Wählby},
howpublished = {bioRxiv},
year = {2026},
month = oct,
doi = {10.64898/2026.10.09.757828},
url = {https://www.biorxiv.org/content/10.64898/2026.10.09.757828v1},
note = {CC BY},
}
RIS
TY - UNPB
TI - Label-free identification of bacterial species using adapted vision transformers
AU - E. Hallström
AU - V. Kandavalli
AU - M. H. Marino Miguelez
AU - J. Elf
AU - C. Wählby
PY - 2026
DA - 2026/10/09
PB - bioRxiv
DO - 10.64898/2026.10.09.757828
UR - https://www.biorxiv.org/content/10.64898/2026.10.09.757828v1
AB - Antibiotic resistance is an increasingly serious problem worldwide. Identifying the bacterial species can help guide antibiotic selection and improve patient outcomes. In sepsis, where every minute counts, rapid identification is particularly important, and new approaches are needed. In this study, deep learning models were trained to identify bacterial species from phase-contrast time-lapse images of cells growing in microfluidic traps, without fluorescent labels. We demonstrated this approach in two previous studies using laboratory strains. Here, the previous work is extended to clinical bacterial isolates, evaluating performance on isolates not seen during training. Furthermore, it was tested whether autofluorescence could aid species identification. Two validation sets were acquired in separate experiments from the training data, the first containing clinical-isolate traps with five species (Escherichia coli, Enterococcus faecalis, Klebsiella pneumoniae, Staphylococcus aureus and Enterobacter cloacae), imaged every two minutes, and the second containing clinical isolates of two species (E. coli and K. pneumoniae) recovered from spiked donor blood, imaged every minute. Training with the best previous CNN method achieved unsatisfactory results. Therefore, vision transformers were explored, and a self-supervised adaptation procedure was developed for pretrained DINOv3 using a frozen teacher, followed by supervised classification using time-lapse montages. Mean macro-F1 was 93.6 {+/-} 1.3% for isolates precultured in Mueller-Hinton medium using 60 frames (118 minutes) and 87.2 {+/-} 2.7% for isolates precultured in blood using 55 frames (54 minutes) (mean {+/-} sample standard deviation across training seeds). Performance was evaluated over time by increasing the number of frames available to the model during testing, and Fourier-domain filtering approximated reduced numerical aperture. The results are promising and suggest that the aperture can be decreased while retaining good results. However, further evaluation on independent isolates, experiments and patient samples is needed to establish generalization. Together with previous findings, these results bring us closer to rapid image-based diagnostics that could transform the initial treatment of acute bacterial infections by enabling better-informed antibiotic selection.
ER -