Bioculture detection methods and apparatuses, systems, electronic devices, and media

CN123015376APending Publication Date: 2026-10-30ACCURATE INT BIOTECHNOLOGY (GUANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610972436.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-01
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

而在自动化培养过程中,目前没有实现高度检测的方法和系统,来代替人工确定悬液的高度

Benefits of technology

[0009]本发明的实施例提供的生物培养物检测方法和装置,首先,获取包括生物培养物沉淀的试管原始图像;其次,基于试管原始图像,确定试管位置及试管底部区域;再次,基于试管位置及试管底部区域,从试管原始图像中提取沉淀感知域图像;其次,对沉淀感知域图像进行形态学特征识别,得到第一沉淀分割掩膜;然后,利用预训练的深度学习语义分割模型对沉淀感知域图像进行轮廓识别,得到第二沉淀分割掩膜;最后,基于第一沉淀分割掩膜与第二沉淀分割掩膜,得到生物培养物沉淀的沉淀区域和沉淀高度。由此,提供了一种形态学分析和深度学习的双规融合策略,其中,双规融合策略中形态学分析利用红色通道和自适应阈值,增强了低对比度下的特征提取;双规融合策略中深度学习利用模型的语义理解能力,克服了传统方法无法处理的纹理模糊问题,双规融合策略显著提升了检测的鲁棒性;本发明涵盖了从试管识别、分类、裁剪到测量的全闭环,且无需对生物培养物进行染色或标记(非侵入式),在保证生物活性的前提下替代了人工目视,满足了高通量自动化培养的质控需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015376A_ABST
    Figure CN123015376A_ABST
Patent Text Reader

Abstract

The application provides a biological culture detection method and device, system, electronic equipment and medium, and relates to the technical fields of artificial intelligence and the like. The specific implementation scheme is as follows: an original image of a test tube including biological culture sediment is acquired; based on the original image of the test tube, the position of the test tube and the bottom region of the test tube are determined; based on the position of the test tube and the bottom region of the test tube, a sediment perception domain image is extracted from the original image of the test tube; morphological feature recognition is performed on the sediment perception domain image to obtain a first sediment segmentation mask; a pre-trained deep learning semantic segmentation model is used to perform contour recognition on the sediment perception domain image to obtain a second sediment segmentation mask; and based on the first sediment segmentation mask and the second sediment segmentation mask, a sediment region and a sediment height of the biological culture sediment are obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, and in particular to a method, apparatus, system, electronic device, and computer-readable storage medium for detecting biological cultures. Background Technology

[0002] In biological culture (such as organoids), after cell digestion in test tubes, manual identification of the culture sediment is often required to determine its height and locate the suspension aspiration point. However, in automated culture processes, there are currently no methods or systems to detect the height of the culture sediment, replacing manual determination. Furthermore, biological culture sediments possess biological characteristics such as translucency, blurred edges, and inconsistencies, and are often accompanied by tube wall reflections and meniscus interference. Traditional fixed threshold segmentation methods have limited accuracy in complex scenarios with uneven lighting or loose sediments. Therefore, how to effectively detect biological cultures is a pressing issue that needs to be addressed. Summary of the Invention

[0003] This invention provides a method, apparatus, system, electronic device, and computer-readable storage medium for detecting biological cultures.

[0004] According to a first aspect, a method for detecting biological culture precipitates is provided. The method includes: acquiring an original image of a test tube containing biological culture precipitates; determining the test tube position and bottom region based on the original image; extracting a precipitate-sensing domain image from the original image based on the test tube position and bottom region; performing morphological feature recognition on the precipitate-sensing domain image to obtain a first precipitate segmentation mask; performing contour recognition on the precipitate-sensing domain image using a pre-trained deep learning semantic segmentation model to obtain a second precipitate segmentation mask; and obtaining the precipitate region and precipitate height of the biological culture precipitate based on the first and second precipitate segmentation masks.

[0005] According to a second aspect, a biological culture detection device is provided, comprising: an acquisition unit configured to acquire an original image of a test tube including biological culture precipitate; a determination unit configured to determine the position of the test tube and the bottom region of the test tube based on the original image of the test tube; an extraction unit configured to extract a precipitate sensing domain image from the original image of the test tube based on the position of the test tube and the bottom region of the test tube; an identification unit configured to perform morphological feature recognition on the precipitate sensing domain image to obtain a first precipitate segmentation mask; a segmentation unit configured to perform contour recognition on the precipitate sensing domain image using a pre-trained deep learning semantic segmentation model to obtain a second precipitate segmentation mask; and a obtaining unit configured to obtain the precipitate region and precipitate height of the biological culture precipitate based on the first precipitate segmentation mask and the second precipitate segmentation mask.

[0006] According to a third aspect, a biological culture detection system is provided, comprising: an image acquisition device for acquiring an original image of a test tube including biological culture precipitate; and an information detection device connected to the image acquisition device for detecting the precipitation area and precipitation height of the original test tube image using the biological culture detection method described in any implementation of the first aspect, thereby obtaining the precipitation area and precipitation height of the biological culture precipitate.

[0007] According to a fourth aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first aspect.

[0008] According to a fifth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the method described in any implementation of the first aspect.

[0009] The biological culture detection method and apparatus provided in the embodiments of the present invention firstly acquire an original image of a test tube including biological culture precipitate; secondly, based on the original image of the test tube, determine the position of the test tube and the bottom region of the test tube; thirdly, based on the position of the test tube and the bottom region of the test tube, extract a precipitate sensing domain image from the original image of the test tube; next, perform morphological feature recognition on the precipitate sensing domain image to obtain a first precipitate segmentation mask; then, use a pre-trained deep learning semantic segmentation model to perform contour recognition on the precipitate sensing domain image to obtain a second precipitate segmentation mask; finally, based on the first precipitate segmentation mask and the second precipitate segmentation mask, obtain the precipitate region and precipitate height of the biological culture precipitate. Therefore, a dual-track fusion strategy combining morphological analysis and deep learning is provided. In this strategy, morphological analysis utilizes the red channel and adaptive threshold to enhance feature extraction under low contrast. In the deep learning strategy, the semantic understanding capability of the model is utilized to overcome the texture blurring problem that traditional methods cannot handle. The dual-track fusion strategy significantly improves the robustness of detection. This invention covers a complete closed loop from test tube identification, classification, cutting to measurement, and does not require staining or labeling of biological cultures (non-invasive). It replaces manual visual inspection while ensuring biological activity, meeting the quality control requirements of high-throughput automated culture.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0011] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of the invention. Wherein: Figure 1 This is a flowchart of an embodiment of the biological culture detection method of the present invention; Figure 2 This is a schematic diagram of the first precipitation segmentation mask and the second precipitation segmentation mask after fusion in this invention; Figure 3 This is a schematic diagram of the structure of one embodiment of the biological culture detection device of the present invention; Figure 4 This is a schematic diagram of the structure of one embodiment of the biological culture detection system of the present invention; Figure 5 This is a block diagram of an electronic device used to implement the biological culture detection method of the present invention. Detailed Implementation

[0012] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.

[0013] The technical solution of the present invention is illustrated below through specific embodiments. It should be understood that the one or more steps mentioned in the present invention do not preclude the existence of other methods and steps before or after the combined steps, or that other methods and steps may be inserted between these explicitly mentioned steps. It should also be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Unless otherwise stated, the numbering of each method step is only for the purpose of identifying each method step, and not for limiting the order of each method or limiting the scope of the present invention. Changes or adjustments to their relative relationships, without substantial changes to the technical content, can also be considered as within the scope of the present invention.

[0014] The raw materials and instruments used in the examples are not subject to any specific restrictions on their source; they can be purchased from the market or prepared according to conventional methods known to those skilled in the art.

[0015] To address the problems of traditional technologies, this invention provides a method for detecting biological cultures. Figure 1 A flowchart 100 is shown as an embodiment of a biological culture detection method according to the present invention, the biological culture detection method comprising the following steps: Step 101: Obtain the original image of the test tube including the biological culture precipitate.

[0016] In this embodiment, it refers to the biological culture aggregate that is deposited at the bottom of the test tube after cell digestion during the biological culture process. The biological culture precipitate has biological characteristics such as being translucent, having blurred edges, and being unstable.

[0017] In this embodiment, the biological culture precipitate is obtained through centrifugation: the culture containing the biological culture is transferred to a test tube, and after low-temperature centrifugation, the cell clusters of the biological culture are deposited at the bottom of the tube under the action of gravity to form a dense precipitate layer, while the matrix gel and culture medium in the supernatant are distributed in layers above the precipitate. By removing the upper liquid, a pure biological culture precipitate can be obtained for subsequent experiments such as subculture, cryopreservation, or molecular biological analysis. The original image of the test tube is obtained by a camera device by taking a picture of the test tube containing the biological culture precipitate. The original image of the test tube is a local image containing the potential precipitate area, which is used for subsequent precipitate detection and analysis.

[0018] In this embodiment, the original image of the test tube can be a grayscale image, which is an image that does not require any staining treatment of the biological culture. Specifically, an industrial camera can be used to photograph the test tube under bright field conditions to obtain the original image of the test tube.

[0019] Step 102: Based on the original image of the test tube, determine the position of the test tube and the bottom area of ​​the test tube.

[0020] In this embodiment, the original image of the input test tube is first preprocessed by grayscale conversion, Gaussian filtering for noise reduction, and edge enhancement to improve the accuracy of subsequent detection. Then, an image segmentation algorithm based on color or shape features (such as HSV color space threshold segmentation or Canny edge detection combined with Hough linear transform) is used to extract the outline of the test tube. Through contour analysis, regions of interest (ROIs) that meet the aspect ratio and area constraints of the test tube are selected to accurately locate the position of the test tube in the image. After determining the overall position of the test tube, based on the geometric morphology of the test tube (usually a cylindrical structure with a rounded bottom), combined with contour fitting or morphological operations, the curvature change points of the bottom region of the test tube are identified. The rounded bottom segment and its adjacent cylindrical region are defined as the bottom region of the test tube. Finally, the position coordinates of the test tube (such as an outer rectangle or mask) and the specific range of the bottom region are output, providing accurate regional positioning information for subsequent applications such as liquid level detection and sedimentation analysis.

[0021] Optionally, step 102 may further include: using an adaptive threshold segmentation algorithm to identify the test tube region in the original test tube image and determine the test tube location.

[0022] Step 103: Extract the precipitation sensing domain image from the original image of the test tube based on the test tube position and the bottom region of the test tube.

[0023] In this embodiment, the precipitation-sensing domain image refers to an image cropped from the original image of the test tube, containing only the bottom of the test tube and the region of interest containing potential precipitates. The precipitation-sensing domain image is the direct input object for the algorithm. By cropping, irrelevant background in the upper half of the test tube is removed, reducing the computational load and enabling the algorithm to focus on small precipitate targets.

[0024] In this embodiment, the extraction process of the precipitation sensing domain image is as follows: First, the test tube area image is cropped from the original image according to the preset test tube position coordinates. Then, based on the positioning information of the bottom area of ​​the test tube, a rectangular region of interest with a height of 1 / 4 to 1 / 3 of the total height of the test tube is defined at the bottom of the test tube area image as the precipitation sensing domain. Finally, the image pixels within this region are extracted to form the precipitation sensing domain image for subsequent precipitation analysis. This process, by accurately locating the bottom area of ​​the test tube, effectively focuses on the key locations where precipitates accumulate, while eliminating interference from the liquid area at the top of the test tube, providing a high-quality image data foundation for precipitation feature extraction and quantitative analysis.

[0025] Step 104: Perform morphological feature recognition on the sedimentation sensing domain image to obtain the first sedimentation segmentation mask.

[0026] In this embodiment, the first sedimentation segmentation mask refers to the binary image of the sedimentation region obtained by the morphological feature recognition method, wherein the pixel value of the sedimentation region is 1 and the pixel value of the background region is 0.

[0027] In this embodiment, the specific implementation of morphological feature recognition of the precipitation sensing domain image to obtain the first precipitation segmentation mask is as follows: First, the precipitation sensing domain image is grayscaled to reduce computational complexity; then, an adaptive threshold segmentation algorithm is used to binarize the grayscale image to initially separate the precipitation area from the background; next, morphological opening operation (erosion followed by dilation) is used to eliminate small noise points and isolated pixels in the binary image, and then morphological closing operation (dilation followed by erosion) is used to fill the small holes inside the precipitation area and smooth the boundaries; finally, each precipitation area is marked by connected component analysis, and non-precipitation interferences are filtered out according to preset area thresholds and shape factors (such as roundness and aspect ratio) to generate an accurate first precipitation segmentation mask. This mask is output in the form of a binary image, where white pixels represent the precipitation target area and black pixels represent the background area, providing a reliable spatial mask basis for subsequent quantitative precipitation analysis.

[0028] Step 105: Use a pre-trained deep learning semantic segmentation model to perform contour recognition on the sedimentation perceptual domain image to obtain the second sedimentation segmentation mask.

[0029] In this embodiment, the second sedimentation segmentation mask refers to the binary image of the sedimentation region obtained through a deep learning semantic segmentation model.

[0030] In this embodiment, a pre-trained deep learning semantic segmentation model is used to perform contour recognition on the sediment-aware domain image. First, the pre-processed sediment-aware domain image is input into a deep learning semantic segmentation model that has been pre-trained on a large-scale natural image dataset (such as COCO or ImageNet). The model utilizes its encoder-decoder structure and the Spatial Pyramid Pooling (ASPP) module to extract multi-scale sediment region features. Then, the decoder performs upsampling and feature fusion to achieve pixel-level classification prediction and outputs a binary segmentation result of the sediment region and background. Finally, edge detection and morphological post-processing are performed on the segmentation result to accurately extract the sediment contour boundary and generate a second sediment segmentation mask for subsequent sediment volume calculation and morphological analysis. It should be noted that the deep learning semantic segmentation model can be DeepLabV3+.

[0031] In this embodiment, the deep learning semantic segmentation model is trained using the following steps: a training dataset is constructed, and data augmentation strategies are applied to the input sedimentation perceptual domain image. The data augmentation strategies include random brightness adjustment, random contrast adjustment, and elastic deformation. The Adam optimizer is used to update the network parameters of the initial deep learning model, and the learning rate is dynamically adjusted using a cosine annealing strategy. When the deep learning model meets the training completion conditions, the trained deep learning semantic segmentation model is obtained.

[0032] Step 106: Based on the first precipitation segmentation mask and the second precipitation segmentation mask, the precipitation area and precipitation height of the biological culture are obtained.

[0033] In this embodiment, the acquired biological culture images are first preprocessed. A deep learning segmentation model (such as U-Net or Mask R-CNN) is used to perform pixel-level recognition of the sedimentation regions in the images, generating a first sedimentation segmentation mask. This mask marks the outline of the projected sedimentation region on a two-dimensional plane in a binarized form. Simultaneously, a second sedimentation segmentation mask is constructed by combining the image's depth information or Z-axis tomographic data to characterize the spatial distribution features of the sedimentation in the vertical direction. Subsequently, the first and second sedimentation segmentation masks are spatially registered and fused. A schematic diagram of the fused first and second sedimentation segmentation masks is shown below. Figure 2 As shown, the pixel area of ​​the mask-covered area is calculated and the actual area of ​​the sedimentation area is obtained by combining the image calibration scale. At the same time, the vertical thickness of the sedimentation is calculated based on the pixel span and interlayer spacing parameters of the second mask in the Z-axis direction. Finally, the set of boundary coordinates of the sedimentation area of ​​the biological culture sedimentation and the sedimentation height value are output, realizing the three-dimensional quantitative characterization of the sedimentation morphology.

[0034] The biological culture detection method provided by the embodiments of the present invention firstly acquires an original image of a test tube including biological culture precipitate; secondly, based on the original image of the test tube, the position of the test tube and the bottom region of the test tube are determined; thirdly, based on the position of the test tube and the bottom region of the test tube, a precipitation sensing domain image is extracted from the original image of the test tube; next, morphological feature recognition is performed on the precipitation sensing domain image to obtain a first precipitation segmentation mask; then, contour recognition is performed on the precipitation sensing domain image using a pre-trained deep learning semantic segmentation model to obtain a second precipitation segmentation mask; finally, based on the first precipitation segmentation mask and the second precipitation segmentation mask, the precipitation area and precipitation height of the biological culture precipitate are obtained. Therefore, a dual-track fusion strategy combining morphological analysis and deep learning is provided. In this strategy, morphological analysis utilizes the red channel and adaptive threshold to enhance feature extraction under low contrast. In the deep learning strategy, the semantic understanding capability of the model is utilized to overcome the texture blurring problem that traditional methods cannot handle. The dual-track fusion strategy significantly improves the robustness of detection. This invention covers a complete closed loop from test tube identification, classification, cutting to measurement, and does not require staining or labeling of biological cultures (non-invasive). It replaces manual visual inspection while ensuring biological activity, meeting the quality control requirements of high-throughput automated culture.

[0035] In some optional implementations of the present invention, determining the test tube position and bottom region based on the original test tube image includes: processing the original test tube image using an adaptive threshold segmentation algorithm to obtain a binary image; identifying the test tube region in the binary image to determine the test tube position and the test tube centerline; determining the corresponding bottom clipping offset according to the test tube type; determining the lowest position of the white pixels on the test tube centerline and using the lowest position as a reference point; and determining the bottom region of the test tube based on the reference point and the bottom clipping offset.

[0036] In this optional implementation, the bottom reference point of the test tube is determined based on the test tube category information and the lowest position of the white pixel on the center line of the test tube in the binary image. Different types of test tubes have different cropping offsets due to differences in bottom shape (the bottom of type A test tubes is offset upwards by 45 pixels, and the bottom of type B test tubes is offset upwards by 18 pixels). Based on this, the bottom area of ​​the test tube is cropped from the original image of the test tube.

[0037] In some embodiments of the present invention, the above-mentioned test tube category is obtained through the following steps: extracting the contour feature indicators of the test tube from the original image of the test tube, the contour feature indicators including normalized standard deviation, roundness ratio and radius standard deviation; inputting the contour feature indicators into a pre-trained ensemble machine learning model, and outputting the test tube category; the ensemble machine learning model includes a support vector machine and a random forest classifier, the support vector machine and the random forest classifier are fused through a soft voting strategy, the soft voting strategy includes obtaining the first prediction probability of the support vector machine and the second prediction probability of the random forest classifier, calculating the weighted average of the first prediction probability and the second prediction probability, and determining the test tube category by the weighted average.

[0038] In this optional implementation, soft voting is a fusion strategy in ensemble learning. Unlike "hard voting" (which directly counts the number of class votes), soft voting calculates a weighted average of the probability values ​​predicted by all base classifiers (such as SVM and random forest), and finally selects the class with the highest average probability as the prediction result. Soft voting can make more refined use of the model's confidence information and improve the accuracy of IVF classification.

[0039] In this optional implementation, the contour feature indicators of the test tube include normalized standard deviation, roundness ratio, and radius standard deviation. SVM support vector machine and random forest are used for ensemble voting, so that the model can determine the test tube category based on the three feature indicators.

[0040] In this optional implementation, the formula for integrating the machine learning model is shown in equation (1).

[0041] (1) In equation (1), F ensemble To integrate machine models, h SVM h is the base classifier for SVM. RF For random forest base classifiers, Φ soft This is the soft voting fusion function. The fusion function is: (2) In equation (2), x is the model-predicted sample. To predict the probability that a sample belongs to class A (test tube A) for the model, The model predicts the probability that a sample belongs to class B (test tube B), where: (3) (4) In equations (3) and (4), The predicted probability of the SVM base classifier model. This represents the predicted probability of the random forest base classifier model.

[0042] In this optional implementation, the training steps of the integrated machine learning model include: first, extracting the bottom contour from the binary image of each test tube in the training set, and calculating three structured feature indicators: normalized standard deviation, roundness ratio, and radius standard deviation, to form a feature vector; then, standardizing the feature vector and inputting it into an SVM support vector machine (using the RBF radial basis function) and a random forest classifier for supervised training; after training, the two base classifiers are integrated through a soft voting fusion function, and the final test tube category determination result is obtained by weighting and averaging their respective prediction probabilities, thereby realizing the automatic classification of different types of test tubes.

[0043] In some optional implementations of the present invention, the above-mentioned morphological feature recognition of the sedimentation sensing domain image to obtain the first sedimentation segmentation mask includes: extracting the red channel image of the sedimentation sensing domain image; calculating the pixel mean and standard deviation of the upper half region of the red channel image as background statistical features; scanning the red channel image line by line in a scanning direction from the bottom of the image upwards; calculating the average gray value of the scanned line and comparing the average gray value of the line with the background statistical features; when the average gray value of a consecutive preset number of lines falls back to the background range set based on the background statistical features, determining the current line as the starting line of the sedimentation region; and performing binarization processing in the region from the starting line to the bottom of the image using an adaptive threshold calculated based on the background statistical features to obtain the first sedimentation segmentation mask.

[0044] In this optional implementation, the red channel image of the sedimentation sensing domain image is extracted, and the pixel mean and standard deviation of the upper half of the image (e.g., 50% area) as the background region are calculated. The image is searched row by row from the bottom. When the mean of more than a preset number of consecutive rows (which can be determined according to the setting requirements, such as 3 preset rows) falls back to within the background mean plus 1.5 times the standard deviation, the position is determined as the starting row of the sedimentation region. In the region from the starting row of sedimentation to the bottom of the image, binarization is performed with the background mean minus 8 (and not less than 35) as the adaptive segmentation threshold. Then, post-processing such as morphological closing operation to fill gaps, small area connected component removal and hole filling is performed to obtain the final sedimentation sensing domain contour. This sedimentation sensing contour is used as the first sedimentation segmentation mask.

[0045] Optionally, after binarization, the above-mentioned morphological feature recognition of the sedimentation sensing domain image to obtain the first sedimentation segmentation mask further includes: performing morphological closing operation on the binarized image to fill the gaps in the sedimentation region; removing connected components with an area smaller than a preset threshold, and performing hole filling operation.

[0046] Optionally, the above-mentioned morphological feature recognition of the sedimentation sensing domain image to obtain the first sedimentation segmentation mask includes: using a contour detection algorithm to obtain all candidate sedimentation contours in the sedimentation sensing domain image, and calculating the centroid ordinate of each candidate contour; determining whether the centroid ordinate is greater than or equal to a preset position threshold, if it is satisfied, it is retained as a valid sedimentation contour, if it is not satisfied, it is discarded as a floating interference contour; taking the union of the bounding rectangles of all retained valid sedimentation contours to form the first sedimentation segmentation mask.

[0047] In some optional implementations of the present invention, the above-mentioned morphological feature recognition of the sedimentation sensing domain image to obtain the first sedimentation segmentation mask further includes: detecting the bright areas in the sedimentation sensing domain image; if the average gray value of the area exceeds a set brightness threshold, or the proportion of bright pixels exceeds a set ratio, it is determined to be a pipe wall reflective area and is removed when generating the first sedimentation segmentation mask.

[0048] In this optional implementation, reflectivity is also determined in the sedimentation sensing field image. If the average gray value of the area exceeds the set brightness threshold or the proportion of bright pixels exceeds the set ratio, it is determined to be a reflective area of ​​the pipe wall and is filtered out to avoid false detection.

[0049] In some embodiments of the present invention, the deep learning semantic segmentation model introduces an attention gating module in the skip connection between the encoder and the decoder; the attention gating module is used to apply spatial attention weighting to the feature map transmitted by the encoder to suppress background regions and reflective interference features; the training loss function of the deep learning semantic segmentation model adopts a weighted combination of the dice loss function and the binary cross-entropy loss function.

[0050] In this embodiment, the attention gating module is a mechanism embedded in a neural network. It uses deep features as gating signals to perform pixel-level weighting on shallow feature maps, automatically assigning high weights to the target area (sediment) and low weights to the background area (pipe wall, liquid). Through the attention gating module, the model can be forced to focus on the sediment and ignore interference such as pipe wall reflection.

[0051] In this embodiment, the dice loss function is a metric (based on the Dice coefficient) for measuring the similarity between two sample sets, commonly used in medical image segmentation. Its core advantage lies in addressing class imbalance. In test tube images, the sediment (foreground) occupies very few pixels, while the background constitutes the vast majority. Ordinary loss functions tend to cause the model to only predict the background, while the dice loss function directly optimizes the overlap, forcing the model to accurately predict the foreground in order to reduce the loss.

[0052] In this embodiment, the deep learning semantic segmentation model adopts a U-Net-based encoder-decoder network structure, which can perform pixel-level semantic segmentation of the sedimentation region in the sedimentation receptive field image. The encoder part uses a multi-level convolution-pooling module to progressively extract multi-scale features of the image. Each level contains two 3×3 convolutional layers, a batch normalization layer, and a ReLU activation function. Then, spatial downsampling is performed through a 2×2 max pooling layer, halving the feature map resolution step by step, while doubling the number of channels step by step (64, 128, 256, 512 respectively), thereby obtaining a multi-level feature representation from low-level texture to high-level semantics. The decoder part uses transposed convolution to upsample and restore spatial resolution, and performs skip connections with the feature maps of the corresponding layers of the encoder at each level, so that the decoder can preserve high-level semantic information while restoring spatial details. Finally, a single-channel probability map of the same size as the input is output through a 1×1 convolutional layer and a sigmoid activation function, where each pixel value represents the probability that it belongs to the sedimentation region.

[0053] In this embodiment, the deep learning semantic segmentation model is optimized for the specific characteristics of biological culture sediment. Specifically, given the semi-transparent nature, blurred edges, and severe imbalance in the positive and negative sample area ratio of biological culture sediment, the following targeted improvements are introduced based on the standard U-Net: First, an attention gating module (AttentionGate) is introduced into the encoder bottleneck layer. By applying spatial attention weighting to the features of skip connections, the propagation of interfering features from background areas (test tube walls, liquid surface reflections) is suppressed, enhancing the ability to focus on small sediment areas. Second, a dice loss function and binary loss function are adopted. The weighted combination of cross-entropy loss functions is used as the training loss function. The dice loss function is naturally robust to class imbalance problems with very small foreground (sedimentation area) area, and the binary cross-entropy provides pixel-level gradient signals. The combination of the two enables the model to converge effectively even when there is a severe imbalance between positive and negative samples. Thirdly, during the training phase, data augmentation strategies are applied to the cropped receptive field image, including random brightness / contrast adjustment (simulating different lighting conditions), random horizontal flipping, and elastic deformation (simulating different morphological distributions of sediments), in order to expand the number of effective training samples and improve the generalization ability of the model.

[0054] In this embodiment, the training steps of the deep learning semantic segmentation model are as follows: the sedimentation perceptual domain image is used as input, and the manually annotated binary mask of the sedimentation region is used as the supervision label to construct the training dataset; the training process uses the Adam optimizer, the initial learning rate is set to 1×10⁻³, and the learning rate is dynamically adjusted using a cosine annealing learning rate scheduling strategy; the batch size is set according to the GPU memory capacity, each training epoch traverses all training samples, and the network weight parameters are updated through backpropagation. The convergence of the model is measured by the loss function value and the Dice coefficient and IoU (Intersection over Union) index on the validation set. Training stops when the validation set index no longer improves.

[0055] In actual testing, the cropped image of the receptive field at the bottom of the test tube is input into the trained deep learning semantic segmentation model. The deep learning semantic segmentation model outputs a pixel-level probability map of the sedimentation region. After thresholding (default threshold 0.5), the second sedimentation segmentation mask of the binary mask is obtained.

[0056] In some optional implementations of the present invention, obtaining the precipitation region and precipitation height of the biological culture precipitation based on the first precipitation segmentation mask and the second precipitation segmentation mask includes: calculating the intersection-union ratio (IUR) of the first precipitation segmentation mask and the second precipitation segmentation mask; if the IUR is greater than a preset consistency threshold, then taking the union region of the first precipitation segmentation mask and the second precipitation segmentation mask as the precipitation region of the biological culture precipitation; if the IUR is less than or equal to the consistency threshold, then taking the second precipitation segmentation mask as the precipitation region of the biological culture precipitation; obtaining the circumscribed rectangle of the precipitation region, and calculating the height of the circumscribed rectangle as the precipitation height.

[0057] In this optional implementation, the Intersection over Union (IoU) is the area of ​​the intersection of two regions divided by the area of ​​their union. IoU serves as the benchmark for fusion decisions in this invention. If the IoU calculated by the traditional algorithm and the deep learning model is high, it indicates that they have reached a consensus, and the result is reliable. If the IoU is low, it indicates a discrepancy (usually due to interference with the traditional algorithm), and in this case, the system chooses to trust the deep learning model.

[0058] In this optional implementation, when the IoU (Intersection over Union) ratio of the two sets of results is greater than the set consistency threshold, the union region of the two is taken as the final sedimentation segmentation result, and the sedimentation height is calculated based on the height of the bounding rectangle of the union region. When the two sets of results are inconsistent (IoU is lower than the threshold), the deep learning segmentation result is preferred because it has stronger robustness to complex interferences such as illumination changes, edge blurring, and pipe wall reflection. The pixel height of the fused sedimentation region is also calculated using the bounding rectangle, and converted into the actual height (millimeters) based on the proportional relationship.

[0059] Optionally, the above-mentioned method of obtaining the precipitation region and precipitation height of biological culture precipitation based on the first precipitation segmentation mask and the second precipitation segmentation mask includes: acquiring the first precipitation segmentation mask and the second precipitation segmentation mask; using an open-source contour detection function to calculate the bounding rectangle and centroid ordinate of each contour in the first precipitation segmentation mask and the second precipitation segmentation mask; retaining only the contours whose centroid is located in the lower part of the clipping region (i.e., the centroid ordinate is greater than or equal to a preset position threshold) as valid precipitation contours; and removing the non-precipitation interference contours located in the upper part to obtain a precipitation region including at least one valid contour; then taking the union of the bounding rectangles of all valid contours, i.e., taking the highest position (minimum ordinate) of all valid contours as the top edge of the rectangle, the lowest position (maximum ordinate) as the bottom edge of the rectangle, and the leftmost and rightmost as the left and right boundaries of the rectangle to form a rectangular frame that surrounds all valid precipitation regions; the height of this rectangular frame is the pixel height of the biological culture precipitation, which is converted into precipitation height (millimeters) by combining the known ratio between pixels and physical size.

[0060] Further reference Figure 3 As an implementation of the methods shown in the above figures, the present invention provides an embodiment of a biological culture detection device, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0061] like Figure 3 As shown, the biological culture detection device 300 provided in this embodiment includes: an acquisition unit 301, a determination unit 302, an extraction unit 303, an identification unit 304, a segmentation unit 305, and a obtaining unit 306. The acquisition unit 301 can be configured to acquire an original image of a test tube including biological culture precipitate. The determination unit 302 can be configured to determine the test tube position and bottom region based on the original test tube image. The extraction unit 303 can be configured to extract a precipitate sensing domain image from the original test tube image based on the test tube position and bottom region. The identification unit 304 can be configured to perform morphological feature recognition on the precipitate sensing domain image to obtain a first precipitate segmentation mask. The segmentation unit 305 can be configured to perform contour recognition on the precipitate sensing domain image using a pre-trained deep learning semantic segmentation model to obtain a second precipitate segmentation mask. The obtaining unit 306 can be configured to obtain the precipitate region and precipitate height of the biological culture precipitate based on the first and second precipitate segmentation masks.

[0062] In this embodiment, the specific processing and technical effects of the acquisition unit 301, determination unit 302, extraction unit 303, identification unit 304, segmentation unit 305, and obtaining unit 306 in the biological culture detection device 300 can be found in the following references. Figure 1The relevant descriptions of steps 101, 102, 103, 104, and 105 in the corresponding embodiments will not be repeated here.

[0063] In some embodiments of the present invention, the determining unit 302 is configured to: process the original image of the test tube using an adaptive threshold segmentation algorithm to obtain a binary image; identify the test tube region in the binary image and determine the test tube position and the test tube center line; determine the corresponding bottom clipping offset according to the test tube type; determine the lowest position of the white pixel on the test tube center line and use the lowest position as a reference point; and determine the bottom region of the test tube based on the reference point and the bottom clipping offset.

[0064] In some embodiments of the present invention, the above-mentioned biological culture detection device 300 includes: a classification unit (not shown in the figure), which is configured to: extract contour feature indicators of the test tubes from the original image of the test tubes, the contour feature indicators including normalized standard deviation, roundness ratio and radius standard deviation; input the contour feature indicators into a pre-trained ensemble machine learning model, and output the test tube category; the ensemble machine learning model includes a support vector machine and a random forest classifier, the support vector machine and the random forest classifier are fused through a soft voting strategy, the soft voting strategy includes obtaining a first prediction probability of the support vector machine and a second prediction probability of the random forest classifier, calculating a weighted average of the first prediction probability and the second prediction probability, and determining the test tube category by the weighted average.

[0065] In some embodiments of the present invention, the recognition unit 304 is configured to: extract the red channel image of the sedimentation sensing domain image; calculate the pixel mean and standard deviation of the upper half region of the red channel image as background statistical features; scan the red channel image line by line in a scanning direction from the bottom of the image upwards; calculate the average gray value of the scanned line and compare the average gray value of the line with the background statistical features; when the average gray value of a consecutive preset number of lines falls back to the background range set based on the background statistical features, determine the current line as the starting line of the sedimentation region; and perform binarization processing in the region from the starting line to the bottom of the image using an adaptive threshold calculated based on the background statistical features to obtain a first sedimentation segmentation mask.

[0066] In some embodiments of the present invention, the identification unit 304 is further configured to: detect bright areas in the sedimentation sensing domain image; if the average gray value of the area exceeds a set brightness threshold, or the proportion of bright pixels exceeds a set ratio, it is determined to be a pipe wall reflective area and is removed when generating the first sedimentation segmentation mask.

[0067] In some embodiments of the present invention, the deep learning semantic segmentation model introduces an attention gating module in the skip connection between the encoder and the decoder; the attention gating module is used to apply spatial attention weighting to the feature map transmitted by the encoder to suppress background regions and reflective interference features; the training loss function of the deep learning semantic segmentation model adopts a weighted combination of the dice loss function and the binary cross-entropy loss function.

[0068] In some embodiments of the present invention, the above-mentioned obtaining unit 306 is configured to: calculate the cross-union ratio (CUNR) of the first precipitation segmentation mask and the second precipitation segmentation mask; if the CUNR is greater than a preset consistency threshold, then take the union region of the first precipitation segmentation mask and the second precipitation segmentation mask as the precipitation region of the biological culture; if the CUNR is less than or equal to the consistency threshold, then take the second precipitation segmentation mask as the precipitation region of the biological culture; obtain the circumscribed rectangle of the precipitation region, and calculate the height of the circumscribed rectangle as the precipitation height.

[0069] The biological culture detection device provided in the embodiments of the present invention firstly acquires an original image of a test tube including biological culture precipitate by an acquisition unit 301; secondly, a determination unit 302 determines the position of the test tube and the bottom region of the test tube based on the original image of the test tube; thirdly, an extraction unit 303 extracts a precipitate sensing domain image from the original image of the test tube based on the position of the test tube and the bottom region of the test tube; fourthly, a recognition unit 304 performs morphological feature recognition on the precipitate sensing domain image to obtain a first precipitate segmentation mask; then, a segmentation unit 305 uses a pre-trained deep learning semantic segmentation model to perform contour recognition on the precipitate sensing domain image to obtain a second precipitate segmentation mask; finally, an acquisition unit 306 obtains the precipitate area and precipitate height of the biological culture precipitate based on the first precipitate segmentation mask and the second precipitate segmentation mask. Therefore, a dual-track fusion strategy combining morphological analysis and deep learning is provided. In this strategy, morphological analysis utilizes the red channel and adaptive threshold to enhance feature extraction under low contrast. In the deep learning strategy, the semantic understanding capability of the model is utilized to overcome the texture blurring problem that traditional methods cannot handle. The dual-track fusion strategy significantly improves the robustness of detection. This invention covers a complete closed loop from test tube identification, classification, cutting to measurement, and does not require staining or labeling of biological cultures (non-invasive). It replaces manual visual inspection while ensuring biological activity, meeting the quality control requirements of high-throughput automated culture.

[0070] The biological culture detection method of this invention addresses the challenge of detecting biological culture sediment, a unique type of biological sample, and proposes a complete automated morphological analysis scheme with the following characteristics: (1) In view of the characteristics of semi-transparent, blurred edges and incomplete precipitation of biological culture sediments, this method adopts red channel separation combined with adaptive threshold segmentation strategy. The segmentation threshold is dynamically determined by statistically analyzing the pixel distribution characteristics of the background area. Compared with the traditional fixed threshold method, it significantly improves the detection accuracy of low contrast and blurred edge sediments. (2) To address the false detection problem caused by reflection on the test tube wall and interference from the liquid meniscus, this method introduces an automatic judgment and filtering mechanism for reflective areas. By analyzing the average brightness of the detection area and the proportion of high-brightness pixels, it effectively distinguishes between real sediment and reflection on the tube wall, thereby improving the accuracy and robustness of the detection results. (3) The automatic classification of different types of test tubes is achieved through machine learning models, and the bottom cutting parameters are adaptively adjusted according to the test tube category, which solves the problem of unified detection in the scenario of mixed use of test tubes of different specifications and improves the versatility and automation of the system. (4) This method uses bright-field images of biological cultures as the data source and adopts a non-invasive pure image analysis method throughout the process. No staining or labeling treatment is required for the biological cultures, which ensures that the biological activity of the tested biological cultures is not affected, which is beneficial to subsequent culture and experiments. It establishes an important link for quality control and drug sensitivity analysis in biological culture culture. (5) The overall solution realizes full-process automation from image acquisition, test tube identification and classification, precipitation area detection to height quantitative measurement, replacing the traditional manual visual interpretation method, improving detection efficiency and result consistency, and meeting the quality control requirements of automated biological culture production lines; (6) A deep learning semantic segmentation model based on the U-Net architecture is introduced. The pixel-level sedimentation region segmentation is achieved through the encoder-decoder structure and skip connections. Compared with the traditional threshold segmentation method, it can effectively deal with complex scenarios such as uneven lighting, loose distribution of sediment, and reflection of tube walls. Especially in extreme cases where the contrast between sediment and background is extremely low and the sediment edge is highly blurred, it can still maintain high segmentation accuracy. At the same time, through the design of attention gating module and Dice loss function for class imbalance, the special problem of biological samples with small sedimentation area and severe imbalance between foreground and background is specifically solved. (7) A dual-channel fusion decision mechanism of morphological analysis and deep learning is adopted to combine the interpretability and computational lightweight advantages of traditional adaptive thresholding methods with the strong feature expression and high robustness advantages of deep learning models. Through IoU consistency comparison, mutual verification and complementary fusion are carried out, which not only ensures efficient processing in normal scenarios, but also improves the detection reliability in complex scenarios, and achieves the optimal balance between detection accuracy and computational efficiency.

[0071] Further reference Figure 4As an implementation of the methods shown in the above figures, the present invention provides an embodiment of a biological culture detection system, which is similar to... Figure 1 The method embodiments shown correspond to those described.

[0072] like Figure 4 As shown, the biological culture detection system 400 provided in this embodiment includes: an image acquisition device 401 and an information detection device 402; the image acquisition device 401 is used to acquire the original image of the test tube including the biological culture precipitate; the information detection device 402 is connected to the image acquisition device and is used to detect the precipitation area and precipitation height of the original image of the test tube using the biological culture detection method, so as to obtain the precipitation area and precipitation height of the biological culture precipitate.

[0073] In this embodiment, the image acquisition device is used to acquire the original image of the test tube containing the biological culture sediment, and it can be a camera or other imaging device; the information detection device includes: a test tube identification and recognition device, a biological culture sediment recognition device, a deep learning segmentation and fusion device, and a communication device.

[0074] In this embodiment, the test tube identification and recognition device is connected to the test tube sedimentation image acquisition device. The test tube identification and recognition device includes a test tube detection module and a test tube classification module. The test tube detection module is used to detect test tubes in the image. The test tube classification module, based on the test tube detection module, classifies the test tubes and confirms the bottom of the test tubes.

[0075] In this embodiment, the biological culture precipitation identification device is connected to the test tube identification device. The biological culture precipitation identification device includes a precipitation sensing domain detection module and a precipitation height analysis module. The precipitation sensing domain detection module is used to detect the potential precipitation outline at the bottom of the test tube. The precipitation height analysis module determines the biological culture precipitation and obtains the precipitation height based on the precipitation sensing domain detection module.

[0076] In this embodiment, the deep learning segmentation and fusion device is connected to the biological culture sedimentation recognition device. The deep learning segmentation and fusion device includes a deep learning inference module and a fusion decision module. The deep learning inference module is equipped with a pre-trained U-Net semantic segmentation model, which is used to perform end-to-end pixel-level sedimentation region segmentation on the sensory domain image at the bottom of the test tube. The fusion decision module performs consistency comparison and fusion between the segmentation mask output by the deep learning inference module and the morphological segmentation result output by the sedimentation sensory domain detection module, and outputs the final sedimentation region segmentation result and sedimentation height.

[0077] In this embodiment, the communication device is used to connect the image acquisition device with the test tube identification and recognition device and the biological culture precipitation identification device.

[0078] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0079] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their patterns are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0080] like Figure 5 As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0081] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0082] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as biological culture detection methods. For example, in some embodiments, the biological culture detection method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the biological culture detection method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform biological culture detection methods by any other suitable means (e.g., by means of firmware).

[0083] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0084] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable biological culture detection device, such that when executed by the processor or controller, the program code causes the patterns / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0085] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0087] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0088] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.

[0089] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.

Claims

1. A method for detecting biological cultures, characterized in that, The method includes: Acquire raw images of test tubes, including biological culture precipitates; Based on the original image of the test tube, determine the position of the test tube and the bottom area of ​​the test tube; Based on the test tube position and the bottom region of the test tube, a precipitation sensing domain image is extracted from the original image of the test tube. Morphological feature recognition is performed on the precipitate sensing domain image to obtain a first precipitate segmentation mask; A pre-trained deep learning semantic segmentation model is used to perform contour recognition on the sedimentation perceptual domain image to obtain a second sedimentation segmentation mask; Based on the first precipitation segmentation mask and the second precipitation segmentation mask, the precipitation area and precipitation height of the biological culture are obtained.

2. The method according to claim 1, characterized in that, Determining the position of the test tube and the bottom region based on the original image of the test tube includes: The original image of the test tube was processed using an adaptive threshold segmentation algorithm to obtain a binary image; Identify the test tube region in the binary image to determine the test tube location and centerline; Determine the corresponding bottom trimming offset based on the type of test tube; Determine the lowest position of the white pixel on the center line of the test tube, and use the lowest position as the reference point; The bottom region of the test tube is determined based on the reference point and the bottom cutting offset.

3. The method according to claim 2, characterized in that, The test tube category is obtained through the following steps: Extract the contour feature indicators of the test tube from the original image of the test tube, the contour feature indicators including normalized standard deviation, roundness ratio and radius standard deviation; The contour feature indicators are input into a pre-trained ensemble machine learning model, which outputs the test tube category. The integrated machine learning model includes a support vector machine and a random forest classifier. The support vector machine and the random forest classifier are fused through a soft voting strategy. The soft voting strategy includes obtaining a first predicted probability of the support vector machine and a second predicted probability of the random forest classifier, calculating a weighted average of the first predicted probability and the second predicted probability, and determining the test tube category through the weighted average.

4. The method according to claim 1, characterized in that, The step of performing morphological feature recognition on the sedimentation sensing domain image to obtain the first sedimentation segmentation mask includes: Extract the red channel image of the precipitate sensing domain image; Calculate the pixel mean and standard deviation of the upper half region of the red channel image as background statistical features; The red channel image is scanned line by line in a scanning direction from the bottom of the image upwards; Calculate the average gray value of the scanned row and compare the average gray value of the row with the background statistical features; When the average gray value of a consecutive preset number of rows falls back to the background range set based on the background statistical features, the current row is determined as the starting row of the sedimentation area; Within the region from the starting line to the bottom of the image, binarization is performed using an adaptive threshold calculated based on the background statistical features to obtain the first sedimentation segmentation mask.

5. The method according to claim 4, characterized in that, The step of performing morphological feature recognition on the sedimentation sensing domain image to obtain the first sedimentation segmentation mask further includes: Detect the highlighted areas in the sedimentation sensing domain image; If the average grayscale value of a region exceeds the set brightness threshold, or the proportion of bright pixels exceeds the set ratio, it is determined to be a reflective area of ​​the pipe wall and is removed when the first sedimentation segmentation mask is generated.

6. The method according to claim 1, characterized in that, The deep learning semantic segmentation model introduces an attention gating module in the skip connection between the encoder and decoder; the attention gating module is used to apply spatial attention weighting to the feature map transmitted by the encoder to suppress background regions and reflective interference features; the training loss function of the deep learning semantic segmentation model adopts a weighted combination of the dice loss function and the binary cross-entropy loss function.

7. The method according to claim 1, characterized in that, The determination of the precipitation region and precipitation height of the biological culture precipitate based on the first precipitation segmentation mask and the second precipitation segmentation mask includes: Calculate the crossover ratio between the first precipitation segmentation mask and the second precipitation segmentation mask; If the crossover ratio is greater than the preset consistency threshold, then the union region of the first precipitation segmentation mask and the second precipitation segmentation mask is taken as the precipitation region of the biological culture. If the crossover ratio is less than or equal to the consistency threshold, then the second precipitation segmentation mask is used as the precipitation region of the biological culture. Obtain the bounding rectangle of the sedimentation region, and calculate the height of the bounding rectangle as the sedimentation height.

8. A biological culture detection device, characterized in that, The device includes: The acquisition unit is configured to acquire raw images of test tubes, including biological culture precipitates; The determining unit is configured to determine the position of the test tube and the bottom region of the test tube based on the original image of the test tube; The extraction unit is configured to extract a precipitation-sensing domain image from the original image of the test tube based on the test tube position and the bottom region of the test tube; The recognition unit is configured to perform morphological feature recognition on the sedimentation sensing domain image to obtain a first sedimentation segmentation mask; The segmentation unit is configured to perform contour recognition on the sedimentation perceptual domain image using a pre-trained deep learning semantic segmentation model to obtain a second sedimentation segmentation mask. The unit is configured to obtain the precipitation region and precipitation height of the biological culture precipitate based on the first precipitation segmentation mask and the second precipitation segmentation mask.

9. A biological culture detection system, characterized in that, The system includes: Image acquisition device for acquiring raw images of test tubes, including biological culture precipitates; An information detection device, connected to the image acquisition device, is used to detect the precipitation area and precipitation height of the original image of the test tube using the biological culture detection method according to any one of claims 1-7, so as to obtain the precipitation area and precipitation height of the biological culture.

10. A terminal device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.