A Semi-Supervised Medical Image Segmentation Method Based on Single-Loop Regularization
By employing parallel learning across multiple subnetworks and single-loop consistency regularization, combined with a pseudo-label competition mechanism, and optimizing the loss function, the problem of insufficient model generalization ability in semi-supervised medical image segmentation is solved, thereby improving the accuracy and stability of image segmentation.
Patent Information
- Application Number
- CN202411712145.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Existing semi-supervised medical image segmentation methods suffer from insufficient generalization ability and accuracy when only a small amount of labeled data is available, and are easily affected by erroneous predictions.
Multiple subnetworks are used to learn labeled images in parallel. Information is shared and pseudo-labels are selected through a single-loop consistency regularization and pseudo-label competition mechanism. Supervised, regularized and unsupervised losses are calculated to optimize model parameters.
It improves the model's ability to extract information from unlabeled images, reduces the impact of noise, and enhances the accuracy and generalization ability of image segmentation.
Smart Images

Figure CN119478419B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image processing, specifically relating to a semi-supervised medical image segmentation method based on single-loop regularization. Background Technology
[0002] Medical images play an increasingly important role in modern medical diagnosis. During diagnosis and treatment, medical images reflect the internal structure of the human body, revealing detailed information about lesions and injuries, thus aiding doctors in further diagnosis and analysis. Existing research shows that good segmentation results can be achieved using large amounts of labeled data and existing image segmentation algorithms. However, in the field of medical image processing, acquiring large amounts of labeled medical image data is often very expensive and time-consuming. Therefore, semi-supervised medical image segmentation, using only a small amount of labeled data and a large amount of unlabeled data, has significant practical significance and application value. It reduces the need for manually labeled data by extracting information from unlabeled images, and this information can also improve the model's generalization ability and accuracy. Furthermore, it can be combined with other techniques such as data augmentation and transfer learning to further improve model performance. Semi-supervised medical image segmentation has broad application prospects in the field of medical image processing, and can be applied to disease diagnosis, surgical navigation, medical research, and many other areas.
[0003] Currently, mainstream semi-supervised medical image segmentation mainly uses deep learning models and methods such as pseudo-labels, consistency learning, and transfer learning to learn the features of unlabeled images. At the same time, it is necessary to avoid interference caused by the model's incorrect predictions. Semi-supervised medical image segmentation methods can further improve the model's generalization ability and accuracy when there are only a few labeled images. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention proposes a semi-supervised medical image segmentation method based on single-loop regularization. The method includes: acquiring the medical image to be predicted and inputting it into a trained medical image segmentation model to obtain the medical image segmentation result.
[0005] The training process of a medical image segmentation model includes:
[0006] S1: Obtain a medical image dataset and preprocess it to obtain preprocessed medical images; the medical images include labeled images and unlabeled images;
[0007] S2: Multiple sub-networks in parallel are used to learn the labeled images, and each sub-network outputs its own image segmentation result; the supervised loss of the medical image segmentation model is calculated.
[0008] S3: Single-loop consistency regularization is used to enable the learning information to be shared among the sub-networks, and the regularization loss of the medical image segmentation model is calculated.
[0009] S4: Based on the image segmentation results output by each sub-network, a pseudo-label competition mechanism is used to select pseudo-labels for each sub-network;
[0010] S5: Each sub-network uses pseudo-labels to learn from unlabeled images and calculates the unsupervised loss of the medical image segmentation model;
[0011] S6: Calculate the total model loss based on supervised loss, regularization loss, and unsupervised loss; adjust the model parameters based on the total model loss to obtain the trained medical image segmentation model.
[0012] Furthermore, the preprocessing of medical images includes:
[0013] Resize the labeled image and its label to 256×256×3 and 256×256×1 respectively;
[0014] Resize the unlabeled image to 256×256×3;
[0015] All medical images are processed by randomly selecting one image enhancement method from brightness adjustment, contrast adjustment, Gaussian blur, and random cropping to obtain pre-processed medical images.
[0016] Preferably, the formula for calculating the supervised loss of the medical image segmentation model is as follows:
[0017]
[0018] Among them, L sup This represents the supervised loss of the medical image segmentation model. Let L represent the supervised loss of subnetwork i, α represent the first weight coefficient, and L represent the weight coefficient. dice L represents the dice loss. ce f represents the cross-entropy loss. i (x) represents the image segmentation result of subnetwork i on input image x, y represents the label of input image x, and N represents the number of subnetworks.
[0019] Preferably, the formula for calculating the regularization loss of the medical image segmentation model is:
[0020]
[0021] Among them, L con This represents the regularization loss of the medical image segmentation model. Let L represent the regularization loss of subnetwork i, α represent the first weight coefficient, and L represent the regularization loss of subnetwork i. diceL represents the dice loss. ce f represents the cross-entropy loss. i (x) represents the image segmentation result of subnetwork i on input image x, f i (x) represents the image segmentation result of subnetwork i on input image x, and N represents the number of subnetworks.
[0022] Preferably, the process of selecting pseudo-labels for each sub-network includes: using the image segmentation result output by the best sub-network as the pseudo-label for the remaining sub-networks, and using the image segmentation result output by the second-best sub-network as the pseudo-label for the best sub-network; wherein, the smaller the supervised loss, the better the sub-network.
[0023] Preferably, the process of calculating the unsupervised loss of a medical image segmentation model includes:
[0024] Calculate the sum of the unsupervised losses for all subnetworks except the best subnetwork.
[0025]
[0026] Calculate the unsupervised loss of the best subnetwork
[0027]
[0028] Where β represents the second weighting coefficient, L dice L represents the dice loss. mse f represents the mean squared error loss. i (x) represents the image segmentation result of subnetwork i on the input image x. This represents the image segmentation result of subnetwork b1 on the input image x, where b1 is the label of the best subnetwork. b2 represents the image segmentation result of subnetwork b2 on the input image x, where b2 is the label of the suboptimal subnetwork;
[0029] according to and Calculate the unsupervised loss of a medical image segmentation model.
[0030] Furthermore, the formula for calculating the unsupervised loss of the medical image segmentation model is as follows:
[0031]
[0032] Among them, L unsup This represents the unsupervised loss of the medical image segmentation model, where σ represents the sigmoid function.
[0033] This represents the supervised loss of subnetwork b1. This represents the supervised loss of subnetwork b2.
[0034] Preferably, the formula for calculating the total loss of the model is:
[0035] L = L sup +λ j (L con +L unsup )
[0036]
[0037] Where L represents the total loss of the model, L sup L represents the supervised loss of the medical image segmentation model. con L represents the regularization loss of the medical image segmentation model. unsup λ represents the unsupervised loss of the medical image segmentation model. j This represents the third weight during the j-th training round, and epoch represents the total number of training rounds.
[0038] The beneficial effects of this invention are as follows: This invention further improves model performance by using a single-loop consistency regularization module for feature extraction and information fusion while employing multiple sub-network integration methods; the competitive pseudo-label generation mechanism designed in this invention can further extract information from unlabeled images while avoiding the impact of errors caused by long-term learning of a single sub-network output on the final result; this invention can better extract relevant knowledge from unlabeled images and avoid the influence of noise, thereby improving the accuracy of image segmentation. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating the training process of the medical image segmentation model of this invention.
[0040] Figure 2 This is a structural diagram of the medical image segmentation model in this invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] This invention proposes a semi-supervised medical image segmentation method based on single-loop regularization, the method comprising the following:
[0043] The medical image to be predicted is acquired and input into a trained medical image segmentation model to obtain the medical image segmentation result.
[0044] like Figure 1 , Figure 2 As shown, the training process of the medical image segmentation model includes:
[0045] S1: Obtain a medical image dataset and preprocess it to obtain preprocessed medical images; the medical images include labeled images and unlabeled images.
[0046] A medical image dataset was acquired and preprocessed. Specifically, labeled image pairs were resized to 256×256×3 and 256×256×1 respectively, while unlabeled images were resized to 256×256×3. Then, an image enhancement method was randomly selected from brightness adjustment, contrast adjustment, Gaussian blur, and random cropping and applied to the images awaiting training to enhance data diversity, resulting in preprocessed medical images.
[0047] S2: Multiple sub-networks are used in parallel to learn the labeled images, and each sub-network outputs its own image segmentation result; the supervised loss of the medical image segmentation model is calculated.
[0048] The model employs sub-networks with identical structures but different parameter initializations; these sub-networks are deep learning networks capable of image segmentation. During network training, these parallel sub-networks with identical structures but different initialization parameters simultaneously perform supervised learning on labeled images, with each sub-network outputting its own image segmentation result.
[0049] The supervised loss of subnetwork i during training on labeled images is:
[0050]
[0051] in, Let L represent the supervised loss of subnetwork i; α represents the first weight coefficient, preferably set to 0.5; L dice L represents the dice loss. ce f represents the cross-entropy loss. i (x) represents the image segmentation result of subnetwork i on input image x, y represents the label of input image x, and N represents the number of subnetworks.
[0052] After training, the supervised loss of each subnetwork is calculated, and the total supervised loss of the model is...
[0053]
[0054] Among them, L supLet N represent the supervised loss of the medical image segmentation model, and N represent the number of subnetworks.
[0055] S3: Single-loop consistency regularization is used to enable the learning information to be shared among the sub-networks, and the regularization loss of the medical image segmentation model is calculated.
[0056] This invention designs a single-loop consistency regularization structure for information exchange between sub-networks. The prediction results of different sub-networks for labeled images are input into the single-loop consistency regularization structure for single-loop consistency regularization learning. In this structure, a sub-network will only learn from another sub-network that has not been learned by other sub-networks, thus forming a single-loop structure. For example, if there are 3 sub-networks, in this structure, sub-network 3 learns from sub-network 2, sub-network 2 learns from sub-network 1, and sub-network 1 learns from sub-network 3, thus forming a single-loop structure. This structure ensures that a single sub-network is not affected by noise interference from too many sub-networks, while also ensuring that a sub-network has direct or indirect connections to other sub-networks.
[0057] The regularization loss for this structure is:
[0058]
[0059] The overall regularization loss of the medical image segmentation model is:
[0060]
[0061] Among them, L con This represents the regularization loss of the medical image segmentation model. Let f represent the regularization loss of subnetwork i, α represent the first weight coefficient, and f i-1 (x) represents the image segmentation result of subnetwork i-1 on the input image x, f N (x) represents the image segmentation result of subnetwork N on input image x.
[0062] S4: Based on the image segmentation results output by each sub-network, a pseudo-label competition mechanism is used to select pseudo-labels for each sub-network.
[0063] The image segmentation result output by the best sub-network is used as the pseudo-label for the remaining sub-networks, and the image segmentation result output by the second-best sub-network is used as the pseudo-label for the best sub-network; where the smaller the supervised loss, the better the sub-network.
[0064]
[0065]
[0066] Where b1 represents the label of the best subnetwork and b2 represents the label of the second-best subnetwork.
[0067] For example, if the losses of the three subnetworks are 0.127, 0.186, and 0.093 respectively, then subnetwork 3 is the best subnetwork, and subnetwork 1 is the second best subnetwork. In the example, both subnetwork 1 and subnetwork 2 use the output of subnetwork 3 as pseudo-labels, and the best subnetwork is subnetwork 3, which uses the output of subnetwork 1 as a pseudo-label.
[0068] S5: Each sub-network uses pseudo-labels to learn from unlabeled images and calculates the unsupervised loss of the medical image segmentation model.
[0069] Calculate the sum of the unsupervised losses for all subnetworks except the best subnetwork.
[0070]
[0071] Calculate the unsupervised loss of the best subnetwork
[0072]
[0073] Where β represents the second weighting coefficient, L mse This represents the loss due to mean squared error (MSE). This represents the image segmentation result of subnetwork b1 on the input image x. This represents the image segmentation result of subnetwork b2 on the input image x. The reason this invention uses MSE instead of CE is that MSE can generate a smoother error value and reduce the impact of pseudo-label noise.
[0074] according to and Calculate the unsupervised loss of a medical image segmentation model:
[0075]
[0076] Among them, L unsup This represents the unsupervised loss of the medical image segmentation model, where σ represents the sigmoid function. This represents the supervised loss of subnetwork b1. This represents the supervised loss of subnetwork b2.
[0077] S6: Calculate the total model loss based on supervised loss, regularization loss, and unsupervised loss; adjust the model parameters based on the total model loss to obtain the trained medical image segmentation model.
[0078] The formula for calculating the total loss of the model is:
[0079] L = Lsup +λ j (L con +L unsup )
[0080]
[0081] Where L represents the total loss of the model, L sup L represents the supervised loss of the medical image segmentation model. con L represents the regularization loss of the medical image segmentation model. unsup λ represents the unsupervised loss of the medical image segmentation model. j This represents the third weight during the j-th training round, and epoch represents the total number of training rounds.
[0082] The Adam optimizer was used during training, with a single-card batch size of 8 and a total of 6000 training epochs. The learning rate was divided by 10 every 1000 epochs. Training was performed on two Nvidia GeForce RTX A6000 GPUs, and the network parameters were updated using backpropagation. Training was stopped when the loss function converged or the maximum preset number of iterations was reached, the model parameters were saved, and the trained medical image segmentation model was obtained.
[0083] After obtaining the trained model, the image to be predicted is input into the training network. For the predictions of the obtained sub-networks, the part with the same prediction result is taken as the final prediction result, and the part with different prediction results is selected as the output with higher prediction confidence as the final prediction result.
[0084] In summary, this invention utilizes multiple sub-networks during training to allow the model to view the problem from different perspectives, thereby extracting more information from limited data. A single-loop regularization structure is also designed, which allows the model to exchange information learned from different perspectives by each sub-network while learning from labeled image pairs, thus improving the model's recognition and generalization abilities. The single-loop structure avoids the instability caused by learning too much noise from different sources while simultaneously learning the outputs of multiple sub-networks. Furthermore, the loop structure allows for indirect learning of the outputs of other sub-networks, facilitating information exchange between them. Subsequent supervised learning during training further reduces the impact of noise in the single-loop consistency regularization, further improving model performance. Traditional methods for learning from unlabeled images employ a teacher-student model. This model has a drawback: because the network generating pseudo-labels is a specific sub-network, errors in this sub-network can propagate during training and cannot be corrected in subsequent iterations. Therefore, this invention employs a competitive mechanism. By utilizing the learning results from labeled images, the sub-network responsible for generating pseudo-labels is selected. This competitive mechanism ensures that all sub-networks can generate pseudo-labels for other sub-networks to learn from, promoting information exchange between sub-networks and preventing the propagation of errors caused by long-term learning of a single sub-network's output, thus improving model performance. This invention can better extract relevant knowledge from unlabeled images and avoid the influence of noise, improving the accuracy of image segmentation.
[0085] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A semi-supervised medical image segmentation method based on single-loop regularization, characterized in that, include: The medical image to be predicted is acquired and input into a trained medical image segmentation model to obtain the medical image segmentation result. The training process of a medical image segmentation model includes: S1: Obtain a medical image dataset and preprocess it to obtain preprocessed medical images; the medical images include labeled images and unlabeled images. S2: Multiple sub-networks in parallel are used to learn the labeled images, and each sub-network outputs its own image segmentation result; the supervised loss of the medical image segmentation model is calculated. S3: Single-loop consistency regularization is used to enable the sharing of learned information among sub-networks, and the regularization loss of the medical image segmentation model is calculated. The formula for calculating the regularization loss of the medical image segmentation model is: Among them, L con This represents the regularization loss of the medical image segmentation model. Let L represent the regularization loss of subnetwork i, α represent the first weight coefficient, and L represent the regularization loss of subnetwork i. dice L represents the dice loss. ce f represents the cross-entropy loss. i (x) represents the image segmentation result of subnetwork i on input image x, f i-1 (x) represents the image segmentation result of subnetwork i-1 on input image x, and N represents the number of subnetworks; S4: Based on the image segmentation results output by each sub-network, a pseudo-label competition mechanism is used to select the pseudo-labels for each sub-network. The process of selecting the pseudo-labels for each sub-network includes: using the image segmentation results output by the best sub-network as the pseudo-labels for the remaining sub-networks, and using the image segmentation results output by the second-best sub-network as the pseudo-labels for the best sub-network. Among these, the smaller the supervised loss, the better the sub-network. S5: Each sub-network learns from unlabeled images using pseudo-labels, calculating the unsupervised loss of the medical image segmentation model; the process of calculating the unsupervised loss of the medical image segmentation model includes: Calculate the sum of the unsupervised losses for all subnetworks except the best subnetwork. Calculate the unsupervised loss of the best subnetwork Where β represents the second weighting coefficient, L mse Indicates the mean square error loss. This represents the image segmentation result of subnetwork b1 on the input image x, where b1 is the label of the best subnetwork. b2 represents the image segmentation result of subnetwork b2 on the input image x, where b2 is the label of the suboptimal subnetwork; according to and Calculate the unsupervised loss of the medical image segmentation model; the formula for calculating the unsupervised loss of the medical image segmentation model is: Among them, L unsup This represents the unsupervised loss of the medical image segmentation model, where σ represents the sigmoid function. This represents the supervised loss of subnetwork b1. This represents the supervised loss of subnetwork b2; S6: Calculate the total model loss based on supervised loss, regularization loss, and unsupervised loss; adjust the model parameters based on the total model loss to obtain the trained medical image segmentation model.
2. The semi-supervised medical image segmentation method based on single-loop regularization according to claim 1, characterized in that, The process of preprocessing medical images includes: Resize the labeled image and its label to 256×256×3 and 256×256×1 respectively; Resize the unlabeled image to 256×256×3; All medical images are processed by randomly selecting one image enhancement method from brightness adjustment, contrast adjustment, Gaussian blur, and random cropping to obtain pre-processed medical images.
3. The semi-supervised medical image segmentation method based on single-loop regularization according to claim 1, characterized in that, The formula for calculating the supervised loss of a medical image segmentation model is as follows: Among them, L sup This represents the supervised loss of the medical image segmentation model. Let L represent the supervised loss of subnetwork i, α represent the first weight coefficient, and L represent the weight coefficient. dice L represents the dice loss. ce f represents the cross-entropy loss. i (x) represents the image segmentation result of subnetwork i on input image x, y represents the label of input image x, and N represents the number of subnetworks.
4. The semi-supervised medical image segmentation method based on single-loop regularization according to claim 1, characterized in that, The formula for calculating the total loss of the model is: L=L sup +λ j (L con +L unsup ) Where L represents the total loss of the model, L sup L represents the supervised loss of the medical image segmentation model. con L represents the regularization loss of the medical image segmentation model. unsup λ represents the unsupervised loss of the medical image segmentation model. j This represents the third weight during the j-th training round, and epoch represents the total number of training rounds.
Citation Information
Patent Citations
Semi-supervised medical image segmentation method and device based on dual-model interactive learning
CN114332135A
Lung CT image segmentation model construction method and device and electronic equipment
CN115829994A