A cell counting method and system for high-resolution cell images
By segmenting and upsampling high-resolution cell images, combining cell detection models and grouping processing, the problem of processing high-resolution cell images in the prior art is solved, and fast and accurate cell counting is achieved, and GPU memory limitations are overcome.
Patent Information
- Application Number
- CN202210751312.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-06-29
AI Technical Summary
The prior art is difficult to effectively deal with a large number of small cell targets in high-resolution cell images, resulting in problems such as reduced cell counting accuracy and computer GPU memory limitations.
Sub-images with lower resolution are generated by segmenting high-resolution cellular images into multiple preset size segmented images and upsampling each segmented image. Then, these sub-images are input into the pre-trained cell detection model in batches, and the position coordinates of the cells' external rectangular frames in the original image were obtained, and the cells were grouped and deduplicated in an orderly manner to finally count the cell count results.
It realizes rapid and accurate counting of a large number of cells in high-resolution cell images, solves the problem of GPU memory limitations, and improves the efficiency and accuracy of cell detection.
Smart Images

Figure CN114943729B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a cell counting method and system for high-resolution cell images. Background Art
[0002] With the development of chip technology, ultra-high-resolution image acquisition chips have been used in the field of cell culture. Although the cells themselves are small in size, the resolution of a frame of cell images taken by ultra-high-resolution data acquisition chips may reach 600 million or 1 billion pixels, so that small cell targets can be represented by more pixels in high-resolution images, that is, they can be portrayed more clearly. This feature provides effective data support for small target detection tasks. The characteristics of such ultra-high-resolution cell images are: high image resolution, the size of cell targets is very small relative to the original high-resolution image, and the number of cells is very large. The total number of cells contained in a high-resolution cell image is as high as 500,000 or even millions of cells.
[0003] With the development of artificial intelligence technology, machine vision models based on deep learning have been widely used in the field of machine vision in recent years. On specific data sets, the accuracy of machine vision recognition based on deep neural network models has exceeded that of human eyes. However, the current application of deep learning in images is still limited to the input of small-sized images. For high-resolution images containing a large number of small cells, the current general solution is to compress them into smaller images first, and then input the smaller images into the target detector for target detection. However, for small cell targets in ultra-high-resolution images, if compression is used, the features of small cell targets will be lost, making them more difficult to detect. In addition, the number of targets detected by existing deep neural network models in a picture is generally from a few to a few hundred, and there is almost no detection of hundreds of thousands of small targets in a picture. Limited by the memory limitations of computer GPUs, it is impossible to directly use deep learning algorithms to detect hundreds of thousands of targets at the same time, which brings difficulties to the application of machine vision recognition in the field of cell recognition. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a cell counting method of high-resolution cell images, comprising:
[0005] Step S1, segmenting a cell image with a first resolution into a plurality of segmented images of preset sizes, and recording the offset coordinates of each segmented image on the cell image;
[0006] Step S2, upsampling each of the segmented images to obtain a sub-image with a second resolution, wherein the first resolution is greater than the second resolution;
[0007] Step S3, inputting each of the sub-images in batches into a pre-trained cell detection model to obtain the first position coordinates of the cells contained in each of the sub-images and the circumscribed rectangular frames of the cells in the corresponding sub-images, and obtaining the second position coordinates of each of the circumscribed rectangular frames in the cell images according to the first position coordinates and the corresponding offset coordinates;
[0008] Step S4, for each batch of the sub-images, the corresponding circumscribed rectangular frames are orderly grouped according to the second position coordinates, and the circumscribed rectangular frames in each group obtained by the orderly grouping are respectively divided into an intermediate area set and a critical area set according to the second position coordinates;
[0009] Step S5, performing deduplication processing on each of the intermediate region sets and each of the critical region sets, and counting the number of the circumscribed rectangular frames in all of the intermediate region sets and all of the critical region sets after the deduplication processing as a cell counting result in the cell image.
[0010] Preferably, in step S1, there is an overlapping area between at least two adjacent segmented images, and the width of the overlapping area is not less than the diameter of one of the cells.
[0011] Preferably, executing step S3 includes:
[0012] Step S31, dividing all the sub-images into several batches, and inputting the sub-images into the cell detection model in batches to obtain the first position coordinates of the cells contained in each sub-image and the circumscribed rectangular frame of the cells in the corresponding sub-image;
[0013] Step S32 , for each of the batches, the second position coordinates of each of the circumscribed rectangular frames in each of the sub-images in the batch in the cell image are obtained according to each of the first position coordinates and the corresponding offset coordinates.
[0014] Preferably, before executing step S32, the method further includes:
[0015] removing the circumscribed rectangular frame located at the edge position of each of the sub-images according to the first position coordinates, so as to optimize each of the batches;
[0016] Then in the step S32, for each optimized batch, the second position coordinates of each circumscribed rectangular frame in each corresponding sub-image in the batch in the cell image are obtained by processing.
[0017] Preferably, the circumscribed rectangular frame located at the edge of each sub-image is a cell corresponding to the cell being cut off by the edge of the sub-image, or being tangent to the edge of the sub-image.
[0018] Preferably, the second position coordinates at least include the diagonal point coordinates of two diagonal points of the corresponding circumscribed rectangular frame;
[0019] Then the step S4 comprises:
[0020] Step S41, for each batch, arranging the circumscribed rectangular frames in order according to the size of the ordinate value contained in the diagonal point coordinates to form a rectangular frame sequence, and dividing the rectangular frame sequence into a plurality of ordered groups;
[0021] Step S42, according to the second position coordinates, each of the circumscribed rectangular frames located in the boundary area between two adjacent groups is added to the boundary area set corresponding to each group, and the other circumscribed rectangular frames except the boundary area in each group are added to the middle area set corresponding to each group.
[0022] Preferably, in step S5, before performing deduplication processing, the following is further included:
[0023] Merging the circumscribed rectangular frames in the boundary area sets to form a total critical set;
[0024] Then in the step S5, deduplication processing is subsequently performed on each of the intermediate region sets and the total critical set, and the number of the circumscribed rectangular frames in all the intermediate region sets and the total critical set after deduplication processing is counted as the cell counting result in the cell image.
[0025] Preferably, in step S5, a non-maximum suppression algorithm is used to perform deduplication processing on each of the intermediate region sets and the total critical set.
[0026] The present invention also provides a cell counting system for high-resolution cell images, which uses the above-mentioned cell counting method. The cell counting system comprises:
[0027] An image segmentation module, used for segmenting a cell image with a first resolution into a plurality of segmented images of preset sizes, and recording the offset coordinates of each of the segmented images on the cell image;
[0028] an image enlargement module, connected to the image segmentation module, and configured to upsample each of the segmented images to obtain a sub-image with a second resolution, wherein the first resolution is greater than the second resolution;
[0029] An image recognition module, connected to the image segmentation module and the image magnification module, respectively, for inputting each of the sub-images in batches into a pre-trained cell detection model to obtain the first position coordinates of the cells contained in each of the sub-images and the circumscribed rectangular frame of the cells in the corresponding sub-image, and obtaining the second position coordinates of each circumscribed rectangular frame in the cell image according to each of the first position coordinates and the corresponding offset coordinates;
[0030] a cell grouping module, connected to the image recognition module, for sequentially grouping the corresponding circumscribed rectangular frames according to the second position coordinates for each batch of the sub-images, and dividing the circumscribed rectangular frames in each group obtained by the sequential grouping into an intermediate region set and a critical region set according to the second position coordinates;
[0031] A cell counting module is connected to the cell grouping module and is used to perform deduplication processing on each of the intermediate area sets and each of the critical area sets, and count the number of the circumscribed rectangular frames in all of the intermediate area sets and all of the critical area sets after deduplication processing as the cell counting result in the cell image.
[0032] Preferably, in the image segmentation module, there is an overlapping area between at least two adjacent segmented images, and the width of the overlapping area is not less than the diameter of one of the cells.
[0033] The above technical solution has the following advantages or beneficial effects: it can quickly and accurately calculate the number and position of cells in high-resolution cell images containing a large number of cells, solving the problem of strong dependence on the memory of the computer GPU when processing a large number of cells. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic flow chart of a cell counting method using high-resolution cell images in a preferred embodiment of the present invention;
[0035] Figure 2 is a schematic diagram of each segmented image and its overlapping area in a preferred embodiment of the present invention;
[0036] Figure 3 Schematic diagram of upsampling a segmented image to form a sub-image in a preferred embodiment of the present invention;
[0037] Figure 4 Schematic diagram of a sub-process of step S3 in a preferred embodiment of the present invention;
[0038] Figure 5 A schematic diagram of a convergence curve of a cell detection model training process in a preferred embodiment of the present invention;
[0039] Figure 6 is a schematic diagram of a circumscribed rectangular frame located at the edge of each sub-image in a preferred embodiment of the present invention;
[0040] Figure 7 Schematic diagram of a sub-process of step S4 in a preferred embodiment of the present invention;
[0041] Figure 8 It is a schematic diagram of the circumscribed rectangular frames of each group in the boundary area and the middle area in a preferred embodiment of the present invention;
[0042] Fig. 9 The figure is a schematic structural diagram of a cell counting system for high-resolution cell images in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0043] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The present invention is not limited to this embodiment, and other embodiments may also fall within the scope of the present invention as long as they conform to the gist of the present invention.
[0044] In a preferred embodiment of the present invention, based on the above problems existing in the prior art, a cell counting method of high-resolution cell images is provided. Figure 1 As shown, including:
[0045] Step S1, segmenting a cell image with a first resolution into a plurality of segmented images of preset sizes, and recording the offset coordinates of each segmented image on the cell image;
[0046] Step S2, upsampling each segmented image to obtain a sub-image with a second resolution, wherein the first resolution is greater than the second resolution;
[0047] Step S3, inputting each sub-image into a pre-trained cell detection model in batches to obtain the first position coordinates of the cells contained in each sub-image and the cell's circumscribed rectangular frame in the corresponding sub-image, and obtaining the second position coordinates of each circumscribed rectangular frame in the cell image according to each first position coordinate and the corresponding offset coordinate;
[0048] Step S4, for each batch of sub-images, the corresponding circumscribed rectangular frames are orderly grouped according to the second position coordinates, and the circumscribed rectangular frames in each group obtained by the orderly grouping are respectively divided into an intermediate area set and a critical area set according to the second position coordinates;
[0049] Step S5, performing deduplication processing on each intermediate region set and each critical region set, and counting the number of circumscribed rectangular frames in all intermediate region sets and all critical region sets after deduplication processing as a cell counting result in the cell image.
[0050] Specifically, in this embodiment, in step S1, when performing image segmentation, it is necessary to ensure that there are overlapping segments between the segmented images, such as Figure 2 As shown in FIG. 1 , taking the example of segmenting a cell image into 9 segmented images, it is necessary to ensure that at least two adjacent segmented images have an overlapping area, and the width of the overlapping area is not less than the diameter of a cell. Figure 2 Take each row of segmented images in as an example, at least ensure that the segmented image 1 ( Figure 2 The area contained by the four arrows corresponding to number 1 in the figure, and so on) and segmented image 2, there is an overlapping area 10 between segmented image 2 and segmented image 3 ( Figure 2 The area demarcated by the dotted lines between two adjacent segmented images) or Figure 2 In each column of segmented images, there is an overlapping area 10 between segmented image 1 and segmented image 4, and between segmented image 4 and segmented image 7, or adjacent segmented images overlap, such as Figure 2 In the figure, segmented image 5 has overlapping areas with segmented image 2, segmented image 4, segmented image 8, and segmented image 6.
[0051] Take the cell image as a high-resolution image with a width of w and a height of h as an example. If the total length of all overlapping regions of each segmented image is l, and the length and width of the segmented image are both s, the total number of segmented images obtained by segmentation in step S1 is w / (sl)*h / (sl). Take the cell image with a width of 11000 and a height of 16060, the width and height of the segmented image are both 320, and the width of a single overlapping region is 100 as an example. The total number of segmented images obtained by segmentation is 50*73=3650.
[0052] To improve the accuracy of cell detection, in this embodiment, after the cell image is segmented, each segmented image needs to be upsampled, wherein the size of the upsampled sub-image is larger than the segmented image. Preferably, the segmented image is 320*320 and the sub-image is 640*640, but this is not limited to this. When the segmented image is enlarged, the size of the cells in the image will also be enlarged in the same proportion, such as Figure 3As shown, it can be seen that the segmented image is 608*608, and the corresponding upsampled sub-image is 640*640. It can be seen that the cell size in the image is enlarged in the same proportion, which can effectively improve the accuracy of cell detection. However, since the increase in image size may reduce the detection speed, when selecting the upsampling ratio of the segmented image, it is necessary to consider the balance between detection accuracy and detection speed and select a reasonable upsampling ratio.
[0053] After upsampling to obtain each sub-image, each sub-image is then subjected to batch image processing. In a preferred embodiment of the present invention, Figure 4 As shown, executing step S3 includes:
[0054] Step S31, dividing all sub-images into several batches, and inputting each sub-image into a cell detection model in batches to obtain the first position coordinates of the cells contained in each sub-image and the circumscribed rectangular frame of the cells in the corresponding sub-image;
[0055] Step S32: for each batch, the second position coordinates of each circumscribed rectangular frame in each sub-image in the batch in the cell image are obtained according to each first position coordinate and each corresponding offset coordinate.
[0056] Specifically, in this embodiment, in the above step S31, the computing power of the computer system equipped with and running the present technical solution is used to determine how to divide the batches. Taking the computer system equipped with and running the present technical solution as NVIDIA2060 GPU as an example, it has only 6G of video memory space. After testing, it can process up to 146 images at a time. It is preferred that a threshold value can be pre-configured in the computer system. The threshold value can be 146. Then, when the total number of segmented images is 3650, the total number of corresponding sub-images is also 3650. All sub-images can be automatically divided into 25 batches, each batch containing 146 sub-images, and then image recognition processing is performed on each sub-image in batches.
[0057] When segmenting a cell image, for the convenience of calculation, it is preferred to construct a pixel coordinate system with the upper left corner of the cell image as the origin, and use the coordinate values of the upper left corner and lower right corner of each segmented image relative to the upper left corner of the cell image as the offset coordinates (Ox, Oy) of each segmented image on the cell image. When performing cell detection on each sub-image in batches, it is preferred to construct a pixel coordinate system with the upper left corner of each sub-image as the origin, and use the coordinate values of the upper left corner and lower right corner of the circumscribed rectangular box corresponding to each cell relative to the upper left corner of the sub-image as the first position coordinates (x1, y1) of each circumscribed rectangular box in the corresponding sub-image. Then, the second position coordinates (x, y) of each circumscribed rectangular box in the cell image are calculated using the following formula:
[0058] x=x1 / a+Ox,y=y1 / a+Oy.
[0059] Wherein, a is the upsampling ratio corresponding to the upsampling of the segmented image to generate a sub-image. It is understandable that the above pixel coordinate system construction method and the reference point selected for the offset coordinates are only used as an embodiment to facilitate calculation and are not limited thereto.
[0060] Preferably, the above-mentioned cell detection model adopts a fast and lightweight neural network, which is lightweight and improves the detection speed. The cell detection model can adopt detectors including but not limited to Yolo series and RCNN series.
[0061] The training process of the above cell detection model includes:
[0062] The high-resolution cell images are segmented into small-size images of fixed size. In the training process, it is not necessary to perform overlapping segmentation on the original images. In this embodiment, the total number of segmented images obtained by segmentation is 12,000.
[0063] The small-size image is enlarged to a fixed-resolution image according to a certain size. Taking the segmented small-size image of 320*320 as an example, after the upsampling method, the obtained fixed-resolution image is 640*640. After actual testing, it is found that the detection effect of small cell targets is better after enlargement. Therefore, in this embodiment, upsampling is performed after image segmentation to improve the detection effect.
[0064] For fixed-resolution images, data annotation can be performed by manually annotating hundreds of images, training a preliminary model, and then using the preliminary model to predict the remaining unlabeled images, automatically generating annotated samples, and then manually adjusting the annotation boxes for the automatically generated samples. The annotated data set is divided into training sets, validation sets, and test sets.
[0065] The cell detection model is trained with the enlarged fixed-resolution image. During the training process, the image can be randomly rotated by some angles, horizontally shifted by a certain distance, vertically shifted by a certain distance, randomly scaled by a certain range, randomly flipped horizontally, randomly flipped vertically, randomly added with noise, blurred, and color changed to enhance the image. It is worth noting that general data enhancement methods include enlargement, reduction, and random crop operations, but these are not included in the implementation process of the present invention, mainly because the cell size in the cell sample is relatively fixed.
[0066] The loss function used in the training process mainly draws on the idea of Yolo. Yolo itself predicts the coordinates of the center point of the target box and the width and height of the rectangular box. The cell detection model in this embodiment mainly directly predicts the coordinates of the upper left corner and the lower right corner of the circumscribed rectangular box. The specific loss function may include the loss of the coordinate box, the category loss, and the confidence loss. The coordinate box position loss and the confidence loss use the mean square error loss (MSE loss), while the category loss uses the cross entropy loss (Cross Entropy loss). After 400 rounds of training on the training set, the model converged rapidly, and the convergence curve is shown in the figure. Figure 5 shown.
[0067] In a preferred embodiment of the present invention, before executing step S32, the method further includes:
[0068] According to each first position coordinate, a bounding rectangular frame located at an edge position of each sub-image is removed to optimize each batch;
[0069] Then in step S32, for each optimized batch, the second position coordinates of each circumscribed rectangular frame in each corresponding sub-image in the batch in the cell image are obtained by processing.
[0070] In a preferred embodiment of the present invention, Figure 6 As shown, the circumscribed rectangular frame located at the edge of each sub-image is a cell corresponding to the cell cut off by the edge of the sub-image, or tangent to the edge of the sub-image.
[0071] Specifically, in this embodiment, the circumscribed rectangular frame at the edge position is removed to avoid the influence of incomplete cells on the deduplication effect during the subsequent deduplication process.
[0072] In a preferred embodiment of the present invention, the second position coordinates at least include the coordinates of two diagonal points of the corresponding circumscribed rectangular frame;
[0073] like Figure 7 As shown, step S4 includes:
[0074] Step S41, for each batch, arranging the circumscribed rectangular frames in order according to the size of the ordinate values contained in the diagonal point coordinates to form a rectangular frame sequence, and dividing the rectangular frame sequence into a plurality of ordered groups;
[0075] Step S42, adding each circumscribed rectangular frame located in the boundary area between two adjacent groups to the boundary area set corresponding to each group according to the second position coordinates, and adding other circumscribed rectangular frames except the boundary area in each group to the middle area set corresponding to each group.
[0076] Specifically, in this embodiment, in step S41, it is preferred to arrange the rectangular frame sequence in an ascending order according to the ordinate values. Here, the number of groups to be divided into for the rectangular frame sequence is also determined in consideration of the computing power of the computer system on which the rectangular frame sequence is mounted, so as to prevent the GPU from running out of memory and being unable to process the external rectangular frames of target cells with too many cells. The specific grouping results can be as follows: Figure 8 As shown in the figure, the results are divided into three groups, namely R1, R2 and R3. It can be understood that the results are divided into three groups only for illustration. In practice, the number of groups depends on the number of bounding rectangles detected and the GPU memory size used. For example, if the number of bounding rectangles in each group is at most 50,000, and the total number of bounding rectangles detected is 1.8 million, then 36 groups are required. Figure 8 As shown, the two The area is the boundary area, and the A area in each group is the area other than the boundary area. It can be seen that the front group and the last group in the rectangular frame sequence have one Region, the remaining groups have two area.
[0077] In a preferred embodiment of the present invention, in step S5, before performing the deduplication process, the following steps are further included:
[0078] Merge each circumscribed rectangular frame in each boundary region set to form a total critical set;
[0079] Then in step S5, deduplication processing is subsequently performed on each intermediate region set and the total critical set, and the number of circumscribed rectangular frames in all intermediate region sets and the total critical set after deduplication processing is counted as the cell counting result in the cell image.
[0080] Specifically, in this embodiment, considering that the area range of the boundary area in each group is small and the number of cells contained therein is relatively small, in order to improve the processing speed, all boundary area sets are merged into a total critical set, and then a deduplication process is performed once.
[0081] In a preferred embodiment of the present invention, in step S5, a non-maximum suppression algorithm is used to perform deduplication processing on each intermediate region set and the total critical set.
[0082] Specifically, in this embodiment, since each segmented image obtained contains overlapping areas when the cell image is initially segmented, the cells located in the overlapping area will be identified at least twice. Through deduplication processing, repeated counting of cells in the overlapping area can be avoided, thereby improving the accuracy of cell counting. This technical solution is used to count cells in a high-resolution 10600*15000 cell image, and the 353974 cells contained therein are accurately detected.
[0083] The present invention also provides a cell counting system with high resolution cell images, which uses the above cell counting method, such as Fig. 9 As shown, the cell counting system includes:
[0084] An image segmentation module 100, for segmenting a cell image with a first resolution into a plurality of segmented images of a preset size, and recording the offset coordinates of each segmented image on the cell image;
[0085] The image enlargement module 200 is connected to the image segmentation module 100 and is used to upsample each segmented image to obtain a sub-image with a second resolution, where the first resolution is greater than the second resolution;
[0086] The image recognition module 300 is connected to the image segmentation module 100 and the image magnification module 200, respectively, and is used to input each sub-image in batches into a pre-trained cell detection model to obtain the first position coordinates of the cells contained in each sub-image and the cell's circumscribed rectangular frame in the corresponding sub-image, and obtain the second position coordinates of each circumscribed rectangular frame in the cell image according to each first position coordinate and the corresponding offset coordinate.
[0087] The cell grouping module 400 is connected to the image recognition module 300 and is used to group the corresponding circumscribed rectangular frames in order according to the second position coordinates for each batch of sub-images, and divide the circumscribed rectangular frames in each group obtained by the orderly grouping into an intermediate area set and a critical area set according to the second position coordinates;
[0088] The cell counting module 500 is connected to the cell grouping module 400 and is used to perform deduplication processing on each intermediate region set and each critical region set, and count the number of circumscribed rectangular frames in all intermediate region sets and all critical region sets after deduplication processing as the cell counting result in the cell image.
[0089] In a preferred embodiment of the present invention, in the image segmentation module 100, at least two adjacent segmented images have an overlapping region, and the width of the overlapping region is not less than the diameter of a cell.
[0090] The above description is only a preferred embodiment of the present invention, and does not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the contents of this specification and illustrations should be included in the protection scope of the present invention.
Claims
1. A cell counting method using high-resolution cell images, characterized in that: include: Step S1, segmenting a cell image with a first resolution into a plurality of segmented images of preset sizes, and recording the offset coordinates of each segmented image on the cell image; Step S2, upsampling each of the segmented images to obtain a sub-image with a second resolution, wherein the first resolution is greater than the second resolution; Step S3, inputting each of the sub-images in batches into a pre-trained cell detection model to obtain the first position coordinates of the cells contained in each of the sub-images and the circumscribed rectangular frames of the cells in the corresponding sub-images, and obtaining the second position coordinates of each of the circumscribed rectangular frames in the cell images according to the first position coordinates and the corresponding offset coordinates; Step S4, for each batch of the sub-images, the corresponding circumscribed rectangular frames are orderly grouped according to the second position coordinates, and the circumscribed rectangular frames in each group obtained by the orderly grouping are respectively divided into an intermediate area set and a critical area set according to the second position coordinates; Step S5, performing deduplication processing on each of the intermediate region sets and each of the critical region sets, and counting the number of the circumscribed rectangular frames in all of the intermediate region sets and all of the critical region sets after the deduplication processing as a cell counting result in the cell image.
2. The cell counting method according to claim 1, characterized in that: In the step S1, at least two adjacent segmented images have an overlapping area, and the width of the overlapping area is not less than the diameter of one of the cells.
3. The cell counting method according to claim 1, characterized in that: Executing the step S3 includes: Step S31, dividing all the sub-images into several batches, and inputting the sub-images into the cell detection model in batches to obtain the first position coordinates of the cells contained in each sub-image and the circumscribed rectangular frame of the cells in the corresponding sub-image; Step S32 , for each of the batches, the second position coordinates of each of the circumscribed rectangular frames in each of the sub-images in the batch in the cell image are obtained according to each of the first position coordinates and the corresponding offset coordinates.
4. The cell counting method according to claim 3, characterized in that: Before executing step S32, the method further includes: removing the circumscribed rectangular frame located at the edge position of each of the sub-images according to the first position coordinates, so as to optimize each of the batches; Then in the step S32, for each optimized batch, the second position coordinates of each circumscribed rectangular frame in each corresponding sub-image in the batch in the cell image are obtained by processing.
5. The cell counting method according to claim 4, characterized in that: The circumscribed rectangular frame located at the edge of each sub-image is a cell corresponding to the cell being cut off by the edge of the sub-image or being tangent to the edge of the sub-image.
6. The cell counting method according to claim 1, characterized in that: The second position coordinates at least include the diagonal point coordinates of the two diagonal points of the corresponding circumscribed rectangular frame; Then the step S4 comprises: Step S41, for each batch, arranging the circumscribed rectangular frames in order according to the size of the ordinate value contained in the diagonal point coordinates to form a rectangular frame sequence, and dividing the rectangular frame sequence into a plurality of ordered groups; Step S42, according to the second position coordinates, each of the circumscribed rectangular frames located in the boundary area between two adjacent groups is added to the boundary area set corresponding to each group, and the other circumscribed rectangular frames except the boundary area in each group are added to the middle area set corresponding to each group.
7. The cell counting method according to claim 6, characterized in that: In the step S5, before performing the deduplication process, the following steps are also included: Merging the circumscribed rectangular frames in the boundary area sets to form a total critical set; Then in the step S5, deduplication processing is subsequently performed on each of the intermediate region sets and the total critical set, and the number of the circumscribed rectangular frames in all the intermediate region sets and the total critical set after deduplication processing is counted as the cell counting result in the cell image.
8. The cell counting method according to claim 7, characterized in that: In the step S5, a non-maximum suppression algorithm is used to perform deduplication processing on each of the intermediate region sets and the total critical set.
9. A cell counting system for high-resolution cell images, characterized in that: The cell counting method according to any one of claims 1 to 8 is applied, wherein the cell counting system comprises: An image segmentation module, used for segmenting a cell image with a first resolution into a plurality of segmented images of preset sizes, and recording the offset coordinates of each of the segmented images on the cell image; an image enlargement module, connected to the image segmentation module, and configured to upsample each of the segmented images to obtain a sub-image with a second resolution, wherein the first resolution is greater than the second resolution; An image recognition module, connected to the image segmentation module and the image magnification module, respectively, for inputting each of the sub-images in batches into a pre-trained cell detection model to obtain the first position coordinates of the cells contained in each of the sub-images and the circumscribed rectangular frame of the cells in the corresponding sub-image, and obtaining the second position coordinates of each circumscribed rectangular frame in the cell image according to each of the first position coordinates and the corresponding offset coordinates; a cell grouping module, connected to the image recognition module, for sequentially grouping the corresponding circumscribed rectangular frames according to the second position coordinates for each batch of the sub-images, and dividing the circumscribed rectangular frames in each group obtained by the sequential grouping into an intermediate region set and a critical region set according to the second position coordinates; A cell counting module is connected to the cell grouping module and is used to perform deduplication processing on each of the intermediate area sets and each of the critical area sets, and count the number of the circumscribed rectangular frames in all of the intermediate area sets and all of the critical area sets after deduplication processing as the cell counting result in the cell image.
10. The cell counting system according to claim 9, characterized in that: In the image segmentation module, at least two adjacent segmented images have an overlapping area, and the width of the overlapping area is not less than the diameter of one of the cells.
Citation Information
Patent Citations
Cell counting method by using automatic software identification
CN108171683A
Glomerular cell image recognition method based on deep neural network
CN111951221A