A semi-supervised target detection model construction method and system for cervical cancer pathological images
By employing a semi-supervised target detection model and a counterfactual interpretable method, this study addresses the issues of low automation and difficulty in labeling data in cervical cancer pathological image diagnosis, achieving efficient and accurate cervical cancer pathological image detection and interpretation, and is suitable for cervical cancer auxiliary screening.
Patent Information
- Application Number
- CN202211558843.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-12-06
AI Technical Summary
Existing technologies for cervical cancer pathological image diagnosis suffer from low automation, long diagnosis time, and difficulty in obtaining large-scale labeled data, especially the difficulty of deep learning models relying on a large number of labeled instances.
A semi-supervised object detection model was adopted, which was constructed by mutually promoting the training of student and teacher models, combined with exponential moving average and data augmentation techniques. The model predictions were explained by the counterfactual interpretability method.
It achieves efficient and accurate detection of cervical cancer pathological images, reduces dependence on labeled data, improves the robustness and interpretability of the model, and is suitable for auxiliary diagnosis in safety-sensitive medical fields.
Smart Images

Figure CN115861238B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a semi-supervised target detection model construction method and system for cervical cancer pathological images, belonging to the field of target detection and recognition technology. Background Technology
[0002] With advancements in medical imaging technology, particularly the continuous upgrading of medical imaging systems and the enhancement of data storage capabilities, cervical cancer pathology image data has experienced explosive growth. Compared to small sample data, a large number of pathology images can uncover more potential information and patterns. Because cervical cancer pathology diagnosis requires observation and diagnosis of cellular-level medical images, a single sample is often prepared into multiple slides. The processes of slide preparation, staining, diagnosis, and reporting are time-consuming, resulting in low automation and long diagnostic times.
[0003] In recent years, deep learning methods have been widely used in cervical cancer screening to alleviate the diagnostic burden on pathologists. For example, deep neural networks are used to classify, segment, and detect objects in cervical cancer pathology images to assist in medical diagnosis. Training these deep neural networks typically relies on a large number of labeled instances; however, obtaining large-scale annotations of cervical cancer pathology images is extremely difficult due to the high demands on labor and expertise. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a semi-supervised target detection model construction method for cervical cancer pathological images. It adopts a novel logical design and applies a training method in which models mutually promote each other, which can accurately obtain a cervical cancer pathological image detection model and efficiently realize the analysis and detection of cervical cancer pathological images.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention designs a semi-supervised target detection model construction method for cervical cancer pathological images, which is executed according to steps A to G to obtain a cervical cancer pathological image detection model;
[0006] Step A. Obtain a preset number of cervical cancer pathological sample images containing labeled data, and a preset number of cervical cancer pathological sample images without labeled data. The labeled data includes the position of the abnormal cell region bounding box marked on the cervical cancer pathological sample image, as well as its corresponding preset classification category and confidence level. Then proceed to Step B.
[0007] Step B. Based on each cervical cancer pathology sample image containing labeled data, take the cervical cancer pathology sample image as input and the labeled data on the cervical cancer pathology sample image as output, combine the loss function detection loss, train the preset student model, obtain the trained student model, and then proceed to step C.
[0008] Step C. Based on the values of each parameter in the trained student model, apply the exponential moving average (EMA) method to update each parameter in the teacher model, which uses the same benchmark detector as the student model, and then update the teacher model. Then proceed to step D.
[0009] Step D. For each cervical cancer pathology sample image that does not contain labeled data, apply the trained student model to process it, obtain the labeled data on each cervical cancer pathology sample image, form the preset result corresponding to the trained student model, and then proceed to step E.
[0010] Step E. For each cervical cancer pathology sample image that does not contain labeled data, the teacher model is applied to process it to obtain the labeled data on each cervical cancer pathology sample image, and the abnormal cell region boxes with confidence scores lower than the preset confidence threshold are filtered out. The category and confidence scores of the remaining abnormal cell region boxes constitute the preset results corresponding to the teacher model, and then proceed to step F.
[0011] Step F. Calculate the detection loss function between the preset results of the student model and the preset results of the teacher model after training. Determine whether the detection loss function meets the preset overflow condition. If yes, the cervical cancer pathological image detection model is constructed by the teacher model; otherwise, proceed to step G.
[0012] Step G. Apply the exponential moving average (EMA) method to further update the parameters in the teacher model, thereby updating the teacher model, and then return to step E.
[0013] As a preferred technical solution of the present invention, it also includes a method for predicting results to be counterfactually interpretable as follows: steps i to vi, used to obtain important interpretable regions in cervical cancer pathological images;
[0014] Step i. For cervical cancer pathological images, apply the cervical cancer pathological image detection model to process them and obtain the annotation data on the cervical cancer pathological images as reference annotation data. Then, perform grid division on the cervical cancer pathological images and proceed to step ii.
[0015] Step ii. Select one of the meshes that was not processed in steps iii to iv as the mesh to be analyzed in this loop, and proceed to step ii;
[0016] Step iii. Delete the grid to be analyzed in the current cycle in the cervical cancer pathology image, and apply the cervical cancer pathology image detection model to process the processed cervical cancer pathology image to obtain the labeled data on the cervical cancer pathology image as the labeled data to be analyzed, and then proceed to step iv.
[0017] Step iv. Compare the reference labeled data with the labeled data to be analyzed, and determine whether there are two abnormal cell regions that have an intersection-union ratio greater than the preset intersection-union ratio threshold and correspond to different categories under the preset classification. If so, the grid to be analyzed in this loop is determined to be an important grid, and then proceed to step v. Otherwise, no processing is performed, and step v is proceeded.
[0018] Step v. Determine whether there are any grids in the cervical cancer pathology image that were not processed in steps iii to iv. If so, restore the grids to be analyzed in this loop that were deleted from the cervical cancer pathology image and enter the next loop, returning to step ii; otherwise, proceed to step vi.
[0019] Step vi. The obtained important grids are the important interpretable regions that make up the cervical cancer pathology image.
[0020] As a preferred technical solution of the present invention: both the student model and the teacher model use the single-stage object detection model RetinaNet as the benchmark detector, and the feature pyramid FPN extraction module in the single-stage object detection model RetinaNet used by the student model is updated to CA-FPN by incorporating a causal attention mechanism.
[0021] As a preferred technical solution of the present invention: In step B, firstly, weak enhancement processing is performed on each cervical cancer pathological sample image containing labeled data and then, based on each cervical cancer pathological sample image, the cervical cancer pathological sample image is used as input and the labeled data on the cervical cancer pathological sample image is used as output. Combined with the loss function detectionloss, the preset student model is trained to obtain the trained student model.
[0022] After completing step C, proceed to steps CD as follows;
[0023] Steps C, D, and E: Perform weak enhancement processing and strong enhancement processing updates on each cervical cancer pathology sample image that does not contain labeled data, respectively, to obtain each cervical cancer pathology sample image without labeled data that does not contain labeled data after weak enhancement processing, and each cervical cancer pathology sample image without labeled data that does not contain labeled data after strong enhancement processing, and then proceed to step D.
[0024] In step D, for each cervical cancer pathological sample image that does not contain labeled data and is subjected to strong enhancement processing, the trained student model is applied to process it to obtain the labeled data on each cervical cancer pathological sample image, which constitutes the preset result corresponding to the trained student model, and then proceeds to step E.
[0025] In step E, for each cervical cancer pathological sample image that does not contain labeled data and is subjected to weak enhancement processing, the teacher model is applied to process it to obtain the labeled data on each cervical cancer pathological sample image, and the abnormal cell region boxes with confidence scores lower than the preset confidence threshold are filtered out. The category and confidence score of the remaining abnormal cell region boxes constitute the preset result corresponding to the teacher model, and then the process proceeds to step F.
[0026] As a preferred embodiment of the present invention: the weak enhancement processing includes performing preset flipping at various angles on the cervical cancer pathological sample images to expand each cervical cancer pathological sample image; the strong enhancement processing includes preset color transformation processing methods for the cervical cancer pathological sample images: (a) randomly changing the brightness, contrast, and saturation of the cervical cancer pathological sample images; (b) converting the input RGB image of the cervical cancer pathological sample to grayscale; (c) blurring the input cervical cancer pathological sample image using a Gaussian filter with a random kernel size; (d) randomly changing the brightness of the input cervical cancer pathological sample image. (e) Randomly change the channel values of the input cervical cancer pathology sample RGB image or randomly change the hue, saturation and value of the input cervical cancer pathology sample image; (f) Reduce the JPEG compression of the cervical cancer pathology sample image; (g) Randomly rearrange the channels of the input cervical cancer pathology sample RGB image; (h) Blur the input cervical cancer pathology sample image using a kernel of random size or blur the input cervical cancer pathology sample image using a median filter with a linear size of random aperture; (i) Perform three random erasures on the cervical cancer pathology sample image to further improve the generalization ability of the model.
[0027] As a preferred technical solution of the present invention: the loss function detection loss includes classification loss and regression loss, wherein the classification loss is calculated by focal loss and the regression loss is calculated by smooth-L1 loss.
[0028] As a preferred technical solution of the present invention: in step F, the preset overflow condition is that the result of the loss function detection loss is less than the preset loss threshold, or the preset overflow condition is that the fluctuation of the result of each loss function detection loss in the cycle from step E to step F for a consecutive preset number of times is within the preset loss fluctuation range.
[0029] As a preferred technical solution of the present invention: in step i, the superpixel algorithm SLIC is used to perform grid division on the cervical cancer pathological image.
[0030] Corresponding to the above, the technical problem to be solved by the present invention is to provide a system for constructing a semi-supervised target detection model for cervical cancer pathological images. The system adopts a modular design, executes the logic between models, accurately obtains the cervical cancer pathological image detection model, and thus efficiently realizes the analysis and detection of cervical cancer pathological images.
[0031] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention designs a system for constructing a semi-supervised target detection model for cervical cancer pathological images, including a sample data construction module, a model construction module, a model training module, an application detection module, and a counterfactual interpretation model;
[0032] The sample data construction module is used to execute step A and obtain images of each cervical cancer pathology sample.
[0033] The model building module is used to build student and teacher models for training.
[0034] The model training module is based on the student model and the teacher model. Steps B to G are executed to obtain the cervical cancer pathological image detection model.
[0035] The application detection module uses a cervical cancer pathological image detection model to process cervical cancer pathological images and obtain labeled data on the cervical cancer pathological images.
[0036] The counterfactual interpretation model is used to process cervical cancer pathological images based on the cervical cancer pathological image detection model to obtain important interpretable regions in cervical cancer pathological images.
[0037] Correspondingly, the present invention designs a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: when the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 8.
[0038] The semi-supervised target detection model construction method and system for cervical cancer pathological images described in this invention has the following technical advantages compared with the prior art:
[0039] (1) The semi-supervised target detection model construction method and system for cervical cancer pathological images designed in this invention adopts a novel logical design. Sample data is constructed using cervical cancer pathological sample images containing labeled data and cervical cancer pathological sample images without labeled data. For student and teacher models with the same benchmark detector, a teacher model that meets the preset overflow condition is obtained through mutual promotion of model training, which constitutes the cervical cancer pathological image detection model. Furthermore, based on the detection of cervical cancer pathological images by the cervical cancer pathological image detection model, a counterfactual interpretable design is designed to accurately analyze the important interpretable regions in cervical cancer pathological images. This not only provides efficient analysis of cervical cancer pathological images but also generates corresponding interpretations, providing reference value for doctors' decision-making.
[0040] (2) The semi-supervised target detection model construction method and system for cervical cancer pathological images designed in this invention can achieve high detection accuracy with a small amount of labeled cervical cancer pathological sample images, alleviating the current situation of high requirements for labor and professional knowledge in the medical field and the difficulty of obtaining large-scale labeling of cervical cancer pathological images; and the robustness of the model is enhanced by the causal attention mechanism, enabling the model to accurately identify pathological cells under different staining agents; at the same time, the explanation of the model prediction is given by the counterfactual method, which can make the model more credible in the medical field where safety is highly sensitive, and is of great significance for cervical cancer auxiliary screening. Attached Figure Description
[0041] Figure 1 The flowchart illustrates the architecture of the semi-supervised target detection model construction method for cervical cancer pathological images designed for this invention.
[0042] Figure 2 A specific data augmentation effect diagram is designed for this invention;
[0043] Figure 3 A schematic diagram of a specific CA-FPN feature pyramid module is provided for this invention.
[0044] Figure 4 A schematic diagram illustrating a specific counterfactual interpretable algorithm for this invention;
[0045] Figure 5 A schematic diagram illustrating the inference results of semi-supervised target detection for cervical cancer is designed for this invention;
[0046] Figure 6 A specific counterfactually explainable effect diagram is designed for this invention;
[0047] Figure 7 The electronic device architecture diagram for this invention is designed. Detailed Implementation
[0048] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0049] This invention designs a semi-supervised target detection model construction method for cervical cancer pathological images. In practical applications, the following steps A to G are specifically executed to obtain a cervical cancer pathological image detection model.
[0050] Step A. Obtain a preset number of cervical cancer pathology sample images containing labeled data, and a preset number of cervical cancer pathology sample images without labeled data. The labeled data includes the location of the abnormal cell region bounding boxes marked on the cervical cancer pathology sample images, as well as the category and confidence level under the corresponding preset classification. Then proceed to Step B.
[0051] Step B. First, perform weak enhancement processing on each cervical cancer pathology sample image containing labeled data and update it. Then, based on each cervical cancer pathology sample image, take the cervical cancer pathology sample image as input and the labeled data on the cervical cancer pathology sample image as output, and combine the loss function detection loss to train the preset student model to obtain the trained student model. Then proceed to step C.
[0052] In the application, the Student model uses the single-stage object detection model RetinaNet as the benchmark detector. RetinaNet consists of a backbone and two sub-networks, with the backbone's output connected to the inputs of the two sub-networks. The backbone's main function is to obtain the feature map of the entire input image through the Feature Pyramid Network (FPN). The two sub-networks perform object classification and location regression based on the output feature map, respectively. RetinaNet effectively alleviates class imbalance by using focal loss. Furthermore, for the Student model, the feature pyramid network (FPN) extraction module in RetinaNet is updated to CA-FPN by incorporating a causal attention mechanism. This adds a causal attention mechanism to the feature pyramid network (FPN) extraction module, enabling the model to distinguish between confounding factors and important features during training, thus further enhancing the model's robustness and reducing the impact of confounding factors.
[0053] Step C. Based on the values of each parameter in the trained student model, apply the exponential moving average (EMA) method to update each parameter in the teacher model, which uses the same benchmark detector as the student model, and then update the teacher model. Then proceed to steps CD.
[0054] In practical applications, the teacher model also uses the single-stage object detection model RetinaNet as the benchmark detector.
[0055] Steps C, D, and E: Perform weak enhancement and strong enhancement processing on each cervical cancer pathology sample image that does not contain labeled data to obtain the corresponding weak enhancement processed cervical cancer pathology sample image that does not contain labeled data, and the corresponding strong enhancement processed cervical cancer pathology sample image that does not contain labeled data, and then proceed to step D.
[0056] In practical applications, the weak enhancement processing includes performing preset flipping at various angles on each cervical cancer pathology sample image of a uniform size, such as (1024, 1024), to expand each cervical cancer pathology sample image; the strong enhancement processing includes preset color transformation processing methods for the cervical cancer pathology sample images: (a) randomly changing the brightness, contrast, and saturation of the cervical cancer pathology sample image; (b) converting the input cervical cancer pathology sample RGB image to grayscale; (c) blurring the input cervical cancer pathology sample image using a Gaussian filter with a random kernel size; (d) randomly changing the input cervical cancer pathology sample image. (e) Randomly change the channel values of the input cervical cancer pathology sample RGB image or randomly change the hue, saturation and value of the input cervical cancer pathology sample image; (f) Reduce the JPEG compression of the cervical cancer pathology sample image; (g) Randomly rearrange the channels of the input cervical cancer pathology sample RGB image; (h) Blur the input cervical cancer pathology sample image using a kernel of random size or blur the input cervical cancer pathology sample image using a median filter with a linear size of random aperture; (i) Perform three random erasures on the cervical cancer pathology sample image to further improve the generalization ability of the model.
[0057] Step D. For each cervical cancer pathology sample image that does not contain labeled data and is subjected to strong enhancement processing, the trained student model is applied to process it to obtain the labeled data on each cervical cancer pathology sample image, which constitutes the preset result corresponding to the trained student model, and then proceeds to step E.
[0058] Step E. For each cervical cancer pathology sample image that does not contain labeled data and is subjected to weak enhancement processing, the teacher model is applied to process it to obtain the labeled data on each cervical cancer pathology sample image. Abnormal cell region boxes with confidence scores lower than the preset confidence threshold are filtered out. The category and confidence score of the remaining abnormal cell region boxes constitute the preset result corresponding to the teacher model. Then proceed to step F.
[0059] Step F. Calculate the detection loss function between the preset results of the student model and the preset results of the teacher model after training. Determine whether the detection loss function meets the preset overflow condition. If yes, the teacher model is used to construct the cervical cancer pathological image detection model; otherwise, proceed to step G.
[0060] In practical applications, the preset overflow condition is designed such that the result of the loss function detection loss is less than the preset loss threshold, or the preset overflow condition is that the fluctuation of the result of each loss function detection loss in each cycle from step E to step F for a consecutive preset number of times is within the preset loss fluctuation range.
[0061] Step G. Apply the exponential moving average (EMA) method to further update the parameters in the teacher model, thereby updating the teacher model, and then return to step E.
[0062] The loss function detection loss involved in the implementation of the above technical solution includes classification loss and regression loss. The classification loss is calculated using focal loss, and the regression loss is calculated using smooth-L1 loss.
[0063] Most existing deep learning models focus solely on improving model performance while neglecting the reasons behind the model's predictions. This black-box-based parameter training model is opaque and incomprehensible, making it difficult to gain the trust of doctors and patients. Explainable artificial intelligence has become a crucial topic, and the reliability of pseudo-labels in semi-supervised object detection tasks has been questioned. When models trained on pseudo-labels produce seriously erroneous predictions, interpretability becomes even more important, allowing for model improvement based on the explained reasons for the errors. Counterfactual analysis is a typical model-agnostic interpretable method, offering advantages such as high flexibility, no restrictions on model type and complexity, and no need to disclose the model. Using counterfactual analysis to explain the predictions of semi-supervised object detection is of significant importance for cervical cancer screening.
[0064] Based on the cervical cancer pathological image detection model obtained from the above execution, a counterfactual interpretability method for cervical cancer pathological images is further designed. The counterfactual interpretability method is a typical model-agnostic interpretability method, which has the advantages of high flexibility, no restrictions on model type and model complexity, and no need to disclose the model. The present invention specifically executes the following steps i to vi to obtain important interpretable regions in cervical cancer pathological images.
[0065] Step i. For cervical cancer pathological images, apply a cervical cancer pathological image detection model to process them and obtain the labeled data on the cervical cancer pathological images as reference labeled data. Then, use the superpixel algorithm SLIC to divide the cervical cancer pathological images into grids, so that each pixel in the grid is highly consistent in color and features, ensuring the accuracy of cell edge detection, and then proceed to step ii.
[0066] Step ii. Select one of the meshes that was not processed in steps iii to iv as the mesh to be analyzed in this loop, and proceed to step ii.
[0067] Step iii. Delete the grid to be analyzed in the current cycle in the cervical cancer pathology image, and apply the cervical cancer pathology image detection model to process the processed cervical cancer pathology image to obtain the labeled data on the cervical cancer pathology image as the labeled data to be analyzed, and then proceed to step iv.
[0068] Step iv. Compare the reference labeled data with the labeled data to be analyzed, and determine whether there are two abnormal cell regions whose intersection-union ratio is greater than the preset intersection-union ratio threshold such as 0.9 and which correspond to different categories under the preset classification. If so, the grid to be analyzed in this loop is determined to be an important grid, and then proceed to step v. Otherwise, no processing is performed, and step v is continued.
[0069] Step v. Determine whether there are any grids in the cervical cancer pathology image that were not processed in steps iii to iv. If so, restore the grids to be analyzed in this cycle that were deleted from the cervical cancer pathology image and enter the next cycle, returning to step ii; otherwise, proceed to step vi.
[0070] Step vi. The obtained important grids are the important interpretable regions that make up the cervical cancer pathology image.
[0071] The semi-supervised target detection model construction method for cervical cancer pathological images designed in this invention was applied in practice. For example, a total of 6,666 pathological images of cervical cancer samples were obtained. These images were extracted from whole-slice images (WSIs) obtained by a Pannoracic MIDIII digital slide scanner. The bounding boxes of each abnormal cell region were marked and classified into 11 categories according to the TBS classification standard, namely ASC-US (ascus), ASC-H (asch), low-grade squamous intraepithelial lesion (lsil), high-grade squamous intraepithelial lesion (hsil), squamous cell carcinoma (scc), atypical glandular cells (agc), Trichomonas vaginalis, Candida albicans, flora, Herpes simplex, and Actinomyces.
[0072] According to Figure 2The design shown enhances cervical cancer pathology images through different geometric and color transformations. Specifically, given a cervical cancer pathology image, a weak enhancement form is generated using random rotation and random flipping. Addressing the high degree of cell similarity and difficulty in distinguishing between cells in cervical cancer pathology images, a strong enhancement strategy is extended to generate a strong enhancement form, including nine color transformation strategies. During strong enhancement, all cervical cancer pathology images are first scaled to a uniform size of (1024, 1024) and randomly flipped. The stronger color enhancement then significantly differentiates pixels in similar / identical images, thereby enhancing the model's robustness and... To enhance generalization ability, random color distortion operations were applied to all cervical cancer pathology images, including: randomly changing the brightness, contrast, and saturation of the image; converting the input RGB image to grayscale; blurring the input image using a Gaussian filter with a random kernel size; randomly changing the brightness and contrast of the input image; randomly changing the channel values of the input RGB image or randomly changing the hue, saturation, and values of the input image; reducing JPEG compression of the image; randomly rearranging the channels of the input RGB image; blurring the input image using a kernel of random size or using a median filter with a linearly large random aperture; and performing three random erasures to further improve the model's generalization ability. Through a complex combination of geometric and color transformation enhancements, the network is able to better fit the characteristics of cervical cancer cells.
[0073] Both the student and teacher models use the single-stage object detection model RetinaNet, with ImageNet pre-trained ResNet50 as the backbone network. In this example, the causal attention module is as follows: Figure 3 As shown, in object detection tasks, models typically need to distinguish between background and foreground objects. For the same target object, its background features are not static. For example, under different staining agents, the background environment of the same cervical cancer pathological cell will vary significantly. Influenced by different background factors, the model's prediction results will have significant deviations. Compared to coarse-grained contextual feature comparison, causal attention uses a fine-grained differentiation method to distinguish between background (confounding factors) and foreground features (causal features). Specifically, in addition to focusing on basic causal features, causal attention also decouples confounding factors from causal features through complementary attention. For features x at different scales:
[0074] New features x′ are obtained using the CBAM attention mechanism (channel attention + spatial attention).
[0075] z=CBAM(x),x′=sigmoid(z)·x
[0076] The confounding factor s and causal feature c are calculated separately for the two complementary attention modules.
[0077]
[0078] Wherein, sigmoid(-z) = 1 - sigmoid(z) fuses the distinguished features and inputs them as new features into the next module.
[0079] Using multiple sets of causal attention modules can further enhance the robustness of the model. For causal features, residual connections are used between each module; for confounding factor features, residual connections are used starting from the second causal attention module to completely distinguish them from causal features. Adversarial training with complementary attention features allows the model to use robust features to make correct predictions in one part and capture biases in the other, thus making the results more accurate.
[0080] Further design of counterfactual interpretability for cervical cancer pathology images, such as algorithms... Figure 4 As shown, specifically:
[0081] In object detection tasks, the predicted result of an image typically contains multiple instances (bounding boxes). The design attempts to explain why the model predicts these instances using counterfactual methods. A counterfactual explanation can be viewed as a set of irreducible features (such as pixels); removing these features would change the original category. For example, given an image x... i The model detection result is four-dimensional coordinate B. i ={b i,j :j∈(1,...,n)} and the corresponding category C i ={c i,j When a segment E is deleted from the model, the detection changes: j∈(1,...,n)}.
[0082]
[0083] D is the detection model, B′ i ={b′ i,j :j∈(1,...,n)} and C′ i ={c′ i,j :j∈(1,...,n)} represents the perturbed detection result. If a bounding box in the result overlaps with the original result but belongs to a different category, it indicates that segment E is the reason the model predicted that result.
[0084] In this example, a pre-trained semi-supervised object detection model is used to infer information from cervical cancer pathology images, for example... Figure 5 As shown, the semi-supervised object detection model can be seen for inference results on cervical cancer pathological images. Regardless of the staining agent used on the slide, the model can accurately identify cancerous cells with obvious clusters.
[0085] In this example, the counterfactual method is used to provide specific reasons for the cervical cancer pathological image detection results. For example... Figure 6 As shown, interpretable results based on counterfactual facts can be observed. Figure 6 (a) represents the ground truth. Figure 6 (b) shows the model prediction results. We search for important features that affect the detection results by masking segmented fragments. Figure 6 (c) and Figure 6 (d) illustrates the counterfactual explanation and results. As can be seen from the figure, when the cell nucleus and cell edge features are masked, the model's prediction changes from lsil to ascus, indicating that these features have a significant impact on the classification prediction of lsil. Simultaneously, due to the masking of some edge features, the model also shows bias in recognizing other normal cells.
[0086] As demonstrated above, the intelligent recognition method for cervical cancer pathology images can automatically detect and identify cancerous cells in cervical cancer pathology images. It achieves high detection accuracy with only a small amount of labeled data, alleviating the current challenges in the medical field, such as the high demands on labor and professional knowledge and the difficulty of obtaining large-scale annotations of cervical cancer pathology images. The robustness of the model is enhanced through a causal attention mechanism, enabling it to accurately identify pathological cells under different staining agents. Furthermore, the use of counterfactual methods to explain the model's predictions makes its application in the highly sensitive medical field more credible, which is of great significance for cervical cancer auxiliary screening.
[0087] Corresponding to the above, this invention designs a system for constructing a semi-supervised target detection model for cervical cancer pathological images, including a sample data construction module, a model construction module, a model training module, an application detection module, and a counterfactual interpretation model. The sample data construction module executes step A to obtain various cervical cancer pathological sample images. The model construction module constructs a student model and a teacher model for training. The model training module, based on the student and teacher models, executes steps B to G to obtain a cervical cancer pathological image detection model. The application detection module applies the cervical cancer pathological image detection model to process the cervical cancer pathological images to obtain labeled data on the cervical cancer pathological images. The counterfactual interpretation model is used to obtain important interpretable regions in the cervical cancer pathological images based on the processing of the cervical cancer pathological images by the cervical cancer pathological image detection model.
[0088] Further application of the semi-supervised target detection model construction method for cervical cancer pathological images described above, a data weak augmentation unit and a data strong augmentation unit are also designed. The data weak augmentation unit is used to perform geometric transformation operations on the labeled cervical cancer pathological images and is trained under supervision using the student model. The data strong augmentation unit is used to perform geometric transformation and color transformation operations on the unlabeled cervical cancer pathological images and is trained under unsupervised supervision using the teacher and student models.
[0089] Furthermore, in some specific embodiments, a single-stage target detection unit, an error correction unit, an EMA unit, a counterfactual interpretable unit, and a causal attention unit can be further designed.
[0090] The single-stage object detection unit is used to utilize RetinaNet as the baseline detector for the student and teacher models. It consists of a backbone and two sub-networks, and RetinaNet effectively mitigates the class imbalance problem by using focal loss.
[0091] The error correction unit is used to correct errors in the target output by the model using the detection loss. The detection loss includes classification loss and regression loss. The classification loss is calculated using focal loss, and the regression loss is calculated using smooth-L1 loss.
[0092] The EMA unit is used to update the teacher model using the exponential moving average method. The EMA method updates the parameters of the teacher model using the exponential moving average (EMA) of the student model. The parameters of the teacher model can be viewed as an ensemble of the student model at different time points.
[0093] The counterfactual interpretability unit is used to explain the reasons for model predictions using counterfactual interpretability methods. Counterfactual interpretability is a typical model-agnostic interpretability method, with advantages such as high flexibility, no restrictions on model type and complexity, and no need to disclose the model.
[0094] The causal attention unit is used to add a causal attention mechanism to the feature pyramid, enabling the model to distinguish confounding factors and important features during training.
[0095] Correspondingly, this invention designs a computer device system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: when the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 8. (See also...) Figure 7 As shown, the content in the figure should not be considered as any limitation on the scope of use of this application.
[0096] Figure 7 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the intelligent recognition method for cervical cancer pathological images disclosed in any of the foregoing embodiments.
[0097] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0098] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223 including training set, etc., and the storage method can be temporary storage or permanent storage.
[0099] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the intelligent cervical cancer pathology image recognition method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0100] Furthermore, this application also discloses a computer storage medium storing computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, they implement the steps of the intelligent recognition method for cervical cancer pathological images disclosed in any of the foregoing embodiments.
[0101] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0102] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0103] The semi-supervised target detection model construction method and system for cervical cancer pathological images designed in the above technical solution adopts a novel logical design. Sample data is constructed using cervical cancer pathological sample images containing labeled data and those without labeled data. Student and teacher models with the same benchmark detector are trained through mutual promotion to obtain a teacher model that meets preset overflow conditions, thus forming the cervical cancer pathological image detection model. Furthermore, based on the detection of cervical cancer pathological images using this model, a counterfactual interpretable approach is designed to accurately analyze important interpretable regions in the cervical cancer pathological images. In the entire design, high detection accuracy can be achieved with only a small amount of labeled cervical cancer pathological sample images, alleviating the current situation in the medical field where high labor and professional knowledge requirements and the difficulty of obtaining large-scale annotation of cervical cancer pathological images are present. Moreover, the robustness of the model is enhanced through a causal attention mechanism, enabling the model to accurately identify pathological cells under different staining agents. Simultaneously, the counterfactual method provides an explanation for the model's predictions, making the model more credible in the highly sensitive medical field and of great significance for cervical cancer auxiliary screening.
[0104] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for constructing a semi-supervised target detection model for cervical cancer pathological images, characterized in that, Follow steps A through G below to obtain a cervical cancer pathological image detection model; Step A. Obtain a preset number of cervical cancer pathological sample images containing labeled data, and a preset number of cervical cancer pathological sample images without labeled data. The labeled data includes the position of the abnormal cell region bounding box marked on the cervical cancer pathological sample image, as well as its corresponding preset classification category and confidence level. Then proceed to Step B. Step B. Based on each cervical cancer pathology sample image containing labeled data, take the cervical cancer pathology sample image as input and the labeled data on the cervical cancer pathology sample image as output, combine the loss function detection loss, train the preset student model, obtain the trained student model, and then proceed to step C. Step C. Based on the values of each parameter in the trained student model, apply the exponential moving average (EMA) method to update each parameter in the teacher model, which uses the same benchmark detector as the student model, and then update the teacher model. Then proceed to step D. Step D. For each cervical cancer pathology sample image that does not contain labeled data, apply the trained student model to process it, obtain the labeled data on each cervical cancer pathology sample image, form the preset result corresponding to the trained student model, and then proceed to step E. Step E. For each cervical cancer pathology sample image that does not contain labeled data, the teacher model is applied to process it to obtain the labeled data on each cervical cancer pathology sample image, and the abnormal cell region boxes with confidence scores lower than the preset confidence threshold are filtered out. The category and confidence scores of the remaining abnormal cell region boxes constitute the preset results corresponding to the teacher model, and then proceed to step F. Step F. Calculate the detection loss function between the preset results of the student model and the preset results of the teacher model after training. Determine whether the detection loss function meets the preset overflow condition. If yes, the cervical cancer pathological image detection model is constructed by the teacher model; otherwise, proceed to step G. Step G. Apply the exponential moving average (EMA) method to further update the parameters in the teacher model, thereby updating the teacher model, and then return to step E.
2. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 1, characterized in that: It also includes a counterfactual interpretability method for prediction results, as shown in steps i to vi, for obtaining important interpretable regions in cervical cancer pathology images; Step i. For cervical cancer pathological images, apply the cervical cancer pathological image detection model to process them and obtain the annotation data on the cervical cancer pathological images as reference annotation data. Then, perform grid division on the cervical cancer pathological images and proceed to step ii. Step ii. Select one of the meshes that was not processed in steps iii to iv as the mesh to be analyzed in this loop, and proceed to step ii; Step iii. Delete the grid to be analyzed in the current cycle in the cervical cancer pathology image, and apply the cervical cancer pathology image detection model to process the processed cervical cancer pathology image to obtain the labeled data on the cervical cancer pathology image as the labeled data to be analyzed, and then proceed to step iv. Step iv. Compare the reference labeled data with the labeled data to be analyzed, and determine whether there are two abnormal cell regions that have an intersection-union ratio greater than the preset intersection-union ratio threshold and correspond to different categories under the preset classification. If so, the grid to be analyzed in this loop is determined to be an important grid, and then proceed to step v. Otherwise, no processing is performed, and step v is proceeded. Step v. Determine whether there are any grids in the cervical cancer pathology image that were not processed in steps iii to iv. If so, restore the grids to be analyzed in this loop that were deleted from the cervical cancer pathology image and enter the next loop, returning to step ii; otherwise, proceed to step vi. Step vi. The obtained important grids are the important interpretable regions that make up the cervical cancer pathology image.
3. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 1 or 2, characterized in that: Both the student model and the teacher model use the single-stage object detection model RetinaNet as the benchmark detector. Furthermore, the feature pyramid FPN extraction module in the single-stage object detection model RetinaNet used by the student model incorporates a causal attention mechanism and is updated to CA-FPN.
4. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 1 or 2, characterized in that: In step B, firstly, weak enhancement processing is performed on each cervical cancer pathology sample image containing labeled data to update it. Then, based on each cervical cancer pathology sample image, the cervical cancer pathology sample image is used as input and the labeled data on the cervical cancer pathology sample image is used as output. Combined with the loss function detection loss, the preset student model is trained to obtain the trained student model. After completing step C, proceed to steps CD as follows; Steps C, D, and E: Perform weak enhancement processing and strong enhancement processing updates on each cervical cancer pathology sample image that does not contain labeled data, respectively, to obtain each cervical cancer pathology sample image without labeled data that does not contain labeled data after weak enhancement processing, and each cervical cancer pathology sample image without labeled data that does not contain labeled data after strong enhancement processing, and then proceed to step D. In step D, for each cervical cancer pathological sample image that does not contain labeled data and is subjected to strong enhancement processing, the trained student model is applied to process it to obtain the labeled data on each cervical cancer pathological sample image, which constitutes the preset result corresponding to the trained student model, and then proceeds to step E. In step E, for each cervical cancer pathological sample image that does not contain labeled data and is subjected to weak enhancement processing, the teacher model is applied to process it to obtain the labeled data on each cervical cancer pathological sample image, and the abnormal cell region boxes with confidence scores lower than the preset confidence threshold are filtered out. The category and confidence score of the remaining abnormal cell region boxes constitute the preset result corresponding to the teacher model, and then the process proceeds to step F.
5. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 4, characterized in that: The weak enhancement processing includes performing preset angle flipping on the cervical cancer pathology sample images to expand each cervical cancer pathology sample image; the strong enhancement processing includes preset color transformation processing methods for the cervical cancer pathology sample images: (a) randomly changing the brightness, contrast, and saturation of the cervical cancer pathology sample images; (b) converting the input cervical cancer pathology sample RGB image to grayscale; (c) blurring the input cervical cancer pathology sample image using a Gaussian filter with a random kernel size; (d) randomly changing the brightness and contrast of the input cervical cancer pathology sample image; (e) Randomly change the channel values of the input cervical cancer pathology sample RGB image or randomly change the hue, saturation, and value of the input cervical cancer pathology sample image; (f) Reduce the JPEG compression of the cervical cancer pathology sample image; (g) Randomly rearrange the channels of the input cervical cancer pathology sample RGB image; (h) Blur the input cervical cancer pathology sample image using a kernel of random size or blur the input cervical cancer pathology sample image using a median filter with a linear size of random aperture; (i) Perform three random erasures on the cervical cancer pathology sample image to further improve the generalization ability of the model.
6. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 1 or 2, characterized in that: The loss function, detection loss, includes classification loss and regression loss. The classification loss is calculated using focal loss, and the regression loss is calculated using smooth-L1 loss.
7. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 1 or 2, characterized in that: In step F, the preset overflow condition is that the result of the loss function detection loss is less than the preset loss threshold, or the preset overflow condition is that the fluctuation of the result of each loss function detection loss in the cycle from step E to step F for a consecutive preset number of times is within the preset loss fluctuation range.
8. The method for constructing a semi-supervised target detection model for cervical cancer pathological images according to claim 2, characterized in that: In step i, the SuperPixel Algorithm (SLIC) is used to perform grid division on cervical cancer pathological images.
9. A system for implementing the semi-supervised target detection model construction method for cervical cancer pathological images according to any one of claims 1 to 8, characterized in that: It includes a sample data construction module, a model construction module, a model training module, an application detection module, and a counterfactual explanation model; The sample data construction module is used to execute step A and obtain images of each cervical cancer pathology sample. The model building module is used to build student and teacher models for training. The model training module is based on the student model and the teacher model. Steps B to G are executed to obtain the cervical cancer pathological image detection model. The application detection module uses a cervical cancer pathological image detection model to process cervical cancer pathological images and obtain labeled data on the cervical cancer pathological images. The counterfactual interpretation model is used to process cervical cancer pathological images based on the cervical cancer pathological image detection model to obtain important interpretable regions in cervical cancer pathological images.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Abnormal cell detection method based on introduction of attention mechanism
CN113838008A
Digital image classification method for cervical fluid-based cells based on a deep learning detection model
US20220083762A1