Semi-supervised medical image classification method and system based on similarity threshold pseudo label
By employing a similarity threshold pseudo-label method in medical image classification, using a confidence threshold to select unlabeled data, and combining multiple loss functions, the problem of low utilization of unlabeled data is solved, thereby improving the accuracy and efficiency of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHENGZHOU UNIV
- Filing Date
- 2024-12-13
- Publication Date
- 2026-05-12
AI Technical Summary
Existing semi-supervised learning methods have low utilization of unlabeled data in medical image classification, and high threshold selection of pseudo-labels leads to the neglect of low threshold data, while low threshold selection of pseudo-labels may lead to a decrease in accuracy.
A pseudo-labeling method based on similarity thresholds is adopted. Unlabeled data is selected and pseudo-labeled by using a confidence threshold. The model is trained by combining high-confidence and low-confidence unsupervised loss functions and utilizing more high-quality unlabeled data.
It improves the robustness of model training and the accuracy of medical image classification, and effectively utilizes more unlabeled data without reducing the accuracy of pseudo-labels.
Smart Images

Figure CN119785086B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image recognition technology, and in particular to a semi-supervised medical image classification method and system based on similarity threshold pseudo-labels. Background Technology
[0002] Deep learning has achieved significant results in the field of medical image classification. However, constructing large-scale medical image datasets is costly, and the annotation of medical images typically requires the participation of professional doctors or experts, consuming considerable time and human resources. Given the current difficulty in obtaining labeled medical image data, semi-supervised medical image classification aims to improve the performance of classification models by utilizing a small amount of labeled data and a large amount of unlabeled data. Currently, advanced semi-supervised learning methods are based on specific natural image classification tasks, and these methods have not been well studied in the field of medical image classification. Therefore, how to effectively extend advanced semi-supervised image classification methods to the field of medical image classification, making them applicable to medical image classification tasks, has extremely high research value and development prospects. Therefore, research on semi-supervised classification of medical images is very meaningful, as it can save significant time and human resources, improve model performance, and thus help doctors make more accurate and timely diagnoses of patients.
[0003] In the field of medical imaging, semi-supervised learning methods can help improve model performance by utilizing unlabeled medical image data. Pseudo-labeling and consistency regularization are two key techniques in semi-supervised learning. Iterative training of the model with incorrect pseudo-labels can lead to confirmation bias. To address this, some methods use high thresholds to select pseudo-labels, increasing their reliability because samples with high thresholds are more likely to be reliable by the model. This reduces noise introduced by pseudo-labels. However, these methods have a significant drawback: they always rely on high thresholds to generate pseudo-labels, causing them to ignore a large amount of unlabeled data with low thresholds. While lowering the threshold improves the utilization of unlabeled data, it may lead to a decrease in the accuracy of pseudo-labeling. Summary of the Invention
[0004] To address this issue, the present invention provides a semi-supervised medical image classification method and system based on similarity threshold pseudo-labels, which solves the problem of low utilization of unlabeled data in existing semi-supervised learning methods for classifying and recognizing medical images.
[0005] According to the design scheme provided by this invention, on the one hand, a semi-supervised medical image classification method based on similarity threshold pseudo-labels is provided, comprising:
[0006] Obtain a medical image dataset and divide it into a training set, a validation set, and a test set according to a preset ratio. The training set is further divided into an unlabeled dataset and a labeled dataset with medical image classification labels according to the labeling ratio.
[0007] A medical image classification model is constructed, and a model training loss function is set. The model training loss function includes: supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss. The supervised loss is obtained by training the model on a labeled dataset. The high-confidence unsupervised loss is obtained by training the model on a portion of unlabeled data in the unlabeled dataset whose confidence is greater than a confidence threshold. The low-confidence unsupervised loss is obtained by training the model on another portion of unlabeled data in the unlabeled dataset whose confidence is less than a confidence threshold but whose similarity is greater than a similarity threshold.
[0008] The model is trained using a loss function and a training set. The trained model is then validated and its performance is tuned using a validation set and a test set to obtain the target model for medical image classification.
[0009] The medical image data to be processed is input into the medical image classification target model, and the medical image classification target model is used to predict and output the classification label of the medical image to be processed.
[0010] As a semi-supervised medical image classification method based on similarity threshold pseudo-labels in this invention, further, a medical image dataset is obtained, and the medical image dataset is divided into a training set, a validation set, and a test set according to a preset ratio, including:
[0011] Collect several publicly available medical image datasets of different categories, and undersample each medical image dataset to obtain a specified number of medical images under each category label;
[0012] Divide a specified number of medical images under each category label into training, validation, and test sets according to a preset ratio.
[0013] As a semi-supervised medical image classification method based on similarity threshold pseudo-labels in this invention, a medical image classification model is further constructed, comprising:
[0014] A medical image classification model is constructed based on the WideResNet wide residual network. The medical image classification model includes multiple residual blocks, and each residual block includes a convolutional layer, a batch normalization layer and a nonlinear activation function.
[0015] As a semi-supervised medical image classification method based on similarity threshold pseudo-labels in this invention, the model training loss function is further expressed as follows: Where a and β are weighting coefficients, To monitor losses, For high-confidence unsupervised loss, This represents the low-confidence unsupervised loss.
[0016] As a semi-supervised medical image classification method based on similarity threshold pseudo-labels in this invention, further, the medical image classification model is trained using a model training loss function and a training set, including:
[0017] The labeled and unlabeled datasets in the training set are sampled according to batch size. The sampled labeled data is weakly enhanced to obtain weakly enhanced labeled data. The sampled unlabeled data is weakly enhanced and strongly enhanced to obtain weakly enhanced unlabeled data and strongly enhanced unlabeled data, respectively. The weak enhancement is to enhance the image by randomly flipping and translating the image. The strong enhancement is to randomly select and combine multiple image transformation operations to enhance the image. The multiple image transformation operations include: image rotation, image flipping, image cropping and image color transformation.
[0018] Weakly enhanced labeled data is input into a medical image classification model to obtain the corresponding first medical classification output probability distribution; weakly enhanced unlabeled data is input into a medical classification model to obtain the corresponding second medical classification output probability distribution.
[0019] The supervised loss is calculated based on the output probability distribution of the first medical classification, and the average of the probability distributions of the first medical classification output probability distributions with a confidence level greater than the confidence threshold and predicted as the correct label category is taken as the class representative probability distribution of the corresponding label category; the confidence level of the second medical classification output probability distribution is compared with the confidence threshold.
[0020] For unlabeled data with a confidence level greater than the confidence threshold, the corresponding pseudo-label is predicted based on the probability distribution output by the second medical classification. The strong enhancement corresponding to the unlabeled data with the predicted pseudo-label is input into the medical image classification model to obtain the corresponding probability distribution, and the high-confidence unsupervised loss is calculated with the corresponding pseudo-label.
[0021] For unlabeled data with confidence scores less than the confidence threshold, the similarity calculation is performed between the output probability distribution of the second medical classification and the class probability distribution corresponding to the highest probability class. For unlabeled data with similarity scores greater than the similarity threshold, pseudo-labels are predicted. The strong enhancement corresponding to the unlabeled data with predicted pseudo-labels is input into the medical image classification model to obtain the corresponding probability distribution, and low-confidence unsupervised loss is calculated with the corresponding pseudo-labels.
[0022] The total training loss of the model is obtained based on supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss, and the model parameters are updated by backpropagation based on the total training loss for iterative training.
[0023] Furthermore, this invention also provides a semi-supervised medical image classification system based on similarity threshold pseudo-labels, comprising: a sample collection module, a model building module, a model training module, and an image classification module, wherein...
[0024] The sample collection module is used to acquire medical image datasets and divide the medical image datasets into training set, validation set and test set according to a preset ratio. The training set is divided into unlabeled dataset and labeled dataset with medical image classification labels according to the labeling ratio.
[0025] The model building module is used to build a medical image classification model and set the model training loss function. The model training loss function includes: supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss. The supervised loss is obtained by training the model on the labeled dataset. The high-confidence unsupervised loss is obtained by training the model on a portion of the unlabeled dataset whose confidence is greater than the confidence threshold. The low-confidence unsupervised loss is obtained by training the model on another portion of the unlabeled dataset whose confidence is less than the confidence threshold but whose similarity is greater than the similarity threshold.
[0026] The model training module is used to train the medical image classification model based on the model training loss function and the training set, and to validate and optimize the trained model using the validation set and test set to obtain the target model for medical image classification.
[0027] The image classification module is used to input the medical image data to be processed into the medical image classification target model, and use the medical image classification target model to predict the classification target of the medical image to be processed.
[0028] The beneficial effects of this invention are:
[0029] This invention uses similarity threshold pseudo-labeling (STPL) to utilize more unlabeled data. It calculates the representative probability distribution for each class based on labeled data, which provides more reliable category information. Unlabeled data is selected and assigned pseudo-labels based on a confidence threshold. Then, unlabeled data with a similarity greater than the similarity threshold between the probability distribution of the low-confidence portion and the corresponding class's representative probability distribution are assigned pseudo-labels. This further selects more high-quality unlabeled data for model training. Without reducing the accuracy of the pseudo-labels, this method utilizes more high-quality unlabeled data in the confidence thresholding approach, thereby improving the robustness of model training and increasing the accuracy and efficiency of medical image classification. Attached image description:
[0030] Figure 1 This is a schematic diagram of a semi-supervised medical image classification process based on similarity threshold pseudo-labels in the embodiment.
[0031] Figure 2 This is a schematic diagram of the model training process in the embodiment;
[0032] Figure 3 The diagram illustrates the pseudo-label accuracy at different confidence and similarity thresholds in the example.
[0033] Figure 4 This illustration shows the proportion of pseudo-labels during training with different confidence and similarity thresholds in the example. Detailed implementation method:
[0034] To make the objectives, technical solutions, and advantages of this invention clearer and more understandable, the invention will be further described in detail below with reference to the accompanying drawings and technical solutions.
[0035] To address the issues of accuracy and efficiency in medical image classification, this invention provides a semi-supervised medical image classification method based on similarity threshold pseudo-labels, comprising:
[0036] S101. Obtain the medical image dataset and divide it into a training set, a validation set, and a test set according to a preset ratio. The training set is divided into an unlabeled dataset and a labeled dataset with medical image classification labels according to the labeling ratio.
[0037] Specifically, several publicly available medical image datasets of different categories can be collected, and each medical image dataset can be undersampled to obtain a specified number of medical images under each category label; the specified number of medical images under each category label can be divided into training set, validation set and test set according to a preset ratio.
[0038] The large medical image dataset MedMNIST contains ten different medical image classification datasets. BloodMNIST is based on a dataset of normal cells from individuals without infection, blood disorders, or tumors, and without any drug treatment at the time of blood collection. It contains 17,092 images, each 3x28x28 pixels, divided into 8 classes. It is undersampled to 1200 images per class, and the source dataset is split into training, validation, and test sets in a 7:1:2 ratio. DermaMNIST is based on HAM10000, a large collection of multi-source dermoscopic images of common pigmented skin lesions. This dataset consists of 10,015 dermoscopic images, each 3x28x28 pixels, divided into 7 different diseases, forming a multi-class classification task. The images are split into training, validation, and test sets in a 7:1:2 ratio. Pathmnist is based on previous research for predicting the survival of colorectal cancer tissue sections. This dataset consists of 107,180 images, each 3x28x28 pixels, divided into 9 classes. The dataset was undersampled to 1000 images per class and divided into training, validation, and test sets in a 7:1:2 ratio. The training set was then divided into labeled and unlabeled datasets according to a predetermined labeling ratio.
[0039] S102. Construct a medical image classification model and set the model training loss function, wherein the model training loss function includes: supervised loss, high-confidence unsupervised loss and low-confidence unsupervised loss. The supervised loss is obtained by training the model on the labeled dataset. The high-confidence unsupervised loss is obtained by training the model on a portion of the unlabeled dataset whose confidence is greater than the confidence threshold. The low-confidence unsupervised loss is obtained by training the model on another portion of the unlabeled dataset whose confidence is less than the confidence threshold but whose similarity is greater than the similarity threshold.
[0040] Specifically, a medical image classification model can be constructed based on the WideResNet wide residual network. This model can be configured to include multiple residual blocks, each containing a convolutional layer, a batch normalization layer, and a non-linear activation function. WideResNet leverages the advantages of parallel computing by increasing the network's width, thereby reducing model training time.
[0041] The model training loss function can be expressed as: Where a and β are weighting coefficients, To monitor losses, For high-confidence unsupervised loss, This represents the low-confidence unsupervised loss.
[0042] S103. Based on the model training loss function, the medical image classification model is trained using the training set, and the trained model is validated and its performance is tuned using the validation set and test set to obtain the target model for medical image classification.
[0043] Specifically, the model training process can be designed to include:
[0044] The labeled and unlabeled datasets in the training set are sampled according to batch size. The sampled labeled data is weakly enhanced to obtain weakly enhanced labeled data. The sampled unlabeled data is weakly enhanced and strongly enhanced to obtain weakly enhanced unlabeled data and strongly enhanced unlabeled data, respectively. The weak enhancement is to enhance the image by randomly flipping and translating the image. The strong enhancement is to randomly select and combine multiple image transformation operations to enhance the image. The multiple image transformation operations include: image rotation, image flipping, image cropping and image color transformation.
[0045] Weakly enhanced labeled data is input into a medical image classification model to obtain the corresponding first medical classification output probability distribution; weakly enhanced unlabeled data is input into a medical classification model to obtain the corresponding second medical classification output probability distribution.
[0046] The supervised loss is calculated based on the output probability distribution of the first medical classification, and the average of the probability distributions of the first medical classification output probability distributions with a confidence level greater than the confidence threshold and predicted as the correct label category is taken as the class representative probability distribution of the corresponding label category; the confidence level of the second medical classification output probability distribution is compared with the confidence threshold.
[0047] For unlabeled data with a confidence level greater than the confidence threshold, the corresponding pseudo-label is predicted based on the probability distribution output by the second medical classification. The strong enhancement corresponding to the unlabeled data with the predicted pseudo-label is input into the medical image classification model to obtain the corresponding probability distribution, and the high-confidence unsupervised loss is calculated with the corresponding pseudo-label.
[0048] For unlabeled data with confidence scores less than the confidence threshold, the similarity calculation is performed between the output probability distribution of the second medical classification and the class probability distribution corresponding to the highest probability class. For unlabeled data with similarity scores greater than the similarity threshold, pseudo-labels are predicted. The strong enhancement corresponding to the unlabeled data with predicted pseudo-labels is input into the medical image classification model to obtain the corresponding probability distribution, and low-confidence unsupervised loss is calculated with the corresponding pseudo-labels.
[0049] The total training loss of the model is obtained based on supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss, and the model parameters are updated by backpropagation based on the total training loss for iterative training.
[0050] Labeled dataset X and unlabeled dataset U can be sampled according to batch size B; weak augmentation is performed on the sampled labeled data to obtain A.w (x b The sampled unlabeled data were subjected to weak and strong enhancement to obtain A. w (u b ) and A s (u b ).
[0051] The obtained A w (x b The input is fed into the model to obtain the corresponding output probability distribution p. b The obtained A w (u b The input is fed into the model to obtain the corresponding output probability distribution q. b A w (x) represents weak augmentation of image x; the supervised loss is calculated based on the probability distribution of the labeled data. Where, p b To label the data model, output the probability distribution, y b For p b For the corresponding true label, H(p,q) represents the cross-entropy of two probability distributions p and q.
[0052] The probability distribution p of the labeled data b The confidence level is greater than the confidence threshold τ c Furthermore, the average of the probability distributions of correctly predicted classes is used as the representative probability distribution of the corresponding class; the probability distribution q of the unlabeled data is used as the representative probability distribution. b Confidence level and confidence threshold τ c For comparison, samples exceeding the confidence threshold are classified according to q. b Predict pseudo-labels; strongly enhance the samples corresponding to the predicted pseudo-labels using A. s (u b The input is given to the model to obtain the corresponding probability distribution p. m (y|A s (u b The high-confidence unsupervised loss can be calculated using the following formula.
[0053]
[0054] μ represents the ratio of unlabeled to labeled data during training, b represents a single data sample traversing the entire batch B, and y represents the output of model m.
[0055] The probability distribution of unlabeled data q b Confidence level and confidence threshold τ c For comparison, the q values of samples with confidence levels below the confidence threshold are... b Calculate the similarity D between the class probability distribution corresponding to the highest probability class. B (p,q), DB (p,q) represents calculating the similarity (Bach distance) between two probability distributions p and q. A similarity score greater than a similarity threshold τ is considered. s The samples predict pseudo-labels; the samples corresponding to the predicted pseudo-labels are then strongly enhanced (A). s (u b The input is given to the model to obtain the corresponding probability distribution p. m (y|A s (u b Therefore, the low-confidence unsupervised loss can be calculated using the following formula.
[0056]
[0057] Fx represents the representative probability distribution corresponding to category x.
[0058] The total training loss is obtained based on supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss. The model parameters are updated through backpropagation, and the best model with the highest classification accuracy on the validation set is saved. The performance of the saved best model is tested using the test set, and the test accuracy for medical image classification under this labeled data ratio is obtained, thus obtaining the target model for medical image classification.
[0059] S104. Input the medical image data to be processed into the medical image classification target model, and use the medical image classification target model to predict and output the classification label of the medical image to be processed.
[0060] Furthermore, based on the above method, this embodiment of the invention also provides a semi-supervised medical image classification system based on similarity threshold pseudo-labels, comprising: a sample collection module, a model building module, a model training module, and an image classification module, wherein,
[0061] The sample collection module is used to acquire medical image datasets and divide the medical image datasets into training set, validation set and test set according to a preset ratio. The training set is divided into unlabeled dataset and labeled dataset with medical image classification labels according to the labeling ratio.
[0062] The model building module is used to build a medical image classification model and set the model training loss function. The model training loss function includes: supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss. The supervised loss is obtained by training the model on the labeled dataset. The high-confidence unsupervised loss is obtained by training the model on the portion of unlabeled data in the unlabeled dataset where the confidence is greater than the confidence threshold. The low-confidence unsupervised loss is obtained by training the model on another portion of unlabeled data in the unlabeled dataset where the confidence is less than the confidence threshold but the similarity is greater than the similarity threshold.
[0063] The model training module is used to train the medical image classification model based on the model training loss function and the training set, and to validate and optimize the trained model using the validation set and test set to obtain the target model for medical image classification.
[0064] The image classification module is used to input the medical image data to be processed into the medical image classification target model, and use the medical image classification target model to predict the classification target of the medical image to be processed.
[0065] To verify the effectiveness of this solution, the following explanation is based on experimental data:
[0066] Table 1
[0067]
[0068] Table 1 shows the accuracy of assigning pseudo-labels to unlabeled data under different threshold conditions. Figure 3 The diagram illustrates the selection of pseudo-labels under different confidence and similarity thresholds. The pseudo-labels assigned to unlabeled data are shown above the dashed lines under the corresponding threshold conditions. Figure 4 The proportion of pseudo-labels assigned during model training under different threshold conditions. See Table 1 and... Figure 3 As shown, the proposed solution selects unlabeled data for comparison on the BloodMNIST dataset, including a comparison threshold reduction (τ). c 0.95,τ c 0.94) selected unlabeled pseudo-labeled data and data above the threshold (τ) c 0.96,τ c 0.95) The accuracy of pseudo-labeled data with partially unlabeled data. Experiments were conducted on the BloodMNIST dataset with a 2% labeled data ratio, and the confidence threshold τ. c The threshold value is set to 0.95, and the threshold condition is compared to τ. c The pseudo-labels of the extra selected unlabeled data.
[0069] like Figure 4 As shown by the orange and red curves in (b), when the proportion of unlabeled data assigned pseudo-labels is similar, it can be seen from Table 1 that the proposed scheme (τ) c 0.95,τ s 0.97) The accuracy of pseudo-labels when selecting unlabeled data below the confidence threshold is higher than that when lowering the confidence threshold (τ). c 0.95,τ cThe pseudo-label accuracy of the unlabeled data selected by the proposed scheme (0.94) was 2% higher. This indicates that the proposed scheme has a certain advantage in selecting unlabeled data with a low confidence threshold. Furthermore, Table 1 shows that the pseudo-label accuracy of the unlabeled data selected by the proposed scheme below the confidence threshold was higher than that of the unlabeled data selected above the confidence threshold (τ). c 0.96,τ c The pseudo-label accuracy of the unlabeled data in the 0.95 part is even higher. Since the unlabeled data above the confidence threshold is the part that the model has determined to participate in training, it shows that the proposed solution has a gain for the model by selecting unlabeled data with a low confidence threshold for training.
[0070] Table 2
[0071]
[0072] Table 2 compares the classification accuracy of our proposed Simmatch method and the latest semi-supervised methods on the BloodMNIST, DermaMNIST, and PathMNIST datasets under different proportions of labeled data. The latest semi-supervised image classification methods include MixMatch, FixMatch, ReFixMatch, and FullMatch. ReFixMatch and FullMatch also utilize more unlabeled data to improve model performance. The data in the table shows that our proposed method achieves optimal classification accuracy on all three datasets under three different proportions of labeled data. These experimental results further confirm the superiority of our proposed method in utilizing low-confidence unlabeled data.
[0073] The experimental results above demonstrate that the proposed solution, by leveraging labeled data and a similarity threshold to utilize more unlabeled data, can improve the utilization rate of unlabeled data without reducing the accuracy of pseudo-labels, thereby effectively enhancing the performance of medical image classification.
[0074] Unless otherwise specifically stated, the relative steps, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention.
[0075] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0076] The units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations are not considered to be beyond the scope of this invention.
[0077] Those skilled in the art will understand that all or part of the steps in the above methods can be implemented by a program instructing related hardware, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk. Optionally, all or part of the steps in the above embodiments can also be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiments can be implemented in hardware or as a software functional module. This invention is not limited to any particular combination of hardware and software.
[0078] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A semi-supervised medical image classification method based on similarity threshold pseudo-labels, characterized in that, Include: Obtain a medical image dataset and divide it into a training set, a validation set, and a test set according to a preset ratio. The training set is further divided into an unlabeled dataset and a labeled dataset with medical image classification labels according to the labeling ratio. A medical image classification model is constructed, and a model training loss function is set. The model training loss function includes: supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss. The supervised loss is obtained by training the model on a labeled dataset. The high-confidence unsupervised loss is obtained by training the model on a portion of unlabeled data in the unlabeled dataset whose confidence is greater than a confidence threshold. The low-confidence unsupervised loss is obtained by training the model on another portion of unlabeled data in the unlabeled dataset whose confidence is less than a confidence threshold but whose similarity is greater than a similarity threshold. The model is trained using a loss function and a training set. The trained model is then validated and its performance is tuned using a validation set and a test set to obtain the target model for medical image classification. The medical image data to be processed is input into the medical image classification target model, and the medical image classification target model is used to predict and output the classification label of the medical image to be processed. The medical image classification model is trained based on a model training loss function and using a training set, including: The labeled and unlabeled datasets in the training set are sampled according to batch size. The sampled labeled data is weakly enhanced to obtain weakly enhanced labeled data. The sampled unlabeled data is weakly enhanced and strongly enhanced to obtain weakly enhanced unlabeled data and strongly enhanced unlabeled data, respectively. The weak enhancement is to enhance the image by randomly flipping and translating the image. The strong enhancement is to randomly select and combine multiple image transformation operations to enhance the image. The multiple image transformation operations include: image rotation, image flipping, image cropping and image color transformation. Weakly enhanced labeled data is input into a medical image classification model to obtain the corresponding first medical classification output probability distribution; weakly enhanced unlabeled data is input into a medical classification model to obtain the corresponding second medical classification output probability distribution. The supervised loss is calculated based on the output probability distribution of the first medical classification, and the average of the probability distributions of the first medical classification output probability distributions with a confidence level greater than the confidence threshold and predicted as the correct label category is taken as the class representative probability distribution of the corresponding label category; the confidence level of the second medical classification output probability distribution is compared with the confidence threshold. For unlabeled data with a confidence level greater than the confidence threshold, the corresponding pseudo-label is predicted based on the probability distribution output by the second medical classification. The strong enhancement corresponding to the unlabeled data with the predicted pseudo-label is input into the medical image classification model to obtain the corresponding probability distribution, and the high-confidence unsupervised loss is calculated with the corresponding pseudo-label. For unlabeled data with confidence scores less than the confidence threshold, the similarity calculation is performed between the output probability distribution of the second medical classification and the class probability distribution corresponding to the highest probability class. For unlabeled data with similarity scores greater than the similarity threshold, pseudo-labels are predicted. The strong enhancement corresponding to the unlabeled data with predicted pseudo-labels is input into the medical image classification model to obtain the corresponding probability distribution, and low-confidence unsupervised loss is calculated with the corresponding pseudo-labels. The total training loss of the model is obtained based on supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss, and the model parameters are updated by backpropagation based on the total training loss for iterative training.
2. The semi-supervised medical image classification method based on similarity threshold pseudo-labels according to claim 1, characterized in that, Obtain the medical image dataset and divide it into a training set, validation set, and test set according to a preset ratio, including: Collect several publicly available medical image datasets of different categories, and undersample each medical image dataset to obtain a specified number of medical images under each category label; Divide a specified number of medical images under each category label into training, validation, and test sets according to a preset ratio.
3. The semi-supervised medical image classification method based on similarity threshold pseudo-labels according to claim 1, characterized in that, Constructing a medical image classification model, including: A medical image classification model is constructed based on the WideResNet wide residual network. The medical image classification model includes multiple residual blocks, and each residual block includes a convolutional layer, a batch normalization layer and a nonlinear activation function.
4. The semi-supervised medical image classification method based on similarity threshold pseudo-labels according to claim 1, characterized in that, The model training loss function is set as follows: +a +β Where a and β are weighting coefficients, To monitor losses, For high-confidence unsupervised loss, This represents the low-confidence unsupervised loss.
5. The semi-supervised medical image classification method based on similarity threshold pseudo-labels according to claim 1, characterized in that, The calculation process for high-confidence unsupervised loss is expressed as follows: Where B is the batch size. express and The cross-entropy of the two probability distributions, μ is the ratio of unlabeled data to labeled data in the training process, and b is the value of a single data point during the entire batch process. Output the probability distribution for the second medical category. The confidence threshold. For labeled data The strongly enhanced unlabeled data obtained after strong enhancement To strongly enhance unlabeled data The output probability distribution obtained by inputting into the model, where y represents the model's output probability distribution.
6. The semi-supervised medical image classification method based on similarity threshold pseudo-labels according to claim 5, characterized in that, The calculation process for low-confidence unsupervised loss is expressed as follows: in, The similarity (Bach distance) between two probability distributions is calculated. express The probability distribution corresponding to the category This is the similarity threshold.
7. A semi-supervised medical image classification system based on similarity threshold pseudo-labels, characterized in that, It includes: a sample collection module, a model building module, a model training module, and an image classification module. The sample collection module is used to acquire medical image datasets and divide the medical image datasets into training set, validation set and test set according to a preset ratio. The training set is divided into unlabeled dataset and labeled dataset with medical image classification labels according to the labeling ratio. The model building module is used to build a medical image classification model and set the model training loss function. The model training loss function includes: supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss. The supervised loss is obtained by training the model on the labeled dataset. The high-confidence unsupervised loss is obtained by training the model on a portion of the unlabeled dataset whose confidence is greater than the confidence threshold. The low-confidence unsupervised loss is obtained by training the model on another portion of the unlabeled dataset whose confidence is less than the confidence threshold but whose similarity is greater than the similarity threshold. The model training module is used to train the medical image classification model based on the model training loss function and the training set, and to validate and optimize the trained model using the validation set and test set to obtain the target model for medical image classification. The image classification module is used to input the medical image data to be processed into the medical image classification target model, and use the medical image classification target model to predict and output the classification label of the medical image to be processed. The medical image classification model is trained based on a model training loss function and using a training set, including: The labeled and unlabeled datasets in the training set are sampled according to batch size. The sampled labeled data is weakly enhanced to obtain weakly enhanced labeled data. The sampled unlabeled data is weakly enhanced and strongly enhanced to obtain weakly enhanced unlabeled data and strongly enhanced unlabeled data, respectively. The weak enhancement is to enhance the image by randomly flipping and translating the image. The strong enhancement is to randomly select and combine multiple image transformation operations to enhance the image. The multiple image transformation operations include: image rotation, image flipping, image cropping and image color transformation. Weakly enhanced labeled data is input into a medical image classification model to obtain the corresponding first medical classification output probability distribution; weakly enhanced unlabeled data is input into a medical classification model to obtain the corresponding second medical classification output probability distribution. The supervised loss is calculated based on the output probability distribution of the first medical classification, and the average of the probability distributions of the first medical classification output probability distributions with a confidence level greater than the confidence threshold and predicted as the correct label category is taken as the class representative probability distribution of the corresponding label category; the confidence level of the second medical classification output probability distribution is compared with the confidence threshold. For unlabeled data with a confidence level greater than the confidence threshold, the corresponding pseudo-label is predicted based on the probability distribution output by the second medical classification. The strong enhancement corresponding to the unlabeled data with the predicted pseudo-label is input into the medical image classification model to obtain the corresponding probability distribution, and the high-confidence unsupervised loss is calculated with the corresponding pseudo-label. For unlabeled data with confidence scores less than the confidence threshold, the similarity calculation is performed between the output probability distribution of the second medical classification and the class probability distribution corresponding to the highest probability class. For unlabeled data with similarity scores greater than the similarity threshold, pseudo-labels are predicted. The strong enhancement corresponding to the unlabeled data with predicted pseudo-labels is input into the medical image classification model to obtain the corresponding probability distribution, and low-confidence unsupervised loss is calculated with the corresponding pseudo-labels. The total training loss of the model is obtained based on supervised loss, high-confidence unsupervised loss, and low-confidence unsupervised loss, and the model parameters are updated by backpropagation based on the total training loss for iterative training.
8. An electronic device, characterized in that, include: At least one processor, and a memory coupled to said at least one processor; The memory stores a computer program that can be executed by the at least one processor to implement the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, enables the implementation of the method as described in any one of claims 1 to 6.