A method for processing pathological images
By constructing a pathological image detection model of feature extraction network and spatial pyramid network, the problem of relying on manual interpretation in pathological image processing in the existing technology is solved, fast and accurate cell detection is achieved, equipment costs are reduced and diagnostic efficiency is improved.
Patent Information
- Application Number
- CN202010655718.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing pathological image processing technology relies on manual interpretation, which is time-consuming, expensive and low in accuracy, and cannot achieve automated and efficient cell detection.
A microscope camera is used to collect cell smear images. Pathological image data sets are generated through enhanced processing and annotation tools. A detection model including a feature extraction network, spatial pyramid network and multi-scale prediction layer is constructed. The stochastic gradient descent method is used to train the model to achieve cell detection. Automatic detection of location, type and confidence.
It achieves fast and accurate pathological image detection, reduces doctors' interpretation time, reduces equipment costs, improves detection efficiency and accuracy, and assists doctors in diagnosis.
Smart Images

Figure CN111861916B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method for processing pathological images. Background Art
[0002] Cytopathology is based on histopathology. It is a discipline that explains the nature of diseases by carefully observing the cell morphology, cell arrangement and the relationship between cells. It is an important part of pathology. Cell samples are made into cell smears through sampling, fixation, preparation, staining and other processes. Cytopathologists observe the cell components in the cell smears under a microscope for diagnosis. First, they browse the whole body under a low-power objective lens, and when the target cell is found, they switch to a high-power objective lens to carefully observe the target cell.
[0003] The computer-assisted film reading systems currently used include ThinPrep Imaging System (TIS) and BD FocalPoint film reader, both of which are microscope-based slide scanning and analysis systems. They have improved the accuracy of interpretation and reduced the reading time to a certain extent, but they are expensive, have low accuracy, and still rely on pathologists for interpretation.
[0004] With the development of digital pathology and artificial intelligence technology, computer analysis systems based on digital pathology images are booming. Compared with traditional image processing technology, artificial intelligence technology has further improved accuracy and a higher degree of automation. However, the design idea of the emerging artificial intelligence-assisted diagnosis system is based on the analysis of full-field scanned digital pathology images, but the existing artificial intelligence technology has not yet achieved completely accurate automatic detection. Doctors are still accustomed to manual reading under a microscope, which takes a long time, and the accuracy rate varies from person to person, and it is difficult to reach an accurate judgment. Summary of the invention
[0005] The purpose of the present invention is to provide a method for processing pathological images to solve the technical problems that the existing pathological images can only be interpreted by pathologists, which takes a long time, is expensive and has low accuracy.
[0006] A method for processing pathological images, the method comprising the following steps:
[0007] Step 1: Use a microscope camera to collect several cell smear pathological images under the microscope to obtain a pathological image dataset;
[0008] Step 2: Enhance each pathological image separately to expand the number of pathological images, and then use annotation tools to annotate the cell locations, cell types and corresponding confidence levels in the pathological images;
[0009] Step 3: Build a pathological image detection model, input the pathological image into the pathological image detection model to generate a pathological image feature map, and use feature maps of different scales to detect and identify the pathological image;
[0010] Step 4: Train the pathological image detection model. The pathological image detection model is trained by the stochastic gradient descent method to obtain a pathological image model. The pathological image to be detected is input into the trained pathological image model for analysis and comparison to obtain the cell location, cell category and corresponding confidence of the pathological image.
[0011] In step 2, the method for enhancing each pathological image includes horizontally flipping, vertically flipping, adding random noise and randomly rotating the pathological image, expanding the data set of pathological image samples, and using a labeling tool as a label making tool LabelImg; the labeling information includes the coordinates of the cell position labeling box in the pathological image, the cell type label, the corresponding confidence value and the path information for saving the pathological image.
[0012] In the step 3, the pathological image detection model includes a feature extraction network, a spatial pyramid network and a multi-scale prediction layer. The feature extraction network is connected to the multi-scale prediction layer via the spatial pyramid network. The feature extraction network includes four processing modules, namely, processing module 1, processing module 2, processing module 3 and processing module 4, and the four processing modules are connected end to end in sequence. The input end of each processing module is provided with a 1×1 convolution layer and a 2×2 average pooling layer for reducing the dimension of the pathological image feature map. When the dimensions of the feature maps output by processing module 2, processing module 3 and processing module 4 are 13×13, 26×26 and 52×52 respectively, the pathological image feature maps of these three scales realize local feature interaction by means of convolution kernels, thereby forming a multi-scale prediction layer; the spatial pyramid network is inserted into the multi-scale prediction layer to realize the feature pyramid network.
[0013] The spatial pyramid network consists of three spatial boxes. In each spatial box, the pathological image feature map is divided into 13×13, 19×19 and 5×5 blocks, which are then spliced after the maximum pooling layer.
[0014] The consumption function trained in step 4 is:
[0015] Loss=Error coord +Error iou +Error cls
[0016]
[0017]
[0018]
[0019] Error coord 、Error iou and Error cls Respectively represent the error of the predicted bounding box, IOU error and classification error; λ coord is the coordinate error weight; S 2 is the number of grids into which the input image is divided, and B is the number of bounding boxes generated for each grid; if is equal to 1, then the jth bounding box covers the target in the i-th grid; otherwise is equal to 0; To predict the center coordinates of the bounding box and its width and height, (x i ,y i ,w i ,h i ) are the center coordinates of the real bounding box and its width and height; λ noobj is the weight of the confidence loss when predicting the bounding box; c i is the confidence level of the prediction; is the true confidence; p i (c) is the true probability that the target belongs to c in grid i, is the predicted probability.
[0020] The detection process in step 4 is as follows:
[0021] The image size is resized to 416×416, and then the image is divided into S×S grids. If the center of the target is located in a grid cell, the detection process is performed in the grid; each grid cell predicts B bounding boxes, the confidence score of the bounding box, and the probability C of the class information of the object. The confidence score is given by the formula Obtain; the confidence score is equal to the intersection-and-union ratio between the real bounding box and the predicted bounding box; the coordinates of the predicted bounding box are marked as (x, y, w, h); where x and y represent the midpoint coordinates of the predicted bounding box, and w and h represent the length and width of the predicted bounding box; if there is no object in the grid cell, it should be 0, otherwise it is 1; the predicted bounding box coordinates (x, y, w, h) obtained in the previous step are processed using logistic normalization; the area in the image that meets the confidence threshold is processed using the non-maximum suppression algorithm; the coordinate range and category information corresponding to the calibrated predicted bounding box are obtained through the processing results of non-maximum suppression.
[0022] The present invention adopts the above technical solution, and the present invention has the following technical effects:
[0023] The present invention detects the pathological image accurately, realizes the rapid detection of the coordinates of the cell position labeling box in the pathological image, the cell type label and the corresponding confidence value, outputs the specific lesion type according to the detected data, and the pathological condition of the pathological image directly obtained by the doctor is helpful to assist the doctor in pathological diagnosis, which is convenient and fast. At the same time, it eliminates the scanning procedure of the pathological section in the prior art and saves the high cost of the scanner, while improving the detection efficiency, which has the advantages of convenience and speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of the present invention.
[0025] Figure 2 This is a structural principle diagram of the pathological image detection model of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention more clear, preferred embodiments are given to further describe the present invention in detail. However, it should be noted that many details listed in the specification are only for the purpose of enabling readers to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0027] A method for processing pathological images, such as Figure 1 As shown, the method comprises the following steps:
[0028] Step 1: Use a microscope camera to collect several cell smear pathology images under the microscope to obtain a pathology image data set. Use a microscope to magnify the cell smear. When the microscope camera magnifies a cell smear at the same time, it rotates in different directions and then magnifies and collects it, so as to collect it from multiple directions. The images collected by the microscope camera are transmitted to the processor for processing.
[0029] Step 2: Each pathological image is enhanced by a processor, which is an ESP image processor. The number of pathological images is expanded, and then the location, cell type and corresponding confidence of the cells in the pathological images are annotated using a labeling tool. The method of enhancing each pathological image includes horizontally flipping, vertically flipping, adding random noise and randomly rotating the pathological image, expanding the data set of pathological image samples, and using a labeling tool, which is a label making tool, LabelImg.
[0030] The annotation information includes the coordinates of the cell location annotation box in the pathological image, the cell type label, the corresponding confidence value and the path information for saving the pathological image. The number of images is increased by enhancement processing, making the collected image database richer. The pathological image enhancement processing is divided into a training set and a test set, and its formatted number and path are saved in a txt format file.
[0031] Step 3: Build a pathological image detection model, input the pathological image into the pathological image detection model to generate a pathological image feature map, and use feature maps of different scales to detect and identify the pathological image.
[0032] The pathological image detection model includes a feature extraction network, a spatial pyramid network and a multi-scale prediction layer. The feature extraction network is connected to the multi-scale prediction layer via the spatial pyramid network. The feature extraction network includes four processing modules, namely processing module 1, processing module 2, processing module 3 and processing module 4, and the four processing modules are connected in sequence. The input end of each processing module is provided with a 1×1 convolution layer and a 2×2 average pooling layer for reducing the dimension of the pathological image feature map. When the dimensions of the feature maps output by processing module 2, processing module 3 and processing module 4 are 13×13, 26×26 and 52×52 respectively, the pathological image feature maps of these three scales realize local feature interaction by means of convolution kernels, thereby forming a multi-scale prediction layer; the spatial pyramid network is inserted into the multi-scale prediction layer to realize the feature pyramid network. The spatial pyramid network is composed of three spatial boxes. In each spatial box, the pathological image feature map is divided into 13×13, 19×19 and 5×5 blocks respectively, and then spliced after passing through the maximum pooling layer.
[0033] The expression formula of the feature extraction network is x l =H l ([x 0 ,x 1 ,x 2 ,...,x l-1 ]); where H l represents a composite function consisting of a BN layer, a ReLU layer, and a 3×3 convolutional layer, [x 0 ,x 1 ,x 2 ,...,x l-1 ] represents the splicing of the underbody foreign object feature maps from previous different layers.
[0034] The interaction of pathological image features at three scales in the pathological image detection model is achieved through 3×3 and 1×1 convolution kernels. Specifically, some convolution layers are added to the 13×13 pathological image feature map of scale 1 before classification and position regression; the feature map of scale 2 is upsampled with the penultimate convolution layer in scale 1 and then concatenated with the feature map, and classification and regression are performed on the output 26×26 feature map; the feature map of scale 3 is merged with the upsampled feature map, and classification and regression are performed on the 52×52 pathological image feature map.
[0035] Step 4: Train the pathological image detection model. The pathological image detection model is trained by the stochastic gradient descent method to obtain a pathological image model. The pathological image to be detected is input into the trained pathological image model for analysis and comparison to obtain the cell location, cell category and corresponding confidence of the pathological image.
[0036] The specific consumption function in training the pathological image detection model is:
[0037] Loss=Error coord +Error iou +Error cls
[0038]
[0039]
[0040]
[0041] Error coord 、Error iou and Error cls Respectively represent the error of the predicted bounding box, IOU error and classification error; λ coord is the coordinate error weight; S 2 is the number of grids into which the input image is divided, and B is the number of bounding boxes generated for each grid; if is equal to 1, then the jth bounding box covers the target in the i-th grid; otherwise is equal to 0; To predict the center coordinates of the bounding box and its width and height, (x i ,y i ,w i ,h i ) are the center coordinates of the real bounding box and its width and height; λ noobj is the weight of the confidence loss when predicting the bounding box; c i is the confidence level of the prediction; is the true confidence; p i(c) is the true probability that the target belongs to c in grid i, is the predicted probability.
[0042] The specific pathological image detection process is as follows: resize the image to 416×416, then divide the image into S×S grids, and if the center of the target is located in a grid cell, perform the detection process in the grid; each grid cell predicts B bounding boxes, the confidence score of the bounding box, and the probability C of the object's category information. The confidence score is given by the formula Obtain; the confidence score is equal to the intersection-and-union ratio between the real bounding box and the predicted bounding box; the coordinates of the predicted bounding box are marked as (x, y, w, h); where x and y represent the midpoint coordinates of the predicted bounding box, and w and h represent the length and width of the predicted bounding box; if there is no object in the grid cell, it should be 0, otherwise it is 1; the predicted bounding box coordinates (x, y, w, h) obtained in the previous step are processed using logistic normalization; the area in the image that meets the confidence threshold is processed using the non-maximum suppression algorithm; the coordinate range and category information corresponding to the calibrated predicted bounding box are obtained through the processing results of non-maximum suppression.
[0043] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing pathological images, characterized in that: The method comprises the following steps: Step 1: Use a microscope camera to collect several cell smear pathological images under the microscope to obtain a pathological image dataset; Step 2: Enhance each pathological image separately to expand the number of pathological images, and then use annotation tools to annotate the cell locations, cell types and corresponding confidence levels in the pathological images; Step 3: Construct a pathological image detection model, input the pathological image into the pathological image detection model to generate a pathological image feature map, and use feature maps of different scales to detect and identify the pathological image. The pathological image detection model includes a feature extraction network, a spatial pyramid network and a multi-scale prediction layer. The feature extraction network is connected to the multi-scale prediction layer via the spatial pyramid network. The feature extraction network includes four processing modules, namely processing module 1, processing module 2, processing module 3 and processing module 4, and the four processing modules are connected head to tail in sequence. The input end of each processing module is provided with a 1×1 convolution layer and a 2 ×2 average pooling layer, used to reduce the dimension of the pathological image feature map. When the dimensions of the feature maps output by processing module 2, processing module 3 and processing module 4 are 13×13, 26×26 and 52×52 respectively, the pathological image feature maps of these three scales realize local feature interaction through convolution kernels, thereby forming a multi-scale prediction layer. Insert a spatial pyramid network into the multi-scale prediction layer to realize a feature pyramid network. The spatial pyramid network consists of three spatial boxes. In each spatial box, the pathological image feature map is divided into 13×13, 19×19 and 5×5 blocks respectively, and then spliced after passing through the maximum pooling layer. Step 4: Train the pathological image detection model. The pathological image detection model is trained by the stochastic gradient descent method to obtain the pathological image model. The pathological image to be detected is input into the trained pathological image model for analysis and comparison to obtain the cell location, cell category and corresponding confidence of the pathological image. The training consumption function is: Loss=Error coord +Error iou +Error cls Error coord 、Error iou and Error cls Respectively represent the error of the predicted bounding box, IOU error and classification error; λ coord is the coordinate error weight; S 2 is the number of grids into which the input image is divided, and B is the number of bounding boxes generated for each grid; if is equal to 1, then the jth bounding box covers the target in the i-th grid; otherwise is equal to 0; To predict the center coordinates of the bounding box and its width and height, (x i ,y i , w i ,h i ) are the center coordinates of the real bounding box and its width and height; λ noobj is the weight of the confidence loss when predicting the bounding box; c i is the confidence level of the prediction; is the true confidence level; p i (c) is the true probability that the target belongs to c in grid i, is the predicted probability; The detection process is: The image size is resized to 416×416, and then the image is divided into S×S grids. If the center of the target is located in a grid cell, the detection process is performed in the grid; each grid cell predicts B bounding boxes, the confidence score of the bounding box, and the probability C of the class information of the object. The confidence score is given by the formula Obtain; the confidence score is equal to the intersection-and-union ratio between the real bounding box and the predicted bounding box; the coordinates of the predicted bounding box are marked as (x, y, w, h); where x and y represent the midpoint coordinates of the predicted bounding box, and w and h represent the length and width of the predicted bounding box; if there is no object in the grid cell, it should be 0, otherwise it should be 1; the predicted bounding box coordinates (x, y, w, h) obtained in the previous step are processed using logistic normalization; the area in the image that meets the confidence threshold is processed using the non-maximum suppression algorithm; the coordinate range and category information corresponding to the calibrated predicted bounding box are obtained through the processing results of non-maximum suppression.
2. A method for processing pathological images according to claim 1, characterized in that: In step 2, the method for enhancing each pathological image includes horizontally flipping, vertically flipping, adding random noise and randomly rotating the pathological image, expanding the data set of pathological image samples, and using a labeling tool as a label making tool LabelImg; the labeling information includes the coordinates of the cell position labeling box in the pathological image, the cell type label, the corresponding confidence value and the path information for saving the pathological image.
Citation Information
Patent Citations
Cervical cancer pathological cell classification system of microscope pathological photograph
CN110334565A
Cervical abnormal cell detection method and system
CN110648322A
