Full-slice cervical cytology image classification method and related device

An instance-level classifier trained by a weakly supervised self-correction method, combined with dynamic weighting and contrastive self-supervised learning, solves the problem of insufficient accuracy in whole-slide cervical cytology image classification in the existing technology and achieves higher cervical cytology image detection accuracy.

CN120635543APending Publication Date: 2025-09-12XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510711806.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing classification methods based on whole-slide cervical cytology images have the problem that manual detection is time-consuming and difficult to screen out mildly diseased cells. Existing automatic detection methods are insufficient in accuracy and performance, especially methods based on multi-instance learning cannot effectively train instance-level feature extractors, resulting in low classification accuracy.

Method used

A method based on weak supervision self-correction is adopted to train instance-level classifiers through a teacher-student architecture. The weak supervision dynamic weighting strategy and contrastive self-supervised learning are combined, the exponential moving average is used to update the teacher network, and reliable pseudo labels are generated through an uncertainty self-correction strategy to train a pre-trained instance-level classifier.

Benefits of technology

It improves the classification accuracy of whole-slide cervical cytology images, achieves higher classification performance, and can more reliably detect cervical lesions, with great potential for practical application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635543A_ABST
    Figure CN120635543A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and discloses a full-slice cervical cytology image classification method and a related device, a two-stage training strategy is used to obtain a credible instance-level classifier, and instance-level prediction with the most information content is aggregated to obtain a packet-level classification result. In the first stage, based on a teacher-student architecture, a loss dynamic weighting strategy is introduced, so that the influence of weak supervision of a positive packet in the training process is gradually reduced; and a more accurate instance feature extractor is obtained by integrating and comparing self-supervised learning. In the second stage, a self-correction strategy based on uncertainty is introduced, uncertain training instances in a positive packet are filtered out through a teacher network, labels of remaining training instances in the positive packet are redistributed, then a student network is fully supervised and finely adjusted, and an instance-level classifier with higher credibility is obtained. Finally, based on the instance-level classifier, the classification performance of the full-slice cervical cytology image is more excellent, and the accuracy is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing and relates to a whole-slice cervical cytology image classification method and related devices. Background Art

[0002] Cervical cancer is the fourth most common cancer among women worldwide. Early screening and prevention can significantly improve cure rates. ThinPrep Cytology Test (TCT) is a key screening technology for the early detection of cervical cancer. TCT specifically involves staining, fixing, and observing cervical cells smeared on a glass slide under a microscope for diagnosis. However, whole slide images (WSIs) are often gigapixel-level, making manual inspection extremely time-consuming and difficult to identify cells without significant lesions.

[0003] Existing automated detection methods based on cell-level annotations show great potential. These methods primarily rely on supervised cell-level annotations to train networks to classify diseased cells, thereby assisting doctors in determining disease status. However, this approach faces the challenge of a lack of manually annotated data. Another automated detection method is based on Multiple Instance Learning (MIL). In MIL-based WSI classification methods, each WSI is considered a "package" containing multiple "instances."

[0004] MIL-based WSI classification methods can generally be divided into two categories: instance-based methods and package-based methods. The instance-based method uses package-level labels to train instance classifiers and then aggregates instance predictions to obtain package-level classifications. However, this method directly inherits package-level labels to generate instance-level pseudo-labels, which severely limits the accuracy and overall performance of the model. The package-based method uses an instance-level feature extractor to obtain the features of each instance in the package and aggregates them into package-level features, and finally trains a package-level classifier. However, this method usually relies on package-level labels for training and cannot effectively train instance-level feature extractors, ignoring instances of mild lesions, resulting in lower classification accuracy. Therefore, there is an urgent need to propose new methods to solve the above problems and improve the classification accuracy of whole-slide cervical cytology images. Summary of the Invention

[0005] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a whole-slice cervical cytology image classification method and related devices.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a whole-slide cervical cytology image classification method, comprising: obtaining a whole-slide cervical cytology image and dividing it into several image blocks; obtaining the positive probability of each image block by calling a pre-trained instance-level classifier; obtaining a preset number of positive probabilities of each image block and taking the average to obtain the mean positive probability, and obtaining the classification result of the whole-slide cervical cytology image based on the mean positive probability; wherein, the pre-trained instance-level classifier is obtained by: constructing an initial instance-level classifier, and constructing a student network and a teacher network based on the teacher-student architecture according to the initial instance-level classifier; introducing a weakly supervised dynamic weighting strategy and a comparative self-supervised learning method to train the student network, and updating the teacher network by exponential moving average; calculating the uncertainty of the training instance according to the uncertainty-based self-correction strategy of the teacher network, and obtaining reliable training instances according to the uncertainty and regenerating pseudo labels to train the student network using a fully supervised training method to obtain a pre-trained instance-level classifier.

[0008] Optionally, the method of obtaining the positive probability of each image block by calling a pre-trained instance-level classifier includes: converting the image block into a FloatTensor, scaling the pixel value of the image block from [0, 255] to [0.0, 1.0], and then normalizing the image block to obtain standardized image block data; inputting the standardized image block data into the pre-trained instance-level classifier to obtain the positive probability of the image block.

[0009] Optionally, the initial instance-level classifier includes a feature extraction part, a feature mapping head and a classification head connected in sequence; the feature extraction part adopts a ResNet-50 network, the feature mapping head includes a linear layer, a ReLU activation function layer and a linear layer connected in sequence; the classification head adopts a linear classification layer.

[0010] Optionally, the weakly supervised dynamic weighting strategy includes: during the training process, using equally weighted cross entropy losses to train the training instances of positive labels and negative labels before W training cycles, introducing a dynamic scalar hyperparameter after W training cycles and before E training cycles to gradually attenuate the weight factor of the cross entropy loss of the training instances of positive labels, and stopping the attenuation after E training cycles; wherein W and E are both constants.

[0011] Optionally, the contrastive self-supervised learning method includes: implementing contrastive self-supervised learning based on a teacher-student architecture, and the same training instance is input into the teacher network and the student network respectively after two groups of random enhancements to generate feature embeddings; updating the weights of the student network with the optimization goal of making the feature embeddings of the same training instance closer and the feature embeddings of different training instances farther apart.

[0012] Optionally, the loss function of the weakly supervised dynamic weighted strategy is for:

[0013]

[0014] Among them, x i,j is a training instance sampled from a labeled bag; y i,j is the training instance label, which is assigned the corresponding bag label Y i ; is the augmentation applied to the input; θ s is the weight of the student network; α(T) is the dynamic weighting function; T is the index of the current cycle.

[0015] The loss function L of the contrastive self-supervised learning method is con for:

[0016]

[0017] Where K is the number of training instances, |P(k)| is the number of training instances with z k The number of feature embeddings in the associated positive feature embedding set, is the indicator function, which is equal to 1 when i≠k; τ represents the temperature hyperparameter, P(k) is the positive feature embedding set derived from the same training instance, and z k is the kth feature embedding, z j is the jth feature embedding.

[0018] Optionally, the calculating the uncertainty of the training instance according to the uncertainty-based self-correction strategy of the teacher network includes: using Monte Carlo dropout to estimate the uncertainty of the training instance, performing M random forward propagations on each input training instance in the teacher network, generating M softmax probability outputs for each input training instance and calculating the mutual information as the uncertainty of the training instance; wherein M is a constant.

[0019] According to a second aspect of the present invention, a whole-slide cervical cytology image classification system is provided, comprising: an acquisition module for acquiring a whole-slide cervical cytology image and dividing it into a number of image blocks; a calling module for obtaining the positive probability of each image block by calling a pre-trained instance-level classifier; a classification module for obtaining a preset number of positive probabilities of each image block and averaging them to obtain the mean positive probability, and obtaining the classification result of the whole-slide cervical cytology image based on the mean positive probability; wherein the pre-trained instance-level classifier is obtained by: constructing an initial instance-level classifier, and constructing a student network and a teacher network based on the teacher-student architecture based on the initial instance-level classifier; introducing a weakly supervised dynamic weighting strategy and a comparative self-supervised learning method to train the student network, and updating the teacher network through exponential moving average; calculating the uncertainty of the training instance according to the uncertainty-based self-correction strategy of the teacher network, and obtaining reliable training instances based on the uncertainty and regenerating pseudo labels to train the student network using a fully supervised training method to obtain a pre-trained instance-level classifier.

[0020] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned whole-slide cervical cytology image classification method when executing the computer program.

[0021] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned whole-slide cervical cytology image classification method are implemented.

[0022] Compared with the prior art, the present invention has the following beneficial effects:

[0023] The present method for whole-slide cervical cytology image classification is essentially a weakly supervised self-correction-based cytology image classification method that does not require cell-level annotation guidance. It uses a two-stage training strategy to obtain a credible instance-level classifier and aggregates the most informative instance-level predictions to obtain packet-level classification results. In the first stage, a dynamic loss weighting strategy is introduced based on a teacher-student architecture to gradually reduce the influence of weak supervision from positive packets during training. Integrative contrastive self-supervised learning is used to make instance feature extraction independent of packet-level labels, thereby obtaining a more accurate instance feature extractor. Furthermore, the weights of the teacher network are updated using an exponential moving average. In the second stage, an uncertainty-based self-correction strategy is introduced. The teacher network filters out uncertain training instances from the positive packets and reassigns labels to the remaining training instances in the positive packets. These credible training instances are then used to fully supervise and fine-tune the student network. The final student network becomes the final pre-trained instance-level classifier, resulting in a more credible instance-level classifier. This instance-level classifier achieves superior classification performance and higher accuracy for whole-slide cervical cytology images, demonstrating significant potential for practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a flow chart of a method for classifying whole-slide cervical cytology images according to an embodiment of the present invention.

[0025] Figure 2 The figures illustrate the differences between the method of the present invention and the current conventional cervical cytology image classification method; among them, Figure (a) is a cell detection-based method, Figure (b) is a package-based multi-instance learning method, and Figure (c) is the method proposed by the present invention.

[0026] Figure 3 This is a diagram of a two-stage instance-level classifier training framework according to an embodiment of the present invention.

[0027] Figure 4 This is a diagram of a packet-level classification framework using a top-k pooling method for instance-level prediction according to an embodiment of the present invention.

[0028] Figure 5 Examples of WSIs and their corresponding patches in the Ali-SCIL dataset used in the present invention. (a) shows a positive (lesion) WSI annotated at the cell level and its corresponding image patch, (b) shows an unannotated positive (lesion) WSI and its corresponding image patch, and (c) shows a negative (no lesion) WSI and its corresponding image patch.

[0029] Figure 6 Graph showing the comparison results between the method of the present invention and the existing MIL method on instance-level test datasets and package-level test datasets.

[0030] Figure 7 This is a diagram showing the ablation experiment results of different uncertainties in the second stage of instance-level classifier training on instance-level test datasets and package-level test datasets according to an embodiment of the present invention.

[0031] Figure 8 This is a visualization of the feature distribution of the instance-level classifier and SimCLR proposed in this embodiment of the present invention using t-SNE on an instance-level dataset. Figure (a) shows the instance features extracted by SimCLR; Figure (b) shows the instance features extracted by the instance-level classifier of the present invention.

[0032] Figure 9 This is a visualization of the Class Activation Map (CAM) extracted using an instance-level classifier according to an embodiment of the present invention. The first and second rows of Figure (a) show eight normal cases and their corresponding CAMs, respectively; the first and second rows of Figure (b) show eight pathological cases and their corresponding CAMs, respectively.

[0033] Figure 10 This is a structural block diagram of a whole-slide cervical cytology image classification system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0035] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] The present invention is described in further detail below with reference to the accompanying drawings:

[0037] See also Figure 1In one embodiment of the present invention, a whole-slide cervical cytology image classification method is provided, specifically a cytology image classification method based on weakly supervised self-correction without the need for cell-level annotation guidance, which greatly improves the classification accuracy of whole-slide cervical cytology image classification.

[0038] Specifically, the whole-slide cervical cytology image classification method of the present invention includes the following steps:

[0039] S1: Acquire a whole-slide cervical cytology image and divide it into several image blocks.

[0040] S2: Get the positive probability of each image block by calling the pre-trained instance-level classifier.

[0041] S3: obtaining a preset maximum number of positive probabilities among the positive probabilities of each image block and taking the average to obtain a mean positive probability, and obtaining a classification result of the full-slice cervical cytology image based on the mean positive probability.

[0042] The pre-trained instance-level classifier is obtained in the following way:

[0043] An initial instance-level classifier is constructed, and based on the initial instance-level classifier, a student network and a teacher network are constructed based on the teacher-student architecture; a weakly supervised dynamic weighting strategy and a contrastive self-supervised learning method are introduced to train the student network, and the teacher network is updated by exponential moving average; the uncertainty of the training instance is calculated according to the uncertainty-based self-correction strategy of the teacher network, and reliable training instances are obtained based on the uncertainty and pseudo labels are regenerated to train the student network using a fully supervised training method to obtain a pre-trained instance-level classifier.

[0044] The present method for whole-slide cervical cytology image classification is essentially a weakly supervised self-correction-based cytology image classification method that does not require cell-level annotation guidance. It uses a two-stage training strategy to obtain a credible instance-level classifier and aggregates the most informative instance-level predictions to obtain packet-level classification results. In the first stage, a dynamic loss weighting strategy is introduced based on a teacher-student architecture to gradually reduce the influence of weak supervision from positive packets during training. Integrative contrastive self-supervised learning is used to make instance feature extraction independent of packet-level labels, thereby obtaining a more accurate instance feature extractor. Furthermore, the weights of the teacher network are updated using an exponential moving average. In the second stage, an uncertainty-based self-correction strategy is introduced. The teacher network filters out uncertain training instances from the positive packets and reassigns labels to the remaining training instances in the positive packets. These credible training instances are then used to fully supervise and fine-tune the student network. The final student network becomes the final pre-trained instance-level classifier, resulting in a more credible instance-level classifier. This instance-level classifier achieves superior classification performance and higher accuracy for whole-slide cervical cytology images, demonstrating significant potential for practical applications.

[0045] Explanatory, the package refers to the whole slide cervical cytology image, the instance refers to the image block segmented from the whole slide cervical cytology image, and the training package and training instance are the labeled data used in training.

[0046] Explanatory, see Figure 2 The present method for whole-slide cervical cytology image classification differs from cell-based and packet-based methods in that it focuses on training a reliable instance-level classifier. During instance-level classifier training, a weakly supervised dynamic loss weighting strategy and contrastive self-supervised learning are introduced to reduce weak supervision of positive packets and improve feature extraction capabilities. An uncertainty-based self-correction strategy is also introduced to reduce the impact of noisy pseudo-labels, making the instance-level classifier more reliable and achieving superior performance. Overall, the reliable instance-level classifier significantly improves the accuracy of automatic classification of whole-slide cervical cytology images for cervical lesions.

[0047] In one possible implementation, obtaining the positive probability of each image block by calling a pre-trained instance-level classifier includes: converting the image block into a FloatTensor, scaling the pixel value of the image block from [0, 255] to [0.0, 1.0], and then normalizing the image block to obtain standardized image block data; and inputting the standardized image block data into the pre-trained instance-level classifier to obtain the positive probability of the image block.

[0048] For explanation, the KFB format of the original whole-slide cervical cytology image is obtained from a digital scanner, and the whole-slide cervical cytology image is read and cut into small image blocks using a tool that can read the KFB format.

[0049] Each image block (instance) is converted into a FloatTensor, and the pixel value of the image block is scaled from [0, 255] to [0.0, 1.0]. The image data is then normalized and input into the instance-level classifier for feature extraction and classification, resulting in a 2D probability vector corresponding to the probability of negative (no lesion) and positive (lesion). The class with the larger probability is the classification result of the instance.

[0050] In one possible implementation, the initial instance-level classifier includes a feature extraction part, a feature mapping head, and a classification head connected in sequence; the feature extraction part adopts a ResNet-50 network, the feature mapping head includes a linear layer, a ReLU activation function layer, and a linear layer connected in sequence; the classification head adopts a linear classification layer.

[0051] In one possible implementation, the instance-level classifier is trained using a two-stage strategy, as follows:

[0052] In the first stage, based on the teacher-student architecture, a weakly supervised dynamic weighting strategy and contrastive self-supervised learning are introduced to train student weights, and the teacher weights are updated through exponential moving average.

[0053] In the second stage, based on the uncertainty self-correction strategy, the uncertainty of the data is calculated, reliable data is retained and pseudo labels are regenerated for full supervision training of the student network.

[0054] For ease of understanding, make the following settings:

[0055] Given a dataset X containing N WSIs, X = {X1, X2, ..., X N}, X in each WSI i is divided into non-overlapping image blocks {x i,j ,j=1,2,..n i}, where n i Indicates that from X i The number of image patches to be derived. X i All image patches of form a bag, and each image patch is an instance of the bag. Bag label Y i ∈{0,1},i={1,2,...N}, the label of each instance {y i,j ,j=1,2,...n i} has the following relationship:

[0056]

[0057] In the first stage, based on the teacher-student architecture, a weakly supervised dynamic weighting strategy and contrastive self-supervised learning are introduced to train student weights, and the teacher weights are updated by exponential moving average.

[0058] In one possible implementation, the weakly supervised dynamic weighting strategy includes:

[0059] During the training process, the training instances of positive labels and negative labels are trained using equally weighted cross entropy loss before W training cycles. After W training cycles and before E training cycles, a dynamic scalar hyperparameter is introduced to gradually attenuate the weight factor of the cross entropy loss of the training instances of the positive labels, and the attenuation stops after E training cycles; where W and E are both constants.

[0060] For example, a dynamic scalar hyperparameter is used during training to gradually reduce the influence of positive bag labels by controlling the weight factor of the cross entropy loss associated with the adjusted positive bag labels and gradually reducing it after each training cycle. The weights of the instances are redistributed using an exponential decay method, gradually reducing the weight of positive instances during loss calculation while keeping the weight of negative instances fixed at 1. The dynamic weighting function can be expressed as:

[0061]

[0062] Where T represents the index of the current training cycle, and the hyperparameters μ and e(T) represent the exponential decay base and exponential decay factor, respectively.

[0063] It is worth noting that the dynamic weighting strategy is not always used. In the first W training cycles, the cross entropy loss with equal weights is used for training so that the model can learn rough features at the beginning; and the decay is stopped after E training cycles. The exponential decay can be expressed as:

[0064]

[0065] Therefore, the dynamic weighted cross entropy loss is expressed as:

[0066]

[0067] Among them, x i,j represents an instance sampled from a labeled bag, y i,j Represents the instance label, which is assigned the corresponding package label Y i . refers to the augmentation applied to the input, and θ s Represents the weight of the student network.

[0068] In one possible implementation, the contrastive self-supervised learning method includes: implementing contrastive self-supervised learning based on a teacher-student architecture, wherein the same training instance is subjected to two sets of random enhancements and then input into a teacher network and a student network respectively to generate feature embeddings; and updating the weights of the student network with the optimization goal of making the feature embeddings of the same training instance closer and the feature embeddings of different training instances further apart.

[0069] For example, contrastive self-supervised learning is implemented based on a teacher-student architecture. The teacher network and the student network have the same network structure, and the EMA (Exponential Moving Average) is used to update the weights of the teacher network. The equation is as follows:

[0070]

[0071] The smoothing coefficient hyperparameter ∈ represents an exponential decay rate, which is 0.99 in this embodiment.

[0072] The same instance x i,j After two sets of random enhancements, they are input into the teacher network and the student network respectively to generate four positive sample pair features, which are expressed as:

[0073]

[0074] in, Indicates that the model parameters θ and enhancement Next x i,j feature output.

[0075] Assume that a mini-batch contains K instances, and the above equation is used to generate the feature embedding set Z(k) = {z k |k∈[1,4K]}. For each feature embedding z k , P(k)={p k |k∈[1,3]} represents the set of other positive feature embeddings derived from the same input instance. Contrastive learning is used to enhance the representation ability of features by bringing similar samples closer and different samples further apart. The self-supervised contrastive loss can be expressed as:

[0076]

[0077] Among them, |P(k)| represents the difference between z k The number of embeddings in the relevant positive feature embedding set, is an indicator function that is equal to 1 when i≠k. The parameter τ represents the temperature hyperparameter, which is 0.07 in this embodiment.

[0078] Based on the above, the loss of the first stage can be written as:

[0079]

[0080] Where γ is a hyperparameter used to balance the two losses in the first stage. Figure 3 , backpropagation is applied to the student network, which is directly affected by the loss Supervision.

[0081] In the second stage, based on the uncertainty self-correction strategy, the uncertainty of the data is calculated, reliable data is retained and pseudo labels are regenerated for full supervision training of the student network.

[0082] In one possible implementation, the uncertainty of the training instance is calculated according to the uncertainty-based self-correction strategy of the teacher network, including: using Monte Carlo dropout to estimate the uncertainty of the training instance, performing M random forward propagations on each input training instance in the teacher network, generating M softmax probability outputs for each input training instance and calculating the mutual information as the uncertainty of the training instance.

[0083] Where M is a constant.

[0084] For example, Monte Carlo dropout is used to estimate the uncertainty of an instance. M random forward propagations are performed on each input in the teacher network with a dropout rate of 0.5, generating M softmax probability outputs for each input. Calculate the mutual information as its corresponding uncertainty. Mutual information is expressed as:

[0085]

[0086] in, is the training data set, x i,j represents an instance sampled from the bag, and represents the teacher network’s prediction for this instance, θ t is the weight of the teacher network. Uncertainty Calculated as:

[0087]

[0088] in, Represents instance x i,j Belongs to category c in the teacher model parameter θ t The probability of the next.

[0089] The specific method of generating pseudo labels and using full supervision to train the student network is as follows:

[0090] Filter out unreliable samples by calculating the uncertainty:

[0091]

[0092] Among them, τ certainty is the preset certainty threshold.

[0093] For the reserved data, pseudo labels are obtained using the following method:

[0094]

[0095] Among them, p m represents the softmax probability output of the mth sample in M ​​Monte Carlo Dropout sampling. In the second stage, the student network is fine-tuned using the standard cross entropy loss:

[0096]

[0097] Explanatory, see Figure 4 After the two-stage training process, the final student network is used as the pre-trained instance-level classifier f(x) for instance-level classification. If package-level classification is performed, the package-level classifier F(X) can be obtained by applying the top k pooling method to obtain the classification of the whole-slide cervical cytology image of the cervical lesion class:

[0098]

[0099] Among them, x i,j It is package X i In this embodiment, k in the top k pooling method is 760.

[0100] Explanatory, the positive probabilities of all instances in a full-slice cervical cytology image are obtained, and a preset large number (760 in this embodiment) of positive probabilities of all these instances are selected, and the average of these positive probabilities is obtained to obtain the mean positive probability. If the mean positive probability is greater than 0.5, the classification result of the full-slice cervical cytology image is positive (lesion); if the mean positive probability is less than 0.5, the classification result of the full-slice cervical cytology image is negative (no lesion).

[0101] In one possible implementation, see Figure 5 Taking cervical cytology images from the Ali-Tianchi competition as an example, the effectiveness of the whole-slide cervical cytology image classification method proposed in this invention is tested by constructing instance-level test datasets and package-level test datasets.

[0102] In this embodiment, the PyTorch framework is used and implemented on an NVIDIA A800 GPU equipped with 80GB of memory. The classification performance is evaluated using precision, recall, F1 score, accuracy, and area under the receiver operating characteristic curve (ROC) AUC. The performance of the whole-slide cervical cytology image classification method (SCIL) of the present invention and several state-of-the-art MIL methods are evaluated on instance-level and package-level test sets. The results of the instance-level test dataset are shown in Table 1, and the results of the package-level test dataset are shown in Table 2. The ROC curves are plotted as shown in Table 2. Figure 6 As shown in FIG. 1 , the method of the present invention achieves the best performance on both test data and , which fully demonstrates the practical application potential of the present invention.

[0103] Table 1

[0104]

[0105] Table 2

[0106] Methods Pre Rec Fl Acc AUC MIL-RNN

[13] 0.8432 0.8389 0.8190 0.8190 0.9670 CE-MIL

[14] 0.8927 0.9000 0.8943 0.8952 0.9737 WENO

[18] 0.7832 0.7889 0.7802 0.7810 0.8459 Loss-MIL

[16] 0.8947 0.8222 0.8331 0.8476 0.9322 AB-MIL

[20] 0.8327 0.8389 0.8282 0.8286 0.8248 DS-MIL

[24] 0.8150 0.8167 0.8158 0.8190 0.8807 DTFD-MIL

[28] 0.8261 0.8444 0.8352 0.8571 0.9015 DF-MIL

[44] 0.9017 0.9056 0.9033 0.9048 0.9548 SCIL(ours) 0.9611 0.9611 0.9611 0.9619 0.9863

[0107] To explore the impact of the various components of our method on the overall model performance, ablation experiments were conducted on two test datasets. A ResNet50 network (SingleNet) trained with package-level labels was used as the baseline model; WSDW-Only integrates weakly supervised dynamic weighting into the SingleNet model; CSSL-Only integrates contrastive self-supervised learning into the teacher-student architecture; and StageOne represents a combined model combining weakly supervised dynamic weighting and contrastive self-supervised learning. Table 3 shows the results for the instance-level dataset, and Table 4 shows the results for the package-level dataset.

[0108] Table 3

[0109]

[0110] Table 4

[0111] Methods CSSL WSDW USC Pre Rec Fl Acc AUC SingleNet 0.7550 0.6889 0.6343 0.6476 0.9700 CSSL-Only √ 0.7904 0.7556 0.7202 0.7238 0.9781 WSDW-Only √ 0.8840 0.8917 0.8849 0.8857 0.9607 StageOne √ √ 0.9136 0.9222 0.9138 0.9143 0.9804 SCIL(ours) √ √ √ 0.9611 0.9611 0.9611 0.9619 0.9863

[0112] The results show that the proposed method achieves the best classification results among all other ablation settings in both test datasets, demonstrating the effectiveness of the pre-trained instance-level classifier in classifying cervical lesion class instances and whole-slide cervical cytology images.

[0113] In one possible implementation, an ablation study of different exponential decay bases was conducted for the setting of the weakly supervised dynamic weighted exponential base. The ablation study was conducted by testing different μ values: 1, 0.95 and 0.9. Table 5 shows the results of the instance-level dataset, and Table 6 shows the results of the package-level dataset.

[0114] Table 5

[0115]

[0116] Table 6

[0117] μ Pre Rec Fl Acc AUC 1 0.7904 0.7556 0.7202 0.7238 0.9774 0.95 0.9611 0.9611 0.9611 0.9619 0.9863 0.9 0.9563 0.9472 0.9509 0.9524 0.9788

[0118] The results show that the classification performance is very sensitive to the choice of the exponential decay base. Starting from μ = 1 and gradually reducing its value, it is observed that as the proportion of supervisory signals of positive bag instances changes, the recall rate of the positive class decreases, while the recall rate of the negative class increases. This change causes the decision boundary of the model to move toward the positive class, partially solving the problem of the decision boundary tilting toward the negative class due to noisy pseudo-labels. However, when μ = 0.9, the recall rate of the positive class decreases further, indicating that the model's tendency to correctly predict positive instances decreases. This may be because the supervisory signal of the positive class becomes too weak relative to the negative class, weakening the model's constraints on the positive class. In addition, the change in accuracy further supports this trend. The overall classification performance reaches its peak at μ = 0.95. Based on this analysis, the exponential decay base μ of all experiments in the embodiments of the present invention is set to 0.95.

[0119] In one possible implementation, for the setting of the uncertainty threshold in the second stage, an ablation study of different uncertainty thresholds is conducted, including 0.05, 0.10, 0.15, and 0.20. Figure 7 shown. Figure 7 The experimental results presented in clearly show that the classification performance is very sensitive to the choice of the certainty threshold. Starting from 0.05 and gradually increasing to 0.20, the accuracy and AUC values ​​in both datasets first increase and then decrease with the adjustment of the certainty threshold. This confirms that when the certainty threshold is set too high, a large number of uncertain instances will be retained, which will introduce noise into the training set and have a negative impact on the fine-tuning performance of the student network. However, if the certainty threshold is set too low, a large number of certain samples may be discarded, reducing the overall amount of training data, thereby compromising the effectiveness of student network fine-tuning. The maximum value is achieved at a certainty threshold of 0.1. Based on this analysis, the certainty threshold of all experiments in the embodiments of the present invention is set to 0.1.

[0120] We further conduct a more detailed evaluation and explanatory experiments on the proposed method and analyze its effectiveness in representation learning and explanatory visualization.

[0121] Representation Learning Analysis: To evaluate the effectiveness of our method in representation learning, we compared the features extracted by our method with those generated by a comparative self-supervised method (SimCLR). Specifically, we trained SimCLR using ResNet-50 as the network backbone, and used SimCLR and our method to extract instance-level features from the same layer in the instance-level test dataset. We used t-SNE to visualize the feature distribution, as shown in Figure 2. Figure 8 As shown in Figure 7. The features extracted by the proposed method show a clear separation between positive and negative examples, so clear that a clear boundary can be manually drawn on a two-dimensional plane, highlighting the powerful feature representation capability of the proposed method. In contrast, the features generated by SimCLR have significant overlap between positive and negative examples and are scattered in the feature space, making them difficult to separate. In addition, a linear classification head was trained using bag labels based on the features extracted by SimCLR to compare the quality of the features. Tests were performed on the instance-level dataset, as shown in Table 7. The proposed method consistently outperformed SimCLR in feature quality, highlighting its effectiveness in detecting patch-level cervical lesions.

[0122] Table 7

[0123]

[0124] Explanatory visualization analysis of the proposed method: CAM is used to display the key areas of the instances detected by the network. Figure 9 , showing the CAM of the final feature layer of the method proposed in the present invention, the first and second rows in (a) are 8 normal instances and their corresponding CAMs, respectively; the first and second rows in (b) are 8 pathological instances and their CAMs, respectively. Figure 9 In the figure, there are no highlighted responses in the negative examples, while the abnormal cells in the positive examples are highlighted. This shows that the proposed method effectively generates features that focus on abnormal cells, bypassing ambiguous areas that may cause misclassification. In other words, the proposed method reliably targets relevant areas, supporting more accurate predictions. This shows that the proposed method enhances the classification ability of the model to learn more discriminative features.

[0125] The following are device embodiments of the present invention, which can be used to perform the method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.

[0126] See also Figure 10 In another embodiment of the present invention, a whole-slide cervical cytology image classification system is provided, which can be used to implement the above-mentioned whole-slide cervical cytology image classification method. Specifically, the whole-slide cervical cytology image classification system includes an acquisition module, a calling module and a classification module.

[0127] Among them, the acquisition module is used to obtain the whole-slice cervical cytology image and divide it into several image blocks; the calling module is used to obtain the positive probability of each image block by calling the pre-trained instance-level classifier; the classification module is used to obtain the positive probabilities of the largest number of the positive probabilities of each image block and take the average to obtain the average positive probability, and obtain the classification result of the whole-slice cervical cytology image based on the average positive probability. Among them, the pre-trained instance-level classifier is obtained by the following method: constructing an initial instance-level classifier, and based on the initial instance-level classifier, constructing a student network and a teacher network based on the teacher-student architecture; introducing a weakly supervised dynamic weighting strategy and a contrastive self-supervised learning method to train the student network, and updating the teacher network through exponential moving average; calculating the uncertainty of the training instance according to the uncertainty-based self-correction strategy of the teacher network, and obtaining reliable training instances based on the uncertainty and regenerating pseudo labels to train the student network using a fully supervised training method to obtain a pre-trained instance-level classifier.

[0128] All relevant contents of each step involved in the embodiment of the aforementioned whole-slide cervical cytology image classification method can be referred to the functional description of the functional modules corresponding to the whole-slide cervical cytology image classification system in the embodiment of the present invention, and will not be repeated here.

[0129] The module division in the embodiments of the present invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in various embodiments of the present invention may be integrated into a single processor, exist physically as separate modules, or two or more modules may be integrated into a single module. The integrated modules may be implemented in either hardware or software functional modules.

[0130] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory, wherein the memory is configured to store a computer program, wherein the computer program includes program instructions, and the processor is configured to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is adapted to implement one or more instructions, specifically, to load and execute one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used to operate the whole-slide cervical cytology image classification method.

[0131] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a computer device, used to store programs and data. It is understood that the computer-readable storage medium herein may include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides storage space, which stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for being loaded and executed by a processor. These instructions may be one or more computer programs (including program code). It should be noted that the computer-readable storage medium herein may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. The processor may load and execute the one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the whole-slide cervical cytology image classification method described in the above-mentioned embodiment.

[0132] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0133] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0134] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A whole-slide cervical cytology image classification method, characterized in that: include: Acquire whole-slide cervical cytology images and divide them into several image blocks; By calling the pre-trained instance-level classifier, the positive probability of each image block is obtained; Obtaining the positive probabilities of the largest number of positive probabilities among the positive probabilities of each image block and taking the average to obtain the mean positive probability, and obtaining the classification result of the full-slice cervical cytology image based on the mean positive probability; The pre-trained instance-level classifier is obtained in the following way: An initial instance-level classifier is constructed, and based on the initial instance-level classifier, a student network and a teacher network are constructed based on the teacher-student architecture; a weakly supervised dynamic weighting strategy and a contrastive self-supervised learning method are introduced to train the student network, and the teacher network is updated by exponential moving average; the uncertainty of the training instance is calculated according to the uncertainty-based self-correction strategy of the teacher network, and reliable training instances are obtained based on the uncertainty and pseudo labels are regenerated to train the student network using a fully supervised training method to obtain a pre-trained instance-level classifier.

2. The whole-slide cervical cytology image classification method according to claim 1, characterized in that: The method of obtaining the positive probability of each image block by calling the pre-trained instance-level classifier includes: Convert the image block to FloatTensor, scale the pixel value of the image block from [0, 255] to [0.0, 1.0], and then normalize the image block to obtain the standardized image block data; The normalized image patch data is input into the pre-trained instance-level classifier to obtain the positive probability of the image patch.

3. The whole-slide cervical cytology image classification method according to claim 1, characterized in that: The initial instance-level classifier includes a feature extraction part, a feature mapping head and a classification head connected in sequence; the feature extraction part adopts a ResNet-50 network, the feature mapping head includes a linear layer, a ReLU activation function layer and a linear layer connected in sequence; the classification head adopts a linear classification layer.

4. The whole-slide cervical cytology image classification method according to claim 1, characterized in that: The weakly supervised dynamic weighting strategy includes: during the training process, using equally weighted cross entropy loss to train the training instances of positive labels and negative labels before W training cycles, introducing a dynamic scalar hyperparameter after W training cycles and before E training cycles to gradually attenuate the weight factor of the cross entropy loss of the training instances of positive labels, and stopping the attenuation after E training cycles; wherein W and E are both constants.

5. The whole-slide cervical cytology image classification method according to claim 4, characterized in that: The contrastive self-supervised learning method includes: Based on the teacher-student architecture, contrastive self-supervised learning is implemented. The same training instance is subjected to two sets of random augmentations and then input into the teacher network and the student network respectively to generate feature embeddings. The weights of the student network are updated with the optimization goal of making the feature embeddings of the same training instance closer and the feature embeddings of different training instances farther apart.

6. The whole-slide cervical cytology image classification method according to claim 5, characterized in that: The loss function of the weakly supervised dynamic weighted strategy is for: Among them, x i,j is a training instance sampled from a labeled bag; y i,j is the training instance label, which is assigned the corresponding bag label Y i ; is the enhancement applied to the input; θ s is the weight of the student network; α(T) is the dynamic weighting function; T is the index of the current cycle; The loss function L of the contrastive self-supervised learning method is con for: Where K is the number of training instances, |P(k)| is the number of training instances with z k The number of feature embeddings in the associated positive feature embedding set, is the indicator function, which is equal to 1 when i≠k; τ represents the temperature hyperparameter, P(k) is the positive feature embedding set derived from the same training instance, and z k is the kth feature embedding, z j is the jth feature embedding.

7. The whole-slide cervical cytology image classification method according to claim 1, characterized in that: The uncertainty of the training instance is calculated according to the uncertainty-based self-correction strategy of the teacher network, including: Monte Carlo dropout is used to estimate the uncertainty of the training instance. M random forward propagations are performed in the teacher network for each input training instance. M softmax probability outputs are generated for each input training instance and the mutual information is calculated as the uncertainty of the training instance; where M is a constant.

8. A whole-slide cervical cytology image classification system, characterized in that: include: An acquisition module, used for acquiring a full-slice cervical cytology image and dividing it into a number of image blocks; A calling module is used to obtain the positive probability of each image block by calling a pre-trained instance-level classifier; A classification module is used to obtain a preset maximum number of positive probabilities among the positive probabilities of each image block and take the average to obtain a mean positive probability, and obtain a classification result of the full-slice cervical cytology image based on the mean positive probability; The pre-trained instance-level classifier is obtained in the following way: An initial instance-level classifier is constructed, and based on the initial instance-level classifier, a student network and a teacher network are constructed based on the teacher-student architecture; a weakly supervised dynamic weighting strategy and a contrastive self-supervised learning method are introduced to train the student network, and the teacher network is updated by exponential moving average; the uncertainty of the training instance is calculated according to the uncertainty-based self-correction strategy of the teacher network, and reliable training instances are obtained based on the uncertainty and pseudo labels are regenerated to train the student network using a fully supervised training method to obtain a pre-trained instance-level classifier.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the whole-slide cervical cytology image classification method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the whole-slide cervical cytology image classification method according to any one of claims 1 to 7 are implemented.