Bacterial cluster motion classification method and system based on single image and deep learning

By using a bacterial cluster movement classification system based on single images and deep learning, a deep neural network (DNN) classifier is used to quickly identify bacterial clusters and planktonic movement patterns. This solves the problem of relying on manual intervention in existing technologies, achieves efficient and objective differentiation of bacterial movement types, is suitable for integration into portable devices, and improves the accuracy of disease screening.

CN120877279APending Publication Date: 2025-10-31KEYIN (SHANGHAI) MEDICAL TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510634071.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing technologies for detecting bacterial clusters rely on labor-intensive, time-consuming, and human-biased manual methods, making it difficult to achieve efficient, objective, and quantitative differentiation of bacterial motility types.

Method used

A bacterial swarm motion classification system based on single images and deep learning is adopted. The system uses a deep neural network (DNN) classifier to quickly identify swarm and planktonic motion patterns by training a single blurred image, providing an automated and objective quantitative assessment.

Benefits of technology

It enables rapid and accurate prediction of bacterial movement patterns in high-throughput environments, reduces human bias, is suitable for integration into portable devices, and improves the efficiency and accuracy of disease screening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877279A_ABST
    Figure CN120877279A_ABST
Patent Text Reader

Abstract

The invention discloses a bacterial cluster motion single image detection method and system based on deep learning, and the method and system are used for quickly and automatically distinguishing the states of cluster motion, swimming and the like of bacteria. According to the method, high-precision classification is realized by acquiring a long-exposure single blurred image of bacteria in a circular limited space and extracting spatial-temporal characteristics by using a dense connected neural network (DenseNet) with an attention module. The kit is suitable for a high-throughput environment, can be integrated into portable equipment, and is used for early diagnosis and treatment evaluation of diseases such as urinary system infection (UTI) and inflammatory bowel disease (IBD).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of microbial detection and artificial intelligence technology, specifically to a method and system for classifying bacterial cluster movement based on a single image and deep learning. Background Technology

[0002] Motility is a fundamental characteristic of bacteria. Differentiating between bacterial motility forms such as swarming and planktonic movement has significant conceptual and clinical implications. In existing techniques, the detection of bacterial swarms involves inoculating samples onto an agar surface and observing colony amplification. Methods using cyclic restriction to differentiate between swarming and planktonic motility offer some rapid methods for detecting swarms, but these are qualitative, time-intensive, and require additional testing to rule out other motility forms. However, they still heavily rely on the expertise of the laboratory personnel, making the process labor-intensive, costly, slow, and susceptible to unavoidable human bias. Existing swarm detection methods primarily rely on manual, time-consuming methods that are easily influenced by human bias and experience.

[0003] Specifically, in existing bacterial motility assays, researchers inoculate samples onto 0.5% (w / v) or 0.3% (w / v) agar surfaces and observe colony expansion to determine whether the sample bacteria are swimming or clustering. However, this qualitative method requires at least 10 hours and additional experiments to rule out sliding or gliding motion. To address this, previous work has successfully distinguished efficient and deterministic motility patterns between planktonic and clustered Enterobacter SM3 on soft agar surfaces by using polydimethylsiloxane (PDMS) chips with circular orifices to amplify the differences between clustering and planktonic motility patterns for clearer observation. This previous study investigated visual and physical differences between SM3 colonies and SM3 planktonic aggregators under confinement conditions using visual observation supplemented by vortex order parameters and spatial autocorrelation functions. Specifically, in addition to direct visual inspection, image sequences from each captured video were used to calculate velocity fields, and then parameters and functions were computed, revealing that clusters exhibit a single vortex motility pattern, while their planktonic counterparts form multiple randomly distributed localized vortices within confinement. This process requires manually labeling regions of interest (ROIs) and smoothing the vector field, which is relatively laborious, time-consuming, and error-prone, making it unsuitable for high-capacity and automated setups. Furthermore, the determination of thresholds for vortex order parameters and various other parameters used to distinguish between swarming and planktonic motion patterns is subjective and heavily reliant on empirical judgment, making it difficult to define and standardize fuzzy patterns and further complicating the interpretation of results. Therefore, there is an urgent need for an automatic, objective, and quantitative image recognition method capable of making accurate and rapid determinations of bacterial motion types.

[0004] The rapid development of artificial intelligence (AI) in recent years has provided a promising approach to solving this problem. Deep neural networks (DNNs) have distinguished themselves due to their remarkable ability to process high-dimensional, sparse, and noisy data exhibiting nonlinear relationships. This capability allows DNNs to identify subtle differences between similar images or videos, even in a variety of noisy environments. Consequently, DNNs have been widely applied in the biomedical field, such as microbial detection, disease detection, and cell, organelle, and organ segmentation. While AI has been used to analyze bacterial motility characteristics of species phenotypes and identify various stages of colony development, the direct, end-to-end differentiation of motility types, such as swarming and planktonic behavior, from raw microscopic videos or images remains largely unexplored. Invention Overview

[0005] To address these limitations, the inventors developed a bacterial cluster motion classification system based on a single image and deep learning to determine the type of surface bacterial movement. This classifier can quickly, accurately, and autonomously predict cluster probabilities using a single blurred image, with a long integration time, thus providing a quantitative and automated method suitable for high-throughput environments. Compared to traditional manual processing methods based on captured video, this method is particularly suitable for high-throughput environments and provides an objective quantitative assessment of cluster probabilities.

[0006] Unlike traditional video-based, manually intervened cluster detection methods (see...) Figure 1 (a) This deep learning method can quickly and automatically identify swarming events from the movement patterns of non-swarming planktonic organisms using a single blurred image, such as Figure 1 As shown in (b), a clustering DNN classifier developed using an attention-based neural network, trained to interpret specific spatiotemporal features encoded in a single image through long-term integration, distinguishes between clustering and planktonic motion patterns. It exhibits high specificity and sensitivity for both internal (SM3 bacteria) and external generalization tests, involving previously unseen bacterial types such as *Serratia marcescens* DB10 and *Citrobacter koseri* H6. This technique provides an automated, objective, efficient, and quantitative method for assessing the clustering probability of samples. This advancement has the potential to be developed into portable systems or integrated with simple disposable chips into smartphone-based devices, creating a convenient, rapid, and practical method for on-site screening of microbial motility in complex samples and facilitating the specific and sensitive detection of a wide range of bacterial diseases.

[0007] For example, the cluster classifier can be trained on Enterobacter SM3 and shows good performance when blindly tested on new cluster (positive) and floater (negative) test images of SM3, with a sensitivity of 97.44% and a specificity of 100%. Furthermore, the classifier exhibits strong external generalization ability when applied to unknown bacterial species such as Serratia marcescens DB10 and Citrobacter koseri H6. This competitive performance suggests the potential for applying this method to diagnostic applications via portable devices, which would facilitate rapid, objective, on-site screening of bacterial cluster movements and potentially enhance early detection and treatment assessment for various diseases, including inflammatory bowel disease (IBD) and urinary tract infections (UTI).

[0008] definition

[0009] Throughout the following description and claims, certain terms are used to refer to specific system components and configurations. As those skilled in the art will understand, the same component may be referred to by different names. This document is not intended to distinguish between components with different names but different functions. In the following discussion and claims, the terms “comprising” and “including” are used in an open-ended manner and should therefore be interpreted as “including, but not limited to…”. “Couple” or “couples” means indirect or direct connection. Thus, if a first device or apparatus is coupled to a second device or apparatus, the connection may be through a direct connection or through an indirect connection via other devices or apparatuses.

[0010] References to relative terms such as “top,” “front,” “bottom,” and “rear” are used to provide relative relationships between elements and are not intended to imply any absolute direction. For simplicity and clarity, various features can be drawn at any scale.

[0011] When used with the term "comprising" in the claims and / or specification, the word "a" or "an" may mean "one," but it also has the same meaning as "one or more," "at least one," and "one or more."

[0012] Throughout this application, the term “about” is used to indicate that a value includes the standard deviation of the error of the equipment or method used to determine that value.

[0013] As used herein, the term "sample" or "test sample" generally refers to material suspected of containing one or more target strains. Test samples can be used directly, such as obtained from the source, or pretreated to alter the characteristics of the sample. Test samples can be derived from any biological source, such as physiological fluids, including blood, interstitial fluid, saliva, lens fluid, cerebrospinal fluid, sweat, urine, breast milk, ascites, mucus, synovial fluid, peritoneal fluid, vaginal secretions, amniotic fluid, etc. Test samples can be pretreated before use, such as preparing plasma from blood, diluting viscous fluids, lysing microorganisms in the sample, etc. Treatment methods may include filtration, precipitation, dilution, distillation, mixing, concentration, inactivation of interfering components, lysis of organisms and / or cells, and addition of reagents. In addition to physiological fluids, other liquid samples such as water, food, soil, etc., can be used for environmental or food production analysis. Furthermore, solid materials suspected of containing targets can be used as test samples. In some cases, modifying solid test samples to form liquid media or release targets (e.g., nucleic acids) may be beneficial.

[0014] The term "cluster movement"

[0015] Swarming motion is the movement of many bacteria on a solid surface in the same direction by the rotation of their flagella. It is a collective, directional expansion movement. Swarming motion is characterized by high coverage and high diffusion speed; the population density is high because bacteria move in groups and cover a large area.

[0016] The term "plankton movement" is also known as "swimming."

[0017] Swimming motion is the movement of a single bacterium in a liquid environment, which is a type of individual, directional movement.

[0018] The term "signal contrast" refers to the quantitative measure of the intensity difference between a target region (such as a bacterial cluster) and a background region in an image or signal. It is used to evaluate the difficulty of distinguishing between clusters and floating motion states in a single image produced at different frame rates.

[0019] The term "loss function" and "weighted cross-entropy loss" are used in deep learning. A loss function is a mathematical function that measures the difference between the model's predictions and the true labels, guiding the optimization of model parameters (e.g., through backpropagation). The goal is to minimize the loss value. "Cross-entropy loss" is used in classification tasks to measure the difference between the predicted probability distribution and the true distribution; weighted cross-entropy is an improvement on standard cross-entropy, addressing data imbalance problems (such as when cluster samples are much fewer than floating samples) by assigning weights to different classes.

[0020] The term "Hough circle transform" refers to an image processing algorithm based on the Hough transform used to detect circular or arc-shaped structures in an image. Its principle is to map edge points in the image space to a parameter space (center coordinates, radius), and then determine the most likely circle through cumulative voting. Invention Details

[0022] This section further details and explains the invention in sections.

[0023] Preparation of microbial samples

[0024] Bacterial strains are revived and prepared into bacterial cultures, which are then inoculated onto soft plates containing agar. After the bacterial population begins to cluster for a certain period of time, a microfluidic chip is installed at the edge of the clustered bacterial population.

[0025] When installed with the micropores facing downwards, the moving bacteria are confined between the micropores and the culture medium on the soft plate.

[0026] The duration of bacterial population aggregation and movement can vary depending on the type of bacteria, for example, it can be 5-10, 6-8, 5-9, 5-8 hours, etc., specifically 6, 7, or 8 hours.

[0027] The strain was preserved in stock glycerol at -80°C; furthermore, the culture medium used for strain activation can be a commonly used culture medium, such as LB medium containing an aqueous solution of 10 g / L tryptone, 5 g / L yeast and 5 g / L NaCl.

[0028] Strain activation and recovery culture conditions: overnight in an incubator at 37°C with shaking at 200 rpm (e.g., 16 hours).

[0029] Inoculation procedure: Inoculate the overnight bacterial culture onto an agar plate. The bacterial culture can be a bacterial suspension, with a volume of 1-10 μL, such as 2 μL, 3 μL, 4 μL, 5 μL, 1 μL, 0.5 μL, etc. The inoculation density can be 102. 8 -10 10 cfu / ml; preferably 10 9 cfu / ml.

[0030] For example, the bacterial culture can be mixed with PBS to a concentration of 100 mg / ml and then spotted onto a culture dish for incubation. The bacteria are allowed to fill the microwells. Based on cell density calculations, bacterial colonies can form a layer 10–40 μm thick on the culture medium in microwells 22 μm deep.

[0031] The culture plate is a semi-solid plate, preferably a moist semi-solid surface such as soft agar, mucosa or ducts, methylcellulose semi-solid culture medium, or beef peptone semi-solid agar. There are no special restrictions on the material; any material that meets the required level of moisture can be used for the culture plate. The degree of moisture can be quantified by water activity (Aw), calculated using the formula: Aw = P / P0, where P is the vapor pressure of water in the sample, and P0 is the vapor pressure of pure water at the same temperature. The suitable water activity range for semi-solid plates with bacterial motility is between 0.90 and 0.999.

[0032] Taking soft agar as an example, the composition of agar can be adjusted, such as different agar concentrations or different nutrient components. It can be prepared using culture media known in existing technologies.

[0033] Furthermore, a preparation composition is provided as an example, but not intended to limit the scope of protection: 1% (w / v) tryptone, 0.5% (w / v) yeast, 0.5% (w / v) sodium chloride, 0.5% (w / v) agar, and 20 ml of deionized water, with a volume of 20 ml / plate. Agar can also be replaced with carrageenan, sodium alginate, gelatin, etc. Then, sterilization is performed using common sterilization methods such as autoclaving, dry heat sterilization, filtration sterilization, and ultraviolet sterilization. Cooling methods include cold water bath cooling, ice cooling, and fan cooling.

[0034] Chip Structure

[0035] The microfluidic biochip used in the sample preparation process is made of a transparent material containing multiple arranged micropores.

[0036] The pore size can be adjusted between 30μm and 200μm according to the characteristics of the micro-plankton, preferably 30-100μm, 30-90μm, 40-90μm, or 50-80μm.

[0037] For example, the micropore diameter can be 50μm, 55μm, 60μm, 65μm, 70μm, 73μm, 74μm, 75μm, 76μm, etc.

[0038] There are no special restrictions on the holes on a PDMS sheet. They can be arranged in the order of 100x100, 200x200, 300x300, etc., or any combination of integers of micro-holes. They are not limited to squares with equal lengths of horizontal and vertical sides. They can also be other geometric shapes that are easy to handle, such as rectangles, circles, rhombuses, etc.

[0039] The width and length of PDMS sheets can be customized to a single side length of 0.1-100cm, with preferred widths being 0.5cm x 0.5cm, 1cm x 1cm, 1.5cm x 1.5cm, and 2cm x 2cm.

[0040] The curvature of the upper and lower surfaces of the micropore can be non-uniform circles and other shapes such as irregular polygons, allowing for optimization on different surfaces.

[0041] The micropore depth can be 10-50μm, preferably 18-40μm, 18-30μm, 18-25μm, or 20-30μm. For example, the micropore depth can be 18μm, 19μm, 20μm, 21μm, 22μm, 23μm, 24μm, or 25μm.

[0042] The material used in biochips is polydimethylsiloxane (PDMS). However, any other transparent material that allows bacteria to move within the micropores can be used as an alternative. Suitable thermoplastic materials include silicon, glass, poly(methyl methacrylate) (PMMA), polycarbonate (PC), polyimide (PI), cyclic olefin copolymers (COC), natural polymers, cellulose membranes, gels, etc.

[0043] In one specific implementation method

[0044] A biochip, approximately 1 cm 2 Large, 0.3 mm thick. Each PDMS sheet is a biochip with a row of micropores on one side of its surface. The circular pores are 50 μm in diameter and 22 μm deep, with approximately 10,000 micropores on a single PDMS sheet.

[0045] A biochip, approximately 1 cm 2 Large, 0.3 mm thick. Each PDMS sheet is a biochip with a row of micropores on one side of its surface. The circular pores are 74 μm in diameter and 22 μm deep, with approximately 10,000 micropores on a single PDMS sheet.

[0046] A biochip, approximately 1 cm 2 Large, 0.3mm thick. Each PDMS sheet is a biochip with a row of micropores on one side of its surface. The circular pores are 65μm in diameter and 20μm deep, with approximately 10,000 micropores on a single PDMS sheet.

[0047] The preparation procedures for the samples and chips can be found in patent 2025104688540, which is cited in its entirety here for reference.

[0048] Image capture

[0049] After preparing the sample and confining it using a chip, an imaging device is used to capture images or videos of it.

[0050] The imaging device can be a phase contrast microscope.

[0051] When capturing video, it can be done at a certain frame rate, such as 10-50fps, 15-45fps, 10-40fps, 20-40fps, or more specifically, 20fps, 24fps, 29fps, 30fps, 31fps, 32fps, etc.

[0052] For example, the imaging field of view (FOV) spans approximately 422 × 353 μm. 2 This is equivalent to 2448×2048 pixels;

[0053] Phase contrast microscopes can include Olympus CKX41, Nikon Eclipse Ti2 / Ti-E, Nikon EclipseCi / E200, Nikon TS2 / TS2-FL, Leica DMi8, Zeiss Axio Observer 7, etc.

[0054] Objective lens magnification is 4x, 10x, 20x, 30x, or 40x, with 20-40x being preferred, based on the ability to capture a clear image.

[0055] Image processing and training / validation dataset preparation

[0056] After video capture shows bacteria in either a clustered (positive) or planktonic (negative) state, the image processing workflow for preparing the training / validation dataset is as follows (see...). Figure 10 Specifically, it includes an image processing workflow for preparing a single image as input for training, validation, and testing of a deep learning-based swarm classifier: original video of an independent experiment — cropping — 10 consecutive test holes — averaging along the time domain — single image of the test hole before normalization — normalization of the area outside the hole + blocking (set to 0) — single image of the test hole after normalization — deep learning-based swarm classifier.

[0057] Furthermore, this step can be automated using the Hough circle transform to identify and select complete circular holes for analysis. Figure 11 This demonstrates automatic hole selection based on the Hough circle transformation. Figure 11 (a) Displaying the first frame of a sample video before automatic hole selection; Figure 11 (b) A diagram showing the selection of complete micropores for analysis using the Hough circle transform.

[0058] First, manually select the centroid coordinates of a single microhole / constraint for each video. Then, use 500×500 pixels at all time points. The window size is cropped from the entire imaging FOV space, with the image sequence centered at these coordinates. To obtain a single image for each test hole to train / validate the deep learning-based cluster classifier, the cropped image sequence is averaged over every 10 consecutive frames in the temporal domain, simulating an integration time 10 times longer. The resulting single image is then normalized to zero mean and unit variance. Furthermore, to eliminate any interference from background features or noise, the intensity values ​​of the region outside the microhole are set to zero.

[0059] It is important to note that, as mentioned in the previous section, the labeling of the well images in our study was objectively derived due to the different experimental protocols used to prepare the wells for bacterial colony (positive) and planktonic (negative) states. Specifically, all negative samples were from the control protocol, while all positive samples were from experiments designed to induce colonies. This method effectively eliminates the possibility of label confusion between positive and negative wells. Furthermore, each well image was carefully examined manually to exclude any images exhibiting defocus or poor contrast. In total, the dataset includes training / validation images from 52 microwells from 6 colony experiments and 38 microwells from 10 planktonic experiments. Through time-varying data augmentation of the start and end points of the 10-frame sequence used for averaging, we generated 1301 positive images and 2703 negative images for training and validation.

[0060] Note the module

[0061] The deep learning-based cluster classifier was developed using DenseNet as its core architecture, and its detailed structure is as follows: Figure 2 As shown. Prior to the DenseNet architecture, attention modules built using standard convolutional neural networks were used to adaptively determine the radius r and centroid offset (s) of the circular active region on the attention map. x and s y This attention map is generated by the sigmoid function defined below.

[0062]

[0063] Where r, s x and s y These are the parameters predicted by the attention module, where x and y are the image indices in the horizontal and vertical directions, ranging from [-250, 250] pixels. k is a factor that adjusts the slope of the sigmoid function, empirically set to 0.0001. Furthermore, r prediction is constrained to the range of [160, 230] pixels, while s... x and s yPredictions are restricted to the [-10, 10] pixel range. Due to the continuous differentiability of the sigmoid function, using this function instead of binary segmentation to generate the attention map ensures correct backpropagation of gradients during training. For comparative neural networks using rectangular attention maps, the parameters output by the attention module differ from those used to define the circular attention map. The attention module does not output the radius r and the centroid offset (s). x and s y Instead of specifying height h, width w, and centroid offset (s), specify height h, width w, and centroid offset (s). x and s y The rectangular attention region is defined using the formula:

[0064]

[0065] Where h,w,S x and S y These are the parameters predicted by the attention module, used to define the position and size of the rectangular attention map. x and y are the image indices in the horizontal and vertical directions, ranging from [-250, 250] pixels. k is empirically set to 0.05. h and w predictions are limited to the range of [320, 460] pixels, and S... x and S y The prediction is restricted to [-10, 10] pixels. After obtaining the attention map, it is multiplied by the input image pixels. The resulting image serves as the final input to the DenseNet module to mitigate edge artifacts, particularly the peripheral bright rings observed in the frontal and negative test microhole images. This utilizes an attention mechanism, rather than for r,S x and S y Setting a fixed value allows for dynamic adjustment based on the current input. This approach not only helps eliminate edge artifacts but also ensures that the most valuable information is preserved in each test image and tolerates unavoidable centroid shifts during image cropping.

[0066] Furthermore, a loss function can be used to train the cluster classifier; the loss function used to train the cluster classifier network is further defined as the weighted cross-entropy loss:

[0067]

[0068] Where p represents the network output, which is the probability score for each class (clustered or non-clustered) before the SoftMax layer, and g is the ground truth, which is set to 0 (negative, non-clustered) or 1 (positive, clustered) in our binary classification setting (for the positive class, g...). k,1 =1, for the negative class, g k,2 =0), where k is the total number of training instances in a batch (k=32). w lThe weights assigned to each category to balance the uneven distribution of positive / negative samples are defined as w. l =1-d l , where d l It represents the percentage of samples in class l (d1 = 32.5% for positive samples and d2 = 67.5% for negative samples).

[0069] During training, we utilized techniques such as batch normalization and rejection (rate of 0.5). Image flipping and rotation were used when loading the training dataset for data augmentation. The network model was optimized using the Adam optimizer with momentum coefficients of (0.9, 0.999). The initial learning rate was set to 10⁻³ and decreased by a scheduler with a coefficient of 0.9 every 10 epochs. Our model was trained on an Nvidia GeForce RTX 3090 GPU with a batch size of 32. The final model used in our work was selected based on the lowest validation loss. Once the model is obtained, it takes only 0.4 seconds to predict the motion type (clustered or non-clustered) of a test hole image. The testing phase (for generating...) Figure 3 The fixed decision threshold was set to 0.72, which was determined from the validation dataset to maintain maximum sensitivity while achieving 100% specificity.

[0070] Comparative Analysis and Network Performance Evaluation of Different Integration Frameworks

[0071] To investigate how the number of ensemble frames used to generate a single image network input affects network performance, we first conducted a comparative analysis of Regions of Interest (ROIs) containing "bright ring" features that distinguish between clustered and floating motions. An ROI for a given hole is defined as having an inner diameter of 100 pixels. The outer diameter is 180 pixels. The ring. Then, we calculate the average intensity within the ROI (positive aperture is I) using a single image generated from 1, 5, 10, 15, or 20 consecutive frames averaged from the original video. pos The negative hole is I neg Next, these average strengths are calculated across all 114 positive and 111 negative holes in the blind test set, yielding the final value for each integral setting. See Figure 8 (cd)). Subsequently, we define the signal contrast as:

[0072]

[0073] The signal contrast value set for each integral is as follows: Figure 8As shown in (e). Furthermore, we trained four additional cluster detection neural networks, each using a single image averaged from 1, 5, 15, or 20 frames, respectively. Including our 10-frame ensemble standard setting, this yielded five models for comparative performance evaluation, with results in… Figure 8 As given in (f). To ensure fairness, all models use the same network architecture, training hyperparameters, convergence criteria, and other training / testing conditions, differing only in the number of frames used to generate their input images.

[0074] All image preprocessing and dataset preparation were performed using MATLAB R2022b (MathWorks). The code for training the cluster classification DNN model was developed in Python 3.7.11 using PyTorch 1.10.1. All network training and testing tasks were performed on a desktop computer equipped with an Intel Core i9-10920X CPU, 256GB of RAM, and an Nvidia GeForce RTX3090 GPU.

[0075] Network evaluation module

[0076] To evaluate the classification performance of our deep learning-based cluster classifier, we used measurements of sensitivity and specificity, defined as:

[0077]

[0078] TP represents a true positive, TN represents a true negative, FP represents a false negative, and FN represents a false negative.

[0079] Furthermore, in the t-SNE analysis, to highlight the characteristics of false positives and false negatives, we used the same input for feature extraction from a pre-trained VGG-16 model based on a deep learning-based classifier, as it is designed to simulate the hierarchical processing of visual information in the human visual system. The extracted features were then dimensionality-reduced using the t-SNE method, with the default settings provided in the PyTorch library applied. Figure 9 (b) shows the resulting two-dimensional projection.

[0080] Beneficial effects

[0081] This invention develops an AI-based motion testing model that can rapidly and accurately predict the probability of clusters within each test limit using a single image, with an integration time of approximately 0.3 seconds. Compared to colonoscopy or fecal microbiome metagenomic analysis, this non-invasive and cost-effective AI-based motion testing offers several advantages, including reduced patient discomfort, cost-effectiveness, rapid result delivery, and user-friendly readings. Furthermore, apart from the initial sample and image acquisition, the subsequent testing process is fully automated, requiring minimal human supervision and parameter tuning. This not only saves manpower but also ensures objective and quantitative assessment free from personal bias. Particularly valuable in high-volume environments (e.g., multiple biological samples grown in multi-well plates), the method of this invention significantly reduces reliance on human expertise and increases detection throughput compared to observation with human intervention, thus potentially enabling effective on-site screening for relevant diseases. An advantage of this method is the earlier acquisition of motion signals. Inspectors do not need to wait for colonies to grow into large clusters; small colonies with a diameter of approximately 2 cm are sufficient for testing. Furthermore, the method of this invention is applicable to various application scenarios, allowing for adjustments to sensitivity or specificity preferences based on specific needs through flexible decision threshold settings. For example, in cases where disease or infection may lead to serious consequences, the detection sensitivity of our method can be improved by lowering the decision threshold (a trade-off in specificity). Conversely, in cases of painful or resource-intensive treatment, the detection specificity can be enhanced (with a slight reduction in sensitivity) by setting a higher threshold in our method. Notably, this decision threshold adjustment will be a one-time effort tailored to each specific application scenario, which is fundamentally different from the intensive parameter tuning required for each individual measurement in traditional analysis methods. Finally, the single-image-based detection mechanism in our method does not require advanced microscopes with high frame rates. This facilitates the transfer of AI-based detection algorithms and disposable PDMS chips to portable devices, even smartphones, which could potentially be used to predict real-time cluster probabilities.

[0082] In summary, plug-and-play automated classification of bacterial motility using a single image with a long integration time of approximately 0.3 seconds is a significant step forward from the state-of-the-art. Further research into mixed bacterial environments in real fecal samples and user-friendly improvements to the current work could lead to the development of a practical application (e.g., for smartphones) capable of capturing and processing images in real time, providing a convenient and direct method for analyzing bacterial motility in a variety of environments. Attached Figure Description

[0083] Figure 1Deep learning enables bacterial motion analysis to detect swarming motion on surfaces. (a) Traditional video-based swarming detection methods require human intervention and observation, which is time-consuming, labor-intensive, and susceptible to various sources of error. (b) Deep learning-based swarming classifiers, once trained, can quickly and accurately predict bacterial motion patterns (swarms or plankton) on unknown data using a single image, with an integration time of approximately 0.3 seconds.

[0084] Figure 2 A network architecture for a deep learning-based cluster classifier. The DNN model is built on the DenseNet backbone. An attention module is used to adaptively generate attention maps, with adjustable radius and centroid offset for the circular active region of each aperture.

[0085] Figure 3 The performance of a deep learning-based classifier in blind testing of bacterial strains SM3, DB10, and H6 for cluster detection. (a) Three example images of SM3 clusters and planktonic / plankton patterns, along with the cluster probabilities predicted by our DNN model (left). The right side shows the confusion matrix tested on a dataset consisting of 39 clustered (positive) well images and 44 planktonic (negative) well images, along with reported sensitivity and specificity to demonstrate the model's internal generalization ability. (b) Same as (a), but with blind test results for DB10 (48 positive well images and 31 negative well images) and H6 (27 positive well images and 36 negative well images), demonstrating the external generalization ability of the same DNN model.

[0086] Figure 4 Sensitivity and specificity curves at different decision thresholds and ROC curves of a deep learning-based cluster classifier in blinded testing of SM3, DB10 and H6 bacterial strains.

[0087] (a) Use Figure 3 Using the same test dataset, the sensitivity and decision threshold of SM3 are compared.

[0088] (b) Use Figure 3 The specificity of SM3 versus the decision threshold on the same test dataset.

[0089] (c) ROC curve of SM3 Figure 3 On the same test dataset, AUC = 0.9988.

[0090] (df) is the same as (ac), but for DB10, AUC = 0.9933.

[0091] (gi) is the same as (ac) and (df), but for H6, AUC = 1.0.

[0092] Figure 5A comparison of sensitivity and specificity performance between deep learning-based cluster classifier models with and without attention modules. (a) Sensitivity achieved by training the model with or without attention modules on SM3 (internal generalization), DB10, and H6 (external generalization). (b) Specificity achieved by training the model with or without attention modules on SM3 (internal generalization), DB10, and H6 (external generalization).

[0093] Figure 6 A visualization of complementary attention maps superimposed on the original video frame sequence, using representative examples of positive apertures (top) and negative apertures (bottom). A single image (used as network input) of a positive example (top) and a negative example (bottom) is expanded and represented as a corresponding sequence of 10 consecutive original video frames. Each frame is overlaid with the complementary region of the circular attention map (yellow shading), clearly showing that the movement of a single bacterium is preserved within the central active region, while undesirable bright ring edge artifacts are suppressed. The radius of the circular active region corresponds to a contour with a sigmoid function equal to 0.5, explicitly defined by the output parameter r of the neural network attention module (see [link to documentation]). Figure 2 (Network structure in the text).

[0094] Figure 7 A comparison of sensitivity and specificity performance between deep learning-based cluster classifier models using circular and rectangular attention maps. (a) Sensitivity achieved by training models using circular and rectangular attention maps on SM3 (internal generalization), DB10, and H6 (external generalization). (b) Specificity achieved by training models using circular and rectangular attention maps on SM3 (internal generalization), DB10, and H6 (external generalization). (c) Example images from cluster micropores, and the corresponding circular and rectangular attention maps generated by the network attention module.

[0095] Figure 8 Comparative analysis and network performance comparison between different integrated frames were performed to generate a single-image network input. (a) The single-image network input image was obtained by averaging 1, 5, 10, 15, and 20 consecutive frames from the original video of representative cluster (positive) pores and representative planktonic (negative) micropores. (b) Illustration of the annular region of interest (ROI) containing “bright ring” features that distinguish cluster and planktonic motion. The average intensity within this ROI is defined as the I0 of the positive pore. pos and negative hole I neg (c) The average value was calculated from 114 positive test wells under different integration settings. (d) Calculate the average value from 111 negative test wells under different integration settings. (e) Under different integration settings, the signal contrast is defined as

[0096] Figure 9 Analysis of erroneous predictions and t-SNE feature projections. (a) Based on predictions from a deep learning-based cluster detection classifier, two images correspond to false positives (one SM3 well and one DB10 well) and two images correspond to false negatives (one H6 well and one DB10 well). (b) Two-dimensional feature projections of all test well images (including false positives and false negatives) obtained by tt-SNE analysis, which were extracted using a pre-trained VGG-16 model. Small clusters represent temporally augmented images from the same microwell video.

[0097] Figure 10 Image processing workflow for preparing individual images as input for training, validation, and testing of a deep learning-based swarm classifier.

[0098] Figure 11 Demonstration of automatic orifice selection based on Hough circle transform. (a) First frame of an example video before automatic orifice selection. (b) Illustration of selecting a complete micro-orifice for analysis using Hough circle transform. Detailed Implementation

[0099] This invention can be applied to detection in various fields and is not particularly limited. These are just examples, and the following are some typical application scenarios.

[0100] The deep learning model of this invention uses the standard library and scripts provided in PyTorch. The trained model, test code, and test images are stored on GitHub.

[0101] Strains were sourced from the following strains: Serratia marcescens DB10 strain from Cornelia Bargmann at Rockefeller University; SM3 strain, Enterobacter spp., was isolated from inflamed mice by Mani Lab11; DB10, Serratia marcescens, was a laboratory strain provided by Cornelia Bargmann at Rockefeller University; and Citrobacter koseri was isolated from human colonoscopy aspirates by Mani Lab11.

[0102] Example 1: A Deep Learning-Based Neural Network for Bacterial Cluster Detection

[0103] This specific embodiment of the deep learning-based bacterial cluster detection neural network is built on the DenseNet architecture using SM3 (Enterobacterium) bacteria, and is for illustrative purposes only and is not intended to limit the scope of protection of the claims.

[0104] The prepared microbial microarray samples were subjected to image and video capture under a phase contrast microscope (Olympus CKX41, 20x). As input to a deep learning-based swarm classifier, a single image per well was obtained by averaging 10 consecutive frames from the original video, equivalent to a total integration time of approximately 0.34 seconds per image. In this single blurred image, time-varying bacterial motion was encoded into the spatial domain, creating distinct trajectory patterns for the swarming and planktonic states of bacteria that the DNN model could learn and distinguish. Specifically, the swarming (positive) pattern is characterized by a prominent, centrally located bright ring in each long exposure image, caused by the collective and repetitive global rotational motion of the SM3 swarm. Conversely, the planktonic (negative) pattern, generated by the free movement of individual bacteria, produces more random and featureless trajectory patterns in each long exposure image. However, bright ring artifacts located at the well edges were also observed in both swarming and swimming bacterial samples, complicating the predictions of the DNN model. This is because the bacterial movement is restricted to the edges of the microwells, forcing the bacteria to move along these boundaries. To address this edge artifact and improve model accuracy, the attention module is integrated into the basic structure of the classifier (e.g., ...). Figure 2 (As shown). This module adaptively adjusts the radius and centroid offset of the circular active area of ​​each hole to mitigate the influence of the outer bright ring.

[0105] The deep learning-based clustering classifier was trained using a dataset of 1301 frontal images from 52 microholes and 2703 negative images from 38 microholes, with 90% used for training and the remaining 10% for validation. The trained network model predicts a continuous output value, ranging from 0 to 1, for each unknown test image, representing the probability of clustering motion. Using a predefined decision threshold, the model blindly classifies each test as either clustered or non-clustered based on its predicted score.

[0106] Validation of the attention module

[0107] The success of our deep learning-based cluster classifier lies in incorporating an attention module to mitigate edge artifacts. These bright, ring-shaped artifacts, present in both positive and negative aperture images, can interfere with the network's ability to learn useful features, thus degrading classifier performance. To further demonstrate the importance of the attention module used in our workflow, we conducted an ablation study by training another deep learning-based classifier using the same network architecture (with the attention module removed for contrast) and training settings. Figure 6The results clearly demonstrate the superiority of the model with the attention module, exhibiting higher sensitivity and specificity on both internal and external generalization tests compared to the model without the attention module. The integration of the attention module not only maintains high model accuracy but also prevents potential data loss that might arise from using circular active regions of a fixed radius across all input images. To illustrate the function of the attention map, we extend the single-image neural network input (one positive example and one negative example) to their original sequence of 10 consecutive original video frames, overlaying each frame with a complementary region of the circular attention map (yellow shading), as shown below. Figure 7 As shown, individual bacterial movements are clearly visible within the central active region defined by the attention map, while unwanted bright ring artifacts at the outer edges are effectively eliminated. This visualization highlights the clear spatial correlation between the bacterial movement region and the boundary depicted by the attention map, demonstrating that the map can selectively preserve key motion-related information within the active region while suppressing peripheral artifacts.

[0108] Advantages of circular attention maps

[0109] Furthermore, unlike other shapes, the underlying principle of utilizing circular attention maps is driven by the inherent tendency of collective bacterial movement—restrained by the circular geometry of the confining aperture and the formation of circular or vortex-like trajectories due to hydrodynamic interactions. Therefore, circular attention maps can more effectively capture these intrinsic movement patterns, thereby improving classification accuracy. To further validate this design choice, we trained an additional neural network using rectangular attention maps; the methodology section provides methodological details while maintaining consistency between the network structure and training hyperparameters in the experiments. Figure 8 The comparison results shown in (a–b) indicate that the classification performance of the rectangular attention map is significantly reduced, particularly affecting the detection sensitivity of strain DB10. Figure 8 (c) illustrates a representative comparison of circular and rectangular attention diagrams applied to the same cluster of micropores.

[0110] Verification of Integral Time

[0111] Another important factor affecting network performance is the integration time used to generate a single image network input, which can simulate various exposure durations in real-world imaging scenarios. Figure 8(a) shows integrated images of positive and negative holes generated by averaging / integrating different numbers of consecutive frames (1, 5, 10, 15, and 20) from the original video data. These images demonstrate that the optimal integration time achieves maximum contrast between swarming (positive) and planktonic (negative) states. When the integration time is too short, such as in a single frame, bacterial trajectories do not accumulate sufficiently, resulting in poor differences between states; notably, positive holes do not clearly exhibit the characteristic "bright ring" pattern indicative of collective bacterial swarming motion. Conversely, excessively long integration times also reduce the distinction between positive and negative holes, as the random movement of planktonic bacteria eventually covers the entire imaging area, making negative holes appear as positive holes. Figure 8 The image contrast analysis detailed in (b–e) quantitatively validates this observation. Figure 8 (b) The region of interest (ROI) shown in yellow shading primarily contains "bright ring" features that distinguish swarming from planktonic motion. For example... Figure 8 As shown in (c–d), the average intensity within the ROI for positive and negative holes was measured. Contrast was calculated as the proportional intensity difference between the positive and negative hole groups, as follows: Figure 8 As shown in (e), the highest contrast was obtained through integration over 10 frames. The classification accuracy of the neural network trained with different numbers of integration frames was evaluated. Figure 8 (f) further confirms this optimal integration length, where integrating over 10 consecutive frames (equivalent to an integration time of 0.34 s) achieved the highest accuracy on a test dataset containing three bacterial strains (SM3, DB10, and H6). Strain-specific analysis showed that while 10-frame integration was most efficient for SM3 and DB10, a shorter 5-frame integration was optimal for H6. This can be attributed to several factors, such as bacterial movement velocity, differences in density per well, and the unique movement characteristics of each strain. Given these comprehensive qualitative and quantitative insights, 10-frame integration (0.34 s) was established as the preferred condition for this invention.

[0112] Example 2: Internal and external generalization ability test of classifier performance

[0113] To blind test the effectiveness of our deep learning-based cluster classifier, we initially tested its internal generalization ability using new, unknown SM3 samples (the same type of bacteria used in training). Figure 3(a) shows three representative images for each SM3 cluster and planktonic / plankton pattern, along with the cluster probabilities blindly predicted by our DNN model. The predicted cluster probabilities correlate closely with the ground truth labels, assigning high values ​​to cluster patterns and low values ​​to planktonic patterns, demonstrating the model's accuracy in distinguishing these movement patterns. Subsequently, the cluster detection DNN model was blind-tested on a large dataset comprising 39 SM3 cluster (positive) micropore images from 5 independent experiments and 44 SM3 planktonic / planktonic (negative) micropore images from 7 independent experiments, achieving a sensitivity of 97.44% and a specificity of 100%. Detailed confusion matrix results are shown below. Figure 3 As shown in (a).

[0114] The blind testing of the deep learning-based cluster classifier was extended to include two novel bacterial strains, DB10 (Serratia marcescens laboratory strain) and H6 (Citrobacter citrate), which were not included in the training set; this constituted an external generalization test of the trained classifier. Classification results are summarized in... Figure 3 In (b), for DB10, the DNN model achieved a sensitivity of 97.92% and a specificity of 96.77% when tested on 48 clustered (positive) well images from 5 independent experiments and 31 planktonic / plankton (negative) well images from 5 independent experiments. Similarly, for H6, the model achieved a sensitivity of 100% and a specificity of 97.22% when tested on 27 clustered (positive) well images from 5 independent experiments and 36 planktonic / plankton (negative) well images from 5 independent experiments. Detailed confusion matrices of the classification performance of DB10 and H6 are also shown below. Figure 3 (b) shows the high accuracy achieved with these new bacterial types, demonstrating the strong external generalization ability of the trained DNN model. This indicates that the features the network learns to distinguish between swarming and planktonic patterns are not specific to a single bacterial species, and can be successfully generalized to other bacterial strains without retraining or transfer learning, highlighting the model's versatility and adaptability. Three sample positive videos (one each of SM3, DB10, and H6) and three sample negative videos (one each of SM3, DB10, and H6), along with the corresponding swarm probability scores predicted by our deep learning-based swarm classifier, are reported in Supplementary Videos 1 and 2, respectively.

[0115] To further evaluate the classification performance of our deep learning-based cluster classifier, we plotted the changes in sensitivity and specificity of SM3, DB10, and H6 strains at different decision thresholds, such as... Figure 4 As shown in (a, d, g). Sensitivity and Figure 4 The specificity of (b, e, h). Furthermore, the receiver operating characteristic (ROC) curves for each bacterial type are shown below. Figure 4As shown in (c, f, i), the trade-off between true positive and false positive rates under different threshold settings is illustrated. The area under the curve (AUC) is also reported for each case, indicating excellent classifier performance: 0.9988 for SM3, 0.9933 for DB10, and 1.0 for H6. These metrics highlight the high accuracy and robustness of the cluster classifier, demonstrating its strong internal and external generalization performance, and highlighting its effectiveness in accurately distinguishing the clustering and planktonic movement patterns of different bacterial types.

[0116] Example 3: Identification and Correction of False Negatives and False Positives

[0117] Despite achieving very high classification accuracy on the blind test dataset, the neural network still produced two false negatives (one SM3 well and one DB10 well) and two false positives (one DB10 well and one H6 well), as shown below. Figure 9 As shown in (a). In these cases, misclassified images often exhibit blurry or boundary features and tend to be located near the decision boundary, as demonstrated by our t-distributed random neighbor embedding (t-SNE) feature projection analysis. Figure 9 (b) Features were extracted using a pre-trained Visual Geometry Group (VGG-16) model. These errors can be mitigated by adopting a more advanced network architecture, increasing the training data with additional examples, and improving the attention mechanism. Furthermore, it is noteworthy that the network correctly classified many other instances near the decision boundary, suggesting that fine-tuning or designing task-specific tasks is necessary for optimal cluster detection.

[0118] Strain-specific motility patterns can be used to distinguish virulence from surface adhesion of the probiotic E. coli 54. These observations may also apply to other bacterial strains, where a species may have several substrains, some with host-beneficial properties and others with host-virulent properties. The deep learning-based AI-driven motility detection method demonstrated in our work could be extended to predict host-beneficial or virulent properties based solely on motility patterns. To ensure prediction accuracy, a comprehensive analysis of colony and planktonic motility can be performed on both soft and hard surfaces, including multiple bacterial strains and different rheological surfaces (e.g., mucins). Prior knowledge of virulence and beneficial strains can serve as fundamental facts. Following predictions from the AI ​​model, beneficial colonies of strains can be managed for various applications, such as probiotic or drug delivery, as well as external convection methods.

[0119] Furthermore, based on current deep learning-based cluster detection methods, future work could focus on deciphering the formation of restricted cluster types in mixed bacterial cultures, followed by combined tests using mixtures of multiple clustering and non-clustering species. However, it is important to note that the single-strain bacterial cluster identification proposed in our study is already valuable for detecting dominant clusters growing in fecal samples, as there is always a clustering strain at the edge of the sample clone. Another future goal could be to test motion detection models in environments with restricted flow fields. For example, actual fecal samples with such obstacles (e.g., non-motile food particles) could be used for testing. Through these future studies, it is possible to obtain AI-based predictive models for determining population patterns in complex media such as feces or soil. This strategy could ultimately be used to monitor the relationship between host symbiotic or motile pathogens, soil bacteria, soil conditions, and plant (crop) health, and even, for example, the impact on coral bacteria, to monitor climate change. Automated, plug-and-play determinations of cluster probabilities could be studied in the context of chemical attractants embedded in agar to observe which environmental or xenobiotic chemicals can trigger acceleration or deceleration of cluster behavior. In this context, these chemicals can be used to therapeutically suppress bacterial clusters (e.g., catheter-induced urinary tract pathogens) or to promote cluster phenotypes (e.g., gut-induced inflammation). Similar approaches have been investigated for individual bacterial species.

[0120] Example 4: Expansion of Motile Bacteria

[0121] The method of this invention can verify strains with typical motile speeds of approximately 10-50 μm / s, 20-50 μm / s, and 10-40 μm / s, such as strains with motile speeds of 20 μm / s, 25 μm / s, 30 μm / s, and 40 μm / s, and cell lengths of approximately 0.1-25 μm, 0.1-20 μm, 0.1-15 μm, 0.2-10 μm, and 0.2-5 μm, specifically lengths of 0.5 μm, 1 μm, 3 μm, 4 μm, and 5 μm. These are typical parameters for motile bacteria. This invention has verified selected Gram-negative bacterial species isolated from feces (SM3, H6) and laboratory strains (DB10) (see the aforementioned research results). In fact, while obligate anaerobes do not aggregate, some Gram-positive bacteria (e.g., Bacillus subtilis) may exhibit statistically striking combinations of cell length and planktonic velocity, altering their limited collective movement patterns, but all are detectable within certain limits using the method of this invention. Furthermore, our deep learning-based swarm detection model was derived using a smooth agar surface under fixed humidity and ambient temperature conditions, typically 40% humidity and 37°C. The smoothness index of the agar is generally directly related to the agar concentration; for example, the optimal agar concentration for swarm detection is 0.4-0.7%, more preferably 0.5%. This may be sufficient to create a standardized clinical test, but there is also great potential to achieve similar results with rheologically different surfaces or agar gel media (e.g., rough agar, mucin, different agar compositions for swarm plates).

[0122] Furthermore, hierarchical motility libraries of bacterial mutants (e.g., iCRISPR libraries) can be used to potentially adapt model parameters to a broader context, as motility between strains can change in subtle ways. More importantly, very different environments may exist within the body, and transitions between planktonic and colony dynamics can occur (e.g., from semi-solid mucosal surfaces to microfluidic pools).

[0123] Example 5: Application of clustered bacteria as an effective biomarker for detecting several diseases

[0124] Our research addresses the critical challenge of distinguishing between bacterial swarming and planktonic movement, two key forms of locomotion associated with bacterial pathogenesis and therapeutic potential. Locomotion is an inherent characteristic of bacteria; despite the energy expenditure, it offers a high return by enabling bacteria to actively acquire nutrients and escape harmful environments. Planktonic / zooplankton and swarming are two major forms of bacterial locomotion. Planktonic movement involves a single bacterium using flagella to propel itself in a single direction within a liquid environment. Swarming, however, requires a group of bacteria moving rapidly and in a coordinated manner in the same direction on a semi-solid surface, facilitated by flagella and surfactants. Both concepts, swarming and planktonic, are flagella-mediated and are sometimes confused; for example, dense groups of planktonic bacteria are often referred to as a “cluster of bacteria.” However, most microbiologists recognize that swarming and planktonic represent fundamentally different types of locomotion. Understanding their differences has significant research and clinical value because swarming bacteria can exhibit unique properties not possessed by bacteria lacking swarming capabilities. Swarming bacteria can move efficiently on semi-solid surfaces and exhibit unique characteristics in infecting hosts or demonstrating therapeutic effects compared to bacteria that only possess planktonic capabilities without swarming abilities. For example, in patients with both catheter-related and non-catheter-related urinary tract infections (UTIs), 80% of pathogenic clinical isolates are urinary tract pathogenic *Escherichia coli* (UPECs). A major determinant of UPEC virulence in UTIs is colony (biofilm) formation. In mice, UPECs migrate upwards from the bladder to infect the kidneys; however, swarm-deficient UPECs fail to infect the kidneys. Another example is *Proteus* (*Proteus mirabilis*), a gregarious bacterium whose urinary virulence is significantly correlated with gregarious behavior. Contrary to the generally detrimental effects usually associated with gregarious bacteria, recent studies have shown that enriched gregarious bacteria under conditions of intestinal stress may produce beneficial effects. Specifically, gregarious bacteria have been shown to promote intestinal mucosal repair and reduce inflammation, thus demonstrating therapeutic efficacy against inflammatory bowel disease (IBD).

[0125] In the case of IBD, the inventors discovered significant differences between patients with and without intestinal inflammation in clinical samples (feces or colonoscopy aspirates). The inventors also demonstrated that clustered isolates from mice (and humans), such as SM1 (isolated from control mice) and SM3 (isolated from colitis mice), differed in clustering rates but not in their floatability. Given these findings, there is a clear need to develop efficient and cost-effective methods to detect the presence of clustered bacteria in urine and fecal samples, thereby aiding in the diagnosis of infections or related diseases such as IBD.

[0126] To emphasize the importance of distinguishing bacterial swarming behavior, it is beneficial to examine the pathological mechanisms of urinary tract and gastrointestinal infections. As previously mentioned, in addition to the unique role of swarming bacteria as UTI pathogens, bacterial swarming is also closely related to the treatment of UTIs. Specifically, the probiotic non-swarming *Escherichia coli* 83972, recognized in the 2015 European Association of Urology guidelines, has shown significant prophylactic (and antibiotic-retaining) properties. Due to poor flagellar formation, this bacterium cannot aggregate or float; however, it can colonize without virulence. A recent report showed that in individuals colonized with *E. coli* 83972 who presented with UTI symptoms, *E. coli* 83972 regained its flagellar mechanism and began to motility (other factors remained unchanged). This suggests that motility in UTIs can be conditionally pathogenic. Furthermore, bacterial swarming colony inhibitors, generally those that affect quorum sensing, are a non-antibiotic strategy for combating inflammation and virulence.

[0127] Warming bacteria also play a crucial role in gut health. In the normal gut, bacteria downregulate the synthesis of flagellar or motility genes, but the bacterial populations present in colonoscopy aspirates and stool samples from IBD patients are increased. Several pathogens, such as Salmonella and Proteus, are associated with IBD and exhibit clustering characteristics. These observations directly suggest clustering in the pathogenesis, rather than preventing intestinal inflammation. In contrast, our previous work has shown that symbiotic microbiota can prevent host inflammation and provides clues for the development of personalized probiotics. In the case of IBD, patients' stool samples showed a significant upregulation of flagellar and motility genes compared to healthy donors. This implies that early detection of commensal movement in stool could be developed into a diagnostic test for IBD. More importantly, early isolation of dominant clustered strains may provide novel probiotics for IBD, with the advantage of autologous rather than heterologous sources. These findings underscore the need to develop efficient and cost-effective methods for detecting clustered bacteria in urine and stool samples, enabling rapid diagnosis of infections and related diseases.

Claims

1. A bacterial swarm motion classification system based on a single image and deep learning, comprising the following structure (1) Image acquisition module: The bacterial sample is placed in the limiting hole of the microfluidic chip, and multiple consecutive frames are captured by the image or video acquisition device and a single blurred image is generated on average to encode the bacterial movement trajectory. (2) Attention module: It is constructed using a standard convolutional neural network. It adaptively adjusts the radius and centroid offset of the circular active region of each hole, which can dynamically shield edge bright ring artifacts, preserve the features of the central active region, and generate a circular or rectangular attention map. After obtaining the attention map, it is multiplied with the pixels of the input image, and the resulting image is used as the final input of the DenseNet module. (3) Deep learning classification model module: A cluster motion classifier is built based on DenseNet to output the probability of cluster motion.

2. In the classification system according to claim 1, the image acquisition module can acquire images using a phase contrast microscope; it can capture raw video at a frame rate of 10-50fps; specifically, it can also be 15-45fps, 10-40fps, or 20-40fps.

3. The classification system according to claim 2, wherein each neural network uses a single image averaged from 1, 5, 10, 15 or 20 frames respectively.

4. The classification system according to claim 1, wherein the microfluidic biochip used in the bacterial sample preparation process is made of a transparent material comprising multiple arranged micropores.

5. The classification system according to claim 1, further comprising an image processing and training and validation dataset preparation module, used to perform image processing on the training / validation dataset after video capture shows bacteria in a positive or negative state, using a single image as training data for a deep learning-based population classifier.

6. The classification system according to claim 5, wherein the preparation module comprises the following steps: original video of independent experiment - cropping - 10 consecutive test holes - averaging along the time domain - single image of test hole before standardization - standardization + blocking (set to 0) of the area outside the hole - single image of test hole after standardization - cluster classifier based on deep learning.

7. In the classification system according to claim 6, the bacterial clustering state is considered positive, and the bacterial planktonic state is considered negative.

8. The classification system according to claim 5, wherein the training steps of the preparation module are automatically performed using the Hough circle transform.

9. The classification system of claim 1, wherein the attention module uses a circular attention map, using a radius r and a centroid offset (s). x and s y The circular attention region is defined by equation (1); the circular attention map is generated by the S-shaped function defined in equation (1). Where r, s x and s y These are the parameters predicted by the attention module, where x and y are the image indices in the horizontal and vertical directions, ranging from [-250, 250] pixels. k is a factor that adjusts the slope of the sigmoid function.

10. The classification system according to claim 1, wherein the attention module uses a comparative neural network of rectangular attention maps, and the attention module specifies the height h, width w, and centroid offset (s). x and s y The rectangular attention region is defined using the formula: Where h, w, s x and s y These are the parameters predicted by the attention module, used to define the position and size of the rectangular attention map. x and y are the image indices in the horizontal and vertical directions, ranging from [-250, 250] pixels.

11. The classification system of claim 1, further comprising a loss function for training the cluster classifier network, It is the weighted cross-entropy loss, defined as shown in equation (3): Where p represents the network output, which is the probability score for each class before the SoftMax layer, and g is the ground truth, which is set to 0 (negative, non-clustered) or 1 (positive, clustered) in the binary classification setting (for the positive class, g = 0). k,1 =1, for the negative class, g k,2 =0), k is the total number of training instances in a batch (k=32); w l The weights assigned to each category to balance the uneven distribution of positive / negative samples are defined as w. l =1-d l , where d l It represents the percentage of samples in class l (d1 = 32.5% for positive samples and d2 = 67.5% for negative samples).

12. The classification system according to claim 11, wherein batch normalization and rejection are used during training, image flipping and rotation are used when loading the training dataset for data augmentation, and the network model is optimized using the Adam optimizer.

13. The classification system of claim 12, wherein the model is trained on an Nvidia GeForce RTX 3090 GPU and the final model obtained is selected based on the lowest validation loss.

14. The classification system according to claim 1 further includes an integral frame number control module, which is capable of comparative analysis of ROIs containing "bright ring" features that distinguish between swarming and floating motion.

15. The classification system according to claim 14, wherein the integral frame number control module includes the following steps: defining the ROI value of a certain hole, and calculating the average intensity within the ROI (I for a positive hole) using a single image generated from multiple consecutive frames in the original video. pos The negative hole is I neg These average strengths are calculated across all positive and negative holes in the blind test set to derive the final value for each integral setting. and 16. The classification system according to claim 15, wherein the signal contrast is defined as shown in equation (4): The positive hole is I. pos The negative hole is I neg, The final value set for each point is... and 17. The classification system of claim 1 further includes a network evaluation module that uses measurements of sensitivity and specificity to evaluate the classification performance of the deep learning-based cluster classifier.

18. The classification system according to claim 17, wherein the measured values ​​of sensitivity and specificity are defined by formulas as shown in equations (5) and (6): TP represents a true positive, TN represents a true negative, FP represents a false negative, and FN represents a false negative.

19. The classification system of claim 18, wherein in the t-SNE analysis, the same input used by the deep learning-based classifier is used for feature extraction by a pre-trained VGG-16 model to simulate the hierarchical processing of visual information in the human visual system, the extracted features are dimensionality reduced using the t-SNE method, and the resulting two-dimensional projection is displayed using the default settings provided in the PyTorch library.

20. The classification system according to claim 1, wherein the bacterial cluster motion classification system based on a single image and deep learning has internal and external generalization capabilities. Internal generalization capability: the classifier has a sensitivity ≥97% and a specificity ≥99% for detecting cluster motion of bacterial samples that are not part of the training data and are from the same source as the training data. External generalization capability: the classifier has a sensitivity ≥97% and a specificity ≥96% for detecting cluster motion of other bacterial strains (such as Serratia marcescens DB10 and Citrobacter coli H6) that are not part of the training data, and requires no retraining or transfer learning.

21. A bacterial swarm movement classification method based on a single image and deep learning, characterized in that, Bacterial swarm movement classification analysis was performed using the bacterial swarm movement classification system described in claims 1-20.

22. The method of claim 21, for use in diagnosing catheter-related and non-catheter-related urinary tract infections (UTIs) and inflammatory bowel disease (IBD), or for use in providing intermediate diagnostic data for diagnosing catheter-related and non-catheter-related urinary tract infections (UTIs) and inflammatory bowel disease (IBD).

Citation Information

Cited By

  • Biological micro-flow chip device and application thereof in microorganism movement mode detection

    CN120555166A

  • A bio-microfluidic chip device and its use in detecting microorganism motility patterns

    CN120555166B