Trajectory determination method based on bacterial flagella stain image

Through the trajectory determination method of bacterial flagellum stained images, combined with target detection and trajectory tracking algorithms, it solves the problem of difficulty in judging bacterial movement decisions in the presence of obstacles with existing technology, achieves accurate analysis and decision-making of bacterial movement trajectories, and improves the accuracy of the research.

WO2024193105A1PCT designated stage expired Publication Date: 2024-09-26SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI

Patent Information

Application Number
PCT/CN2023/137231
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-20
Filing Date
2023-12-07
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

Existing bacterial movement trajectory analysis methods are only suitable for liquid environments, and it is difficult to accurately judge bacterial movement decisions in random terrain with obstacles.

Method used

A trajectory determination method based on bacterial flagellum staining images is adopted. By acquiring bacterial flagellum staining videos, target detection algorithms and trajectory tracking algorithms are used to identify the location of the bacteria and track their movement trajectories, thereby determining the movement decisions of the bacteria. The method includes preprocessing images, target detection and trajectory tracking, using Kalman filtering and Hungarian assignment algorithm for matching and association to generate movement trajectories and movement decisions of bacteria.

Benefits of technology

Accurately judging the movement decisions of bacteria under random terrain improves the accuracy of bacterial movement trajectory analysis, can better reflect the true movement status and behavior of bacteria, and provides valuable data for biomedical engineering research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023137231_26092024_PF_FP
    Figure CN2023137231_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed is a trajectory determination method based on a bacterial flagella stain image. The method comprises: obtaining a bacterial flagella stain video, and according to the bacterial flagella stain video, determining a plurality of bacterial flagella stain images; inputting each bacterial flagella stain image into a target detection algorithm, and obtaining each of the bacterial flagella stain images which contains a detection frame, wherein the detection frame is used for reflecting the position of a bacterium; inputting into a trajectory tracking algorithm each bacterial flagella stain image containing the detection frame, and obtaining the movement trajectories respectively corresponding to a plurality of bacteria; and according to the movement trajectory of each bacterium, determining a motion decision respectively corresponding to each bacterium. The present invention combines bacterial flagella fluorescence microscopy imaging technology with a target detection algorithm and a trajectory tracking algorithm, thereby solving the problems that existing bacterial motion trajectory analysis methods are only suitable for liquid environments, and when a random terrain has an obstacle, it is difficult to accurately judge the motion decision of a bacterium.
Need to check novelty before this filing date? Find Prior Art

Description

A trajectory determination method based on bacterial flagella staining images Technical Field

[0001] The present invention relates to the field of image analysis, and in particular to a trajectory determination method based on bacterial flagella staining images. Background Art

[0002] Bacterial chemotaxis is a crucial mechanism for bacteria to sense and respond to environmental changes, and is crucial for their survival and reproduction in diverse environments. Bacteria sense chemical concentration gradients in their environment and adjust their movement to move toward or away from certain stimuli. Bacterial chemotaxis is a highly complex behavior that involves the coordinated action of multiple components, such as receptors, signal transduction systems, and motile flagella. Therefore, research on bacterial chemotaxis helps to reveal the mechanisms by which bacteria sense and respond to their environment and can also provide insights for research in the field of biomedical engineering.

[0003] There have been several studies on bacterial chemotaxis. However, these studies primarily focus on analyzing bacterial trajectories in liquids (without obstacles). In random terrain, bacterial trajectories are affected by obstacles, making it difficult to determine bacterial movement decisions based on their trajectories.

[0004] Therefore, the existing technology still needs to be improved and developed. Technical issues

[0005] The technical problem to be solved by the present invention is to provide a trajectory determination method based on bacterial flagella staining images in response to the above-mentioned defects of the prior art, aiming to solve the problem that the existing bacterial motion trajectory analysis method is only applicable to liquid environments and is difficult to accurately judge the bacterial motion decisions in random terrain with obstacles. Technical Solutions

[0006] The technical solutions adopted by the present invention to solve the problem are as follows:

[0007] In a first aspect, an embodiment of the present invention provides a trajectory determination method based on a bacterial flagella stained image, wherein the method comprises:

[0008] Acquire a bacterial flagella staining video, and determine a plurality of frames of bacterial flagella staining images based on the bacterial flagella staining video;

[0009] Inputting each frame of the bacterial flagella stained image into a target detection algorithm to obtain each frame of the bacterial flagella stained image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria;

[0010] Inputting each frame of the bacterial flagella stained image containing the detection frame into a trajectory tracking algorithm to obtain movement trajectories corresponding to a number of the bacteria;

[0011] According to the movement trajectory of each of the bacteria, a movement decision corresponding to each of the bacteria is determined.

[0012] In one embodiment, a plurality of bacterial flagellar staining images are determined based on the bacterial flagellar staining video, including:

[0013] Determine a plurality of frames of original bacterial flagella staining images according to the bacterial flagella staining video;

[0014] Preprocessing is performed on each frame of the original bacterial flagella stained image to obtain each frame of the bacterial flagella stained image, wherein the preprocessing includes one or more operations of image denoising, image enhancement, and image segmentation.

[0015] In one embodiment, the target detection algorithm works as follows:

[0016] For each frame of the bacterial flagella stained image input, detecting the position information and category information of each of the bacteria in the bacterial flagella stained image;

[0017] generating the detection frames corresponding to the respective bacteria according to the position information of the respective bacteria;

[0018] The color, ID, and prediction confidence of each category corresponding to each detection frame are determined according to the category information of each bacteria, wherein different categories of bacteria use detection frames of different colors.

[0019] In one embodiment, the target detection algorithm is pre-trained, and the training method includes:

[0020] Inputting the training image into an untrained object detection algorithm to obtain coordinate data corresponding to a plurality of prediction boxes in the training image and prediction confidence scores of various categories;

[0021] Obtaining a plurality of real annotation boxes corresponding to the training image;

[0022] Determining the degree of overlap between each prediction frame and the corresponding annotation frame by using an intersection-over-union ratio, and classifying each prediction frame according to the prediction confidence and the degree of overlap of each prediction frame;

[0023] Determine the performance index of the target detection algorithm based on the classification result, and judge whether the performance index meets the training requirements. If not, continue to execute the step of inputting the training image into the target detection algorithm that has not completed training until the performance index meets the training requirements, thereby obtaining the trained target detection algorithm.

[0024] In one embodiment, the trajectory tracking algorithm works as follows:

[0025] For each frame of the bacterial flagella stained image input, a target prediction result of the bacterial flagella stained image of the frame is obtained by a Kalman filter tracking algorithm according to the detection frame of the bacterial flagella stained image of the previous frame;

[0026] Obtaining a target detection result of the bacterial flagella stained image, and calculating an intersection-over-union overlap matrix of the target detection result and the target prediction result;

[0027] According to the intersection-over-union overlap matrix, the target of the bacterial flagella stained image frame is assigned by the Hungarian assignment algorithm to obtain the optimal match;

[0028] Determine, based on the optimal match, target data association and position association where the intersection-over-union ratio between the bacterial flagella stained image of the frame and the bacterial flagella stained image of the previous frame is higher than or equal to a preset threshold;

[0029] It is determined whether all frames of the bacterial flagella stained image containing the detection frame have been processed. If so, the movement trajectory corresponding to each of the bacteria is determined based on all the generated target data associations and the position associations.

[0030] In one embodiment, determining the movement decision corresponding to each of the bacteria according to the movement trajectory of each of the bacteria includes:

[0031] determining kinematic characteristics corresponding to each of the bacteria according to the movement trajectory of each of the bacteria;

[0032] The motion decisions corresponding to the bacteria are determined according to the kinematic characteristics of the bacteria.

[0033] In one embodiment, the method further comprises:

[0034] marking the movement decision of each of the bacteria on the detection frame of each of the bacteria;

[0035] A bacteria tracking video is generated based on the bacterial flagella staining image in each marked frame.

[0036] In a second aspect, an embodiment of the present invention further provides a trajectory determination device based on a bacterial flagella staining image, wherein the device comprises:

[0037] an acquisition module, configured to acquire a bacterial flagella staining video and determine a plurality of bacterial flagella staining images based on the bacterial flagella staining video;

[0038] a detection module, configured to input each frame of the bacterial flagella stained image into a target detection algorithm to obtain each frame of the bacterial flagella stained image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria;

[0039] A tracking module, configured to input each frame of the bacterial flagella stained image containing the detection frame into a trajectory tracking algorithm to obtain movement trajectories corresponding to a plurality of the bacteria;

[0040] The determination module is used to determine the movement decision corresponding to each of the bacteria according to the movement trajectory of each of the bacteria.

[0041] In a third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory and one or more processors; the memory stores one or more programs; the program includes instructions for executing any of the above-mentioned trajectory determination methods based on bacterial flagellar staining images; and the processor is used to execute the program.

[0042] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are suitable for being loaded and executed by a processor to implement any of the steps of the above-mentioned method for determining a trajectory based on a bacterial flagellar staining image. Beneficial effects

[0043] Beneficial effects of the present invention: The embodiments of the present invention solve the problem that the existing bacterial motion trajectory analysis method is only applicable to liquid environments and is difficult to accurately judge the bacterial motion decisions in random terrain with obstacles by combining bacterial flagella fluorescence microscopy imaging technology, target detection algorithm and trajectory tracking algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] FIG1 is a flow chart of a method for determining a trajectory based on a bacterial flagella staining image provided by an embodiment of the present invention.

[0046] FIG2 is a schematic diagram comparing the bacterial flagella staining image before and after enhancement provided by an embodiment of the present invention, with the left side showing the image before enhancement and the right side showing the image after enhancement.

[0047] FIG3 is a schematic diagram of image annotation using LabelImg provided by an embodiment of the present invention.

[0048] FIG4 is a diagram showing the working principle of a trajectory tracking algorithm provided by an embodiment of the present invention.

[0049] FIG5 is a schematic diagram showing the results of a trajectory tracking algorithm provided by an embodiment of the present invention.

[0050] FIG6 is a schematic diagram of analysis of bacterial trajectories and identification results provided by an embodiment of the present invention.

[0051] FIG7 is a module diagram of a trajectory determination device based on a bacterial flagella staining image provided by an embodiment of the present invention.

[0052] FIG8 is a functional block diagram of a terminal provided by an embodiment of the present invention. Modes for Carrying Out the Invention

[0053] The present invention discloses a method for determining trajectory based on a stained bacterial flagella image. To clarify the objectives, technical solutions, and effects of the present invention, the present invention is further described below with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are intended only to illustrate the present invention and are not intended to limit the present invention.

[0054] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the description of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.

[0055] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0056] In view of the above-mentioned defects of the prior art, the present invention provides a trajectory determination method based on a bacterial flagella staining image, as shown in FIG1 , the method comprising:

[0057] Step S100, obtaining a bacterial flagella staining video, and determining a plurality of frames of bacterial flagella staining images according to the bacterial flagella staining video;

[0058] Step S200: Input each frame of the bacterial flagella stained image into a target detection algorithm to obtain each frame of the bacterial flagella stained image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria;

[0059] Step S300, inputting each frame of the bacterial flagella stained image containing the detection frame into a trajectory tracking algorithm to obtain movement trajectories corresponding to a number of the bacteria;

[0060] Step S400: determining a motion decision corresponding to each of the bacteria according to the movement trajectory of each of the bacteria.

[0061] Specifically, in random terrain, bacterial trajectories may be obstructed by obstacles, making it difficult to accurately determine bacterial trajectories using traditional trajectory analysis methods. This makes subsequent research and analysis, such as analyzing bacterial status and movement decisions, difficult. To address this issue, this embodiment combines bacterial flagella fluorescence microscopy to capture bacterial flagellar staining videos. Traditional observation methods cannot directly observe the morphology of bacterial flagella, hindering subsequent research into detailed movement decisions. For each flagellar staining video frame, a target detection algorithm is used to identify bacteria within the flagellar staining image, and the locations of the identified bacteria are marked with detection frames. Each flagellar staining image containing a detection frame is then input into a trajectory tracking algorithm, which matches each detection frame to predict the movement trajectory of each bacterium, thus resolving the problem of bacterial trajectories being obstructed by obstacles in random terrain. Finally, the movement decisions of each bacterium are analyzed based on its movement trajectory, such as whether the bacterium is currently swimming or spinning.

[0062] In one implementation, determining a plurality of frames of bacterial flagella stained images based on the bacterial flagella stained video specifically includes:

[0063] Determine a plurality of frames of original bacterial flagella staining images according to the bacterial flagella staining video;

[0064] Preprocessing is performed on each frame of the original bacterial flagella stained image to obtain each frame of the bacterial flagella stained image, wherein the preprocessing includes one or more operations of image denoising, image enhancement, and image segmentation.

[0065] Specifically, in order to make the photographed bacteria clearer and the format more suitable for image processing algorithms, this embodiment also requires preprocessing each frame of the original bacterial flagella stained image captured, including but not limited to one or more operations of image denoising, image enhancement, and image segmentation.

[0066] For example, we used ImageJ software to preprocess the captured video. First, we converted the 16-bit image to 8-bit. Then, we enhanced the image contrast by setting the Saturated pixels parameter to 0.3%. The result is shown in Figure 2.

[0067] In one implementation, the target detection algorithm works as follows:

[0068] For each frame of the bacterial flagella stained image input, detecting the position information and category information of each of the bacteria in the bacterial flagella stained image;

[0069] generating the detection frames corresponding to the respective bacteria according to the position information of the respective bacteria;

[0070] The color, ID, and prediction confidence of each category corresponding to each detection frame are determined according to the category information of each bacteria, wherein different categories of bacteria use detection frames of different colors.

[0071] Specifically, when the target detection algorithm receives an input image of bacterial flagella, it performs image detection to determine the location and category of the bacteria in the image, thereby generating detection frames for each bacterium. To facilitate differentiation, each detection frame is labeled with the corresponding bacterial ID and the prediction confidence level for each category, and different detection frames are used for different categories of bacteria.

[0072] In one implementation, the target detection algorithm is constructed based on a model among YOLOv5, Faster R-CNN, and SSD.

[0073] In one implementation, the target detection algorithm is pre-trained, and the method for obtaining the training image set of the target detection algorithm includes: splitting the generated bacterial flagellar staining video into several frames of bacterial flagellar staining pictures; randomly selecting a part of the pictures for annotation, and then randomly selecting a part of the annotated pictures as the verification image set, and the remaining pictures as the training image set.

[0074] For example, a video of bacterial flagella staining was generated and split into images using Python code. 237 images were randomly selected for annotation, 29 of which were then randomly selected as validation images, and the remaining images were used as training images. LabelImg, a Python-based image annotation software compatible with the YOLOv5 model, was then used for image annotation (as shown in Figure 3). It is important to note that this process requires careful attention to distinguishing between swimming and spinning states in the image, and to ensure that the detection box is accurately marked at the edge of each bacterium.

[0075] In one implementation, the training method of the target detection algorithm includes:

[0076] Inputting the training image into an untrained object detection algorithm to obtain coordinate data corresponding to a plurality of prediction boxes in the training image and prediction confidence scores of various categories;

[0077] Obtaining a plurality of real annotation boxes corresponding to the training image;

[0078] Determining the degree of overlap between each prediction frame and the corresponding annotation frame by using an intersection-over-union ratio, and classifying each prediction frame according to the prediction confidence and the degree of overlap of each prediction frame;

[0079] Determine the performance index of the target detection algorithm based on the classification result, and judge whether the performance index meets the training requirements. If not, continue to execute the step of inputting the training image into the target detection algorithm that has not completed training until the performance index meets the training requirements, thereby obtaining the trained target detection algorithm.

[0080] Specifically, this embodiment trains the target detection algorithm using the training image set generated above, and then verifies it using the validation image set. During training, the target detection accuracy index corresponding to the algorithm must first be set: the predicted rectangular coordinates of each target in the output image and the prediction confidence Conf of each category, and the intersection-over-union (IOU) is used to measure the degree of overlap between the predicted box and the actual annotation box to determine whether the positioning of the predicted box is accurate. The IOU calculation formula is as follows:

[0081] ;

[0082] Where Bp is the predicted box and Bgt is the labeled box.

[0083] Then, through the relationship between the predicted box and the labeled box, each predicted box is classified based on the prediction confidence and overlap of each category. According to the classification results, the performance index of the target detection algorithm can be calculated to determine whether the target detection algorithm meets the training requirements. If not, repeat the above steps and continue training until the training requirements are met.

[0084] For example, according to the relationship with the annotation box, each predicted box can be divided into the following four categories: TP (True Positive), FP (False Positive), FN (False Negative) and TN (True Negative).

[0085] TP:{Conf>Pthresh and IOU>IOUthresh};

[0086] FP:{Conf>Pthresh and IOU<IOUthresh};

[0087] FN:{Conf<Pthresh and IOU>IOUthresh};

[0088] TN:{Conf<Pthresh and IOU<IOUthresh};

[0089] Where IOUthresh is a constant between 0 and 1 and needs to be manually specified. Based on the classification results, a confusion matrix is ​​constructed for the four prediction boxes. This example uses Precision, Recall, AP, mAP@0.5, and mAP@0.5:0.95 as performance indicators, and further defines the following parameters:

[0090] (1) Precision refers to the proportion of correct predictions among all prediction boxes, reflecting the accuracy of the model in "not mistaking background for target". Its calculation formula is as follows:

[0091] ;

[0092] (2) Recall (recall rate, sensitivity, recall rate) refers to the proportion of all labeled boxes that are correctly predicted, reflecting the sensitivity of the model to "not ignore the target as background". Its calculation formula is as follows:

[0093] ;

[0094] (3) Average Precision (AP): Change the Pthreshold threshold from 0 to 1, calculate the Precision and Recall corresponding to each Pthreshold threshold, and draw a PR performance curve for a certain category. The area enclosed is the AP of the category. Taking the AP of all categories and different IOUthresh, mAP@0.5 and mAP@0.5:0.95 can be calculated respectively. mAP@0.5 is the average AP of each category when IOUthresh is 0.5. mAP@0.5:0.95 is the average AP of each category when IOUthresh is 10 times increased from 0.5 to 0.95 with a step size of 0.05.

[0095] ;

[0096] ;

[0097] .

[0098] In one implementation, when training the target detection algorithm, the graphics card used is RTX3090, and in order to balance the training recognition effect and computing performance, the size of each input image of the target detection algorithm is scaled from 2048*2048 to 1600*1600, and the batch size is 6.

[0099] In one implementation, the trajectory tracking algorithm works as follows:

[0100] For each frame of the bacterial flagella stained image input, a target prediction result of the bacterial flagella stained image of the frame is obtained by a Kalman filter tracking algorithm according to the detection frame of the bacterial flagella stained image of the previous frame;

[0101] Obtaining a target detection result of the bacterial flagella stained image, and calculating an intersection-over-union overlap matrix of the target detection result and the target prediction result;

[0102] According to the intersection-over-union overlap matrix, the target of the bacterial flagella stained image frame is assigned by the Hungarian assignment algorithm to obtain the optimal match;

[0103] Determine, based on the optimal match, target data association and position association where the intersection-over-union ratio between the bacterial flagella stained image of the frame and the bacterial flagella stained image of the previous frame is higher than or equal to a preset threshold;

[0104] It is determined whether all frames of the bacterial flagella stained image containing the detection frame have been processed. If so, the movement trajectory corresponding to each of the bacteria is determined based on all the generated target data associations and the position associations.

[0105] Simply put, the trajectory tracking algorithm in this embodiment is an online real-time tracking method. Its main principle is to establish a linear constant velocity model for each detected object, independent of other objects and camera motion. The Kalman filter method is used to predict the state of each object in the current frame (predicted value). The Hungarian algorithm and the target detection model are then used to perform data association with the detection state (observed value) of the current frame. Specifically, as shown in Figure 4, the Kalman filter is first initialized based on the detection results of the first few frames of video. After initialization, when the tth frame appears, the detection box of the t-1 frame is first used to predict the target in the tth frame using the Kalman filter tracking algorithm to obtain the predicted result. Based on the target detection results in the tth frame, the IOU overlap matrix between the detection results and the predicted results is calculated. The Hungarian assignment algorithm is then used to assign the target in the tth frame to the IOU overlap matrix, resulting in the optimal match and the most appropriate target data and position association between frames. Associations whose IOUs fall below a certain threshold during Hungarian algorithm matching are eliminated. When the IOUs of the target detection results and the Kalman prediction results after matching using the Hungarian assignment algorithm are less than the set threshold, it is determined that a new target has entered. In one implementation, if the number of detected targets exceeds the predicted number, the extra targets are added to the tracking results, and the Kalman filter state for those targets is initialized. In another implementation, if the number of detected targets is less than the predicted number, this indicates a target mismatch. These targets are marked as missing frames, and targets with consecutive missing frames exceeding a certain threshold are deleted. This shows that the performance of the trajectory tracking algorithm is significantly influenced by the target detection algorithm. Finally, matching is performed to produce the resulting state matrix.

[0106] The state transition matrix F_t is a matrix that describes the dynamics of the system. It shows how the state at the previous moment affects the state at the current moment. For example, if we want to estimate the position and velocity of an object, the state transition matrix may look like this:

[0107] F_t=[[1, dt],[0, 1]]

[0108] Where dt is the time interval. This matrix indicates that the current position is equal to the position at the previous moment plus the velocity multiplied by the time interval, and the current velocity is equal to the velocity at the previous moment.

[0109] The resulting state matrix is ​​used to update the Kalman filter, calculate the new Kalman gain, covariance, and the new target state vector. Continue with detection and prediction for frame t+1, and repeat the above steps until the sequence detection and tracking is complete.

[0110] In one implementation, the trajectory tracking algorithm is constructed based on a tracking algorithm among SORT and Particle Filter.

[0111] In one implementation, determining the movement decisions corresponding to the bacteria according to the movement trajectories of the bacteria specifically includes:

[0112] determining kinematic characteristics corresponding to each of the bacteria according to the movement trajectory of each of the bacteria;

[0113] According to the kinematic characteristics of each of the bacteria, a motion decision corresponding to each of the bacteria is determined.

[0114] Specifically, this embodiment can determine the current kinematic characteristics of the bacteria, such as speed and / or angular velocity, by analyzing the movement trajectory of the bacteria. Since there is a certain mapping relationship between the movement decision of the bacteria and the kinematic characteristics, the current movement decision of the bacteria can be analyzed based on the kinematic characteristics of the bacteria.

[0115] In one implementation, when the kinematic characteristic is a speed characteristic, since the motility of each bacterium is different, the swimming speed of each bacterium at each time point is calculated, and then scaled based on the top 5% maximum value of its speed as a standard to obtain the standardized bacterial swimming speed.

[0116] In one implementation, the kinematic characteristics of each bacterium are used to determine a motion decision corresponding to each bacterium. Specifically, for each bacterium, the confidence level (classification confidence level) for each bacterium is determined based on the kinematic characteristics of the bacterium, such as the confidence level for swimming or spinning. The confidence level for spinning is then subtracted from the confidence level for swimming. If the bacterial flagellum is in the "swimming" state, the confidence level is positive; conversely, if the bacterial flagellum is in the "spinning" state, the confidence level is negative. The larger the absolute value of the confidence level, the more confident the YOLOv5 classification network is in the judgment of that state. The absolute value of the confidence level is limited to 1.

[0117] In one implementation, the method further includes:

[0118] Performing probability density distribution analysis on all points of the movement trajectory of each bacterium with standardized swimming speed;

[0119] According to the classification confidence of each bacterium and the probability density distribution analysis result, the movement state / movement decision corresponding to each bacterium is determined.

[0120] Specifically, as shown in Figure 6 (left), the density distribution of bacterial classification confidence and normalized velocity at various time points shows that in liquid environments, bacteria can be divided into two states: swimming and spinning. However, in an environment with a 0.3% agarose concentration, some bacteria maintain a swimming morphology but exhibit very low velocity, indicating that they are stuck in an obstacle. The right side of Figure 6 shows the distribution of time and distance of bacterial swimming in each state.

[0121] In one implementation, the method further includes:

[0122] marking the movement decision of each of the bacteria on the detection frame of each of the bacteria;

[0123] A bacteria tracking video is generated based on the bacterial flagella staining image in each marked frame.

[0124] Specifically, as shown in FIG5 , the detection frame of each bacterium in the bacteria tracking video generated by this embodiment is assigned a different color and ID, and is marked with the current movement decision / movement status of the bacteria, thereby visualizing the analysis results, including the real-time tracking trajectory of the bacterial position, the visual display of the bacterial state changes, etc.

[0125] To demonstrate the technical effects of the present invention, the inventors used the YOLOv5 target recognition algorithm and trajectory tracking algorithm to process bacterial flagellar staining fluorescence images, and conducted a series of experiments and tests to verify the feasibility and effectiveness of the present invention. First, the inventors used publicly available datasets and self-collected datasets for testing. The experimental results show that the technical solution proposed in the present invention can effectively perform target recognition and trajectory tracking on bacterial flagellar staining fluorescence images, and can accurately determine the movement state of bacteria. In addition, the inventors also performed performance tests on the algorithm used in the present invention. The results show that the algorithm proposed in the present invention has high accuracy and speed, and can meet the needs of practical applications.

[0126] The advantages of the present invention are:

[0127] 1. Efficiently and accurately identify bacterial movement patterns: This paper adopts the deep learning-based target recognition algorithm YOLOv5, and inputs bacterial fluorescence microscopy videos into the model for analysis and processing. Compared with traditional algorithms based on manual feature extraction and traditional machine learning, the YOLOv5 model has the advantages of lightweight model, high accuracy, and fast inference speed. It can more efficiently and accurately identify the movement patterns of bacteria.

[0128] 2. Real-time tracking of bacterial movement trajectory: The present invention uses a trajectory tracking algorithm to track bacteria in real time, which can accurately extract the movement trajectory of bacteria. Compared with traditional methods, it can better reflect the actual movement state of bacteria and more accurately analyze and judge the behavior of bacteria.

[0129] 3. Combining movement status and classification information to make decisions: The present invention combines the speed information and target classification information of bacteria to judge and analyze the current state of bacteria, which can better understand and explain the behavior and decision-making of bacteria, and provide effective tools and means for further studying the movement behavior of bacteria.

[0130] 4. The technical solutions of the present invention can also be applied to other fields, such as biomedicine and ecology. For example, the present invention can be used to study the movement of cells, animals, plants, etc., analyze their behavioral characteristics, and improve understanding of their life activities. Furthermore, the present invention can also be applied to fields such as environmental monitoring and food safety, for detecting and analyzing the movement and behavioral characteristics of microorganisms to achieve effective control and management.

[0131] 5. Traditional observation methods cannot directly observe the morphology of bacterial flagella, and therefore cannot accurately determine bacterial movement decisions. This invention achieves direct observation of bacterial flagellar morphology by modifying specific sites in the E. coli flagellin protein and combining it with fluorescent microscopy of bacterial flagella. This observation of bacterial flagellar morphology can be used to determine the current movement decision of bacteria. Furthermore, a deep neural network algorithm for bacterial state recognition and an object tracking algorithm are used to quantitatively observe and analyze bacterial chemotaxis in different environments.

[0132] Based on the above embodiment, the present invention further provides a trajectory determination device based on a bacterial flagella staining image, as shown in FIG7 , the device comprising:

[0133] An acquisition module 01 is configured to acquire a bacterial flagella staining video and determine a plurality of bacterial flagella staining images based on the bacterial flagella staining video;

[0134] Detection module 02, used to input each frame of the bacterial flagella stained image into a target detection algorithm to obtain each frame of the bacterial flagella stained image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria;

[0135] Tracking module 03, used for inputting each frame of the bacterial flagella stained image containing the detection frame into a trajectory tracking algorithm to obtain the movement trajectories corresponding to the bacteria;

[0136] The determination module 04 is configured to determine the movement decision corresponding to each of the bacteria according to the movement trajectory of each of the bacteria.

[0137] Based on the above embodiments, the present invention further provides a terminal, a functional block diagram of which can be shown in FIG8 . The terminal includes a processor, a memory, a network interface, and a display screen connected via a system bus. The processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a trajectory determination method based on a bacterial flagellar staining image is implemented. The display screen of the terminal can be a liquid crystal display or an electronic ink display.

[0138] Those skilled in the art will understand that the principle block diagram shown in Figure 8 is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0139] In one implementation, the terminal has one or more programs stored in its memory, and is configured to be executed by one or more processors. The one or more programs include instructions for performing a trajectory determination method based on a bacterial flagella staining image.

[0140] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media used in the various embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0141] In summary, the present invention discloses a trajectory determination method based on bacterial flagellar staining images, the method comprising: obtaining a bacterial flagellar staining video, and determining a plurality of frames of bacterial flagellar staining images based on the bacterial flagellar staining video; inputting each frame of the bacterial flagellar staining image into a target detection algorithm to obtain each frame of the bacterial flagellar staining image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria; inputting each frame of the bacterial flagellar staining image containing the detection frame into a trajectory tracking algorithm to obtain movement trajectories corresponding to a plurality of the bacteria; and determining the motion decision corresponding to each of the bacteria based on the movement trajectory of each of the bacteria. By combining bacterial flagellar fluorescence microscopy imaging technology, a target detection algorithm, and a trajectory tracking algorithm, the present invention solves the problem that existing bacterial motion trajectory analysis methods are only applicable to liquid environments and are difficult to accurately judge the motion decisions of bacteria in random terrains with obstacles.

[0142] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A trajectory determination method based on bacterial flagella staining images, It is characterized in that The method comprises: Acquire a bacterial flagella staining video, and determine a plurality of frames of bacterial flagella staining images according to the bacterial flagella staining video; Inputting each frame of the bacterial flagella staining image into a target detection algorithm to obtain each frame of the bacterial flagella staining image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria; Inputting each frame of the bacterial flagella staining image containing the detection frame into a trajectory tracking algorithm to obtain movement trajectories corresponding to a number of the bacteria; According to the movement trajectory of each of the bacteria, the movement decisions corresponding to each of the bacteria are determined.

2. The method for determining the trajectory based on the bacterial flagella staining image according to claim 1, It is characterized in that Determine a plurality of frames of bacterial flagella staining images according to the bacterial flagella staining video, including Determine a plurality of frames of original bacterial flagella staining images according to the bacterial flagella staining video; Preprocessing is performed on each frame of the original bacterial flagella stained image to obtain each frame of the bacterial flagella stained image, wherein the preprocessing includes one or more operations of image denoising, image enhancement, and image segmentation.

3. The method for determining the trajectory based on the bacterial flagella staining image according to claim 1, It is characterized in that The working principle of the target detection algorithm is: For each frame of the bacterial flagella staining image input, detecting the position information and category information of each of the bacteria in the frame of the bacterial flagella staining image; Generating the detection frames corresponding to the bacteria respectively according to the position information of the bacteria; The color, ID and prediction confidence of each category corresponding to each detection frame are determined according to the category information of each bacteria, wherein different categories of bacteria use detection frames of different colors.

4. The method for determining the trajectory based on bacterial flagella staining images according to claim 3, It is characterized in that The target detection algorithm is pre-trained, and the training method includes: Inputting the training image into the untrained target detection algorithm to obtain coordinate data corresponding to a plurality of prediction boxes in the training image and prediction confidence of each category; Obtaining a plurality of real annotation boxes corresponding to the training image; Determining the overlap between each prediction frame and the corresponding annotation frame by using an intersection-and-union ratio, and classifying each prediction frame according to the prediction confidence and the overlap of each prediction frame; Determine the performance index of the target detection algorithm according to the classification result, and judge whether the performance index meets the training requirements. If not, continue to execute the step of inputting the training image into the target detection algorithm that has not completed the training until the performance index meets the training requirements, thereby obtaining the trained target detection algorithm.

5. The method for determining the trajectory based on bacterial flagella staining images according to claim 1, It is characterized in that The working principle of the trajectory tracking algorithm is: For each frame of the bacterial flagella stained image input, a target prediction result of the bacterial flagella stained image of the previous frame is obtained by a Kalman filter tracking algorithm according to the detection frame of the bacterial flagella stained image of the previous frame; Obtaining a target detection result of the bacterial flagella staining image, and calculating an intersection-over-union overlap matrix of the target detection result and the target prediction result; According to the intersection-overlap ratio overlap matrix, the target of the bacterial flagella staining image of the frame is assigned by the Hungarian assignment algorithm to obtain the best match; Determine, according to the optimal match, target data association and position association whose intersection-over-intersection ratio between the bacterial flagella staining image of the frame and the bacterial flagella staining image of the previous frame is higher than or equal to a preset threshold; It is determined whether the bacterial flagella staining images in each frame containing the detection frame have been processed. If so, the movement tracks corresponding to the bacteria are determined according to all the generated target data associations and the position associations.

6. The method for determining a trajectory based on a bacterial flagella staining image according to claim 1, It is characterized in that Determining movement decisions corresponding to the bacteria according to the movement trajectories of the bacteria, including: Determining kinematic characteristics corresponding to each of the bacteria according to the movement trajectory of each of the bacteria; The motion decisions corresponding to each of the bacteria are determined according to the kinematic characteristics of each of the bacteria.

7. The method for determining the trajectory based on the bacterial flagella staining image according to claim 6, It is characterized in that The method further comprises: Marking the movement decision of each of the bacteria on the detection frame of each of the bacteria; A bacteria tracking video is generated according to the bacterial flagella staining image of each marked frame.

8. A trajectory determination device based on bacterial flagella staining images, It is characterized in that The device comprises: An acquisition module is used to acquire a bacterial flagella staining video, and determine a plurality of frames of bacterial flagella staining images according to the bacterial flagella staining video; A detection module, used for inputting each frame of the bacterial flagella staining image into a target detection algorithm to obtain each frame of the bacterial flagella staining image containing a detection frame, wherein the detection frame is used to reflect the location of the bacteria; A tracking module, used for inputting each frame of the bacterial flagella staining image containing the detection frame into a trajectory tracking algorithm to obtain movement trajectories corresponding to a plurality of the bacteria; The determination module is used to determine the movement decisions corresponding to each of the bacteria according to the movement trajectory of each of the bacteria.

9. A terminal, It is characterized in that The terminal includes a memory and one or more processors; the memory stores one or more programs; the program contains instructions for executing the trajectory determination method based on bacterial flagella staining images as described in any one of claims 1-7; and the processor is used to execute the program.

10. A computer-readable storage medium having a plurality of instructions stored thereon, It is characterized in that The instructions are suitable for being loaded and executed by a processor to implement the steps of the trajectory determination method based on bacterial flagella staining images as described in any one of claims 1 to 7 above.

Citation Information

Patent Citations

  • Quantitative flagellar fluorescent markers and standards

    CN109071609A

  • Bacteria classification

    CN114175094A

  • Cell tracking method, sperm optimization method, electronic device and storage medium

    CN114757867A

  • Track determination method based on bacterial flagellum staining image

    CN116309723A

  • Fast bacteria detection and antibiotic susceptibility test by precision tracking of bacterial cells

    US20210065368A1

Cited By

  • Method for measuring motion direction of flagellate under flowing condition

    CN121883536A