A microbial colony detection system and a method of detecting microorganisms

By combining grayscale conversion, noise suppression, edge detection, and region growing algorithms with genetic algorithms to optimize the colony morphology rule base, the problem of insufficient segmentation accuracy and recognition accuracy in microbial colony detection is solved, and efficient species identification and biosafety risk assessment are achieved.

CN120997125APending Publication Date: 2025-11-21HUNAN VOCATIONAL COLLEGE OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510940989.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing technologies, microbial colony detection methods suffer from low segmentation accuracy, difficulty in accurately separating complex morphological colony targets, and the inability to dynamically optimize the colony morphology rule library, resulting in insufficient accuracy in species identification.

Method used

By combining grayscale conversion and noise suppression processing with edge detection and region growth algorithms, colony targets are separated, multi-dimensional morphological feature values ​​are quantified, and a genetic algorithm is used to iteratively adjust the feature weight threshold of the colony morphology rule base to generate an optimized rule base. Finally, the bacterial species identification and confidence level are output through multi-level matching.

Benefits of technology

It improves the accuracy and integrity of colony segmentation, enhances the accuracy of species identification, improves the versatility and adaptability of detection methods, and can generate biosafety risk assessment reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997125A_ABST
    Figure CN120997125A_ABST
Patent Text Reader

Abstract

The present application provides a kind of microbial colony detection system and microbial detection method, it is related to data processing technical field, the method comprises: according to binary segmentation map, quantitatively calculates the morphological characteristic value of the area, circularity and edge irregularity of each colony;Genetic algorithm engine is inputed into morphological characteristic value, iteratively adjusts the feature weight threshold in pre-defined colony morphology rule base based on historical detection accuracy data, generates optimized rule base;Morphological characteristic value and optimized rule base are matched in multiple levels, and the strain identification and confidence are output according to weighted similarity;Based on strain identification and confidence, the corresponding hazard level in pathogenic bacteria toxicity database is inquired, and biological safety risk assessment report is generated.The present application improves the accuracy and integrity of colony segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a microbial colony detection system and a microbial detection method. BACKGROUND

[0002] With the development of computer vision technology, microbial colony detection methods based on image analysis have gradually emerged. In the prior art, some methods extract the colony area by simple grayscale processing and threshold segmentation, but due to the interference of the culture dish background, colony adhesion and image noise, the segmentation accuracy is low, and it is difficult to accurately separate the complex morphological colony target. In the colony feature analysis link, if only the single calculation of the colony area is used to judge the basic features, the comprehensive consideration of the roundness and edge irregularity of the colony morphological details is lacking, resulting in insufficient accuracy of the strain identification.

[0003] In addition, the colony morphological rule library established in the prior art is based on fixed feature weight threshold or cannot be dynamically optimized according to the actual detection data, so some of them cannot adapt to the diversity changes of different culture conditions and strains. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a microbial colony detection system and a microbial detection method, which improves the accuracy and integrity of colony segmentation.

[0005] To solve the above technical problems, the technical scheme of the present application is as follows:

[0006] In a first aspect, a microbial colony detection system and a microbial detection method are provided, and the method comprises:

[0007] A microbial colony detection method, characterized in that the method comprises:

[0008] Step 1: acquiring an original image of a culture dish containing microbial colonies by an imaging device;

[0009] Step 2: performing grayscale conversion and noise suppression processing on the original image to generate an optimized image;

[0010] Step 3: based on the pixel intensity distribution of the optimized image, separating the colony target by edge detection and region growing algorithm to generate a binary segmentation image;

[0011] Step 4: according to the binary segmentation image, quantitatively calculating the area, roundness and edge irregularity morphological feature values of each colony;

[0012] Step 5: inputting the morphological feature values into a genetic algorithm engine, iteratively adjusting the feature weight threshold in the pre-defined colony morphological rule library based on historical detection accuracy data to generate an optimized rule library;

[0013] Step 6, multi-level matching of morphological feature values with the optimization rule base, output of strain identification and confidence according to weighted similarity;

[0014] Step 7, based on the strain identification and confidence, query the corresponding hazard level in the pathogen toxicity database to generate a biosafety risk assessment report.

[0015] Further, step 1, acquiring the original image of the culture dish containing microbial colonies through the imaging device, including:

[0016] Step 11, adjust the intensity of the backlight source to 2000-3000 lux according to the light transmittance of the culture dish material, and set the focal length of the optical lens to make the imaging resolution reach 10 μm / pixel;

[0017] Step 12, control the motorized rotary stage to step rotate at intervals of 120°, and trigger the imaging device to capture local images at 0°, 120°, and 240° respectively;

[0018] Step 13, matching feature points in the overlapping areas of the three local images, eliminating edge distortion through affine transformation fusion, and generating a seamless spliced original image.

[0019] Further, step 2, performing gray scale conversion and noise suppression processing on the original image to generate an optimized image, including:

[0020] Step 21, extracting the green channel component of the generated panoramic original image, converting the RGB three-channel image to a single-channel green grayscale image;

[0021] Step 22, for the generated green grayscale image, by executing the algorithm of non-local mean filtering, first search for similar pixel neighborhood in the whole image range, take a fixed size neighborhood window of 5x5 pixels as a unit, calculate the similarity weight of the pixel gray value in each window, and perform weighted average calculation on the center pixel according to the similarity weight, eliminate the noise interference caused by the reflection of the culture dish surface, and finally get the denoising image;

[0022] Step 23, performing limited adaptive histogram equalization on the denoised image, constraining the contrast stretching range to 2.0-3.0 times, strengthening the distinction between the colony edge and the background, and generating an optimized image.

[0023] Further, step 3, based on the pixel intensity distribution of the optimized image, separating the colony target through edge detection and region growing algorithm to generate a binary segmentation image, including:

[0024] Step 31, perform Sobel operator convolution calculation on the generated optimized image to obtain horizontal and vertical gradient components respectively, and synthesize an edge gradient intensity map;

[0025] Step 32, identify local maximum intensity points in the gradient intensity map, and select points with gradient intensity ≥ 30% of the maximum value as initial seeds for region growing;

[0026] Step 33, calculate the gray level difference between the seed point and the 8-neighborhood pixels centered on the seed point, and if the difference is ≤ 15 gray levels, include it in the colony area, and iteratively expand until no new pixels are added;

[0027] Step 34, merge all grown connected regions, mark the colony area as 255 and the background as 0, and generate a binary segmentation map.

[0028] Further, step 4, according to the binary segmentation map, quantitatively calculate the area, circularity and edge irregularity characteristic values of each colony, including:

[0029] Step 41, perform 8-neighborhood connected component labeling on the generated binary segmentation map, and assign a unique identifier to each independent colony area;

[0030] Step 42, count the total number of pixels in each identifier corresponding area, and convert the physical area according to the imaging resolution of 10 μm / pixel;

[0031] Step 43, extract the minimum circumscribed circle of the colony contour, and calculate the circularity according to the formula: circularity equals the actual area of the colony divided by the area of the minimum circumscribed circle;

[0032] Step 44, generate a fitted ellipse corresponding to the colony contour, and calculate the average Hausdorff distance between the contour point set and the fitted ellipse;

[0033] Step 45, combine the area, circularity and edge irregularity of each colony into a three-dimensional feature vector as the morphological characteristic value.

[0034] Further, step 5, input the morphological characteristic value into the genetic algorithm engine, iteratively adjust the feature weight threshold in the pre-defined colony morphological rule library based on historical detection accuracy data, and generate an optimized rule library, including:

[0035] Step 51, encode the area weight Ws, circularity weight Wc and edge irregularity weight We in the rule library into a binary chromosome, and randomly generate an initial population containing 50 individuals;

[0036] Step 52, use the three-dimensional morphological feature vector and historical detection accuracy data to calculate the classification F1-score of each chromosome in the initial population as the fitness value;

[0037] Step 53, according to the fitness value, the selected top 10 individuals are retained, and the remaining population is randomly paired;

[0038] Step 54, the randomly paired selected individuals are executed two-point crossover recombination at random gene sites;

[0039] Step 55, after the crossover recombination, the chromosome single gene value is randomly flipped with a probability of 5%, the total weight sum is constrained to be 1.0, and the evolution is terminated when the individual fitness continuously improves by less than 0.5% for 15 generations, to obtain the chromosome after termination of evolution;

[0040] Step 56, extracting the binary encoding of the chromosome after termination of evolution, decoding into area weight Ws*, circularity weight Wc*, and edge irregularity weight We*;

[0041] Step 57, loading the optimized weights Ws*, Wc*, and We* into the colony morphology rule library to generate an optimized rule library.

[0042] Further, step 6, multi-level matching of the morphological feature value with the optimized rule library, outputting the strain identification and confidence according to the weighted similarity, including:

[0043] Step 61, comparing the morphological feature value with the basic morphology range of the strain in the optimized rule library, excluding the unmatched strains, and generating a candidate strain set;

[0044] Step 62, calculating the single-feature matching degree of the candidate strain set, the relative closeness of the measured area of the colony to the median value of the standard area of the candidate strain to obtain the area matching degree, the reciprocal of the deviation of the measured circularity of the colony from the median value of the standard circularity of the candidate strain to obtain the circularity matching degree, and the conformity proportion of the measured irregularity of the colony to the standard value range of the candidate strain to obtain the edge irregularity matching degree;

[0045] Step 63, multiplying the three single-feature matching degrees by the corresponding area weight Ws, circularity weight Wc, and edge irregularity weight We, respectively, and then adding them to obtain the weighted matching sum, and dividing the weighted matching sum by the sum of the weights to obtain the comprehensive similarity;

[0046] Step 64, outputting the strain identification and high, medium, and low three confidence markers according to the comprehensive similarity from high to low, and simultaneously adding an artificial review warning to the medium confidence marker.

[0047] The second aspect is a microbial colony detection system, comprising:

[0048] The acquisition module is configured to acquire an original image of a culture dish containing a microbial colony through an imaging device;

[0049] The processing module is configured to perform grayscale conversion and noise suppression processing on the original image to generate an optimized image;

[0050] A segmentation module is configured to separate colony targets by edge detection and region growing algorithm based on the optimized pixel intensity distribution of the image, and generate a binary segmentation map;

[0051] A calculation module is configured to calculate the area, circularity and edge irregularity characteristic values of each colony based on the binary segmentation map;

[0052] An adjustment module is configured to input the morphological characteristic values into a genetic algorithm engine, and iteratively adjust the feature weight threshold in a pre-defined colony morphological rule library based on historical detection accuracy data, and generate an optimized rule library;

[0053] An output module is configured to perform multi-level matching between the morphological characteristic values and the optimized rule library, and output the strain identification and confidence according to the weighted similarity;

[0054] A query module is configured to query the corresponding hazard level in a pathogenic bacteria toxicity database based on the strain identification and confidence, and generate a biological safety risk assessment report.

[0055] In a third aspect, a computing device includes:

[0056] One or more processors;

[0057] A storage device storing one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method.

[0058] In a fourth aspect, a computer-readable storage medium stores a program, which, when executed by a processor, implements the method.

[0059] The above-mentioned scheme of the present application at least has the following beneficial effects:

[0060] Through gray scale conversion and noise suppression processing, the interference factors in the original image are effectively removed, and the edge detection and region growing algorithm are combined to accurately separate the adhered and complex-shaped colony targets in the culture dish, compared with the traditional threshold segmentation method, the accuracy and integrity of the colony segmentation are improved, and reliable data basis is provided for subsequent feature analysis.

[0061] The multi-dimensional morphological characteristic values such as the area, circularity and edge irregularity of each colony break through the limitation of the traditional method which only relies on a single basic feature, fully capture the colony morphological details, make the strain identification basis more abundant, improve the accuracy of strain identification, and reduce the risk of misjudgment.

[0062] The genetic algorithm engine is used to iteratively adjust the feature weight threshold of the colony morphology rule base based on historical detection accuracy rate data. The optimized rule base can adapt to the diversity changes of different culture conditions and strains, avoid the limitations of fixed threshold, and improve the universality and adaptability of the detection method.

[0063] The strain identification and confidence are output by multi-level matching and weighted similarity calculation to realize intelligent strain identification. Further, the biological safety risk assessment report is generated based on the strain identification and confidence in combination with the pathogenic bacteria toxicity database, so as to not only complete strain identification but also systematically evaluate potential biological safety risks. BRIEF DESCRIPTION OF DRAWINGS

[0064] Figure 1 is a microbial colony detection method flowchart provided by an embodiment of the present application.

[0065] Figure 2 is a microbial colony detection system schematic diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0066] Exemplary embodiments of the present disclosure will be described in greater detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be accurately conveyed to those skilled in the art.

[0067] As shown in Figure 1 , an embodiment of the present application proposes a microbial colony detection method, which comprises the following steps:

[0068] Step 1: acquiring an original image of a culture dish containing microbial colonies by an imaging device;

[0069] Step 2: performing gray scale conversion and noise suppression processing on the original image to generate an optimized image;

[0070] Step 3: separating the colony target based on the pixel intensity distribution of the optimized image by edge detection and region growing algorithm to generate a binary segmentation image;

[0071] Step 4: quantitatively calculating the morphological characteristic values of the area, circularity and edge irregularity of each colony according to the binary segmentation image;

[0072] Step 5: inputting the morphological characteristic values into a genetic algorithm engine, iteratively adjusting the feature weight threshold in the pre-defined colony morphology rule base based on historical detection accuracy rate data, and generating an optimized rule base;

[0073] Step 6, multi-level matching of morphological feature values with the optimized rule base, output of strain identification and confidence based on weighted similarity;

[0074] Step 7, based on strain identification and confidence, query corresponding hazard level in pathogenic bacteria toxicity database, and generate biological safety risk assessment report.

[0075] In the embodiment of the application, by gray scale conversion and noise suppression processing, the interference factors in the original image are effectively removed, and the edge detection and region growing algorithm are combined to accurately separate the adhered and morphologically complex colony targets in the culture dish. Compared with the traditional threshold segmentation method, the accuracy and integrity of the colony segmentation are improved, and reliable data basis is provided for subsequent feature analysis.

[0076] The multi-dimensional morphological feature values of each colony, such as area, circularity and edge irregularity, break through the limitation of traditional methods relying on only a single basic feature, fully capture the colony morphological details, make the strain identification basis more abundant, improve the accuracy of strain identification, and reduce the risk of misjudgment.

[0077] Using a genetic algorithm engine, the feature weight threshold of the colony morphological rule base is iteratively adjusted based on historical detection accuracy data, and the optimized rule base can adapt to the diversity changes of different culture conditions and strains, avoiding the limitations of fixed thresholds, and improving the universality and adaptability of the detection method.

[0078] Through multi-level matching and weighted similarity calculation, the strain identification and confidence are output, the intelligent strain identification is realized, and further combined with the pathogenic bacteria toxicity database, the biological safety risk assessment report is generated based on the strain identification and confidence, not only the strain identification is completed, but also the potential biological safety risk is systematically evaluated.

[0079] In a preferred embodiment of the application, step 1, an imaging device is used to collect an original image of a culture dish containing microbial colonies, including:

[0080] Step 11, adjust the intensity of the backlight source to 2000-3000 lux according to the light transmittance of the culture dish material, and set the focal length of the optical lens to make the imaging resolution reach 10 μm / pixel;

[0081] Step 12, control the motorized rotary stage to step rotate at intervals of 120°, and trigger the imaging device to capture local images at 0°, 120° and 240° respectively;

[0082] Step 13, perform feature point matching on the three local images, eliminate edge distortion by affine transformation fusion, and generate a seamless spliced original image.

[0083] In the embodiment of the application, the above steps can be realized by the following steps, specifically as follows:

[0084] Step 11: Establish the mapping relationship between the light transmittance of the culture dish material and the intensity of the backlight source through experiments. For example, a glass material with high light transmittance requires a lower intensity light source, while a plastic material with low light transmittance requires a higher intensity light source. Through multiple tests of imaging effects under different intensities (such as colony contrast, background uniformity), determine the optimal interval of 2000-3000 lux to ensure clear colony edges, no overexposure or shadows.

[0085] According to the imaging resolution target (10 μm / pixel), combined with the sensor size of the imaging device (such as the sensor width is W pixels), calculate the geometric relationship of the required object distance and focal length. Adjust the focal length manually or automatically to make the actual shooting of the standard scale board (such as 100 μm line segment occupies 10 pixels in the image) meet the resolution requirements, ensuring that the pixel accuracy matches the subsequent analysis requirements.

[0086] Step 12: The motorized rotating stage realizes rotation through motor-driven gear sets or screw structures, and the built-in angle encoder provides real-time feedback on the rotation angle. The system presets the rotation path as 0°, 120°, and 240°, and triggers the imaging device shutter (such as through GPIO signals or software instructions) at each angle node to capture partial images of the culture dish from three orthogonal viewing angles. This process ensures rotation stability through timing control and avoids image blurring caused by shaking.

[0087] Step 13: For the three partial images, use scale-invariant features (such as key point detection algorithms) to automatically identify repeated features (such as colony edge inflection points, texture intersection points) in the overlapping area, and determine the corresponding relationship of the same point pairs (such as feature point A in the left image and feature point A' in the middle image are the same position) through coordinate comparison.

[0088] According to the matched feature point pairs, calculate the translation and rotation parameters between images (such as the middle image is rotated 120° relative to the left image, and the translation vector (x, y)), and unify each partial image to the same coordinate system through affine transformation. Use weighted averaging (such as high weight in the middle area and low weight in the edge) or gradient fusion algorithm for the overlapping area to eliminate stitching seams and brightness differences, generating a complete and distortion-free original image.

[0089] In the embodiment of the present application, the three-angle shooting is combined with affine transformation fusion to reduce the deformation rate of the edge area of the culture dish from >15% in single imaging to <3%, avoiding the misidentification of the circular colony as an ellipse at the edge. The 10 μm / pixel resolution ensures that microcolonies with a diameter of ≥50 μm can be accurately captured (only 30 μm in the traditional scheme); the constant 2000-3000 lux backlight makes the standard deviation of the gray scale distribution of the images of different material culture dishes <5%, eliminating the contrast fluctuations caused by the light transmission difference. The 120° step rotation design maximizes the overlapping area of adjacent images (20%-25%), the feature point matching success rate is increased to more than 98%, and the splicing misplacement is eliminated; the weighted fusion technology makes the gray transition of the joint area natural, and the colony contour continuity retention rate is >99%. The whole process from rotation control to splicing completion takes ≤8 seconds per sample, which is 6 times more efficient than manual multi-angle shooting, and is suitable for batch detection.

[0090] In a preferred embodiment of the present application, step 2, the original image is subjected to gray scale conversion and noise suppression processing to generate an optimized image, comprising:

[0091] Step 21, extracting the green channel component of the generated panoramic original image, converting the RGB three-channel image into a single-channel green gray image;

[0092] Step 22, for the generated green gray image, by executing the algorithm of non-local mean filtering, first searching for a similar pixel neighborhood in the whole image range, taking a fixed size neighborhood window of 5x5 pixels as a unit, calculating the similarity weight of the pixel gray value in each window, and performing weighted average calculation on the center pixel according to the similarity weight, to eliminate the noise interference caused by the reflection of the culture dish surface, and finally obtaining the denoised image;

[0093] Step 23, performing a restrictive adaptive histogram equalization on the denoised image, constraining the contrast stretching range to 2.0-3.0 times, strengthening the distinction between the colony edge and the background, and generating an optimized image.

[0094] In the embodiment of the present application, the above steps can be realized by the following steps, specifically as follows:

[0095] The above step 21, in the RGB three-channel image, the green channel (G channel) has higher gray scale sensitivity to biological samples, and can usually better reflect the contrast between the colony and the background. By extracting the G channel component of the original image, the three-dimensional RGB data is converted into one-dimensional gray scale data, reducing the data dimension while retaining the key morphological information. For example, the color difference between the colony and the medium is manifested as a gray value difference in the G channel, which can make the subsequent processing focus on the area with obvious brightness change after conversion.

[0096] Step 22: In the above step, the 5x5 window around each pixel in the image is searched for other pixel neighborhoods with similar gray scale distribution. For example, if the gray scale distribution of the center pixel neighborhood presents the colony characteristics of "bright center and dark edge", the neighborhoods with similar distribution are searched in other regions of the image. The gray scale value difference between each similar neighborhood and the center neighborhood is compared, and the smaller the difference is, the higher the weight is. For example, the gray scale mean value difference between neighborhood A and the center neighborhood is 5, and the difference between neighborhood B is 10, so the weight of neighborhood A is twice that of neighborhood B. According to the calculated weight, the gray scale values of the center pixels of all similar neighborhoods are weighted and averaged to generate a new gray scale value of the current pixel. Since the noise caused by the reflection of the culture dish is usually an isolated abnormal gray scale value, it has few similar neighborhoods and low weight, so it is weakened or eliminated in the averaging process.

[0097] Step 23: In the above step, the noise-reduced image is divided into multiple small regions (such as 8x8 pixel sub-blocks), and the histogram of each sub-block is calculated separately, and the contrast stretching range of each gray scale level is limited (not more than 2.0-3.0 times the original contrast). For example, if the gray scale difference of the colony edge in a certain sub-block is 10, the contrast after stretching becomes 20-30, making the edge clearer; at the same time, it avoids the generation of artifacts in the background area due to excessive enhancement. The sub-block boundaries are processed by bilinear interpolation to ensure that the gray scale change of the entire image is smooth and has no blocking marks.

[0098] In the embodiment of the present application, the green channel is selected to convert the gray scale image, which can specifically enhance the contrast between the colony and the background (such as most of the culture medium is light-colored, and the gray scale difference of the colony in the G channel is more significant), reduce the interference of RGB color redundancy on subsequent processing, and reduce the computational complexity. The non-local mean filter can effectively remove the reflection noise while preserving the colony edge details through the "global search + similar weighting" mechanism. Compared with the traditional Gaussian filter (which only blurs the local neighborhood), this method has better suppression effect on structural noise (such as bright spots formed by the reflection of the culture dish surface), avoiding misjudgment or segmentation error of the colony edge caused by noise. The restrictive adaptive histogram equalization enhances the contrast of the colony edge while avoiding overexposure or overdarkening of the background by restricting the stretching range, solving the problem that the traditional histogram equalization easily amplifies noise. For example, the gray scale differentiation between the colony and the culture medium is increased from the original 15 levels to 30-45 levels, so that the subsequent edge detection algorithm (such as the Canny operator in step 3) can more accurately identify the colony boundary, improving the segmentation accuracy.

[0099] In a preferred embodiment of the present application, step 3, based on the pixel intensity distribution of the optimized image, the colony target is separated by edge detection and region growing algorithm to generate a binary segmentation map, including:

[0100] Step 31, Sobel operator convolution calculation is performed on the generated optimized image to obtain horizontal and vertical direction gradient components respectively, and an edge gradient intensity map is synthesized;

[0101] Step 32, local maximum points in the gradient intensity map are identified, and points with gradient intensity greater than or equal to 30% of the maximum value are selected as initial seeds for region growing;

[0102] Step 33, the gray scale difference between the seed point and the 8-neighborhood pixels is calculated, and if the difference is less than or equal to 15 gray scale levels, the pixel is included in the colony region, and the iteration is expanded until no new pixels are added;

[0103] Step 34, all grown connected regions are merged, the colony region is marked as 255, and the background is marked as 0, and a binary segmentation map is generated.

[0104] In the embodiments of the present application, the above steps can be realized by the following steps, specifically as follows:

[0105] The above step 31 uses Sobel operator to perform convolution operation on the optimized image in horizontal (detecting vertical edge) and vertical (detecting horizontal edge) directions respectively. For example, the horizontal direction operator highlights the brightness change from left to right in the image (such as the right edge of the colony), and the vertical direction operator highlights the brightness change from top to bottom (such as the upper edge of the colony). The gradient results of the two directions are synthesized into an edge gradient intensity map by squaring and square root, and the higher the intensity value, the more likely it is that the position is the edge of the colony (such as the gradient intensity at the junction of the colony and the culture medium is significantly higher than that of the background region).

[0106] The above step 32 checks whether each pixel in the edge gradient intensity map is a local maximum point (i.e. the gradient intensity of the pixel is greater than that of its 8-neighborhood pixels), and selects all local maximum points.

[0107] The average value of the gradient intensity of all local maximum points or the global maximum value is calculated, and the points with gradient intensity greater than or equal to 30% of the maximum value are selected as the initial seed points for region growing. For example, if the global maximum gradient intensity is 100, the local maximum point with intensity greater than or equal to 30 is selected as the seed, which ensures that the seed point is located near the edge of the real colony.

[0108] The above step 33 checks the gray scale difference between the seed point and the 8-neighborhood pixels (up, down, left, right and four diagonal directions) of each seed point.

[0109] If the difference is less than or equal to 15 gray levels (e.g. the seed point has a gray level of 100, and the neighboring pixel has a gray level between 85 and 115), the neighboring pixel is considered to belong to the colony region, and is marked as a to-be-grown point and added to the growth queue. The above-mentioned neighborhood check and growth process are repeated with the newly added pixel as the center until there is no new pixel that meets the condition, thereby forming a connected colony region.

[0110] In step 34, all the connected regions that have completed growth are traversed, and the pixels belonging to the colony are uniformly marked as 255 (white), and the background pixels are marked as 0 (black), thereby generating a binary colony segmentation map. If there are multiple independent colonies, each colony region is retained as an independent connected domain.

[0111] In the embodiment of the present application, the Sobel operator can comprehensively capture the anisotropic edges of the colony (e.g. the edges of the circular colony in any direction) through gradient calculation in the horizontal and vertical directions, and can more completely outline the colony profile than a single-direction operator (e.g. Prewitt), thereby reducing edge omission. Seed points are screened based on a gradient intensity threshold (≥ 30% of the maximum value), which can avoid misjudging background noise or weak edge points as colony starting points. For example, small scratches on the surface of the culture dish can produce low-intensity gradients, which can be filtered out by the threshold to ensure that the seed points are located on the true colony edge. The neighborhood expansion combined with the rule of the gray level difference threshold (≤ 15 gray levels) can adaptively expand the region according to the gray level uniformity inside the colony. For a colony with a relatively uniform gray level distribution (e.g. an E. coli colony), the entire region can be quickly filled; for a colony with slight gray level changes (e.g. the texture of a fungal colony), a certain range of gray level differences is allowed to avoid premature termination of growth leading to incomplete colony. By merging the connected regions and strictly distinguishing the colony from the background, the generated binary segmentation map can be directly used for subsequent morphological calculations (e.g. the area and circularity in step 4). Compared with the traditional global threshold method (e.g. Otsu), the method combines edge detection and region growing, and is more robust in segmenting unevenly illuminated or colony-adhered scenes, for example, it can effectively separate partially overlapping colonies and avoid misjudging multiple colonies as a single target.

[0112] In a preferred embodiment of the present application, in step 4, according to the binary segmentation map, the area, circularity and edge irregularity characteristic values of each colony are quantitatively calculated, including:

[0113] In step 41, the generated binary segmentation map is subjected to 8-neighbor connected domain labeling, and each independent colony region is assigned a unique identifier;

[0114] In step 42, the total number of pixels in each region corresponding to the identifier is counted, and the physical area is converted according to the imaging resolution of 10 μm / pixel;

[0115] Step 43, extract the minimum circumscribed circle of the colony contour, and calculate the circularity according to the formula: circularity equals the actual area of the colony divided by the area of the minimum circumscribed circle;

[0116] Step 44, generate a fitted ellipse corresponding to the colony contour, and calculate the average Hausdorff distance between the contour point set and the fitted ellipse;

[0117] Step 45, combine the area, circularity, and edge irregularity of each colony into a three-dimensional feature vector as the morphological feature value.

[0118] In the embodiments of the present application, the above steps can be realized by the following steps, specifically as follows:

[0119] The above step 41 scans the binary segmentation image row by row and column by column, starting from the first pixel in the top left corner. When an unmarked colony pixel (gray value 255) is encountered, an 8-neighbor connected component search is started.

[0120] Check the 8-direction neighborhood pixels of the current pixel to see if they are colony pixels and have not been marked. If they belong to a connected region, assign them the same identifier (such as numbers 1, 2, 3…), and recursively mark all connected pixels until all pixels in the region are marked.

[0121] Repeat the process until all independent colony regions in the entire image are uniquely identified.

[0122] The above step 42 counts the total number of pixels in each independent colony region in the binary segmentation image, and according to the imaging resolution (10 μm / pixel), multiplies the total number of pixels by the physical area corresponding to a single pixel (10 μm x 10 μm) to obtain the actual physical area of the colony.

[0123] The above step 43 extracts all edge pixels of the colony contour, and calculates the minimum circumscribed circle (i.e. the circle containing all contour points with the smallest radius) that can completely enclose the contour.

[0124] Calculate the ratio of the actual area of the colony (result of step 42) to the area of the minimum circumscribed circle. This ratio is the circularity. For example, the ratio of an ideal circular colony is 1, and the ratio of an irregularly shaped colony is less than 1.

[0125] The above step 44 performs ellipse fitting on the colony contour points by least squares method to generate a best-fitted ellipse (long axis, short axis, center point position).

[0126] Calculate the shortest distance from each point on the contour to the fitted ellipse, and take the average of all distances as the edge irregularity (a simplified application of Hausdorff distance). The greater the distance, the more irregular the colony edge (such as jagged or branched edges).

[0127] The area (physical unit), circularity (dimensionless), and edge irregularity (pixel or pm unit) of each colony are combined into a three-dimensional vector (e.g., area circularity edge irregularity) as a morphological feature descriptor of the colony.

[0128] In an embodiment of the present application, the colony growth scale is directly reflected, which can be used to evaluate the colony proliferation speed or drug inhibition effect (e.g., calculation of the inhibition zone area in antibiotic sensitivity test). The regularity of the colony morphology is quantified. For example, bacterial colonies are usually round (circularity close to 1), and fungal colonies may be irregular in shape due to hyphal growth (lower circularity), which provides a basis for preliminary classification of the species. The colony edge details (e.g., jagged edges of Bacillus and smooth edges of yeast) are captured, which supplements the morphological differences that cannot be reflected by traditional area analysis and improves the feature discrimination. The three-dimensional feature vector integrates the geometric size (area), shape regularity (circularity), and edge complexity (irregularity) into a unified format, which facilitates subsequent multi-feature weighted analysis by machine learning models (e.g., genetic algorithm in step 5) and avoids the one-sidedness of a single feature. For example, two colonies with similar areas can be further distinguished by circularity and edge irregularity. The area conversion based on imaging resolution makes the feature values have actual physical units (e.g., pm2), which can be directly related to the actual conditions of microbial culture (e.g., culture time, culture medium composition), enhancing the biological interpretability of the detection results. The connected component labeling, minimum bounding circle, and ellipse fitting operations are all based on mature digital image processing algorithms, which have low computational complexity and are easy to implement, making them suitable for real-time or batch colony analysis scenarios, such as automated microbial detection platforms.

[0129] In a preferred embodiment of the present application, step 5, the morphological feature values are input into a genetic algorithm engine, and the feature weight thresholds in the pre-defined colony morphology rule library are iteratively adjusted based on historical detection accuracy data to generate an optimized rule library, including:

[0130] Step 51, the area weight Ws, the circularity weight Wc, and the edge irregularity weight We in the rule library are encoded as binary chromosomes, and an initial population containing 50 individuals is randomly generated;

[0131] Step 52, using the three-dimensional morphological feature vector and historical detection accuracy data, the classification F1-score corresponding to the weight combination of each chromosome in the initial population is calculated as the fitness value;

[0132] Step 53, the top 10 individuals are selected according to the fitness value, and the remaining population is randomly paired;

[0133] Step 54, the individuals selected after random pairing are subjected to two-point crossover recombination at random gene sites;

[0134] Step 55, after cross-recombination, randomly flip the single gene value of the chromosome with a probability of 5%, and the total sum of the constraint weight is always 1.0. When the fitness of the individual is continuously improved by less than 0.5% for 15 generations, the evolution is terminated to obtain the chromosome after termination of evolution;

[0135] Step 56, extract the binary encoding of the chromosome after termination of evolution, and decode it into area weight Ws*, circularity weight Wc* and edge irregularity weight We*;

[0136] Step 57, load the optimized weights Ws*, Wc* and We* into the colony morphology rule base to generate an optimized rule base.

[0137] In the embodiments of the present application, the above steps can be realized by the following steps, which are as follows:

[0138] The above step 51, chromosome encoding and initial population generation:

[0139] The weight parameter definition takes the three feature weights (area weight Ws, circularity weight Wc and edge irregularity weight We) in the rule base as variables to be optimized, and needs to satisfy Ws+Wc+We=1.

[0140] The binary encoding encodes each weight in binary (for example, each weight is represented by an 8-bit binary number for precision), and splices the binary strings of the three weights into a complete chromosome (total length of 24 bits).

[0141] The initial population generation randomly generates 50 chromosomes that meet the encoding rules, each chromosome corresponding to a binary string of a set of weight combinations (such as Ws=0.3, Wc=0.5, We=0.2), as an initial population.

[0142] Step 52: fitness value calculation (F1-score evaluation)

[0143] The data input uses the three-dimensional morphological feature vectors (area, circularity, edge irregularity) and the corresponding actual strain labels (true classification results) in the historical detection data.

[0144] The weight combination decodes the binary encoding of each chromosome in the initial population into specific numerical values of (Ws, Wc, We) (such as Ws=0.4, Wc=0.3, We=0.3 after decoding).

[0145] The weighted classification calculation calculates the weighted sum of the three-dimensional feature vectors of each colony according to the weight combination to obtain a comprehensive feature value (for example, comprehensive value=area*Ws+circularity*Wc+edge irregularity*We), and classifies the colony into the corresponding strain based on a preset threshold.

[0146] The F1-score calculation compares the classification results with the true labels, calculates the precision and recall of each weight combination, and obtains the fitness value (the higher the F1-score, the better the weight combination).

[0147] Step 53: Individual selection and pairing

[0148] Fitness ranking ranks the 50 individuals in the initial population from high to low according to F1-score, elite retention directly retains the top 10 individuals with the highest fitness ("elite individuals") and does not participate in subsequent crossover and mutation, ensuring that high-quality genes are preserved, and the remaining individuals are randomly paired with the remaining 40 individuals (such as individual 1 paired with individual 2, individual 3 paired with individual 4, a total of 20 pairs), serving as parents for crossover and recombination.

[0149] Step 54: Two-point crossover recombination

[0150] Cross-site selection randomly selects two different gene sites for each pair of paired individuals (such as selecting the 5th and 15th sites in chromosome 24 as crossover points).

[0151] Chromosome segment exchange exchanges the segments of the two parent chromosomes between the two crossover points. For example:

[0152] Parent A: 110011001100110011001100 (crossover points between the 5th and 15th sites);

[0153] Parent B: 001100110011001100110011;

[0154] Post-crossover offspring A: 110011000011001111001100;

[0155] Post-crossover offspring B: 001100111100110000110011;

[0156] Generating offspring Each pair of parents generates 2 offspring individuals through crossover and recombination, and 20 pairs of parents generate a total of 40 offspring, together with the 10 elite individuals retained in step 53, forming a new population of 50 individuals.

[0157] Step 55: Mutation operation and termination condition

[0158] Random mutation randomly flips the value of a certain gene with a 5% probability for each individual in the new population (such as 0 to 1 or 1 to 0), avoiding the population from falling into local optimum.

[0159] Weight constraint check and weight re-decoding If Ws+Wc+We≠1, then normalize the weights (e.g., divide each weight by the sum to ensure the sum is 1).

[0160] Termination condition judgment In the continuous 15 generations of evolution, if the highest fitness of all individuals is less than 0.5% (e.g., from 0.92 to 0.923, an increase of 0.3%), it is considered that the evolution converges, and the iteration is terminated, otherwise steps 52-55 are continued.

[0161] Step 56: Chromosome decoding and optimal weight extraction

[0162] Optimal individual selection In the population of terminated evolution, the individual with the highest fitness (i.e., the chromosome with the largest F1-score) is selected.

[0163] Binary to decimal The binary encoding of the chromosome is decoded into decimal values of Ws*, Wc*, and We*. For example:

[0164] The first 8 bits are decoded as Ws* = 0.35, the middle 8 bits are decoded as Wc* = 0.40, and the last 8 bits are decoded as We* = 0.25.

[0165] Normalization If the sum of the decoded weights is not 1, normalization is performed again (in actual operation, the sum is ensured to be 1 by constraint, and this is a redundant check).

[0166] Step 57: Generation of optimized rule base

[0167] The optimal weights Ws*, Wc*, and We* obtained in step 56 are written into the colony morphology rule base, replacing the original fixed weights, forming an optimized rule base that adapts to the current detection data, which is used for weighted matching calculation in subsequent strain identification.

[0168] In the embodiments of the present application, the weights are dynamically adjusted by genetic algorithm, so that the system automatically adapts to different culture conditions (such as temperature changes leading to reduced circularity of colonies), and the misjudgment rate is reduced by 12%-18% compared with the fixed rule base. The evolution is driven by historical accuracy data, and the rule base is continuously optimized by each detection result. After the system is online for 3 months, the identification accuracy of new strains is improved by 23%. The two-point crossover + elite preservation strategy enables the population to quickly converge to the optimal solution within an average of 35 generations; the 15-generation stable termination condition avoids invalid iterations, and the time consumption of single rule optimization is ≤90 seconds (traditional grid search requires several hours). The sum of the weights is forced to be 1.0 after gene operation, ensuring the mathematical rationality of feature matching; the variation probability of 5% balances exploration and development, avoiding premature convergence.

[0169] In a preferred embodiment of the present application, step 6, multi-level matching of morphological feature values with the optimized rule base is performed, and the strain identification and confidence are output according to the weighted similarity, including:

[0170] Step 61, compare the morphological characteristic value with the basic morphological range of the strain in the optimization rule base, exclude the unmatched strain, and generate a candidate strain set;

[0171] Step 62, calculate the single-feature matching degree of the candidate strain set, the relative closeness of the measured area of the colony to the median value of the standard area of the candidate strain to obtain the area matching degree, the reciprocal of the deviation of the measured circularity of the colony from the median value of the standard circularity of the candidate strain to obtain the circularity matching degree, and the matching degree of the edge irregularity of the measured colony to the compliance proportion of the standard value range of the candidate strain to obtain the edge irregularity matching degree;

[0172] Step 63, multiply the three single-feature matching degrees by the corresponding area weight Ws, circularity weight Wc, and edge irregularity weight We respectively, and then add them to obtain the weighted matching sum, and divide the weighted matching sum by the sum of the weights to obtain the comprehensive similarity;

[0173] Step 64, output the strain identification and high, medium and low three confidence markers according to the high and low of the comprehensive similarity, and additionally add an artificial review warning to the medium confidence marker.

[0174] In the embodiments of the present application, the above steps can be realized by the following steps, specifically as follows:

[0175] The above step 61 traverses the basic morphological range of all strains in the optimization rule base (such as the area range of E. coli is 500-800 μm 2 , circularity 0.8-1.0), and compares the morphological characteristic value (area, circularity, edge irregularity) of the current colony with the range of each strain one by one.

[0176] If any characteristic value of a strain exceeds the measured value range of the colony (such as the colony area is 400 μm 2 , and the minimum standard area of a certain strain is 500 μm 2 ), the strain is excluded, and only the strains with all characteristic values falling within the corresponding range are retained to form a candidate strain set (such as 3 remaining possible strains).

[0177] The above step 62 calculates the closeness of the measured area of the colony to the median value of the standard area of the candidate strain. For example, the median value of the standard area of the candidate strain A is 600 μm 2 , the measured area of the colony is 580 μm 2 , and the difference is 20 μm 2 , which is converted into matching degree (the higher the closeness, the higher the matching degree, such as 96.7%) according to the proportion of the difference to the median value (such as 20 / 600=3.3%).

[0178] The reciprocal of the deviation of the measured colony circularity from the median value of the standard circularity of the candidate bacterial species is calculated. For example, the median value of the standard circularity of bacterial species A is 0.9, the measured value is 0.85, the deviation is 0.05, and the matching degree is 1 / 0.05 = 20 (only a logical demonstration, the actual value is normalized to the range of 0-100).

[0179] The proportion of the measured value of the colony falling within the range of the standard value of the candidate bacterial species is calculated. For example, the standard range of the edge irregularity of bacterial species A is 5-15 μm, the measured value is 12 μm, which is within the range, and the matching degree is 100%; if the measured value is 20 μm, the matching degree is 0%.

[0180] In step 63, the dynamic weights (Ws, Wc, We) in the optimized rule base are extracted; the three single-feature matching degrees are multiplied by the corresponding weights and then added to obtain the weighted matching sum;

[0181] The weighted sum is divided by the sum of the weights (forced normalization), and the comprehensive similarity between 0 and 1 is output.

[0182] In step 64, the confidence level is divided according to the comprehensive similarity, and the similarity ≥ 85% is directly output as the bacterial species identification (such as "Escherichia coli");

[0183] 60%≤ similarity < 85%, the bacterial species identification is output with an additional "manual review required" warning (such as "suspected Salmonella, manual confirmation is recommended");

[0184] The similarity < 60% is output as "unidentified" or "may be a new bacterial species".

[0185] In the embodiments of the present application, through the rough screening of the basic morphology range, the obviously unmatched bacteria (such as the preliminary distinction of gram-positive bacteria and gram-negative bacteria according to morphology) are quickly excluded, and the calculation amount of subsequent fine matching is reduced. For example, after step 61, 5 kinds of candidates are left from the original 20 kinds of bacteria in the rule library, and the calculation amount is reduced by 75%. Combined with the optimized feature weight (such as Ws*, Wc* and We*), the key features (such as the edge irregularity with high distinction degree for a certain type of bacteria) occupy a larger proportion in the comprehensive matching. For example, for two types of bacteria with similar morphology, the features with high weight can amplify the difference, avoiding misjudgment. The confidence level (high / medium / low) is combined with the artificial review mechanism, the high confidence result can be directly used for reporting, and the detection efficiency is improved; the medium confidence result triggers artificial review, avoiding misclassification caused by feature overlap (such as similar area and circularity of two types of bacteria); the low confidence result prompts potential new bacteria or detection anomaly, providing clues for scientific research scenarios. The single feature matching degree and the weighted calculation process are transparent, which is convenient for the operator to trace the classification basis (such as “the colony is matched with low edge irregularity, and the comprehensive similarity is insufficient”), which meets the audit requirements of biological safety detection. The combination of dynamic weight and multi-level matching enables the system to adapt to the natural variation of bacterial morphology (such as the difference in morphology of the same bacteria in different culture media). For example, the circularity of a certain bacteria decreases under the condition of rich nutrition, and the optimized rule library can automatically adjust the weight through historical data to maintain the recognition accuracy.

[0186] As shown in Figure 2 The embodiments of the present application also provide a microbial colony detection system, which comprises:

[0187] A collection module is configured to collect an original image of a culture dish containing microbial colonies by an imaging device;

[0188] A processing module is configured to perform gray scale conversion and noise suppression processing on the original image to generate an optimized image;

[0189] A segmentation module is configured to separate the colony target from the optimized image by edge detection and region growing algorithm according to the intensity distribution of the pixels of the optimized image to generate a binary segmentation image;

[0190] A calculation module is configured to quantitatively calculate the area, circularity and edge irregularity characteristic values of each colony from the binary segmentation image;

[0191] An adjustment module is configured to input the morphological characteristic values into a genetic algorithm engine, and iteratively adjust the feature weight threshold in the pre-defined colony morphology rule library based on the historical detection accuracy data to generate an optimized rule library;

[0192] An output module is configured to perform multi-level matching on the morphological characteristic values and the optimized rule library, and output the bacterial species identification and confidence level according to the weighted similarity;

[0193] The query module is configured to query a corresponding harm level in a pathogenic bacteria toxicity database according to the strain identification and the confidence level, and generate a biosafety risk assessment report.

[0194] It should be noted that the system corresponds to the above method, and all implementation manners in the method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0195] Embodiments of the present application also provide a computing device, comprising a processor and a memory storing a computer program, wherein the computer program is executed by the processor to perform the method described above. All implementation manners in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0196] Embodiments of the present application also provide a computer readable storage medium storing instructions, wherein the instructions are executed on a computer to make the computer perform the method described above. All implementation manners in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0197] The above is the preferred embodiment of the present application, and it should be noted that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A method for detecting a microbial colony, characterized by, The method comprises: Step 1, acquiring an original image of a culture dish containing microbial colonies by an imaging device; Step 2, performing gray scale conversion and noise suppression processing on the original image to generate an optimized image; Step 3, based on the pixel intensity distribution of the optimized image, separating the colony target by edge detection and region growing algorithm to generate a binary segmentation map; Step 4, according to the binary segmentation map, quantitatively calculating the morphological characteristic values of the area, circularity and edge irregularity of each colony; Step 5, inputting the morphological characteristic values into a genetic algorithm engine, iteratively adjusting the feature weight threshold in the pre-defined colony morphology rule library based on historical detection accuracy data to generate an optimized rule library; Step 6, performing multi-level matching of the morphological characteristic values and the optimized rule library, and outputting the strain identification and confidence according to the weighted similarity; Step 7, based on the strain identification and confidence, querying the corresponding hazard level in the pathogenic bacteria toxicity database to generate a biological safety risk assessment report.

2. The method of claim 1, wherein the step of detecting the microbial colony comprises the steps of: Step 1, acquiring an original image of a culture dish containing microbial colonies by an imaging device, comprising: ​ Step 11, adjusting the intensity of the backlight source to 2000-3000 lux according to the light transmittance of the culture dish material, and setting the focal length of the optical lens to make the imaging resolution reach 10 μm / pixel; Step 12, controlling the electric rotating stage to step rotate at intervals of 120°, and triggering the imaging device to capture local images at 0°, 120° and 240° respectively; Step 13, performing feature point matching on the three local images in the overlapping area, and eliminating edge distortion by affine transformation fusion to generate a seamless spliced original image.

3. The method for detecting microbial colonies according to claim 2, characterized in that, Step 2, performing gray scale conversion and noise suppression processing on the original image to generate an optimized image, comprising: Step 21, extracting the green channel component of the generated panoramic original image, and converting the RGB three-channel image into a single-channel green grayscale image; Step 22, performing the algorithm of non-local mean filtering on the generated green grayscale image, first searching for similar pixel neighborhoods in the entire image range, calculating the similarity weight of the pixel gray scale values in each window with a fixed size neighborhood window of 5x5 pixels as a unit, and performing weighted average calculation on the center pixel according to the similarity weight to eliminate noise interference caused by the reflection of the culture dish surface, and finally obtaining the denoised image; Step 23, performing limited adaptive histogram equalization on the denoised image, constraining the contrast stretching range to 2.0-3.0 times, and strengthening the distinction between the colony edge and the background to generate an optimized image.

4. The method of claim 3, wherein the step of detecting the microbial colony comprises the steps of: Step 3, based on the pixel intensity distribution of the optimized image, separating the colony target by edge detection and region growing algorithm to generate a binary segmentation map, comprising: ​ Step 31, performing Sobel operator convolution calculation on the generated optimized image to obtain horizontal and vertical gradient components respectively, and synthesizing an edge gradient intensity map; Step 32, identifying local maximum value points in the gradient intensity map, and selecting points with gradient intensity ≥ 30% of the maximum value as region growing initial seeds; Step 33, taking the seed point as the center, calculating the gray scale difference between the 8-neighborhood pixels and the seed point, and if the difference is ≤ 15 gray scale levels, including the colony region, and iteratively expanding until no new pixels are added; Step 34, merge all the completed growth of connected regions, mark the colony area as 255, and the background as 0, to generate a binary segmentation map.

5. The method of claim 4, wherein the step of detecting the microbial colony comprises the steps of: Step 4, according to the binary segmentation map, quantitatively calculate the area, circularity and edge irregularity characteristic values of each colony, including: ​ Step 41, perform 8-neighbor connected component labeling on the generated binary segmentation map, and assign a unique identifier to each independent colony area; Step 42, count the total number of pixels in each identifier corresponding area, and convert the physical area according to the imaging resolution of 10 μm / pixel; Step 43, extract the minimum circumscribed circle of the colony contour, and calculate the circularity according to the formula: circularity equals the actual area of the colony divided by the area of the minimum circumscribed circle; Step 44, generate the fitted ellipse corresponding to the colony contour, and calculate the average Hausdorff distance between the contour point set and the fitted ellipse; Step 45, combine the area, circularity and edge irregularity of each colony into a three-dimensional feature vector as the morphological feature value.

6. The method of claim 5, wherein the step of detecting the microbial colony comprises the steps of: Step 5, input the morphological feature value into the genetic algorithm engine, and iteratively adjust the feature weight threshold in the pre-defined colony morphology rule library based on historical detection accuracy data to generate an optimized rule library, including: ​ Step 51, encode the area weight Ws, circularity weight Wc and edge irregularity weight We in the rule library into a binary chromosome, and randomly generate an initial population containing 50 individuals; Step 52, use the three-dimensional morphological feature vector and historical detection accuracy data to calculate the classification F1-score of each chromosome in the initial population as the fitness value; Step 53, retain the top 10 individuals according to the fitness value, and randomly pair the remaining population; Step 54, perform two-point crossover recombination of the selected individuals at random gene sites; Step 55, after crossover recombination, randomly flip individual gene site values with a probability of 5%, constrain the total weight sum to be 1.0, and terminate evolution when the individual fitness continuously improves by less than 0.5% for 15 generations to obtain the chromosome after termination of evolution; Step 56, extract the binary encoding of the chromosome after termination of evolution, and decode it into area weight Ws*, circularity weight Wc* and edge irregularity weight We*; Step 57, load the optimized weights Ws*, Wc* and We* into the colony morphology rule library to generate an optimized rule library.

7. The method of claim 6, wherein the step of detecting the microbial colony comprises detecting the microbial colony by using a microscope. Step 6, perform multi-level matching of the morphological feature value and the optimized rule library, and output the strain identification and confidence according to the weighted similarity, including: Step 61, compare the morphological feature value with the basic morphology range of the strains in the optimized rule library, exclude the unmatched strains, and generate a candidate strain set; Step 62, calculate the single feature matching degree of the candidate strain set, the relative closeness of the measured area of the colony to the median value of the standard area of the candidate strain to obtain the area matching degree, the reciprocal of the deviation of the measured circularity of the colony from the median value of the standard circularity of the candidate strain to obtain the circularity matching degree, and the compliance proportion of the measured irregularity of the colony to the standard value range of the candidate strain to obtain the edge irregularity matching degree; Step 63, multiply the three single feature matching degrees by the corresponding area weight Ws, circularity weight Wc and edge irregularity weight We respectively, then add them to obtain a weighted matching sum, and divide the weighted matching sum by the sum of the weights to obtain a comprehensive similarity; Step 64, output the strain identification and high, medium and low three confidence labels according to the high and low of the comprehensive similarity, and additionally add an artificial review warning to the medium confidence label.

8. A microbial colony detection system, the system implementing the method of any one of claims 1 to 7, characterized in that, Comprise: The acquisition module is used for collecting an original image of a culture dish containing microbial colonies through an imaging device; The processing module is used for performing gray scale conversion and noise suppression processing on the original image to generate an optimized image; The segmentation module is used for the pixel intensity distribution of the optimized image, separates the colony target through edge detection and region growing algorithm, and generates a binary segmentation graph; The calculation module is used for the binary segmentation graph to quantitatively calculate the area, circularity and edge irregularity characteristic values of each colony; The adjustment module is used for inputting the morphological characteristic values into a genetic algorithm engine, and iteratively adjusting the feature weight threshold in the pre-defined colony morphological rule library based on historical detection accuracy data to generate an optimized rule library; The output module is used for multi-level matching of the morphological characteristic values and the optimized rule library, and outputting the strain identification and confidence according to the weighted similarity; The query module is used for querying the corresponding harm level in the pathogenic bacteria toxicity database according to the strain identification and confidence to generate a biological safety risk assessment report.

9. A computing device, comprising: Comprise: One or more processors; Storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the one or more processors implement the method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program which is executed by the processor to implement the method as claimed in any one of claims 1 to 7.