A cell counting method, device, computer equipment and readable storage medium
By using the trained color separation model and microscope or external shooting equipment in digital pathology image analysis, the accuracy and efficiency problems of cell segmentation and detection are solved, efficient cell counting and classification are achieved, the cost is reduced, and the Application scenarios.
Patent Information
- Application Number
- CN202011427461.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-07
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-12-07
AI Technical Summary
In digital pathology image analysis, cell segmentation and detection are difficult to achieve stably and accurately, and are affected by problems such as noise, contamination, blur, and poor contrast between the foreground and background. In addition, the high cost and low efficiency of digital scanners limit the application and promotion of analysis methods.
Capture cell staining images through a tri-optical microscope or external shooting equipment, use the trained color separation model for analysis, obtain binary images, determine peak points and connectivity, perform segmentation processing to count the number of cells, and improve image analysis efficiency .
Without the need to scan the entire digital slice, the analysis cost is reduced, the efficiency is improved, the application scenarios are expanded, and accurate cell counting and classification of digital pathology images are achieved.
Smart Images

Figure CN112489027B
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical imaging technology, and in particular to a cell counting method, device, computer equipment and readable storage medium. Background Art
[0002] In digital pathology image analysis, cell segmentation and detection play a vital role in obtaining pathology image information and are usually the basis for automatic image analysis.
[0003] At present, the analysis process of digital pathology images is mostly carried out by analyzing digital pathology scan slice images. However, due to the complexity of digital pathology images of pathology digital scan slices, such as noise, pollution, blur, poor contrast between foreground and background, and due to differences in cell morphology and cell overlap, it is difficult to perform stable and accurate cell segmentation and detection.
[0004] Since the analysis of digital pathology images usually needs to be performed on digital scanned slices, and the market price of digital scanners is relatively high, and it takes a long time to scan a digital slice, about 2 to 5 minutes, and the size of the scanned digital slice image file is about 1G, the cost of using digital scanned slices for intelligent image interpretation is high and the efficiency is low. At the same time, the analysis of corresponding digital pathology images can only be performed in medical and scientific research institutions equipped with digital scanners. The huge storage capacity of digital slices limits the application and promotion of automatic image analysis methods. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a cell counting method, device, computer equipment and readable storage medium, which improves the efficiency of image analysis and interpretation by analyzing and processing cell staining images taken with a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment without performing full-slice scanning of digital slices.
[0006] The present application embodiment provides a cell counting method, which comprises:
[0007] Inputting a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and acquiring multiple binary images of the cell staining image for different cell categories; wherein the binary image includes multiple first connectivity quantities;
[0008] Determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities;
[0009] Selecting a second connectivity including a plurality of the peak points, and performing segmentation processing on the second connectivity to determine the number of cells included in the second connectivity;
[0010] Based on the number of cells included in the second connectivity and the cell category corresponding to the binary image, the total number of cells corresponding to the cell category is determined.
[0011] In an optional implementation, the color separation model is trained by the following method:
[0012] Acquire a first cell staining image sample, and input the cell staining image sample into a color space model to obtain a second cell staining image sample in a target color space;
[0013] Unsupervised machine learning is performed on the second cell staining image sample to obtain multiple color feature clusters based on preset cluster center features. When the similarity of each sample feature in each color feature cluster meets a preset similarity threshold, the training is completed to obtain a trained color separation model.
[0014] In an optional embodiment, the first cell staining image captured by a professional microscope camera on a trinocular optical microscope or by a microscope eyepiece or other external shooting device is input into a trained color separation model, and multiple binary images of the cell staining image are obtained for different cell categories, including:
[0015] Acquire a first cell staining image, and input the first cell staining image into a color space model to obtain a second cell staining image in a target color space;
[0016] Inputting the second cell staining image into a trained color separation model to separate the cell category corresponding to each pixel position in the second cell staining image;
[0017] Based on the cell category corresponding to each pixel position in the second cell staining image, a plurality of binary images corresponding to different cell categories are generated.
[0018] In an optional implementation, determining the multiple peak points included in the distance image corresponding to the binary image and the number of peak points included in each first connectivity comprises:
[0019] Performing distance transformation on the binary image to obtain a distance image corresponding to the binary image, and determining a plurality of peak points included in the distance image and a pixel position corresponding to each peak point;
[0020] Based on the pixel position corresponding to each peak point and the pixel position corresponding to each first connectivity amount, the number of peak points included in each first connectivity amount is determined.
[0021] In an optional embodiment, the segmenting of the second connectivity to determine the number of cells included in the second connectivity includes:
[0022] According to a preset shrinkage distance threshold, shrinking the third connectivity that is greater than the shrinkage distance threshold, to obtain a plurality of fourth connectivity;
[0023] Performing distance transformation on the fourth connectivity to determine the number of peak points included in each fourth connectivity;
[0024] A fifth connectivity including multiple peak points is selected, and the fifth connectivity is contracted until multiple sixth connectivity including one peak point are obtained, and the number of the sixth connectivity is determined to be the number of cells included in the second connectivity.
[0025] In an optional implementation, the shrinkage distance threshold is determined by the following method:
[0026] Based on the distance image corresponding to the binary image, determining the distance value corresponding to each third connectivity quantity, and constructing a distance list including a plurality of distance values;
[0027] From the distance list, a minimum value that is not less than a preset distance threshold is selected as the shrinkage distance threshold.
[0028] In an optional implementation, the method further includes:
[0029] Based on the total number of cells corresponding to different cell categories, the proportion of different cell categories is determined.
[0030] The present application also provides a cell counting device, which comprises:
[0031] An input module is used to input a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and obtain a plurality of binary images of different cell categories corresponding to the cell staining image for different cell categories; wherein the binary image includes a plurality of first connectivity quantities;
[0032] A first determination module is used to determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities;
[0033] a segmentation module, configured to select a second connectivity including a plurality of the peak points, and perform segmentation processing on the second connectivity to determine the number of cells included in the second connectivity;
[0034] The second determination module is used to determine the total number of cells corresponding to the cell category based on the number of cells included in the second connectivity and the cell category corresponding to the binary image.
[0035] In an optional embodiment, the cell counting device further comprises: a training module;
[0036] The training module is specifically used to train the color separation model by the following method:
[0037] Acquire a first cell staining image sample, and input the cell staining image sample into a color space model to obtain a second cell staining image sample in a target color space;
[0038] Unsupervised machine learning is performed on the second cell staining image sample to obtain multiple color feature clusters based on preset cluster center features. When the similarity of each sample feature in each color feature cluster meets a preset similarity threshold, the training is completed to obtain a trained color separation model.
[0039] In an optional implementation manner, the input module is specifically used for:
[0040] Acquire a first cell staining image, and input the first cell staining image into a color space model to obtain a second cell staining image in a target color space;
[0041] Inputting the second cell staining image into a trained color separation model to separate the cell category corresponding to each pixel position in the second cell staining image;
[0042] Based on the cell category corresponding to each pixel position in the second cell staining image, a plurality of binary images corresponding to different cell categories are generated.
[0043] In an optional implementation manner, the first determining module is specifically configured to:
[0044] Performing distance transformation on the binary image to obtain a distance image corresponding to the binary image, and determining a plurality of peak points included in the distance image and a pixel position corresponding to each peak point;
[0045] Based on the pixel position corresponding to each peak point and the pixel position corresponding to each first connectivity amount, the number of peak points included in each first connectivity amount is determined.
[0046] In an optional implementation manner, the segmentation module is specifically used to:
[0047] According to a preset shrinkage distance threshold, shrinking the third connectivity that is greater than the shrinkage distance threshold, to obtain a plurality of fourth connectivity;
[0048] Performing distance transformation on the fourth connectivity to determine the number of peak points included in each fourth connectivity;
[0049] A fifth connectivity including multiple peak points is selected, and the fifth connectivity is contracted until multiple sixth connectivity including one peak point are obtained, and the number of the sixth connectivity is determined to be the number of cells included in the second connectivity.
[0050] In an optional embodiment, the cell counting device further comprises: a third determination module;
[0051] The third determination module is specifically used to: determine the shrinkage distance threshold by the following method: based on the distance image corresponding to the binary image, determine the distance value corresponding to each third connectivity amount, and construct a distance list including multiple distance values;
[0052] From the distance list, a minimum value that is not less than a preset distance threshold is selected as the shrinkage distance threshold.
[0053] In an optional embodiment, the cell counting device further comprises: a fourth determination module;
[0054] The fourth determination module is specifically used to determine the proportion of different cell categories based on the total number of cells corresponding to different cell categories.
[0055] An embodiment of the present application also provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the machine-readable instructions perform the steps in any one of the above possible implementation modes.
[0056] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the steps in any possible implementation manner described above are executed.
[0057] The present application provides a cell counting method, device, computer equipment and readable storage medium, including: inputting a first cell staining image into a trained color separation model to obtain multiple binary images of different cell categories corresponding to the first cell staining image; wherein the binary image includes multiple first connectivity quantities; determining multiple peak points included in the distance image corresponding to the binary image, and the number of peak points included in each first connectivity quantity; selecting a second connectivity quantity including multiple peak points, and segmenting the second connectivity quantity to determine the number of cells included in the second connectivity quantity; based on the number of cells included in the second connectivity quantity and the cell category corresponding to the binary image, determining the total number of cells corresponding to the cell category. By analyzing and processing the cell staining image, determining the number corresponding to each cell category in the image, and analyzing the cell staining image based on the cells of each cell category, the efficiency of image analysis and interpretation can be improved.
[0058] In order to make the above-mentioned objects, features and advantages of the present application more obvious and understandable, preferred embodiments are specifically listed below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 A flow chart of a cell counting method provided in an embodiment of the present application is shown;
[0061] Figure 2a The cell staining images provided in the examples of the present application are shown;
[0062] Figure 2b-1 A diagram showing the prediction results of the color separation model provided in an embodiment of the present application is shown;
[0063] Figure 2b-2 A binary image of negative cells in a cell staining image provided in an embodiment of the present application is shown;
[0064] Figure 2b-3 A binary image of positive cells in a cell staining image provided in an embodiment of the present application is shown;
[0065] Figure 2c The cell counting results provided in the examples of the present application are shown;
[0066] Figure 3A schematic diagram of the structure of a cell counting device provided in an embodiment of the present application is shown;
[0067] Figure 4 A schematic diagram of the structure of another cell counting device provided in an embodiment of the present application is shown;
[0068] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0069] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0070] Research has found that, at present, the analysis process of digital pathology images is mostly carried out by analyzing digital pathology scan slice images. However, due to the complexity of digital pathology images of pathology digital scan slices, such as noise, pollution, blur, poor contrast between foreground and background, etc., and due to differences in cell morphology and cell overlap, it is difficult to perform stable and accurate cell segmentation and detection.
[0071] Based on the above research, the embodiment of the present application provides a cell counting method, device, computer equipment and readable storage medium, including: inputting a first cell staining image into a trained color separation model to obtain multiple binary images of different cell categories corresponding to the first cell staining image; wherein the binary image includes multiple first connectivity quantities; determining multiple peak points included in the distance image corresponding to the binary image, and the number of peak points included in each first connectivity quantity; selecting a second connectivity quantity including multiple peak points, and segmenting the second connectivity quantity to determine the number of cells included in the second connectivity quantity; based on the number of cells included in the second connectivity quantity and the cell category corresponding to the binary image, determining the total number of cells corresponding to the cell category. By analyzing and processing the cell staining image, determining the number corresponding to each cell category in the image, and analyzing the cell staining image based on the cells of each cell category, the efficiency of image analysis and interpretation can be improved.
[0072] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by this application for the above problems below should be the contributions made by the inventor to this application during the application process.
[0073] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0074] To facilitate understanding of this embodiment, a cell counting method disclosed in the embodiment of the present application is first introduced in detail. The execution subject of the cell counting method provided in the embodiment of the present application is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the cell counting method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0075] The cell counting method provided in the embodiment of the present application is described below by taking the execution subject as a terminal device as an example.
[0076] See also Figure 1 FIG. 1 is a flow chart of a cell counting method provided in an embodiment of the present application, wherein the cell counting method comprises steps S101 to S104, wherein:
[0077] S101: inputting a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and acquiring a plurality of binary images of different cell categories corresponding to the cell staining image for different cell categories; wherein the binary image includes a plurality of first connectivity quantities;
[0078] S102: Determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities;
[0079] S103: selecting a second connectivity including a plurality of the peak points, and performing segmentation processing on the second connectivity to determine the number of cells included in the second connectivity;
[0080] S104: Based on the number of cells included in the second connectivity and the cell category corresponding to the binary image, determine the total number of cells corresponding to the cell category.
[0081] The embodiment of the present application inputs a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and obtains multiple binary images of different cell categories corresponding to the first cell staining image for different cell categories; wherein the binary image includes multiple first connectivity quantities; multiple peak points included in the distance image corresponding to the binary image and the number of peak points included in each first connectivity quantity are determined; a second connectivity quantity including multiple peak points is selected, and the second connectivity quantity is segmented to determine the number of cells included in the second connectivity quantity; based on the number of cells included in the second connectivity quantity and the cell category corresponding to the binary image, the total number of cells corresponding to the cell category is determined. By analyzing and processing the cell staining image, determining the number corresponding to each cell category in the image, and analyzing the cell staining image based on the cells of each cell category, the efficiency of image analysis and interpretation can be improved.
[0082] The above S101 to S104 are described in detail below.
[0083] 1. In the above S101, the first cell staining image may be an image captured by using a microscope camera on a professional trinocular optical microscope, or an image captured by using a camera device such as a mobile phone through an eyepiece.
[0084] At present, the analysis of digital pathology images usually needs to be performed on digital scanned slices. The market price of digital scanners is between RMB 300,000 and RMB 1 million. It takes 2 to 5 minutes to scan a digital slice, and the size of the scanned digital slice image file is about 1G. Therefore, the cost of using digital scanned slices for intelligent image interpretation is high and the efficiency is low. In addition, the analysis of corresponding digital pathology images can only be performed in medical and scientific research institutions equipped with digital scanners. The huge storage capacity of digital slices limits the application and promotion of this analysis method.
[0085] In the embodiment of the present application, there is no need to use a digital slice scanner for slice scanning. Images can be taken using a microscope camera on a professional trinocular optical microscope, or images can be taken through the eyepiece using a camera device such as a mobile phone, and automatic analysis can be performed. This greatly reduces the cost of analyzing digital pathology images, improves the efficiency of analyzing digital pathology images, and has a wider range of application scenarios.
[0086] For example, the tumor area of the immunohistochemical nuclear staining image can be automatically analyzed. For example, biological indicators such as Ki67, ER, PR of breast cancer, AR of prostate cancer, Ki67 of glioma and Cyclin D1 of lymphoma can be analyzed and processed. Specifically, digital pathological images of immunohistochemical nuclear staining taken under microscopy can be analyzed and processed.
[0087] Exemplarily, a digital pathology image of Ki67 nuclear staining of glioma is used as an example for further explanation. Glioma Ki67 expression requires calculation of the number of negative cells, the number of positive cells, the total number of cells and the positive ratio in the image. After immunohistochemical Ki67 staining of digital pathology sections of glioma, the cell nuclei are stained, and the negative cell nuclei are colored blue and the positive cell nuclei are colored brown.
[0088] Specifically, first, obtain digital pathology images of Ki67 nuclear staining of glioma for multiple patients. All image data are Ki67 nuclear staining images of glioma taken under the eyepiece of a microscope using a mobile phone. Try to select areas with better image quality. The acquired image size is 4032×3024 (width×height). Among them, digital pathology images of Ki67 nuclear staining of glioma can be obtained under high power and medium power microscopes respectively. Therefore, this application does not require a high magnification of the microscope, which saves the experimental cost to a certain extent.
[0089] In one embodiment, Figure 2a As shown, Figure 2a This is a cell staining image provided in the examples of this application. Since the submitted drawings cannot contain color, Figure 2a The blue pixel area of the negative cell nucleus and the brown pixel area of the positive cell nucleus cannot be displayed and can only be distinguished by the color depth. After obtaining the first cell staining image, the first cell staining image is input into the trained color separation model to obtain multiple binary images of different cell categories corresponding to the cell staining image.
[0090] The color separation model is trained by the following method:
[0091] Acquire a first cell staining image sample, and input the cell staining image sample into a color space model to obtain a second cell staining image sample in a target color space;
[0092] Unsupervised machine learning is performed on the second cell staining image sample to obtain multiple color feature clusters based on preset cluster center features. When the similarity of each sample feature in each color feature cluster meets a preset similarity threshold, the training is completed to obtain a trained color separation model.
[0093] Exemplarily, the color space model can be an RGB space or an HSV space, and preferably, it can also be a fusion space of the RGB space and the HSV space. Taking the fusion space of the RGB space and the HSV space as an example, for a given first cell staining image sample, it is first converted from the RGB space to the HSV space, and then the RGB space and the HSV space are fused to synthesize a new space, and then the model is used for prediction.
[0094] The fusion method of RGB space and HSV space is as follows: connect the channels of an RGB image with an image shape of (H, W, C) and the image converted to the HSV space to synthesize a new image with an image shape of (H, W, 2C), and then stretch it to a shape of (H×W, 2C) as input data in the clustering model training and prediction process. H is the image height, W is the image width, and C is the number of channels.
[0095] Based on the synthesized new space, a first cell staining image sample is obtained, and the cell staining image sample is input into the color space model to obtain a second cell staining image sample in the target color space. Afterwards, in order to achieve color separation, a portion of data is randomly selected from the acquired pathological image as a training set to train an unsupervised Kmeans clustering model.
[0096] Specifically, the first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment is input into a trained color separation model, and multiple binary images of the cell staining image are obtained for different cell categories, including:
[0097] Acquire a first cell staining image, and input the first cell staining image into a color space model to obtain a second cell staining image in a target color space;
[0098] Inputting the second cell staining image into a trained color separation model to separate the cell category corresponding to each pixel position in the second cell staining image;
[0099] Based on the cell category corresponding to each pixel position in the second cell staining image, a plurality of binary images corresponding to different cell categories are generated.
[0100] For example, Figure 2b-1 As shown, Figure 2b-1This is a diagram of the prediction results of the color separation model provided in the embodiment of the present application. Usually, the cell staining categories of immunohistochemical staining include negative cells and positive cells. After obtaining the color separation model, for a given cell staining image, first convert it from the RGB space to the HSV space, then merge the RGB space and the HSV space to synthesize a new space, and then use the color separation model to predict, obtain the category corresponding to each position in the cell staining image, thereby extracting the positions of negative cells and positive cells, and generate two binary images according to the positions of negative cells and positive cells respectively. Figure 2b-2 , Figure 2b-3 As shown, Figure 2b-2 is a binary image of negative cells in the cell staining image provided in the embodiment of the present application, Figure 2b-3 The binary image of positive cells in the cell staining image provided in the embodiment of the present application, the pixels in the area where the cells are located are white. The binary image includes a plurality of first connectivity quantities.
[0101] 2. In the above S102, after the binary image is acquired, a plurality of peak points included in the distance image corresponding to the binary image and the number of peak points included in each of the first connectivity quantities can be determined.
[0102] Before determining the peak point, the following processing can also be included. Specifically, cells with smaller areas are discarded and not counted. According to the distribution of connectivity in the binary image, the area size of each connectivity is calculated and sorted, and the data with smaller and larger areas at the beginning and end are removed. Half of the data in the middle area are taken to calculate the average value as the area size of a single cell. Cells with an area smaller than one-third of the area of a single cell are considered to be uncut intact cells and are discarded. On the one hand, the efficiency of image processing can be improved, and on the other hand, the interference of useless image areas on the results can be reduced.
[0103] Specifically, the determining of the multiple peak points included in the distance image corresponding to the binary image and the number of peak points included in each first connectivity includes:
[0104] Performing distance transformation on the binary image, determining a plurality of peak points included in a distance image corresponding to the binary image, and a pixel position corresponding to each peak point.
[0105] Exemplarily, a distance transform may be performed on the binary image to obtain a distance peak point within a certain area, wherein the area size is selected based on the area size of a single cell.
[0106] After determining the pixel position corresponding to each peak point, the number of peak points included in each first connectivity volume can be determined based on the pixel position corresponding to each peak point and the pixel position corresponding to each first connectivity volume.
[0107] Among them, if the number of peaks is 1, it is considered to be a single cell and no further cell segmentation is required. Otherwise, it is considered to be an unseparated cell cluster.
[0108] 3. In the above S103, for the connectivity including multiple peak points, it is necessary to segment the second connectivity to determine the number of cells included in the second connectivity.
[0109] Specifically, the segmenting process of the second connectivity to determine the number of cells included in the second connectivity includes:
[0110] According to a preset shrinkage distance threshold, shrinking the third connectivity that is greater than the shrinkage distance threshold, to obtain a plurality of fourth connectivity;
[0111] Performing distance transformation on the fourth connectivity to determine the number of peak points included in each fourth connectivity;
[0112] A fifth connectivity including multiple peak points is selected, and the fifth connectivity is contracted until multiple sixth connectivity including one peak point are obtained, and the number of the sixth connectivity is determined to be the number of cells included in the second connectivity.
[0113] For example, each unseparated cell cluster is shrunk according to a certain distance threshold, and then the distance transformation is performed again to obtain the distance peak point in a certain area, and re-judgment is made whether there is an unseparated cell cluster. This is an iterative process until the number of distance peaks of all connected quantities in the binary image is 1 or cannot be shrunk any further, and the cell segmentation is completed. Taking into account the overlap of cells, when obtaining the distance peak point in a certain area for the cell cluster, the area size is selected based on half the area size of a single cell.
[0114] The shrinkage distance threshold can be determined by the following method:
[0115] Based on the distance image corresponding to the binary image, determining the distance value corresponding to each third connectivity quantity, and constructing a distance list including a plurality of distance values;
[0116] From the distance list, a minimum value that is not less than a preset distance threshold is selected as the shrinkage distance threshold.
[0117] Exemplarily, the method for setting the distance threshold of each cell cluster during the cell shrinkage process is as follows: after the distance transformation, a distance list of a single cell cluster is obtained, and the minimum value greater than one-third of the maximum distance value is taken from the distance list as the distance threshold for cell shrinkage, and points less than the distance threshold are discarded.
[0118] 4. In the above S104, after the segmentation process is completed, the total number of cells corresponding to each cell category can be determined based on the cell category corresponding to each binary image.
[0119] For example, Figure 2c As shown, Figure 2c The cell counting result diagram shows that the white dots mark the position of each segmented cell. After the cell segmentation is completed, the position of each segmented cell can be determined and counted according to the distribution of connectivity in the image to obtain the number of negative cells, the number of positive cells, and the total number of cells. Since the image data in this embodiment is a glioma, almost all of the cells in the glioma are tumor cells, so all cells are treated as tumor cells, and the Ki67 positive ratio is finally calculated.
[0120] In addition, the proportion of different cell categories can be determined based on the total number of cells corresponding to different cell categories, that is, cell counting and positive ratio calculation can be performed, and the cell counting method involved in the present application can also be evaluated.
[0121] For example, the accuracy of cell segmentation and positive-negative discrimination under high magnification is 98.76%, the recall rate is 91.77%, and the F1-score is 95.14%; the accuracy of cell segmentation and positive-negative discrimination under medium magnification is 98.52%, the recall rate is 91.94%, and the F1-score is 95.12%. There is basically no difference in the performance of the algorithm under high and medium magnification microscopes, and both cell segmentation and positive-negative discrimination perform well. The calculation method of performance evaluation indicators is as follows:
[0122] Accuracy = number of cells correctly segmented and identified as positive or negative / total number of cells predicted;
[0123] Recall rate = number of cells correctly segmented and identified as positive or negative / actual total number of cells;
[0124] F1-score = 2 × precision × recall / (precision + recall).
[0125] The automatic analysis of digital pathological images involved in this embodiment has received widespread attention in clinical and scientific research, and has greatly benefited clinicians, biomedical researchers and patients. Compared with time-consuming and labor-intensive manual interpretation, intelligent image analysis methods can provide clinicians and biomedical researchers with more accurate interpretation results, reduce the interpretation differences between medical observers, and provide patients with more accurate personalized treatment methods.
[0126] In the embodiment of the present application, in order to realize the automatic analysis of the immunohistochemical nuclear staining image, the positive and negative cells of the cell staining image are first separated and extracted. Since the immunohistochemical nuclear staining makes the negative cells appear blue and the positive cells appear brown, the negative cells, positive cells and background can be separated by the color separation method. In order to make the algorithm process more automated, the automatic color separation process is realized by clustering; then the extracted negative cells and positive cells are respectively segmented, and the detection and segmentation of the cell nucleus can be realized by image morphological operations, distance transformation and other methods; finally, the segmentation results are counted, and the number of negative cells, the number of positive cells, the total number of cells and the positive ratio are calculated. Without scanning the entire digital slice, the tumor area of the immunohistochemical nuclear staining image directly photographed by the microscope eyepiece or objective lens is automatically analyzed, which improves the analysis efficiency of the cell staining image.
[0127] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0128] Based on the same inventive concept, a cell counting device corresponding to the cell counting method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned cell counting method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0129] Reference Figure 3 , Figure 4 As shown, Figure 3 This is a schematic diagram of the structure of a cell counting device provided in an embodiment of the present application. Figure 4 This is a schematic diagram of the structure of another cell counting device provided in an embodiment of the present application. The cell counting device comprises: an input module 310, a first determination module 320, a segmentation module 330, and a second determination module 340, wherein:
[0130] The input module 310 is used to input the first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into the trained color separation model, and obtain a plurality of binary images of different cell categories corresponding to the cell staining image for different cell categories; wherein the binary image includes a plurality of first connectivity quantities;
[0131] A first determination module 320 is used to determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities;
[0132] A segmentation module 330 is used to select a second connectivity including a plurality of the peak points, and perform segmentation processing on the second connectivity to determine the number of cells included in the second connectivity;
[0133] The second determination module 340 is used to determine the total number of cells corresponding to the cell category based on the number of cells included in the second connectivity and the cell category corresponding to the binary image.
[0134] The embodiment of the present application inputs a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and obtains multiple binary images of different cell categories corresponding to the first cell staining image for different cell categories; wherein the binary image includes multiple first connectivity quantities; multiple peak points included in the distance image corresponding to the binary image and the number of peak points included in each first connectivity quantity are determined; a second connectivity quantity including multiple peak points is selected, and the second connectivity quantity is segmented to determine the number of cells included in the second connectivity quantity; based on the number of cells included in the second connectivity quantity and the cell category corresponding to the binary image, the total number of cells corresponding to the cell category is determined. By analyzing and processing the cell staining image, determining the number corresponding to each cell category in the image, and analyzing the cell staining image based on the cells of each cell category, the efficiency of image analysis and interpretation can be improved.
[0135] In an optional embodiment, the cell counting device further includes: a training module 350;
[0136] The training module 350 is specifically used to train the color separation model by the following method:
[0137] Acquire a first cell staining image sample, and input the cell staining image sample into a color space model to obtain a second cell staining image sample in a target color space;
[0138] Unsupervised machine learning is performed on the second cell staining image sample to obtain multiple color feature clusters based on preset cluster center features. When the similarity of each sample feature in each color feature cluster meets a preset similarity threshold, the training is completed to obtain a trained color separation model.
[0139] In an optional implementation manner, the input module 310 is specifically used for:
[0140] Acquire a first cell staining image, and input the first cell staining image into a color space model to obtain a second cell staining image in a target color space;
[0141] Inputting the second cell staining image into a trained color separation model to separate the cell category corresponding to each pixel position in the second cell staining image;
[0142] Based on the cell category corresponding to each pixel position in the second cell staining image, a plurality of binary images corresponding to different cell categories are generated.
[0143] In an optional implementation manner, the first determining module 320 is specifically configured to:
[0144] Performing distance transformation on the binary image to obtain a distance image corresponding to the binary image, and determining a plurality of peak points included in the distance image and a pixel position corresponding to each peak point;
[0145] Based on the pixel position corresponding to each peak point and the pixel position corresponding to each first connectivity amount, the number of peak points included in each first connectivity amount is determined.
[0146] In an optional implementation manner, the segmentation module 330 is specifically used to:
[0147] According to a preset shrinkage distance threshold, shrinking the third connectivity that is greater than the shrinkage distance threshold, to obtain a plurality of fourth connectivity;
[0148] Performing distance transformation on the fourth connectivity to determine the number of peak points included in each fourth connectivity;
[0149] A fifth connectivity including multiple peak points is selected, and the fifth connectivity is contracted until multiple sixth connectivity including one peak point are obtained, and the number of the sixth connectivity is determined to be the number of cells included in the second connectivity.
[0150] In an optional embodiment, the cell counting device further includes: a third determination module 360;
[0151] The third determination module 360 is specifically used to: determine the shrinkage distance threshold by the following method: based on the distance image corresponding to the binary image, determine the distance value corresponding to each third connectivity amount, and construct a distance list including multiple distance values;
[0152] From the distance list, a minimum value that is not less than a preset distance threshold is selected as the shrinkage distance threshold.
[0153] In an optional embodiment, the cell counting device further includes: a fourth determination module 370;
[0154] The fourth determination module 370 is specifically used to determine the proportion of different cell categories based on the total number of cells corresponding to different cell categories.
[0155] The present application also provides a computer device, such as Figure 5 FIG. 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application, wherein the computer device 10 includes:
[0156] A processor 11 and a memory 12; the memory 12 stores machine-readable instructions executable by the processor 11. When the computer device 10 is running, the machine-readable instructions are executed by the processor 11 to implement the following steps:
[0157] Inputting a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and acquiring multiple binary images of the cell staining image for different cell categories; wherein the binary image includes multiple first connectivity quantities;
[0158] Determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities;
[0159] Selecting a second connectivity including a plurality of the peak points, and performing segmentation processing on the second connectivity to determine the number of cells included in the second connectivity;
[0160] Based on the number of cells included in the second connectivity and the cell category corresponding to the binary image, the total number of cells corresponding to the cell category is determined.
[0161] In an optional implementation manner, in the instruction executed by the processor 11, the color separation model is trained by the following method:
[0162] Acquire a first cell staining image sample, and input the cell staining image sample into a color space model to obtain a second cell staining image sample in a target color space;
[0163] Unsupervised machine learning is performed on the second cell staining image sample to obtain multiple color feature clusters based on preset cluster center features. When the similarity of each sample feature in each color feature cluster meets a preset similarity threshold, the training is completed to obtain a trained color separation model.
[0164] In an optional embodiment, the instructions executed by the processor 11 include inputting the first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and acquiring multiple binary images of the cell staining image for different cell categories, including:
[0165] Acquire a first cell staining image, and input the first cell staining image into a color space model to obtain a second cell staining image in a target color space;
[0166] Inputting the second cell staining image into a trained color separation model to separate the cell category corresponding to each pixel position in the second cell staining image;
[0167] Based on the cell category corresponding to each pixel position in the second cell staining image, a plurality of binary images corresponding to different cell categories are generated.
[0168] In an optional implementation, in the instruction executed by the processor 11, determining the multiple peak points included in the distance image corresponding to the binary image and the number of peak points included in each first connectivity includes:
[0169] Performing distance transformation on the binary image to obtain a distance image corresponding to the binary image, and determining a plurality of peak points included in the distance image and a pixel position corresponding to each peak point;
[0170] Based on the pixel position corresponding to each peak point and the pixel position corresponding to each first connectivity amount, the number of peak points included in each first connectivity amount is determined.
[0171] In an optional implementation, in the instructions executed by the processor 11, the segmentation process of the second connectivity to determine the number of cells included in the second connectivity includes:
[0172] According to a preset shrinkage distance threshold, shrinking the third connectivity that is greater than the shrinkage distance threshold, to obtain a plurality of fourth connectivity;
[0173] Performing distance transformation on the fourth connectivity to determine the number of peak points included in each fourth connectivity;
[0174] A fifth connectivity including multiple peak points is selected, and the fifth connectivity is contracted until multiple sixth connectivity including one peak point are obtained, and the number of the sixth connectivity is determined to be the number of cells included in the second connectivity.
[0175] In an optional implementation manner, in the instruction executed by the processor 11, the shrinkage distance threshold is determined by the following method:
[0176] Based on the distance image corresponding to the binary image, determining the distance value corresponding to each third connectivity quantity, and constructing a distance list including a plurality of distance values;
[0177] From the distance list, a minimum value that is not less than a preset distance threshold is selected as the shrinkage distance threshold.
[0178] In an optional implementation manner, the instructions executed by the processor 11 further include:
[0179] Based on the total number of cells corresponding to different cell categories, the proportion of different cell categories is determined.
[0180] The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the cell counting method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0181] The computer program product of the cell counting method provided in the embodiments of the present application includes a computer-readable storage medium storing a program code, and the instructions included in the program code can be used to execute the steps of the cell counting method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0182] The present application also provides a computer program, which implements any one of the methods of the aforementioned embodiments when executed by a processor. The computer program product can be implemented in hardware, software, or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0183] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0184] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0185] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0186] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0187] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A cell counting method, It is characterized in that The cell counting method comprises: Inputting a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and acquiring multiple binary images of the cell staining image for different cell categories; wherein the binary image includes multiple first connectivity quantities; Determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities; Selecting a second connectivity including a plurality of the peak points from the plurality of first connectivitys, and performing segmentation processing on the second connectivity to determine the number of cells included in the second connectivity; the second connectivity is the connectivity corresponding to the unseparated cell clusters; Based on the number of cells included in the second connectivity and the cell category corresponding to the binary image, determine the total number of cells corresponding to the cell category; The color separation model is trained by the following method: Acquire a first cell staining image sample, and input the cell staining image sample into a color space model to obtain a second cell staining image sample in a target color space; Performing unsupervised machine learning on the second cell staining image sample, obtaining a plurality of color feature clusters based on preset cluster center features, and completing the training when the similarity of each sample feature in each of the color feature clusters meets a preset similarity threshold, thereby obtaining a trained color separation model; The color space model includes a fusion space of an RGB space and an HSV space; wherein, the fusion method of the RGB space and the HSV space is: a RGB image with an image shape of (H, W, C) is channel-connected with an image converted into an HSV space to synthesize a new image with an image shape of (H, W, 2C), and then the new image is stretched to a shape size of (H×W, 2C) as input data in the clustering model training and prediction process; wherein H is the image height, W is the image width, and C is the number of channels.
2. The cell counting method according to claim 1, It is characterized in that The first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment is input into the trained color separation model, and multiple binary images of the cell staining image are obtained for different cell categories, including: Acquire a first cell staining image, and input the first cell staining image into a color space model to obtain a second cell staining image in a target color space; Inputting the second cell staining image into a trained color separation model to separate the cell category corresponding to each pixel position in the second cell staining image; Based on the cell category corresponding to each pixel position in the second cell staining image, a plurality of binary images corresponding to different cell categories are generated.
3. The cell counting method according to claim 1, It is characterized in that The determining of the plurality of peak points included in the distance image corresponding to the binary image and the number of peak points included in each first connectivity comprises: Performing distance transformation on the binary image to obtain a distance image corresponding to the binary image, and determining a plurality of peak points included in the distance image and a pixel position corresponding to each peak point; Based on the pixel position corresponding to each peak point and the pixel position corresponding to each first connectivity amount, the number of peak points included in each first connectivity amount is determined.
4. The cell counting method according to claim 1, It is characterized in that The segmenting process of the second connectivity to determine the number of cells included in the second connectivity includes: According to a preset shrinkage distance threshold, shrinking the third connectivity that is greater than the shrinkage distance threshold, to obtain a plurality of fourth connectivity; Performing distance transformation on the fourth connectivity to determine the number of peak points included in each fourth connectivity; A fifth connectivity including multiple peak points is selected, and the fifth connectivity is contracted until multiple sixth connectivity including one peak point are obtained, and the number of the sixth connectivity is determined to be the number of cells included in the second connectivity.
5. The cell counting method according to claim 4, It is characterized in that The shrink distance threshold is determined by the following method: Based on the distance image corresponding to the binary image, determining the distance value corresponding to each third connectivity quantity, and constructing a distance list including a plurality of distance values; From the distance list, a minimum value that is not less than a preset distance threshold is selected as the shrinkage distance threshold.
6. The cell counting method according to claim 1, It is characterized in that Also includes: Based on the total number of cells corresponding to different cell categories, the proportion of different cell categories is determined.
7. A cell counting device, It is characterized in that The cell counting device comprises: An input module is used to input a first cell staining image captured by a professional microscope camera on a trinocular optical microscope or through a microscope eyepiece or other external shooting equipment into a trained color separation model, and obtain multiple binary images of the cell staining image for different cell categories; wherein the binary image includes multiple first connectivity quantities; A first determination module is used to determine a plurality of peak points included in the distance image corresponding to the binary image, and the number of peak points included in each of the first connectivity quantities; A segmentation module, configured to select a second connectivity including a plurality of the peak points from the plurality of first connectivity, and perform segmentation processing on the second connectivity to determine the number of cells included in the second connectivity; the second connectivity is the connectivity corresponding to the unseparated cell clusters; A second determination module is used to determine the total number of cells corresponding to the cell category based on the number of cells included in the second connectivity and the cell category corresponding to the binary image; The training module is used to train the color separation model by the following method: A first cell staining image sample is obtained, and the cell staining image sample is input into a color space model to obtain a second cell staining image sample in a target color space; unsupervised machine learning is performed on the second cell staining image sample, and multiple color feature clusters are obtained based on preset cluster center features. When the similarity of each sample feature in each color feature cluster meets a preset similarity threshold, the training is completed to obtain a trained color separation model; the color space model includes a fusion space of RGB space and HSV space; wherein, the fusion method of RGB space and HSV space is: channel-connecting an RGB image with an image shape of (H, W, C) and an image converted to HSV space to synthesize a new image with an image shape of (H, W, 2C), and then stretching it to a shape size of (H×W, 2C) as input data in the clustering model training and prediction process; wherein H is the image height, W is the image width, and C is the number of channels.
8. A computer device, It is characterized in that include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor performs the steps of the cell counting method according to any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program. When the computer program is executed by a computer device, the computer device performs the steps of the cell counting method according to any one of claims 1 to 6.
