Prototype purity pseudo-label based pathological whole slide weakly supervised classification model training method, slide level and tile level classification method, readable storage medium

CN122990381APending Publication Date: 2026-10-27SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611223158.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-10-27

Smart Images

  • Figure CN122990381A_ABST
    Figure CN122990381A_ABST
Patent Text Reader

Abstract

The application discloses a pathological whole slice weak supervision classification model training method based on prototype purity pseudo label, a slice level and a block level classification method and a readable storage medium. The training method comprises the following steps: acquiring a whole slice image, and pre-processing the whole slice image; extracting an example feature vector; constructing a training set semantic prototype; counting a class balance prototype purity; determining a selected area of each class; assigning a pseudo label to an image example; and optimizing deep learning model parameters in a manner of minimizing a total training loss function to obtain a trained pathological whole slice weak supervision classification model. The application can obtain class-specific local example supervision from weak slice labels without example level manual labeling and package model attention mining, and can output slice classification results, example classification results and pathological evidence heat maps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a training method for a weakly supervised classification model of whole pathological slides based on prototype purity pseudo-labels, slide-level and patch-level classification methods, and a readable storage medium. Background Technology

[0002] Whole-slide images (WSI) in pathology typically have ultra-high resolution, with a single image containing tens of thousands to hundreds of thousands of local image patches, making them difficult to directly input into conventional neural networks. Existing computational pathology methods usually divide a whole-slide image into multiple local image patches, treating the entire slide as a bag and the image patches as instances within the bag, and using slide-level diagnostic labels to train a multi-instance learning model.

[0003] Multi-instance learning models can classify slides with only slide-level labels, but correct slide-level classification does not necessarily mean that the model can reliably identify local evidence corresponding to the target pathological category. Especially in tumor subtype classification tasks, a single slide often contains subtype-specific regions, normal or negative tissue, non-specific morphologies shared by multiple subtypes, and preparation artifacts. If slide labels are directly assigned to all image patches in the package, a large number of incorrect instance-level labels will be generated.

[0004] Existing methods often generate example-level supervision signals based on attention scores, bag-level model predictions, teacher model outputs, pure negative slice sample correction, or spatial smoothing results. These methods may rely on the internal behavior of a pre-trained multi-example learning model and are prone to inheriting attention biases or shortcut features; in tasks with only multiple target subtypes and a lack of pure negative slice samples, it is also difficult to construct reliable example-level labels using the positive / negative bag hypothesis.

[0005] Currently, existing methods still have the following drawbacks: Example-level annotation is costly. Pathological images contain a huge number of blocks, and annotating them block by block or pixel by pixel requires a significant investment of time from pathologists. Furthermore, subtype-specific evidence may have blurred boundaries and subjective differences. Packet-level labels cannot be directly inherited by all instances. If a large number of image patches within the same slice lack evidence of the target subtype, directly inheriting packet-level labels will result in severe label noise. Packet-level high performance is inconsistent with example-level reliability. Packet-level models can rely on a small number of highly discriminative image patches to complete classification, but the judgment of examples in other relevant regions may still be inaccurate; False labels generated by attention or model prediction are easily affected by model bias. If the bag-level model focuses on non-specific regions, the example-level labels will further amplify this bias.

[0006] Pursuing only coverage may lead to the selection of common but not specific patterns. If maximizing coverage is prioritized, shared organizations that frequently appear in multiple categories may be incorrectly selected as category evidence.

[0007] Therefore, there is a need for a method that does not rely on the attention output of the bag-level model and can directly extract class-specific example supervision from weak slice labels and base model features. Summary of the Invention

[0008] To address the aforementioned shortcomings in existing technologies, the present invention provides a training method for a weakly supervised classification model of pathological whole slides based on prototype purity pseudo-labels, slide-level and tile-level classification methods, and a readable storage medium. These solutions resolve the problems of high annotation costs, inability to directly inherit all instances, inconsistent reliability between package-level and instance-level methods, susceptibility of pseudo-labels to model bias, and insufficient category recognition accuracy in existing technologies.

[0009] To achieve the aforementioned objectives, the technical solution adopted in this invention is: a training method for a weakly supervised classification model of whole pathological slides based on prototype purity pseudo-labels, comprising: Obtain the full slice image, preprocess the full slice image to obtain several image patches, denoted as image examples; Extracting example feature vectors from image patches; Constructing semantic prototypes for the training set based on example feature vectors from image patches; Based on the semantic prototype statistics of the training set, the prototype purity is balanced according to the categories. The prototype priority is determined by balancing the prototype purity according to the category, and the selected area for each category is determined according to the prototype priority. Assign pseudo-labels to image examples based on the selected region and the set of allowed labels; The total training loss function is calculated based on pseudo-labels and example feature vectors; By optimizing the parameters of the deep learning model by minimizing the total training loss function, a well-trained weakly supervised classification model for whole pathological slides is obtained.

[0010] Further, a full-slice image is acquired, and the full-slice image is preprocessed to obtain several image patches, including: Obtain whole-slice images of pathology with slice-level labels, and denote them as the training package; Tissue region detection is performed on the whole pathological slide image to generate a tissue region mask; Based on tissue region masking, the white background region in the whole pathological slide image is removed to obtain the effective tissue region; The effective tissue region is cut into non-overlapping blocks to obtain several non-overlapping image blocks; The methods for generating tissue region masks include grayscale thresholding, color space thresholding, and tissue detection methods.

[0011] Furthermore, the extraction of example feature vectors based on image patches specifically involves inputting each image patch into a pre-trained pathological image encoder to obtain example feature vectors.

[0012] Furthermore, a semantic prototype of the training set is constructed based on example feature vectors of image patches, including: All example feature vectors are subjected to L2 normalization; the normalized example feature vectors are then clustered using K-means to obtain k non-overlapping prototype regions, which are the semantic prototypes of the training set.

[0013] Furthermore, based on the semantic prototype statistical category balance of the training set, prototype purity is achieved, including: Count the number of slice examples of different target categories in the semantic prototype of the training set; Normalization is performed based on the number of slices by category, and the expression is as follows:

[0014] In the formula, For the first semantic prototypes of the training set Target Category Percentage of slice examples; For the first semantic prototypes of the training set Target Category The number of slice examples; For the target category in the semantic prototype of all training sets The number of slice examples; The expression for calculating the class-balanced prototype purity is as follows:

[0015] In the formula, For training set semantic prototypes Category Category balance purity; For the first semantic prototypes of the training set Target Category Percentage of slice examples; This represents the set of target categories.

[0016] Furthermore, prototype priority is determined by balancing prototype purity according to category, and the selected area for each category is determined based on the prototype priority, including: For each target category, the semantic prototypes of the entire training set are sorted from high to low according to the category-balanced prototype purity to obtain the sorted prototype sequence; Establish a set of selected prototypes for each target category, and initialize the set of selected prototypes to an empty set; Based on the sorted prototype sequence, the semantic prototypes of the training set with the highest purity of the category-balanced prototypes are added to the selected prototype set in turn. After each addition of a training set semantic prototype to the selected prototype set, the number of image examples belonging to the current selected prototype set in each training bag of the target category is counted. Determine whether the number of image examples belonging to the currently selected prototype set in each training bag of the target category is greater than or equal to a preset threshold; If so, the current set of selected prototypes is used as the selected region of the target category; otherwise, the process of adding the semantic prototypes of the training set with the highest purity of the category-balanced prototypes to the set of selected prototypes is repeated until the number of image examples belonging to the current set of selected prototypes in each training bag of the target category is greater than or equal to a preset threshold.

[0017] Furthermore, pseudo-labels are assigned to image examples based on the selected region and the set of allowed labels, specifically:

[0018] In the formula, Indicates the first The first in Zhang Quan slice image The pseudo-labels corresponding to the image examples; For the first Category labels for Zhang Quan's slice images; Indicate target category The selected area; Indicates the set of allowed tags; Indicates the target category Complementary categories.

[0019] Furthermore, the total training loss function is:

[0020]

[0021]

[0022] In the formula, Represents the total training loss function; Represents the packet-level loss function; Indicates the example loss function; Indicates the example-level loss weights; Indicates the total number of samples; Represents the cross-entropy loss function; Indicates the first Example package consisting of Zhang Quan's sliced ​​images; This indicates that the packet-level classifier is for the first... Prediction results of the example package composed of Zhang Quan's slice images; This indicates that the example-level classifier is for the first... The first in Zhang Quan slice image Prediction results for one image example; This represents the set of image example indices with assigned pseudo-labels in a full-slice image.

[0023] This invention also provides a method for classifying whole pathological slides, comprising: Obtain the full slice image to be tested; The whole slice image to be tested is input into the classification model to obtain the class probability of the whole slice image to be tested and the class probability of each image patch in the whole slice image to be tested; The classification model was trained using a weakly supervised classification model training method based on prototype purity pseudo-labels for pathological whole slides.

[0024] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of a training method for a weakly supervised classification model of whole pathological slides based on prototype purity pseudo-labels.

[0025] The beneficial effects of this invention are as follows: 1. No example-level or pixel-level training annotations are required. The method generates example supervision using only slice-level labels and frozen base model features, reducing the annotation costs for pathology experts. This makes the construction of AI-assisted diagnostic systems more efficient and economical, and significantly improves their feasibility and interpretability for clinical application.

[0026] 2. Reduce reliance on internal attention or prediction scores within the bag model. Pseudo-labels are derived from cross-slice prototype statistics, eliminating the need to first train a bag-level teacher model to mine examples. Instead, stable and reliable example-level supervision signals are obtained directly in the feature space through cross-slice statistics on the clustering distribution and activation frequency of prototypes for each pathology category. This effectively avoids excessive dominance of the bag model in the example mining process, reduces the coupling of the training process, and saves the training overhead of the bag-level teacher model, making the entire learning process simpler, more efficient, and more robust.

[0027] 3. Class-balanced purity mitigates bias caused by differences in class sample size. By normalizing the number of packages, the association between prototypes and classes is primarily determined by class specificity rather than package quantity. This effectively avoids the statistical advantage that classes with a larger number of packages may have due to their larger sample size. This ensures that the prototype's relevance score more accurately reflects its consistency with the inherent semantic features of the class, rather than being swayed by the number of packages. The prototype selection for each class reflects the essential characteristics of each class more evenly and fairly, ensuring that the association between prototypes and classes is driven by class specificity, rather than being diluted or distorted by the number of packages. This significantly improves the model's robustness and generalization ability in long-tailed distribution scenarios.

[0028] 4. Prioritizing purity helps distinguish between category-specific evidence and shared patterns. The coverage threshold only guarantees the amount of supervision and does not prioritize high-frequency but low-purity prototypes. This ensures that the final prototype set is mainly composed of category-specific evidence, supplemented only by shared patterns when necessary. Thus, while ensuring sufficient training, the discriminative purity of the prototype set is maintained to the greatest extent.

[0029] 5. Packet consistency filtering can avoid obviously contradictory pseudo-labels. Examples that cannot be reliably determined can remain unassigned and not participate in the example loss, effectively balancing the sufficiency and reliability of supervision information, so that example-level training still has high credibility in weakly labeled environments.

[0030] 6. Model compatibility. The module for generating pseudo-labels can be connected to different pathological encoders and multi-example learning backbones with example branches, significantly reducing R&D adaptation costs and engineering complexity. Furthermore, it enables the module to stably generate high-quality example-level supervision signals under different encoder and backbone configurations, resulting in consistent performance improvements and more accurate lesion localization. At the same time, it effectively avoids the risk of amplified attention bias that may be introduced by strong encoders, making it a universal, efficient, and robust weakly supervised learning enhancement plugin. Attached Figure Description

[0031] Figure 1 Flowchart of a weakly supervised classification model training method for whole pathological slides based on prototype purity pseudo-labels provided for an example; Figure 2 A flowchart for calculating the purity of the category balance prototype is provided for the embodiments. Figure 3 This is a schematic diagram illustrating the integration of the prototype purity-driven pseudo-label method into a multi-instance learning framework, as provided in the embodiment. Detailed Implementation

[0032] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0033] The core of this invention is not to directly infer example labels from the package-level labels or model scores of individual examples, but rather to first construct semantic local regions in the feature space. Weak slice labels may be noisy for individual examples, but when a large number of semantically similar examples are aggregated into the same prototype region, the proportion of class balance of this prototype in different class slices can reflect its class specificity.

[0034] For each target category, this invention sorts prototypes from highest to lowest purity, prioritizing the prototypes with the strongest category specificity. The coverage threshold serves only as a sufficiency constraint, ensuring that each target category slice contains at least a predetermined number of selected examples without altering the "purity-first" selection principle. For prototypes selected by multiple categories simultaneously, conflict resolution is performed based on the highest purity. Subsequently, consistency filtering is performed according to the package-level label to which the example belongs, avoiding the generation of pseudo-labels that contradict the package-level label.

[0035] In one embodiment of the present invention, the training method for a weakly supervised classification model of whole pathological slides based on prototype purity pseudo-labels includes the following steps: S1. Obtain the full slice image, preprocess the full slice image to obtain several image blocks, denoted as image examples.

[0036] Specifically, it includes: Obtain whole-slice images of pathology slides with slice-level labels, and denote this as the training package. ,in Indicates the first Example package consisting of Zhang Quan's sliced ​​images, For the known package-level category label of this slice, The number of training slices. (Package) Include Example of an image patch: , Indicates the first The first in Zhang Quan slice image An example of an image patch.

[0037] The target category set is denoted as For classification tasks that only contain multiple target subtypes, the package-level label space... With the target category set The same; for classification tasks that simultaneously include pure negative slide samples, the bag-level label space It also includes the negative label 0, i.e. The instance-level output space consists of target categories and complementary classes ⊥. Complementary classes are used to represent examples that should not receive target subtype labels, such as negative tissues, shared morphologies, non-specific morphologies, and artifacts.

[0038] set up For the example space, each image is an example. With potential target concept support set .in, Example The semantic patterns appear in the target category with a non-negligible probability. In the package. Image example. The singleton support tag is defined as follows:

[0039] Among them, complementary categories This is used to represent true negative tissue, morphologies shared by multiple categories, non-specific morphologies, and artifacts. This invention does not assume that all examples within the same package should inherit package-level labels; instead, it aims to identify examples that can independently support a specific target category. Direct observation is not performed during the training phase. Instead, pseudo-labels are generated through subsequent category-balanced prototype purity estimation, purity-priority coverage selection, and package-level label consistency filtering. As a supervisory signal for the example classifier.

[0040] Tissue region detection is performed on the whole pathological slice image to generate a tissue region mask.

[0041] Based on tissue region masking, the white background region in the whole pathological slide image is removed to obtain the effective tissue region.

[0042] In this embodiment, at a magnification of 40x, the effective tissue area is divided into non-overlapping blocks to obtain a non-overlapping image block of size 512×512 pixels.

[0043] The methods for generating tissue region masks include grayscale thresholding, color space thresholding, and tissue detection methods.

[0044] S2. Extract example feature vectors based on image patches.

[0045] Each image patch is input into a pre-trained pathology image encoder (pathology baseline model). This yields the example feature vector: .

[0046] In this embodiment, a pathological baseline model such as CONCH or UNI is used and kept frozen during prototype construction and subsequent multi-instance learning to ensure feature space stability and reduce training costs. Instance features can be saved offline for reuse in clustering and model training. The subsequent steps remain unchanged when using other frozen encoders capable of generating pathological semantic features.

[0047] S3. Construct a semantic prototype of the training set based on example feature vectors of image patches.

[0048] By summarizing the example features from all training sets and performing clustering in a unified feature space, k non-overlapping prototype regions are obtained. Each prototype corresponds to a local semantic region in the feature space, and image patches with similar semantics are assigned to the same prototype.

[0049] First, L2 normalization is performed on all example feature vectors; then, K-means clustering is performed on the normalized example feature vectors to obtain... k The CONCH dataset consists of 512 non-overlapping prototype regions, which are the semantic prototypes of the training set. UNI's 1024-dimensional features are used The number of K-means iterations can be set to 20. The number of prototypes can be adjusted according to the feature dimension and data size, but the subsequent purity estimation, sorting, and coverage selection rules remain unchanged.

[0050] S4. Balance prototype purity based on training set semantic prototype statistics and categories.

[0051] like Figure 2 As shown, it specifically includes: Count the number of slice examples of different target categories in the semantic prototype of the training set; Normalization is performed based on the number of slices by category, and the expression is as follows:

[0052] In the formula, For the first semantic prototypes of the training set Target Category Percentage of slice examples; For the first semantic prototypes of the training set Target Category The number of slice examples; For the target category in the semantic prototype of all training sets The number of slice examples; The expression for calculating the class-balanced prototype purity is as follows:

[0053] In the formula, For training set semantic prototypes Category Category balance purity; For the first semantic prototypes of the training set Target Category Percentage of slice examples; This represents the set of target categories.

[0054] The larger the value, the better the prototype is in terms of the balance of the number of categories. The more concentrated the occurrence in the category In the slices. If a prototype is prevalent in multiple categories of slices, and the purity of each category is similar, it is more likely to correspond to a shared or non-specific morphology.

[0055] S5. Determine prototype priority based on prototype purity according to category, and determine the selected area for each category based on prototype priority.

[0056] Specifically, it includes: For each target category The semantic prototypes of the entire training set are sorted from high to low according to the category-balanced prototype purity to obtain the sorted prototype sequence. Establish a set of selected prototypes for each target category. And initialize the selected prototype set to an empty set; Based on the sorted prototype sequence, the semantic prototypes of the training set with the highest purity of the category-balanced prototypes are added to the selected prototype set in turn. After each addition of a training set semantic prototype to the selected prototype set, the number of image examples belonging to the current selected prototype set in each training bag of the target category is counted. Determine whether the number of image examples belonging to the currently selected prototype set in each training bag of the target category is greater than or equal to a preset threshold. ; If so, the current set of selected prototypes is used as the selected region of the target category; otherwise, the process of adding the semantic prototypes of the training set with the highest purity of the category-balanced prototypes to the set of selected prototypes is repeated until the number of image examples belonging to the current set of selected prototypes in each training bag of the target category is greater than or equal to a preset threshold.

[0057] First, prototype priority is determined based on purity, then a coverage threshold is used to ensure the number of supervised samples. Coverage constraints do not directly compare the total frequency of prototype occurrences, thus reducing the risk of preferentially selecting high-frequency shared patterns into the target category. The final number of selected examples can differ across different packages, only requiring the minimum number of covered packages to reach the threshold. The same prototype may be selected simultaneously by multiple category selection processes. For this prototype, its purity across candidate categories is compared, and it is assigned to the category with the highest purity, ensuring that the final selection regions of different categories do not overlap. For data containing negative slices, negative slice samples are not included in the coverage stopping condition for the target category prototypes.

[0058] S6. Assign pseudo-labels to the image example based on the selected region and the set of allowed labels.

[0059] Specifically:

[0060] In the formula, Indicates the first The first in Zhang Quan slice image The pseudo-labels corresponding to the image examples; For the first Category labels for Zhang Quan's slice images; Indicate target category The selected area; This represents the set of allowed tags. Among them, complementary tags... It is used to provide negative example-level supervision signals; unassigned examples do not participate in example-level loss. Through this mechanism, this method prioritizes ensuring the reliability of pseudo-labels rather than forcibly assigning categories to all examples.

[0061] S7. Calculate the total training loss function based on pseudo-labels and example feature vectors.

[0062] The total training loss function is:

[0063]

[0064]

[0065] In the formula, Represents the total training loss function; Represents the packet-level loss function; Indicates the example loss function; Indicates the example-level loss weights; Indicates the total number of samples; Represents the cross-entropy loss function; Indicates the first Example package consisting of Zhang Quan's sliced ​​images; This indicates that the packet-level classifier is for the first... Prediction results of the example package composed of Zhang Quan's slice images; This indicates that the example-level classifier is for the first... The first in Zhang Quan slice image Prediction results for one image example; This represents the set of image example indices with assigned pseudo-labels in a full-slice image.

[0066] In practice, the specific steps for generating pseudo-tags are executed by the pseudo-tag generation module. For example... Figure 3 As shown, the pseudo-label generation module integrates with a multi-instance learning framework that simultaneously features package-level and instance-level branches. Package-level classifier Receive all example features from a training bag, aggregate them, and predict the bag-level category; Example Classifier Predict the category for a single example feature. The bag-level loss is the average cross-entropy over the entire training set, while the example-level loss is calculated only on examples that have been assigned pseudo-labels.

[0067] S8. Optimize the parameters of the deep learning model by minimizing the total training loss function to obtain a well-trained weakly supervised classification model for whole pathological slides.

[0068] The test full-slice image employs the same tissue region extraction, slicing, and image encoder feature extraction process as the training phase. The bag-level branch outputs the class probability of the entire full-slice image, while the example branch outputs the class probability of each image patch within the full-slice image. The inference phase does not require re-performing the training set prototype selection, nor does it require manual annotation at the example level.

[0069] In one feasible embodiment of the present invention, pathological whole slide data containing only multiple target subtypes are used as an example. Each slide has only one subtype label, and pure negative slides and example-level training annotations are not provided.

[0070] 1. Divide the effective tissue into 512×512 pixel non-overlapping image blocks at 40x magnification; 2. Extract example features using the CONCH or UNI basic pathological model; 3. Use K-means to cluster all training example features. For CONCH and UNI features, set the number of prototypes to 100 and 2000 respectively, and the number of iterations to 20. 4. Count the number of examples in different subtype slices for each prototype, and normalize them according to the number of training slices for each subtype to obtain the class balance purity; 5. For each subtype, select prototypes in descending order of purity to cover the threshold. Setting it to 5 means that each slice of each subtype must have at least 5 examples falling into the selected prototype; 6. When a class conflict occurs within the same prototype, it is assigned to the subtype with the highest purity. For subtypes... The slice is only allowed to have the example pseudo-tag as... or complementary ; 7. Integrate pseudo-labels into a multi-instance learning model (deep learning model) with instance branches, using instance-level loss weights. Set it to 0.3.

[0071] 8. Train using the Adam optimizer, with a learning rate set to... Weight decay is set to During training, the batch size of the sample at the package level is 1, and the maximum number of training rounds is 100.

[0072] This embodiment is applicable to multi-subtype classification tasks such as breast cancer subtypes, lung cancer subtypes, or other subtypes without explicit negative sections.

[0073] In another feasible embodiment of the invention, a multi-category pathology task containing negative slides is used as an example.

[0074] When the sample data contains both target subtype slices and pure negative slices, the pseudo-label assignment strategy is still performed on the target subtype samples. The negative sample is directly labeled with a package-level tag for all its examples. This approach utilizes negative samples to provide a reliable negative example supervision signal, while still identifying specific examples of each lesion category through prototype purity. It is suitable for pathology data that simultaneously contains normal, benign, and multiple lesion subtypes.

[0075] Training, validation, and test sets can be partitioned at the slice level to ensure that examples from the same slice do not leak across sets. An example implementation can use four-fold cross-validation, with each fold partitioning training, validation, and test samples in a 2:1:1 ratio. The validation set is used for early stopping and model selection, while the test set is used for final slice-level and example-level evaluation.

[0076] Slice-level evaluation uses macro averaging (A commonly used metric for evaluating the overall performance of a multi-class classification model). Example-level evaluation uses a macro-average of the complete label space. Macro average that only averages the target category but retains negative examples And the macro-average that evaluates subtype discrimination ability only in foreground examples. Example-level manual annotations are used only for evaluation and are not involved in training or prototype purity estimation.

[0077] Given a set of test examples For any set of evaluation example indices Define sample set complementary example set Then the category The one-vs-rest AUC (one-to-many AUC) can be written as: , in This is an example classifier for the first... The examples belong to the category Output predicted probability scores; This is an example classifier for the first... The examples belong to the category The output is the predicted probability score.

[0078] Define the complete set of examples and the foreground examples: , The macro average of the complete label space. A macro average that takes the average only over the target category but retains negative examples. Macro-average of subtype discrimination ability is evaluated only in foreground examples. .in Refers to the complete example tag space The normalized probability calculated on the above, This refers to the instance tag space after removing the negative class. The probability calculated using normalization.

[0079] To verify the beneficial effects of the present invention, this embodiment conducted ablation experiments on the publicly available pathological whole-slice dataset TCGA-BRCA-Invasive. This dataset consists of whole-slice images of invasive breast cancer in TCGA-BRCA. All three sets of experiments used the same data partitioning, CONCH feature extractor, CLAM backbone network and training parameters, and only the prototype purity pseudo-label related modules were subjected to progressive ablation. The first group is the CLAM baseline model, which uses only slice-level labels for bag-level supervised training and does not introduce instance pseudo-label supervision based on prototype purity. The second group is CLAM + prototype purity pseudo-label (without class balance), which introduces prototype clustering and prototype purity estimation on the basis of CLAM, and assigns pseudo-labels to instances that meet the conditions according to prototype purity. It further uses the obtained pseudo-labels for instance-level auxiliary supervision, but directly uses the original training data distribution in the prototype purity statistics process without class balance processing. The third group is CLAM + full prototype purity driven pseudo-label method (this invention), which further introduces a class balance mechanism on the basis of the second group. When calculating prototype purity, it balances the contributions of different slice classes to reduce the bias caused by the difference in the number of class samples on prototype purity estimation. The experimental results are shown in Table 1.

[0080] Table 1

[0081] The above ablation results show that class-balanced prototype purity primarily improves example-level supervision: the complete method (this invention) compared to the CLAM baseline, , and The AUCs increased from 83.51, 81.15, and 77.16 to 86.39, 85.40, and 79.33, respectively, while the packet-level AUC remained relatively stable.

[0082] In independent pseudo-label quality assessment, the same example classifier was trained using pseudo-labels generated by each method. The prototype purity-driven pseudo-label method achieved high scores on TCGA-PanGlioma. 76.91 For 84.81, The score is 94.65, and it achieves 78.64, 78.44, and 79.70 on BRACS, which is generally better than the compared text similarity, attention score, coverage priority, and model-internal pseudo-label methods. This result shows that class-balanced prototype purity can form a more reliable example training signal.

[0083] This invention effectively alleviates the class imbalance problem in pathological whole-slice classification by introducing a class balancing mechanism and prototype purity pseudo-labels, and improves the model's robustness to weakly supervised noisy labels. Joint optimization of bag-level and instance-level loss functions enables the model to learn both global and local features simultaneously.

Claims

1. A training method for a weakly supervised classification model of whole pathological slides based on prototype purity pseudo-labels, characterized in that, include: Obtain the full slice image, preprocess the full slice image to obtain several image patches, denoted as image examples; Extracting example feature vectors from image patches; Constructing semantic prototypes for the training set based on example feature vectors from image patches; Based on the semantic prototype statistics of the training set, the prototype purity is balanced according to the categories. The prototype priority is determined by balancing the prototype purity according to the category, and the selected area for each category is determined according to the prototype priority. Assign pseudo-labels to image examples based on the selected region and the set of allowed labels; The total training loss function is calculated based on pseudo-labels and example feature vectors; By optimizing the parameters of the deep learning model by minimizing the total training loss function, a well-trained weakly supervised classification model for whole pathological slides is obtained.

2. The method according to claim 1, characterized in that, Obtain the full-slice image, preprocess the full-slice image to obtain several image patches, including: Obtain whole-slice images of pathology with slice-level labels, and denote them as the training package; Tissue region detection is performed on the whole pathological slide image to generate a tissue region mask; Based on tissue region masking, the white background region in the whole pathological slide image is removed to obtain the effective tissue region; The effective tissue region is cut into non-overlapping blocks to obtain several non-overlapping image blocks; The methods for generating tissue region masks include grayscale thresholding, color space thresholding, and tissue detection methods.

3. The method according to claim 1, characterized in that, The specific method for extracting example feature vectors based on image patches is as follows: each image patch is input into a pre-trained pathological image encoder to obtain example feature vectors.

4. The method according to claim 1, characterized in that, The semantic prototype of the training set is constructed based on example feature vectors of image patches, including: All example feature vectors are subjected to L2 normalization; the normalized example feature vectors are then clustered using K-means to obtain k non-overlapping prototype regions, which are the semantic prototypes of the training set.

5. The method according to claim 2, characterized in that, Based on the semantic prototype statistical category balancing of the training set, the prototype purity is achieved, including: Count the number of slice examples of different target categories in the semantic prototype of the training set; Normalization is performed based on the number of slices by category, and the expression is as follows: In the formula, For the first semantic prototypes of the training set Target Category Percentage of slice examples; For the first semantic prototypes of the training set Target Category The number of slice examples; For the target category in the semantic prototype of all training sets The number of slice examples; The expression for calculating the class-balanced prototype purity is as follows: In the formula, For training set semantic prototypes Category Category balance purity; For the first semantic prototypes of the training set Target Category Percentage of slice examples; This represents the set of target categories.

6. The method according to claim 5, characterized in that, Prototype priority is determined by balancing prototype purity according to category, and the selected area for each category is determined based on prototype priority, including: For each target category, the semantic prototypes of the entire training set are sorted from high to low according to the category-balanced prototype purity to obtain the sorted prototype sequence; Establish a set of selected prototypes for each target category, and initialize the set of selected prototypes to an empty set; Based on the sorted prototype sequence, the semantic prototypes of the training set with the highest purity of the category-balanced prototypes are added to the selected prototype set in turn. After each addition of a training set semantic prototype to the selected prototype set, the number of image examples belonging to the current selected prototype set in each training bag of the target category is counted. Determine whether the number of image examples belonging to the currently selected prototype set in each training bag of the target category is greater than or equal to a preset threshold; If so, the current set of selected prototypes is used as the selected region of the target category; otherwise, the process of adding the semantic prototypes of the training set with the highest purity of the category-balanced prototypes to the set of selected prototypes is repeated until the number of image examples belonging to the current set of selected prototypes in each training bag of the target category is greater than or equal to a preset threshold.

7. The method according to claim 6, characterized in that, Pseudo-labels are assigned to image examples based on the selected region and the set of allowed labels, specifically: In the formula, Indicates the first The first in Zhang Quan slice image The pseudo-labels corresponding to the image examples; Indicates the first The first in Zhang Quan slice image One image example; For the first Category labels for Zhang Quan's slice images; Indicate target category The selected area; Indicates the set of allowed tags; Indicates the target category Complementary categories.

8. The method according to claim 7, characterized in that, The total training loss function is: In the formula, Represents the total training loss function; Represents the packet-level loss function; Indicates the example loss function; Indicates the example-level loss weights; Indicates the total number of samples; Represents the cross-entropy loss function; Indicates the first Example package consisting of Zhang Quan's sliced ​​images; This indicates that the packet-level classifier is for the first... Prediction results of the example package composed of Zhang Quan's slice images; This indicates that the example-level classifier is for the first... The first in Zhang Quan slice image Prediction results for one image example; This represents the set of image example indices with assigned pseudo-labels in a full-slice image.

9. A method for classifying pathological whole slides at the slice level and the tile level, characterized in that, include: Obtain the full slice image to be tested; The whole slice image to be tested is input into the classification model to obtain the class probability of the whole slice image to be tested and the class probability of each image patch in the whole slice image to be tested; The classification model is trained using the training method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer program is stored therein, and when the computer program is executed by a processor, the processor performs the steps of the training method for a weakly supervised classification model of pathological whole slides based on prototype purity pseudo-labels as described in any one of claims 1 to 8.