Cell detection method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]然而,荧光图像中通常同时存在单个细胞和细胞聚团,两者在尺寸和形态上存在明显差异
[0005]本申请旨在至少解决相关技术中存在的技术问题之一。为此,本申请提出一种细胞检测方法,能够提高对细胞检测的准确性。
Smart Images

Figure CN122551349A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a cell detection method and apparatus. Background Technology
[0002] With the development of technology, the use of computers to process the fluorescence images of cells and output cell detection results plays an important role in medical diagnosis.
[0003] In related technologies, cell detection using cell fluorescence images involves processing the entire fluorescence image through methods such as connected component analysis, morphological processing, and watershed algorithms to separate adjacent targets in the fluorescence image, ultimately obtaining detection results including cell number and location.
[0004] However, fluorescence images typically contain both single cells and cell clusters, which differ significantly in size and morphology. Using a uniform connected component analysis and watershed algorithm for cell detection in fluorescence images only allows for a compromise selection based on a single target type, making it difficult to simultaneously adapt to the characteristic differences between the two types of targets. Therefore, this cell detection method is prone to interference between the detection of cell clusters and single cells, leading to missegmentation of either single cells or cell clusters, thus affecting the accuracy of cell detection. Summary of the Invention
[0005] This application aims to address at least one of the technical problems existing in the related art. To this end, this application proposes a cell detection method that can improve the accuracy of cell detection.
[0006] The cell detection method according to the first aspect of this application includes: Based on the contour features of each connected region in the fluorescence image of the cell, the category label of each connected region is determined; Based on the category labels of each connected region, extract each first connected region with the category label of cell cluster from the fluorescence image to generate an image to be detected; The image to be detected is input into the trained image detection model to obtain the cell cluster detection results of each first connected region; Based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell, the cell detection results of the fluorescence image are obtained; The image detection model is trained using image samples from multiple cell clusters.
[0007] By analyzing the contour features of connected regions in the fluorescence image of cells, the category labels of each connected region are determined. Based on these category labels, cell clusters are extracted from the fluorescence image to generate images to be detected. These images are then input into an image detection model for cell cluster detection. After obtaining the detection results for each cell cluster, these results are merged with the contour features of individual cells to obtain the cell detection results for the fluorescence image. Thus, based on the contour features of individual cells obtained in the first stage, the detection results of individual cells are directly determined. Subsequent detection in the second stage only applies to the images generated from cell clusters. This ensures that the detection of the images to be detected only needs to adapt to the features of cell clusters, reducing mutual interference between the detection of cell clusters and individual cells, thereby reducing missegmentation of individual cells or cell clusters and improving the accuracy of cell detection.
[0008] According to one embodiment of this application, determining the category label of each connected region based on the contour features of each connected region in the fluorescence image of the cell includes: Based on the brightness of each of the connected regions, the fluorescence image is thresholded to obtain a binarized image; Extract the outer contours of each connected region from the binarized image; The contour features of the outer contours of each connected region are input into the trained contour classification model to obtain the category labels of each connected region.
[0009] According to one embodiment of this application, the step of extracting each first connected region with the category label of cell clusters from the fluorescence image based on the category label of each connected region, and generating a detection image, includes: Based on the category labels of each of the connected regions, each first connected region with the category label of cell clusters and each second connected region with the category label of a single cell are determined from each of the connected regions. Based on the outer contour of each of the second connected regions, determine each target image region in the fluorescence image that corresponds one-to-one with each of the second connected regions; The target image regions are masked to generate the image to be detected, which includes each of the first connected regions.
[0010] According to one embodiment of this application, the step of inputting the image to be detected into a trained image detection model to obtain the cell cluster detection results of each first connected region includes: The image to be detected is segmented to obtain multiple sub-images; Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each first connected region.
[0011] According to one embodiment of this application, the step of segmenting the image to be detected to obtain multiple sub-images includes: Based on a preset overlapping region, the image to be detected is segmented to obtain multiple sub-images with partially overlapping regions of adjacent sub-images.
[0012] According to one embodiment of this application, before performing image segmentation on the image to be detected based on a preset overlapping region to obtain multiple sub-images with partially overlapping regions of adjacent sub-images, the method further includes: Determine that the boundary of the preset overlapping region overlaps with the first connected region, and adjust the boundary of the preset overlapping region until the first connected region is completely located inside the preset overlapping region, or the first connected region is completely located outside the preset overlapping region.
[0013] According to one embodiment of this application, the step of inputting each of the sub-images into the image detection model to obtain the cell cluster detection results of each first connected region includes: Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each of the sub-images; Based on the coordinate positions of each sub-image in the image to be detected, the cell cluster detection results of each sub-image are mapped to the image to be detected to obtain the initial detection results of each first connected region in the image to be detected; The initial detection results of each of the first connected regions are deduplicated to obtain the cell cluster detection results of each of the first connected regions.
[0014] According to one embodiment of this application, the step of deduplicating the initial detection results of each of the first connected regions to obtain the cell cluster detection results of each of the first connected regions includes: Based on the initial detection results, determine the detection score of the initial detection results; Based on the detection scores of each of the initial detection results corresponding to the first connected region, the initial detection result with the highest detection score among the initial detection results is determined as the cell cluster detection result of the first connected region.
[0015] According to one embodiment of this application, determining the detection score of the initial detection result based on the initial detection result includes: The detection score of the initial detection result is obtained based on the confidence level of the cell detection box, the area of the cell detection box, and the area normalization coefficient of the cell detection box in the initial detection result.
[0016] The cell detection device according to a second aspect embodiment of this application includes: The label acquisition module is used to determine the category label of each connected region based on the contour features of each connected region in the fluorescence image of the cell; An image extraction module is used to extract each first connected region with the category label of cell clusters from the fluorescence image according to the category label of each connected region, and generate an image to be detected; The cell detection module is used to input the image to be detected into the trained image detection model to obtain the cell cluster detection results of each first connected region; The data acquisition module is used to obtain the cell detection results of the fluorescence image based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell; The image detection model is trained using image samples from multiple cell clusters.
[0017] An electronic device according to a third aspect of this application includes a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the cell detection method described in any of the above embodiments.
[0018] A computer-readable storage medium according to a fourth aspect of this application stores a computer program thereon, which, when executed by a processor, implements the cell detection method described in any of the above embodiments. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the first process of the cell detection method provided in the embodiments of this application; Figure 2a A schematic diagram of fluorescence images provided in the embodiments of this application; Figure 2b A partial schematic diagram of a fluorescence image provided in an embodiment of this application; Figure 3a This is a schematic diagram of the classification results of connected regions provided in an embodiment of this application; Figure 3b This is a schematic diagram of the local classification results of the connected regions provided in an embodiment of this application; Figure 4 This is a partial schematic diagram of the image to be detected provided in an embodiment of this application; Figure 5 A partial schematic diagram of the cell cluster detection results provided in an embodiment of this application; Figure 6a This is a schematic diagram of cell detection results for fluorescence images provided in the embodiments of this application; Figure 6b A partial schematic diagram of cell detection results from fluorescence images provided in an embodiment of this application; Figure 7a This is a schematic diagram of a binarized image provided in an embodiment of this application; Figure 7b A partial schematic diagram of a binarized image provided in an embodiment of this application; Figure 8 This is a schematic diagram of mask processing provided in an embodiment of this application; Figure 9 This is a schematic diagram of a sub-image provided in an embodiment of this application; Figure 10 This is a schematic diagram of the preset overlapping area provided in the embodiments of this application; Figure 11 This is a schematic diagram of the preset overlapping area adjustment provided in the embodiments of this application; Figure 12 This is a schematic diagram of a cell detection frame provided in an embodiment of this application; Figure 13 A schematic diagram of the cell cluster detection results of each first connected region after deduplication provided in the embodiments of this application; Figure 14 This is a schematic diagram of the structure of the cell detection device provided in the embodiments of this application; Figure 15 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0023] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0024] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0025] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0026] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), and similarly, "multiple items" refers to two or more (including two).
[0027] The cell detection method and apparatus provided in this application will be described in detail below through several specific embodiments.
[0028] With the development of technology, the use of computers to process the fluorescence images of cells and output cell detection results plays an important role in medical diagnosis.
[0029] In related technologies, cell detection using fluorescence images involves processing the entire fluorescence image using methods such as connected component analysis, morphological processing, and watershed algorithms to separate adjacent targets and ultimately obtain detection results including cell number and location. When the fluorescence image contains cell clusters where multiple cells are in contact or adhered to each other, morphological erosion dilation, distance transformation, local extremum search, and watershed algorithms can be used to process the entire fluorescence image to break down the cell clusters into multiple independent cells.
[0030] However, in fluorescence images, individual cells typically appear as small, regularly shaped bright spots, while cell clusters appear as larger, irregularly shaped, and unevenly distributed gray-scale regions. If a uniform connected component analysis and watershed algorithm are used to detect cells across the entire fluorescence image, the relevant parameters can often only be selected as a compromise for one type of target, making it difficult to simultaneously adapt to the feature differences between the two types of targets. Therefore, this cell detection method is prone to interference between the detection of cell clusters and individual cells, leading to missegmentation of individual cells or cell clusters, thus affecting the accuracy of cell detection.
[0031] Therefore, this embodiment of the application determines the category label of each connected region in the fluorescence image of the cell by using the contour features of each connected region. Based on the category label of each connected region, cell clusters are extracted from the fluorescence image to generate an image to be detected. This image is then input into an image detection model for cell cluster detection. After obtaining the detection results of each cell cluster, the detection results of each cell cluster are merged with the contour features of individual cells to obtain the cell detection results of the fluorescence image. Thus, based on the contour features of individual cells obtained in the first stage, the detection results of individual cells are directly determined. Subsequently, the second stage of detection is only performed on the image to be detected generated from cell clusters. This ensures that the detection of the image to be detected only needs to adapt to the features of cell clusters, reducing the mutual interference between the detection of cell clusters and individual cells, thereby reducing the missegmentation of individual cells or cell clusters and improving the accuracy of cell detection.
[0032] According to some embodiments of this application, this application provides a cell detection method, which can be applied to a terminal device to detect cells. The terminal device can be a desktop terminal, a mobile terminal, or a server, etc. The server can be an independent server or a server cluster composed of multiple servers, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence sampling point devices.
[0033] like Figure 1 As shown, the cell detection method provided in this embodiment includes: S101, determine the category label of each connected region based on the contour features of each connected region in the fluorescence image of the cell; S102, based on the category labels of each connected region, extract each first connected region whose category label is cell cluster from the fluorescence image to generate an image to be detected; S103, input the image to be detected into the trained image detection model to obtain the cell cluster detection results of each first connected region; S104, based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell, the cell detection results of the fluorescence image are obtained; The image detection model is trained using image samples from multiple cell clusters.
[0034] In some embodiments, a cell fluorescence image refers to a digital image formed by an imaging system acquiring the fluorescence emitted by cells after they have been specifically labeled with fluorescent dyes or fluorescent proteins and irradiated with excitation light of a specific wavelength. It can visually reflect cell morphology, the distribution and abundance of specific molecules (such as DNA and proteins), and is commonly used for cell counting, classification, and state analysis. The acquired fluorescence image can be displayed as follows: Figure 2a and Figure 2b As shown.
[0035] For fluorescence images, contour recognition can be performed to extract the outer contours of each connected region in the fluorescence image. The contour features of the outer contours of each connected region are then input into a trained contour classification model for classification, thus obtaining the category label of the outer contour. At this point, the category label of the outer contour is the category label of the corresponding connected region.
[0036] The contour features may include area, perimeter, roundness, aspect ratio of the circumscribed rectangle, convex hull area ratio, number of indentations, major axis of the fitted ellipse, minor axis of the fitted ellipse, ellipse tilt angle, average gray value, and gray variance.
[0037] Contour classification models can be machine learning models such as random forests, support vector machines, and gradient boosting trees, whose output class labels are single cells or cell clusters. Training a contour classification model involves sequentially inputting multiple contour feature samples into the model. Each time, the output classification label of the model is matched with the actual label of the input contour feature sample. If they do not match, gradient descent is used to adjust the network parameters of the contour classification model through error backpropagation, and training continues until the classification label of each input contour feature sample matches the corresponding actual label. At this point, the training of the contour classification model is complete, and a trained contour classification model is obtained.
[0038] By inputting the contour features of the outer contours of each connected region into a trained contour classification model for classification, we can obtain the first connected regions labeled as cell clusters and the second connected regions labeled as single cells. For example... Figure 3a and Figure 3b As shown.
[0039] For each second connected region, its outer contour can be used as the detection result of a single cell to form a set of single-cell detection results. For each first connected region, since the first connected region is a cluster of cells, all second connected regions can be removed from the fluorescence image, and only all first connected regions can be extracted to form the image to be detected, such as... Figure 4 As shown.
[0040] For the image to be detected, it can be input into a trained image detection model for cell cluster detection. The image detection model can be a lightweight model, such as the YOLO model. Training the image detection model can involve using images containing only cell clusters as cell cluster image samples, with each cell cluster image sample labeled with a bounding box for each individual cell within the cluster. Multiple image samples are sequentially input into the image detection model for training. Each time, the cell bounding boxes output by the image detection model are matched with the labeled cell bounding boxes of the current image sample. If there is a mismatch, gradient descent is used to adjust the network parameters of the image detection model through error backpropagation, and training continues until the cell bounding boxes obtained from each input image sample match the labeled cell bounding boxes of the current input image sample. This indicates that the training of the image detection model is complete, and a trained image detection model is obtained.
[0041] After training the image detection model, the image to be detected can be input into the trained model, which will then output the cell detection boxes for individual cells in each of the first connected regions of the image. Figure 5 As shown. After obtaining the cell detection boxes of individual cells in each first connected region, the cell detection boxes of individual cells in each first connected region can be used as the cell cluster detection results for each first connected region.
[0042] The cell cluster detection results of each first connected region are merged with the detection results of individual cells in each second connected region. Specifically, the cell detection bounding boxes of individual cells in each first connected region are merged with the outer contours of individual cells in each second connected region. This process marks all cells in the fluorescence image, resulting in the output of the cell detection results for the entire fluorescence image. Figure 6a and Figure 6b As shown.
[0043] By analyzing the contour features of connected regions in the fluorescence image of cells, the category labels of each connected region are determined. Based on these category labels, cell clusters are extracted from the fluorescence image to generate images to be detected. These images are then input into an image detection model for cell cluster detection. After obtaining the detection results for each cell cluster, these results are merged with the contour features of individual cells to obtain the cell detection results for the fluorescence image. Thus, based on the contour features of individual cells obtained in the first stage, the detection results of individual cells are directly determined. Subsequent detection in the second stage only applies to the images generated from cell clusters. This ensures that the detection of the images to be detected only needs to adapt to the features of cell clusters, reducing mutual interference between the detection of cell clusters and individual cells, thereby reducing missegmentation of individual cells or cell clusters and improving the accuracy of cell detection.
[0044] To improve the accuracy of identifying the external contours of each connected region and further enhance the accuracy of cell detection, in some embodiments, the category label of each connected region is determined based on the contour features of each connected region in the cell fluorescence image, including: Based on the brightness of each of the connected regions, the fluorescence image is thresholded to obtain a binarized image; Extract the outer contours of each connected region from the binarized image; The contour features of the outer contours of each connected region are input into the trained contour classification model to obtain the category labels of each connected region.
[0045] In some embodiments, for a cell fluorescence image, the brightness of each connected region in the fluorescence image can be acquired to determine a segmentation threshold for the fluorescence image based on the brightness of each connected region. For example, the lowest brightness of each connected region can be determined as the segmentation threshold of the fluorescence image. Based on this segmentation threshold, threshold segmentation is performed on the fluorescence image, i.e., binarization processing is performed on the fluorescence image to obtain a binarized image, such as... Figure 7a and Figure 7b As shown.
[0046] Since thresholding the fluorescence image to obtain a binarized image makes the external contours of each connected region clearer, contour recognition can be performed on each connected region in the binarized image to more accurately obtain their external contours. Based on the extracted external contours of each connected region, the contour features of each connected region can be more accurately identified. These contour features can then be input into a trained contour classification model to obtain the category label for each connected region.
[0047] By thresholding the fluorescence image based on the brightness of each connected region, a binarized image is obtained. The outer contours of each connected region are then extracted from the binarized image. The contour features of the outer contours of each connected region are input into a contour classification model to obtain the category labels of each connected region. This allows for more accurate identification of the outer contours of each connected region through the binarized image, making the contour features input to the contour classification model more accurate and improving the reliability of the output category labels of each connected region. Consequently, the accuracy of cell detection based on the category labels of each connected region is improved.
[0048] After determining the category labels of each connected region, for each first connected region with the category label "cell clusters," a detection image can be generated. This detection image is then input into an image detection model to obtain the cell cluster detection results for each first connected region. Since the accuracy of the cell cluster detection results for each first connected region depends on the accuracy of the generated detection image, to obtain the detection image more accurately and improve the accuracy of the cell cluster detection results for each first connected region, in some embodiments, based on the category labels of each connected region, the first connected regions with the category label "cell clusters" are extracted from the fluorescence image to generate the detection image, including: Based on the category labels of each of the connected regions, each first connected region with the category label of cell clusters and each second connected region with the category label of a single cell are determined from each of the connected regions. Based on the outer contour of each of the second connected regions, determine each target image region in the fluorescence image that corresponds one-to-one with each of the second connected regions; The target image regions are masked to generate the image to be detected, which includes each of the first connected regions.
[0049] In some embodiments, after inputting the contour features of the outer contours of each connected region into a trained contour classification model for classification and obtaining the category labels of each connected region, the connected region with the category label of cell clusters can be used as the first connected region, and the connected region with the category label of a single cell can be used as the second connected region.
[0050] For each second connected region, the image region where each second connected region is located can be determined from the fluorescence image based on the outer contour of each second connected region, and used as the target image region corresponding to each second connected region.
[0051] Masking is performed on each target image region. For example, using a mask image with the same pixel values as the background values, the pixel values of each target image region are adjusted to the background values to perform masking on each target image region, generating a detection image including each first connected region. Figure 8As shown. After masking, the resulting image to be detected is one that retains only cell clusters, thus effectively eliminating the interference of individual cell images on cell cluster detection, thereby improving the accuracy of cell cluster detection results in each first connected region.
[0052] To improve the detection accuracy of cell clusters in each first connected region, in some embodiments, the image to be detected is input into a trained image detection model to obtain the cell cluster detection results for each first connected region, including: The image to be detected is segmented to obtain multiple sub-images; Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each first connected region.
[0053] In some embodiments, the acquired image to be detected can be proportionally divided according to a preset size to obtain multiple sub-images. For example, for an image to be detected with a size of 3072×2048 pixels, it can be regularly divided according to a preset size of 512×512 pixels, with a division step of 512 pixels, to obtain multiple sub-images. Figure 9 As shown.
[0054] For each sub-image, it can be input into the image detection model to obtain the cell cluster detection results of the first connected region in each sub-image. Since image detection models usually have limitations on the size of the input image, dividing the image to be detected into multiple sub-images and then inputting them into the image detection model for detection eliminates the need to scale the input image detection model. This avoids the loss of details caused by scaling the image in the input image detection model, thereby improving the detection accuracy of cell clusters in each first connected region obtained by the image detection model.
[0055] To reduce the risk of cell clusters being cropped out at the boundaries of sub-images during the segmentation process, thus preventing missed detections, some embodiments involve image segmentation of the image to be detected to obtain multiple sub-images, including: Based on a preset overlapping region, the image to be detected is segmented to obtain multiple sub-images with partially overlapping regions of adjacent sub-images.
[0056] In some embodiments, a preset overlap region between adjacent sub-images can be predefined. Taking a detection image with a size of 3072×2048 pixels as an example, the preset overlap region between adjacent sub-regions can be set to a width of 64 pixels, such as... Figure 10 As shown.
[0057] After obtaining the image to be detected, it can be regularly segmented into a 512×512 base window, with a segmentation step of 512 pixels. Then, each base window is extended by a preset overlap area of 64 pixels in all directions (top, bottom, left, and right). This allows partial overlap between adjacent sub-images, resulting in multiple sub-images with partially overlapping regions. Because of the partial overlap between adjacent sub-images, cell clusters located at the edges of a sub-image will inevitably exist in its adjacent sub-images, thus avoiding missed detections of these cell clusters.
[0058] To avoid the boundary of the first connected region overlapping with the preset overlapping region, which would cause cell clusters in the first connected region to be truncated in the sub-image, in some embodiments, before performing image segmentation on the image to be detected according to the preset overlapping region to obtain multiple sub-images with partially overlapping regions of adjacent sub-images, the method further includes: Determine that the boundary of the preset overlapping region overlaps with the first connected region, and adjust the boundary of the preset overlapping region until the first connected region is completely located inside the preset overlapping region, or the first connected region is completely located outside the preset overlapping region.
[0059] In some embodiments, an initial preset overlapping region can be preset, and then the boundary of the initial preset overlapping region is detected to see if it overlaps with the first connected region. For example, it is detected whether the outline of the first connected region intersects with the boundary of the initial preset overlapping region. If no outline of the first connected region intersects with the boundary of the initial preset overlapping region, it indicates that the boundary of the initial preset overlapping region does not overlap with the first connected region. In this case, image segmentation is performed on the image to be detected based on the initial preset overlapping region. If the outline of the first connected region intersects with the boundary of the initial preset overlapping region, it indicates that the boundary of the initial preset overlapping region overlaps with the first connected region. In this case, the width of the preset overlapping region is adjusted to adjust the boundary of the preset overlapping region until the first connected region is completely located inside the preset overlapping region, or the first connected region is completely located outside the preset overlapping region, that is, the adjusted boundary of the preset overlapping region does not overlap with the first connected region. Figure 11 As shown. Then, based on the adjusted preset overlapping area, the image to be detected is segmented. This avoids cell clusters in the first connected region being truncated in the sub-image, thereby improving the detection accuracy of cell clusters in the first connected region.
[0060] Considering that there are some overlapping areas between multiple sub-images, in order to avoid redundancy in the detection results, in some embodiments, each of the sub-images is input into the image detection model to obtain the cell cluster detection results of each first connected region, including: Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each of the sub-images; Based on the coordinate positions of each sub-image in the image to be detected, the cell cluster detection results of each sub-image are mapped to the image to be detected to obtain the initial detection results of each first connected region in the image to be detected; The initial detection results of each of the first connected regions are deduplicated to obtain the cell cluster detection results of each of the first connected regions.
[0061] In some embodiments, after inputting each sub-image into the image detection model to obtain the cell cluster detection results of each sub-image, the cell cluster detection results of each sub-image can be mapped to the image to be detected based on the coordinate positions of each first connected region in the sub-image and the coordinate positions of each first connected region in the image to be detected. For example, assuming a sub-image is located at the top left corner of the image to be detected, with coordinates (x0, y0), and the coordinates of a cell detection box of a cell cluster in the sub-image are (x1, y1, x2, y2), then the coordinates of the cell detection box mapped back to the coordinate system of the image to be detected are: (x1+x0, y1+y0, x2+x0, y2+y0). Through coordinate mapping, the cell cluster detection results in each sub-image, i.e., the cell detection boxes in each sub-image, can be uniformly transformed to the coordinate system of the image to be detected, forming a set of candidate detection boxes for the entire image. This set of candidate detection boxes for the entire image is the initial detection result of each first connected region in the image to be detected.
[0062] Because there are overlapping areas between adjacent sub-images, the same cell may be detected repeatedly within the overlapping areas.
[0063] Based on this, the initial detection results of each first connected region in the image to be detected can be deduplicated, so that only one initial detection result is retained for each first connected region, thereby obtaining the cell cluster detection results of each first connected region.
[0064] Considering that the same cell in the overlapping area can be divided into the following two cases during detection: Case 1: When the entire cell is located in the overlapping area of adjacent sub-images, different sub-images may output two complete cell detection boxes respectively.
[0065] Scenario 2: When only a portion of a cell is located within the overlapping region, different sub-images may output a complete cell detection box and a local cell detection box, such as... Figure 12 As shown.
[0066] Therefore, to make the cell cluster detection results of each first connected region more accurate, in some embodiments, the initial detection results of each first connected region are deduplicated to obtain the cell cluster detection results of each first connected region, including: Based on the initial detection results, determine the detection score of the initial detection results; Based on the detection scores of each of the initial detection results corresponding to the first connected region, the initial detection result with the highest detection score among the initial detection results is determined as the cell cluster detection result of the first connected region.
[0067] In some embodiments, for the initial detection results of each first connected region in the image to be detected, the detection score of the cell detection box in the initial detection result can be determined based on the cell detection box confidence score of the individual cell in the first connected region output by the image detection model. For example, the cell detection box confidence score output by the image detection model can be used as the detection score of the corresponding cell detection box. For overlapping cell detection boxes, non-maximum suppression (NMS) can be used to retain the cell detection box with the highest detection score and remove the other cell detection boxes, so as to remove duplicates from the initial detection results of each first connected region, thereby obtaining the cell cluster detection results of each first connected region.
[0068] Alternatively, in some embodiments, the detection score of the initial detection result can be obtained based on the confidence level of the cell detection box, the area of the cell detection box, and the area normalization coefficient of the cell detection box in the initial detection result.
[0069] For example, to ensure that complete detection boxes are retained preferentially during the deduplication process, a detection box score can be calculated for each detection box in the initial detection results: ; Where Confidence represents the confidence score of the cell detection box output by the model, and Area represents the area of the cell detection box. ref This represents the area normalization coefficient.
[0070] For overlapping cell detection boxes, non-maximum suppression (NMS) is used to retain the cell detection box with the highest detection score and remove the others. This process deduplicates the initial detection results for each first connected region, thus obtaining the cell cluster detection results for each first connected region. Figure 13 As shown.
[0071] Since the detection score for each cell detection box is derived from the confidence score, area, and area normalization coefficient of the cell detection box, when the same cell corresponds to both a complete cell detection box and a local cell detection box in an overlapping region, the complete cell detection box has a larger area and receives a higher detection score. When performing NMS, complete cell detection boxes can be preferentially preserved while local cell detection boxes are suppressed. This reduces local duplicate detection results caused by factor map boundary truncation, improving the completeness and accuracy of cell cluster detection results.
[0072] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below. In some embodiments, the cell detection method includes: S201, based on the brightness of each connected region in the cell fluorescence image, threshold segmentation is performed on the fluorescence image to obtain a binarized image.
[0073] S202, extract the outer contours of each connected region from the binarized image.
[0074] S203, input the contour features of the external contours of each connected region into the trained contour classification model to obtain the category labels of each connected region.
[0075] S204, based on the category labels of each connected region, determine each first connected region with the category label of cell cluster and each second connected region with the category label of single cell from each connected region.
[0076] S205, based on the outer contour of each second connected region, determine each target image region in the fluorescence image that corresponds one-to-one with each second connected region.
[0077] S206, perform masking on each target image region to generate an image to be detected that includes each first connected region.
[0078] S207, Based on the preset overlapping area, perform image segmentation on the image to be detected to obtain multiple sub-images with partially overlapping regions of adjacent sub-images.
[0079] If the boundary of the preset overlapping region overlaps with the first connected region, the boundary of the preset overlapping region is adjusted until the first connected region is completely located inside the preset overlapping region, or the first connected region is completely located outside the preset overlapping region.
[0080] S208, based on the preset overlapping area, perform image segmentation on the image to be detected to obtain multiple sub-images with partially overlapping regions of adjacent sub-images.
[0081] S209, input each sub-image into the image detection model to obtain the cell cluster detection results for each sub-image.
[0082] The image detection model is trained using image samples from multiple cell clusters.
[0083] S210, based on the coordinate positions of each sub-image in the image to be detected, map the cell cluster detection results of each sub-image to the image to be detected, and obtain the initial detection results of each first connected region in the image to be detected.
[0084] S211. Based on the confidence level of the cell detection box, the area of the cell detection box, and the area normalization coefficient of the cell detection box in the initial detection result, the detection score of the initial detection result is obtained.
[0085] S212, based on the detection scores of each initial detection result corresponding to the first connected region, the initial detection result with the largest detection score among all initial detection results is determined as the cell cluster detection result of the first connected region.
[0086] S213. Based on the cell cluster detection results of each first connected region and the outer contour of each second connected region with a category label of a single cell in each connected region, the cell detection results of the fluorescence image are obtained.
[0087] The cell detection device provided in this application is described below. The cell detection device described below can be referred to in correspondence with the cell detection method described above.
[0088] In one embodiment, such as Figure 14 As shown, a cell detection device is provided, comprising: The label acquisition module 310 is used to determine the category label of each connected region based on the contour features of each connected region in the fluorescence image of the cell; Image extraction module 320 is used to extract each first connected region with the category label of cell cluster from the fluorescence image according to the category label of each connected region, and generate an image to be detected; The cell detection module 330 is used to input the image to be detected into a trained image detection model to obtain the cell cluster detection results of each first connected region; The data acquisition module 340 is used to obtain the cell detection results of the fluorescence image based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell; The image detection model is trained using image samples from multiple cell clusters.
[0089] By analyzing the contour features of connected regions in the fluorescence image of cells, the category labels of each connected region are determined. Based on these category labels, cell clusters are extracted from the fluorescence image to generate images to be detected. These images are then input into an image detection model for cell cluster detection. After obtaining the detection results for each cell cluster, these results are merged with the contour features of individual cells to obtain the cell detection results for the fluorescence image. Thus, based on the contour features of individual cells obtained in the first stage, the detection results of individual cells are directly determined. Subsequent detection in the second stage only applies to the images generated from cell clusters. This ensures that the detection of the images to be detected only needs to adapt to the features of cell clusters, reducing mutual interference between the detection of cell clusters and individual cells, thereby reducing missegmentation of individual cells or cell clusters and improving the accuracy of cell detection.
[0090] In one embodiment, the tag acquisition module 310 is specifically used for: Based on the brightness of each of the connected regions, the fluorescence image is thresholded to obtain a binarized image; Extract the outer contours of each connected region from the binarized image; The contour features of the outer contours of each connected region are input into the trained contour classification model to obtain the category labels of each connected region.
[0091] In one embodiment, the image extraction module 320 is specifically used for: Based on the category labels of each of the connected regions, each first connected region with the category label of cell clusters and each second connected region with the category label of a single cell are determined from each of the connected regions. Based on the outer contour of each of the second connected regions, determine each target image region in the fluorescence image that corresponds one-to-one with each of the second connected regions; The target image regions are masked to generate the image to be detected, which includes each of the first connected regions.
[0092] In one embodiment, the cell detection module 330 is specifically used for: The image to be detected is segmented to obtain multiple sub-images; Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each first connected region.
[0093] In one embodiment, the cell detection module 330 is specifically used for: Based on a preset overlapping region, the image to be detected is segmented to obtain multiple sub-images with partially overlapping regions of adjacent sub-images.
[0094] In one embodiment, the cell detection module 330 is further configured to: Determine that the boundary of the preset overlapping region overlaps with the first connected region, and adjust the boundary of the preset overlapping region until the first connected region is completely located inside the preset overlapping region, or the first connected region is completely located outside the preset overlapping region.
[0095] In one embodiment, the cell detection module 330 is specifically used for: Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each of the sub-images; Based on the coordinate positions of each sub-image in the image to be detected, the cell cluster detection results of each sub-image are mapped to the image to be detected to obtain the initial detection results of each first connected region in the image to be detected; The initial detection results of each of the first connected regions are deduplicated to obtain the cell cluster detection results of each of the first connected regions.
[0096] In one embodiment, the cell detection module 330 is specifically used for: Based on the initial detection results, determine the detection score of the initial detection results; Based on the detection scores of each of the initial detection results corresponding to the first connected region, the initial detection result with the highest detection score among the initial detection results is determined as the cell cluster detection result of the first connected region.
[0097] In one embodiment, the cell detection module 330 is specifically used for: The detection score of the initial detection result is obtained based on the confidence level of the cell detection box, the area of the cell detection box, and the area normalization coefficient of the cell detection box in the initial detection result.
[0098] Figure 15 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 15 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call a computer program stored in the memory 830 to execute a cell detection method, such as including: Based on the contour features of each connected region in the fluorescence image of the cell, the category label of each connected region is determined; Based on the category labels of each connected region, extract each first connected region with the category label of cell cluster from the fluorescence image to generate an image to be detected; The image to be detected is input into the trained image detection model to obtain the cell cluster detection results of each first connected region; Based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell, the cell detection results of the fluorescence image are obtained; The image detection model is trained using image samples from multiple cell clusters.
[0099] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0100] On the other hand, this application also provides a storage medium, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the cell detection methods provided in the above embodiments.
[0101] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0103] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method of detecting cells, characterized by, include: Based on the contour features of each connected region in the fluorescence image of the cell, the category label of each connected region is determined; Based on the category labels of each connected region, extract each first connected region with the category label of cell cluster from the fluorescence image to generate an image to be detected; The image to be detected is input into the trained image detection model to obtain the cell cluster detection results of each first connected region; Based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell, the cell detection results of the fluorescence image are obtained; The image detection model is trained using image samples from multiple cell clusters.
2. The cell detection method of claim 1, wherein, The step of determining the category label of each connected region based on the contour features of each connected region in the fluorescence image of the cell includes: Based on the brightness of each of the connected regions, the fluorescence image is thresholded to obtain a binarized image; Extract the outer contours of each connected region from the binarized image; The contour features of the outer contours of each connected region are input into the trained contour classification model to obtain the category labels of each connected region.
3. The cell detection method of claim 1, wherein, The step of extracting each first connected region labeled as a cell cluster from the fluorescence image based on the category label of each connected region to generate a detection image includes: Based on the category labels of each of the connected regions, each first connected region with the category label of cell clusters and each second connected region with the category label of a single cell are determined from each of the connected regions. Based on the outer contour of each of the second connected regions, determine each target image region in the fluorescence image that corresponds one-to-one with each of the second connected regions; The target image regions are masked to generate the image to be detected, which includes each of the first connected regions.
4. The method of claim 1-3, wherein, The step of inputting the image to be detected into the trained image detection model to obtain the cell cluster detection results of each first connected region includes: The image to be detected is segmented to obtain multiple sub-images; Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each first connected region.
5. The method of claim 4, wherein the cell is a human cell. The step of segmenting the image to be detected to obtain multiple sub-images includes: Based on a preset overlapping region, the image to be detected is segmented to obtain multiple sub-images with partially overlapping regions of adjacent sub-images.
6. The cell detection method of claim 4, wherein, Before performing image segmentation on the image to be detected based on a preset overlapping region to obtain multiple sub-images with partially overlapping regions of adjacent sub-images, the process further includes: Determine that the boundary of the preset overlapping region overlaps with the first connected region, and adjust the boundary of the preset overlapping region until the first connected region is completely located inside the preset overlapping region, or the first connected region is completely located outside the preset overlapping region.
7. The cell detection method according to claim 5 or 6, characterized in that, The step of inputting each of the sub-images into the image detection model to obtain the cell cluster detection results for each first connected region includes: Each of the sub-images is input into the image detection model to obtain the cell cluster detection results for each of the sub-images; Based on the coordinate positions of each sub-image in the image to be detected, the cell cluster detection results of each sub-image are mapped to the image to be detected to obtain the initial detection results of each first connected region in the image to be detected; The initial detection results of each of the first connected regions are deduplicated to obtain the cell cluster detection results of each of the first connected regions.
8. The cell detection method of claim 7, wherein, The process of deduplicating the initial detection results of each of the first connected regions to obtain the cell cluster detection results of each of the first connected regions includes: Based on the initial detection results, determine the detection score of the initial detection results; Based on the detection scores of each of the initial detection results corresponding to the first connected region, the initial detection result with the highest detection score among the initial detection results is determined as the cell cluster detection result of the first connected region.
9. The cell detection method of claim 8, wherein, The step of determining the detection score of the initial detection result based on the initial detection result includes: The detection score of the initial detection result is obtained based on the confidence level of the cell detection box, the area of the cell detection box, and the area normalization coefficient of the cell detection box in the initial detection result.
10. A cell detection device, characterized by include: The label acquisition module is used to determine the category label of each connected region based on the contour features of each connected region in the fluorescence image of the cell; An image extraction module is used to extract each first connected region with the category label of cell clusters from the fluorescence image according to the category label of each connected region, and generate an image to be detected; The cell detection module is used to input the image to be detected into the trained image detection model to obtain the cell cluster detection results of each first connected region; The data acquisition module is used to obtain the cell detection results of the fluorescence image based on the cell cluster detection results of each first connected region and the outer contour of each second connected region in each connected region where the category label is a single cell; The image detection model is trained using image samples from multiple cell clusters.
11. An electronic device, comprising: It includes a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the cell detection method according to any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, said computer program, when executed by a processor, implementing the cell detection method according to any one of claims 1-9.