Embedded bacterial colony detection and counting method and device based on series cascade model

By introducing the series cascade model into the automatic colony counting system, and combining the CNN and Transformer branch modules for colony scene classification and preprocessing, the problem of reduced detection accuracy caused by colony scene interference in the existing technology is solved, and high accuracy and Reliable colony counting.

CN118587705APending Publication Date: 2024-09-03SHENZHEN SHENGTAI OPTOELECTRONICS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410820330.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing automatic colony counting system ignores the particularity of different colony scenarios, resulting in reduced accuracy and reliability of colony detection and counting results, and cannot meet the requirements of colony technology.

Method used

Using the embedded colony detection and counting method based on the series cascade model, the colony scene image data to be detected is first classified, the scene type and location information are determined, and the corresponding preprocessing strategy is called for preprocessing to reduce scene interference and improve Accuracy and reliability of subsequent colony counting. This method combines CNN and Transformer branch modules and uses local and global feature extraction to enhance the model's expression ability and recognition accuracy.

Benefits of technology

It improves the accuracy and reliability of colony detection and counting, reduces counting errors, meets the requirements of colony technology, and achieves stable and efficient detection in different colony scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587705A
    Figure CN118587705A
Patent Text Reader

Abstract

The invention relates to the technical field of bacterial colony counting, in particular to an embedded bacterial colony detection counting method and device based on a cascade model, and the method comprises the following steps: obtaining to-be-detected bacterial colony picture data; according to the acquired to-be-detected bacterial colony picture data, detecting and determining a bacterial colony scene involved in the to-be-detected bacterial colony picture data based on a preset bacterial colony scene classification model, and forming a current scene detection result; according to the formed current scene detection result, calling a preset preprocessing strategy from a database, and preprocessing the to-be-detected bacterial colony picture data; the different scene types correspond to different preprocessing strategies; and inputting the preprocessed to-be-detected bacterial colony picture data into a preset bacterial colony detection counting model, and outputting a bacterial colony counting result corresponding to the to-be-detected bacterial colony picture data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of colony counting, and in particular to an embedded colony detection and counting method and device based on a series cascade model. Background Art

[0002] In scientific fields such as microbiology, food science and medical diagnosis, colony counting is a key link in measuring the density of microorganisms in samples, and plays an irreplaceable role in evaluating the hygienic safety level of samples, monitoring fermentation processes and diagnosing infectious diseases. Although the traditional manual colony counting method is intuitive and direct, it has limitations such as time-consuming, labor-intensive and affected by the subjective judgment of the operator. These problems not only reduce work efficiency, but also may introduce counting errors, affecting the reliability and accuracy of the research.

[0003] In order to solve the above problems, automatic colony counting systems came into being. However, most of the existing automatic colony counting systems use a single counting model to directly process the input colony images and perform corresponding counting operations. However, they ignore the potential impact of the particularity of different colony scenes on the counting results, resulting in a significant reduction in the accuracy and reliability of colony counting, which cannot meet the requirements of colony technology. Summary of the invention

[0004] One of the purposes of the present invention is to provide an embedded colony detection and counting method and device based on a series cascade model, which can solve the problem in the prior art that the accuracy of colony detection and counting results is reduced due to interference caused by colony scenes, and improve the accuracy and reliability of colony detection and counting.

[0005] In order to achieve the above object, an embedded colony detection and counting method based on a series cascade model is provided, comprising the following steps:

[0006] S1. Obtain image data of the bacterial colony to be detected;

[0007] S2. According to the acquired colony image data to be detected, based on a preset colony scene classification model, the colony scene involved in the colony image data to be detected is detected and determined to form a current scene detection result; the current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type;

[0008] S3, according to the formed current scene type and the current scene position information corresponding to the current scene type, calling the preset preprocessing strategy from the database to preprocess the bacterial colony image data to be detected; different scene types correspond to different preprocessing strategies;

[0009] S4. The preprocessed colony image data to be detected is used as input to a preset colony detection and counting model, and the colony counting result corresponding to the colony image data to be detected is output.

[0010] Technical principles and effects of this solution: In this solution, first, the colony image data to be detected is acquired, and then the colony scene involved in the colony image data to be detected is detected and determined through the colony scene classification model, thereby forming a corresponding current scene detection result. The current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type. After that, the preprocessing strategy corresponding to the current scene type will be retrieved from the database to preprocess the colony image data to be detected, thereby eliminating the adverse effect of the scene type on the colony image data to be detected in the subsequent colony counts, and improving the reliability and speed of subsequent colony counts.

[0011] Then the preprocessed colony image data to be detected is input into a pre-set colony detection and counting model, and the corresponding colony counting result is output, thereby realizing the colony detection and counting function while improving the efficiency and accuracy of the detection and counting.

[0012] Compared with a single colony counting model, the pre-processing colony scene classification model introduced in this solution improves the accuracy and reliability of subsequent colony detection and counting by adopting a targeted preprocessing strategy after classifying the colony scene, thereby solving the problem in the prior art that the accuracy of colony detection and counting results is reduced due to interference caused by the colony scene.

[0013] Further, the S2 includes:

[0014] S20, according to the acquired colony image data to be detected, extract local features of the historical colony sample photo data through the CNN branch module and generate a first feature vector;

[0015] S21, according to the acquired colony image data to be detected, the global context feature extraction of the historical colony sample photo data is performed through the Transformer branch module to generate a second feature vector;

[0016] S22, fusing the generated first feature vector and the second feature vector to form a fusion feature, and processing the fusion feature through a preset fusion processing formula to output a corresponding current scene detection result.

[0017] Beneficial effects: In this scheme, the synchronous setting of the CNN branch module and the Transformer branch module realizes the complementarity of feature levels, enabling the model to simultaneously utilize local subtle features and global structural information, improving the accuracy of recognition and classification, while also enhancing the expressiveness of the model. By integrating two different learning modes, the model can learn data from different angles, helping to reduce the risk of overfitting.

[0018] Furthermore, the CNN branch module includes at least one convolution block, and the convolution block includes a convolution layer, a batch normalization layer and an activation function, which is used to perform multi-layer local feature extraction on the input image data and output a corresponding feature map;

[0019] It also includes a global average pooling layer, which is set after the convolution block and is used to convert the feature map output by the convolution block into a feature vector of fixed dimension;

[0020] Also included is a fully connected layer, for further processing the feature vector and outputting a corresponding first feature vector;

[0021] The Transformer branch module includes a patch partitioning and embedding layer, which is used to divide the input image data into multiple patches and embed each patch to generate a corresponding feature vector;

[0022] Also including at least one Transformer block, each Transformer block including a multi-head self-attention mechanism, a multi-layer perceptron (MLP), and layer normalization, for capturing a global context image and performing feature transformation to form a second feature vector;

[0023] An optional residual connection is also provided inside the Transformer block for retaining and accumulating feature information.

[0024] Furthermore, before S1, the step further includes:

[0025] S010. Obtain historical colony sample image data from the colony sample annotation dataset, and build and train a colony scene classification model based on the CNN-Transformer fusion deep learning algorithm.

[0026] Beneficial effects: The colony scene classification model is constructed and trained through historical colony sample image data, and the reliability of the colony scene classification model construction and training is greatly improved through the huge amount of data.

[0027] Furthermore, the S010 further includes:

[0028] S0101. Obtain historical colony sample photo data from the colony sample annotation dataset;

[0029] S0102. According to the acquired historical colony sample photo data, the colony scene in the historical colony sample photo data, the colony scene location information corresponding to the colony scene, and the colony morphology location data are labeled;

[0030] S0103. According to the annotated historical bacterial colony sample photo data, based on a preset data enhancement strategy, the annotated historical bacterial colony sample photo data is subjected to data enhancement processing to form a corresponding data set;

[0031] S0104. Split the data in the dataset into a training set and a test set;

[0032] S0105. Based on the CNN-Transformer deep learning algorithm, build a colony scene classification initialization model;

[0033] S0106. Input the data in the training set into the colony scene classification initialization model for iterative training. In each iterative training process, according to the output data of the colony scene classification initialization model, determine whether the training effect of the colony scene classification initialization model meets the standard under the current number of iterations. If so, complete the training to form the corresponding colony scene classification model. Otherwise, continue training until the training effect meets the standard.

[0034] S0107. When the result of the judgment is that the training is completed, the data in the test set is input into the corresponding colony scene classification model, and it is determined whether the output result corresponding to the model is consistent with the annotation content corresponding to the data in the test set. If so, the colony scene classification model is judged to be a valid model, otherwise it is an invalid model.

[0035] Beneficial effects: In this scheme, when constructing and training the colony scene classification model, the historical data will be processed first, and the data will be enhanced to expand the diversity of samples and improve the generalization ability of the model.

[0036] The present invention also provides an embedded colony detection and counting device based on a series cascade model, using the above-mentioned embedded colony detection and counting method based on a series cascade model, comprising a machine platform, wherein a detection table for placing a culture dish is provided on the machine platform;

[0037] It also includes a camera and a support frame for photographing the culture dish to form the image data of the bacterial colony to be detected, wherein the support frame is arranged on the upper end surface of the machine platform, and the camera is arranged on the support frame and located above the culture dish;

[0038] It also includes a light source, which is arranged below the culture dish and corresponds to the camera;

[0039] It also includes a controller, which includes: an acquisition module, used to acquire the image data of the bacterial colony to be detected;

[0040] A scene classification module is used to detect and determine the colony scenes involved in the colony image data to be detected based on the acquired colony image data to be detected and based on a preset colony scene classification model to form a current scene detection result; the current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type;

[0041] A preprocessing module, used to retrieve a preset preprocessing strategy from a database according to the current scene type formed and the current scene position information corresponding to the current scene type, and preprocess the bacterial colony image data to be detected; different scene types correspond to different preprocessing strategies;

[0042] The counting module is used to input the preprocessed colony image data to be detected into a preset colony detection and counting model, and output the colony counting result corresponding to the colony image data to be detected. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a flow chart of an embedded colony detection and counting method based on a series cascade model in Embodiment 1 of the present invention;

[0044] Figure 2 It is a structural diagram of a CNN branch module and a Transformer branch module in Embodiment 1 of the present invention;

[0045] Figure 3 is a logic block diagram of a controller in Embodiment 1 of the present invention;

[0046] Figure 4 It is a structural diagram of an embedded colony detection and counting device based on a series cascade model in Example 1 of the present invention. DETAILED DESCRIPTION

[0047] The following is further described in detail through specific implementation methods:

[0048] The symbols in the drawings of the specification include: a machine platform 1, a testing platform 2, and a supporting frame 3.

[0049] Embodiment 1

[0050] An embedded colony detection and counting method based on a cascade model is basically as follows Figure 1 As shown, the following steps are included:

[0051] S1. Obtain image data of the bacterial colony to be detected;

[0052] The S1 also includes:

[0053] S010. Obtain historical colony sample image data from the colony sample annotation dataset, and build and train a colony scene classification model based on the CNN-Transformer fusion deep learning algorithm.

[0054] The S010 further includes:

[0055] S0101. Obtain historical colony sample photo data from the colony sample annotation dataset;

[0056] S0102. According to the acquired historical colony sample photo data, the colony scenes in the historical colony sample photo data, the colony scene location information corresponding to the colony scenes, and the colony morphology location data are labeled; the corresponding colony scenes include colony overlap, water mist, water droplets, marker pen traces, colony spread, culture dish impurities, high-density colonies, and culture dish bubbles; the corresponding colony morphology location data include colony samples of different types, shapes, and sizes, such as clusters, strips, spreads, overlaps, colonies greater than or equal to 0.1 mm, and dense colonies greater than 1,000.

[0057] S0103. According to the annotated historical colony sample photo data, based on a preset data enhancement strategy, data enhancement processing is performed on the annotated historical colony sample photo data to form a corresponding data set; in this embodiment, the annotated historical colony sample photo data is rotated, scaled, cropped, contrasted, brightly transformed or adjusted to expand the diversity of samples and improve the generalization ability of the model.

[0058] S0104. Split the data in the dataset into a training set and a test set;

[0059] S0105. Based on the CNN-Transformer deep learning algorithm, build a colony scene classification initialization model;

[0060] S0106. Input the data in the training set into the colony scene classification initialization model for iterative training. In each iterative training process, judge whether the training effect of the colony scene classification initialization model meets the standard under the current number of iterations according to the output data of the colony scene classification initialization model. If so, complete the training to form the corresponding colony scene classification model. Otherwise, continue training until the training effect meets the standard. In this embodiment, during the training process, 1*1 convolution is used to align the channel dimension, the up / down sampling strategy of the FPN network is used to align the feature resolution, and Layer Norm and Batch Norm are used to align the feature values ​​to fuse the features of the two styles, continuously eliminate the semantic differences between them, and enhance the global perception ability of local features and the local details of the global representation.

[0061] S0107. When the result of the judgment is that the training is completed, the data in the test set is input into the corresponding colony scene classification model, and it is determined whether the output result corresponding to the model is consistent with the annotation content corresponding to the data in the test set. If so, the colony scene classification model is judged to be a valid model, otherwise it is an invalid model.

[0062] S2. According to the acquired colony image data to be detected, based on a preset colony scene classification model, the colony scene involved in the colony image data to be detected is detected and determined to form a current scene detection result; the current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type;

[0063] The S2 includes:

[0064] S20, according to the acquired colony image data to be detected, extract local features of the historical colony sample photo data through the CNN branch module and generate a first feature vector;

[0065] S21, according to the acquired colony image data to be detected, the global context feature extraction of the historical colony sample photo data is performed through the Transformer branch module to generate a second feature vector;

[0066] S22, fusing the generated first feature vector and the second feature vector to form a fusion feature, and processing the fusion feature through a preset fusion processing formula to output a corresponding current scene detection result.

[0067] like Figure 2 As shown, the CNN branch module includes at least one convolution block, and the convolution block includes a convolution layer, a batch normalization layer and an activation function, which is used to perform multi-layer local feature extraction on the input image data and output the corresponding feature map;

[0068] It also includes a global average pooling layer, which is set after the convolution block and is used to convert the feature map output by the convolution block into a feature vector of fixed dimension;

[0069] Also included is a fully connected layer, for further processing the feature vector and outputting a corresponding first feature vector;

[0070] The Transformer branch module includes a patch partitioning and embedding layer, which is used to divide the input image data into multiple patches and embed each patch to generate a corresponding feature vector;

[0071] Also including at least one Transformer block, each Transformer block including a multi-head self-attention mechanism, a multi-layer perceptron (MLP), and layer normalization, for capturing a global context image and performing feature transformation to form a second feature vector;

[0072] An optional residual connection is also provided inside the Transformer block for retaining and accumulating feature information.

[0073] S3. According to the current scene type formed and the current scene position information corresponding to the current scene type, a preset preprocessing strategy is retrieved from the database to preprocess the colony image data to be detected; the different scene types correspond to different preprocessing strategies; in the present embodiment, different scene types correspond to different preprocessing strategies, for example, in the scene with water mist or water droplets, a defogging algorithm is used to reduce interference; in the scene with marker traces, an image restoration technology is used to remove the marker traces; in the high-density colony scene, an image enhancement algorithm is used to improve the clarity and contrast between colonies to facilitate detection.

[0074] S4. The pre-processed colony image data to be detected is used as input, input into the preset colony detection and counting model, and the colony counting result corresponding to the colony image data to be detected is output. In this embodiment, before performing colony detection and counting, the colony scene is pre-processed to enhance the stability, robustness and accuracy of colony detection and counting, and the minimum colony size can reach 100 microns, meeting the most stringent requirements of the national standard. In this embodiment, the colony detection and counting model also uses CNN branch modules and Transformer branch modules when identifying the colony image data to be detected, but the branch modules corresponding to the two models are different, not the same module. Specifically, the CNN branch module automatically extracts the colony features in the image of the input colony image data to be detected, such as shape, edge, texture, etc., and outputs the corresponding high-dimensional feature map. Then, the Transformer branch module is used to enhance the ability to distinguish colony features through the self-attention mechanism in the Transformer branch module on the basis of the high-dimensional feature map, especially in the case of dense colonies or similar morphology, by giving different weights to different regions, focusing on key colony features, reducing the impact of interference information. After the high-dimensional feature map is processed by the self-attention mechanism, a segmentation network or object detection algorithm such as a region-based convolutional neural network (R-CNN) or Mask R-CNN is used to accurately locate and segment the colony, and each segmented area represents a separate colony, and then the number of colonies is counted. In this embodiment, the colony scene detection model and the colony detection counting model are connected in series, the model architecture internal network CNN+Transformer cascade model is connected in series, and the model internal network architecture is cascaded.

[0075] like Figure 3 and Figure 4 As shown, this embodiment also discloses an embedded colony detection and counting device based on a series cascade model, using the above-mentioned embedded colony detection and counting method based on a series cascade model, comprising a machine 1, on which a detection table 2 for placing a culture dish is provided;

[0076] It also includes a camera and a support frame 3 for photographing the image data of the bacterial colony to be detected formed by the culture dish, the support frame 3 is arranged on the upper end surface of the machine 1, and the camera is arranged on the support frame 3 and located above the culture dish;

[0077] It also includes a light source, which is arranged below the culture dish and corresponds to the camera;

[0078] It also includes a controller, which includes: an acquisition module, used to acquire the image data of the bacterial colony to be detected;

[0079] A scene classification module is used to detect and determine the colony scenes involved in the colony image data to be detected based on the acquired colony image data to be detected and based on a preset colony scene classification model to form a current scene detection result; the current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type;

[0080] A preprocessing module, used to retrieve a preset preprocessing strategy from a database according to the current scene type formed and the current scene position information corresponding to the current scene type, and preprocess the bacterial colony image data to be detected; different scene types correspond to different preprocessing strategies;

[0081] The counting module is used to input the preprocessed colony image data to be detected into a preset colony detection and counting model, and output the colony counting result corresponding to the colony image data to be detected.

[0082] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is described too much here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can know all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. An embedded colony detection and counting method based on a series cascade model, characterized in that: The following steps are involved: S1. Obtain image data of the colony to be detected; S2. According to the acquired colony image data to be detected, based on a preset colony scene classification model, the colony scene involved in the colony image data to be detected is detected and determined to form a current scene detection result; the current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type; S3, according to the formed current scene type and the current scene position information corresponding to the current scene type, calling the preset preprocessing strategy from the database to preprocess the bacterial colony image data to be detected; different scene types correspond to different preprocessing strategies; S4. The preprocessed colony image data to be detected is used as input to a preset colony detection and counting model, and the colony counting result corresponding to the colony image data to be detected is output.

2. The embedded colony detection and counting method based on the series cascade model according to claim 1 is characterized in that: The S2 includes: S20, according to the acquired colony image data to be detected, extract local features of the historical colony sample photo data through the CNN branch module and generate a first feature vector; S21, according to the acquired colony image data to be detected, the global context feature extraction of the historical colony sample photo data is performed through the Transformer branch module to generate a second feature vector; S22, fusing the generated first feature vector and the second feature vector to form a fusion feature, and processing the fusion feature through a preset fusion processing formula to output a corresponding current scene detection result.

3. The embedded colony detection and counting method based on the series cascade model according to claim 2 is characterized in that: The CNN branch module includes at least one convolution block, which includes a convolution layer, a batch normalization layer and an activation function, and is used to perform multi-layer local feature extraction on the input image data and output a corresponding feature map; It also includes a global average pooling layer, which is set after the convolution block and is used to convert the feature map output by the convolution block into a feature vector of fixed dimension; Also included is a fully connected layer, for further processing the feature vector and outputting a corresponding first feature vector; The Transformer branch module includes a patch partitioning and embedding layer, which is used to divide the input image data into multiple patches and embed each patch to generate a corresponding feature vector; Also including at least one Transformer block, each Transformer block including a multi-head self-attention mechanism, a multi-layer perceptron (MLP), and layer normalization, for capturing a global context image and performing feature transformation to form a second feature vector; An optional residual connection is also provided inside the Transformer block for retaining and accumulating feature information.

4. The embedded colony detection and counting method based on the series cascade model according to claim 3 is characterized in that: The S1 also includes: S010. Obtain historical colony sample image data from the colony sample annotation dataset, and build and train a colony scene classification model based on the CNN-Transformer fusion deep learning algorithm.

5. The embedded colony detection and counting method based on the series cascade model according to claim 4 is characterized in that: The S010 further includes: S0101. Obtain historical colony sample photo data from the colony sample annotation dataset; S0102. According to the acquired historical colony sample photo data, the colony scene in the historical colony sample photo data, the colony scene location information corresponding to the colony scene, and the colony morphology location data are labeled; S0103. According to the annotated historical bacterial colony sample photo data, based on a preset data enhancement strategy, the annotated historical bacterial colony sample photo data is subjected to data enhancement processing to form a corresponding data set; S0104. Split the data in the dataset into a training set and a test set; S0105. Based on the CNN-Transformer deep learning algorithm, build a colony scene classification initialization model; S0106. Input the data in the training set into the colony scene classification initialization model for iterative training. In each iterative training process, according to the output data of the colony scene classification initialization model, determine whether the training effect of the colony scene classification initialization model meets the standard under the current number of iterations. If so, complete the training to form the corresponding colony scene classification model. Otherwise, continue training until the training effect meets the standard. S0107. When the result of the judgment is that the training is completed, the data in the test set is input into the corresponding colony scene classification model, and it is determined whether the output result corresponding to the model is consistent with the annotation content corresponding to the data in the test set. If so, the colony scene classification model is judged to be a valid model, otherwise it is an invalid model.

6. An embedded colony detection and counting device based on a series cascade model, using an embedded colony detection and counting method based on a series cascade model according to any one of claims 1 to 5, characterized in that: The machine comprises a platform, wherein a detection table for placing a culture dish is arranged on the platform; It also includes a camera and a support frame for photographing the culture dish to form the image data of the bacterial colony to be detected, wherein the support frame is arranged on the upper end surface of the machine platform, and the camera is arranged on the support frame and located above the culture dish; It also includes a light source, which is arranged below the culture dish and corresponds to the camera; It also includes a controller, which includes: an acquisition module, used to acquire the image data of the bacterial colony to be detected; A scene classification module is used to detect and determine the colony scenes involved in the colony image data to be detected based on the acquired colony image data to be detected and based on a preset colony scene classification model to form a current scene detection result; the current scene detection result includes the current scene type and the current scene position information corresponding to the current scene type; A preprocessing module, used to retrieve a preset preprocessing strategy from a database according to the current scene type formed and the current scene position information corresponding to the current scene type, and preprocess the bacterial colony image data to be detected; different scene types correspond to different preprocessing strategies; The counting module is used to input the preprocessed colony image data to be detected into a preset colony detection and counting model, and output the colony counting result corresponding to the colony image data to be detected.

Citation Information

Cited By

  • Driving style classification and identification method under urban typical steering working condition

    CN119357842A