AI predicts bacterial swarming from a single blurry image, unlocking new diagnostic possibilities

Swarming is one of the principal forms of bacterial motility facilitated by flagella and surfactants. It plays a distinctive role in both disease and healing. For example, in urinary tract infections (UTIs), swarming bacteria can aggressively migrate across tissue surfaces, contributing to the spread and severity of infection. Conversely, in inflammatory bowel disease (IBD), certain swarming microbes have been shown to promote gut lining repair.
These contrasting roles highlight the potential of the detection of swarming bacteria as a valuable biomarker for diagnosing and monitoring various conditions.
Although both swarming and swimming are driven by flagella, they represent fundamentally different behaviors. Swimming involves individual bacteria moving independently through liquid environments, whereas swarming is a coordinated group movement across semi-solid surfaces, aided by surfactants that enable the group of bacteria to move in unison.
To study these behaviors in detail, researchers often place tiny circular wells made of a soft polymer along the edges of bacterial colonies. Under an optical microscope, swarmers display a large, single swirl that circulates across the entire well. In contrast, swimmers generate multiple small, disorganized local swirls—like scattered whirlpools moving in no particular direction.
Traditionally, distinguishing these motion patterns requires video recording and expert visual inspection, limiting its scalability and accuracy.
In a recent study led by Professor Aydogan Ozcan at UCLA and Professor Sridhar Mani at Albert Einstein College of Medicine, researchers introduced a deep learning-based method for automatically detecting bacterial swarming from a single blurry microscopic image. The paper is in the journal Gut Microbes.
This automated approach eliminates the need for manual expert video analysis, making the process faster and more accurate. This is especially well-suited for high-throughput applications and provides objective, quantitative readouts.
By using a single long-exposure image that encodes time-varying motion into the spatial smear patterns, this method eliminates the need for high-frame-rate video capture, making it more accessible and practical for use in resource-limited settings.
By training an AI model on thousands of microscopy images corresponding to a strain of bacteria, the team developed a neural network capable of distinguishing the characteristic motion patterns of swarming from swimming with very high accuracy—achieving a sensitivity of 97.44% and a specificity of 100%.
Remarkably, the classifier not only performed well on the bacterial strain used in training but also generalized effectively to entirely different types of bacteria without the need for retraining the network, maintaining over 96% sensitivity and specificity.
This AI-powered bacterial swarming detection method represents a significant advancement for diagnostic microbiology applications. Future work will focus on evaluating the method under a variety of conditions, including complex environments with mixed bacterial populations.
With its automated readout and simple imaging hardware, this approach also holds strong potential for integration with smartphone-based imagers—enabling portable, on-site, and non-invasive detection of swarming bacteria.
More information: Yuzhu Li et al, Deep learning-based detection of bacterial swarm motion using a single image, Gut Microbes (2025).