A method for organ segmentation in medical images based on semi-supervised learning
Through the semi-supervised learning method, the teacher model and the student model combine labeled and unlabeled data to generate pseudo-labels and optimize the loss function, solving the problem of poor generalization in the absence of training data in medical image organ segmentation model, and achieving fast and accurate organ segmentation.
Patent Information
- Application Number
- CN202311850926.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-12-28
AI Technical Summary
In the prior art, when the training data is small, the generalization of the medical image organ segmentation model is affected, resulting in poor segmentation effect.
The semi-supervised learning method is adopted to construct teacher models and student models, use labeled and unlabeled data for training, generate pseudo-labels, optimize loss functions, and combine encoder, segmentation decoder and feature representation to perform organ segmentation of medical images.
It improves the efficiency and accuracy of medical image organ segmentation, solves the problem of poor generalization of the model when training data is insufficient, and achieves fast and accurate organ segmentation.
Smart Images

Figure CN117808837B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of life science and medical image processing, and in particular relates to a medical image organ segmentation method based on semi-supervised learning. Background Art
[0002] In recent years, machine learning has achieved remarkable results in image analysis tasks across diverse fields, including image recognition, medical diagnosis, industrial inspection, defect identification, and building health assessment, fully demonstrating its strong development potential. Machine learning methods are widely used in various medical image analysis tasks, including ultrasound images, X-ray images, magnetic resonance imaging (MRI), retinal scans, histopathology (HI), computed tomography (CT), positron emission tomography (PET), and dermoscopy images. At the same time, efficient machine learning algorithms have also been proposed and applied to digital pathology image analysis to help pathologists obtain fast, stable, and quantitative examination results, thereby making more accurate diagnoses.
[0003] Because deep learning model training relies on data, it requires a large amount of labeled data. However, due to the high resolution and rich information of pathological images, labeling this data is extremely difficult. To fully utilize the deep feature correlations between images, weakly supervised and semi-supervised methods have been introduced. These methods use limited labeled data as a foundation and combine feature correlations between the data to achieve model training.
[0004] Current supervised learning methods rely on large amounts of labeled data. When there is less labeled training data, the generalization of the model's organs will be affected. Summary of the Invention
[0005] In order to overcome the shortcomings of the existing technology and improve the efficiency of medical image organ segmentation, the present invention provides a medical image organ segmentation method based on semi-supervised learning, comprising the following steps:
[0006] Step S1: constructing an organ segmentation model and performing training to obtain a trained organ segmentation model;
[0007] Step S2: inputting the medical image data into the trained organ segmentation model;
[0008] Step S3: The trained organ segmentation model outputs the segmentation results of the medical image.
[0009] Furthermore, the step S1 of constructing the organ segmentation model and training it includes the following steps:
[0010] Step S11: Obtain a training data set;
[0011] Step S12: Building an organ segmentation model: Building an organ segmentation model based on a neural network, the organ segmentation model includes a teacher model and a student model, the teacher model and the student model have the same structure but different parameter weights;
[0012] The parameter weights of the student model are θ S , which is updated by optimizing the loss function using an optimization algorithm;
[0013] The parameter weight of the teacher model is θ T , which is updated using a moving average index according to the parameter weights of the student model, and the formula is:
[0014] θ T =αθ T +(1-α)θ S (1)
[0015] Where α is a parameter used to control the direction of updating the teacher model parameter weights;
[0016] Step S13: Train the teacher model and the student model separately.
[0017] Furthermore, the training data set in step S11 includes a labeled training data set and an unlabeled training data set, wherein:
[0018] Labeled training dataset D L is represented as:
[0019] D L ={(x L1 ,...,x Li ,...,x Ln ), (y L1 ,...,y Li ,...,y Ln )} (2)
[0020] where x Li is the annotated medical image data, y Li is x Li The corresponding labeled data, x Li and y Li Composed of labeled data pairs, D L There are n pairs of labeled data in total, L1...Li...Ln represent the serial numbers of the labeled data pairs respectively;
[0021] Unlabeled training dataset D U is represented as:
[0022] D U ={(x U1 ,...,x Ui,...,x UN )} (3)
[0023] where x Ui is unlabeled medical image data, D U There are N unlabeled data in total, U1…Ui…UN represent the sequence numbers of the unlabeled data, N>>n.
[0024] Furthermore, the x Li The acquisition method includes one or a combination of positron emission tomography, magnetic resonance imaging, magnetic resonance tomography, and single photon emission computed tomography;
[0025] The y Li This includes data regarding the location, shape, and size of the target volume, organs at risk, and any structures of interest.
[0026] Furthermore, in step S12, the teacher model and the student model both include an encoder, a segmentation decoder and a feature representative. In the constructed organ segmentation model, the medical image data is input into the encoder, the encoder outputs the primary feature data of the medical image, and the primary feature data of the medical image is input into the segmentation decoder and the feature representative respectively, and finally the segmentation result and the secondary feature data are output respectively.
[0027] Furthermore, the feature representor is composed of three convolutional layers with different resolution levels and two upsampling layers. The convolutional layers contain operation operators, and the operation operators include one or more combinations of convolution operations, normalization operations, ReLU activation functions, random drop operations, and gating operations.
[0028] Furthermore, the optimization algorithm includes one of a gradient descent algorithm, a stochastic gradient descent algorithm, a mini-batch gradient descent algorithm, an AdaGrad algorithm and a RMSProp algorithm.
[0029] Furthermore, the specific steps of step S13 include:
[0030] Step S131: Training data processing: respectively from D L With D U Sample B group with labeled data pairs B L and B unlabeled data B U ;
[0031] Step S132: Train the teacher model and the student model based on the data sampled in step S131.
[0032] Furthermore, in step S132, the labeled loss, unlabeled loss, and contrast loss are calculated during the training process. The calculation process is as follows:
[0033] Calculate the labeled loss: B L For each data pair in Li Input the student model to get the first segmentation result P SLi , use the segmentation loss function to calculate the labeled loss L L ;
[0034] Calculate the unlabeled loss: B U For each unlabeled data x Ui Do data augmentation, and then input the teacher model to get the second segmentation result P TUi , calculate P TUi The entropy of the j-th pixel in is:
[0035]
[0036] Where: P TUi j (c) is P TUi The pixel value of the jth pixel in the cth segmentation category, H(P TUi j ) represents P TUi j Entropy, C is the number of segmentation categories, c is a segmentation category in C;
[0037] According to the entropy calculated above, it is an unlabeled data x Ui Generate pseudo-label data y Ui , the formula is:
[0038]
[0039] where δ t It is the first threshold set manually in the t-th epoch. One epoch represents the number of updates when all training data in the learning process have been used once.
[0040] B U For each unlabeled data x Ui Input the student model to get the third segmentation result P SUi , use the segmentation loss function to calculate the unlabeled loss L U ;
[0041] Calculate contrast loss: select samples and calculate contrast loss for the selected samples, where the samples include query samples, positive samples, and negative samples; the query samples represent the secondary feature data for which contrast loss is to be calculated, the positive samples represent the secondary feature data that belongs to the same segmentation category as the query samples, and the negative samples represent the secondary feature data that does not belong to the same segmentation category as the query samples.
[0042] Furthermore, the process of selecting the query sample, the positive sample, and the negative sample, and the process of calculating the contrast loss are as follows:
[0043] Query sample selection:
[0044] There are labeled query samples: B L For each data pair in Li Input the student model to get the first secondary feature data Z SLi , input the teacher model to get the fourth segmentation result P TLi , from Z SLi Select a labeled query sample S for each segmentation category Lc , the formula is:
[0045] S Lc ={Z SLi j |y Li j =c,P TLi j >δ L} (6)
[0046] Among them, Z SLi j Represents the first secondary feature data Z output by the student model SLi The feature data of the jth pixel in y Li j Represents x Li The corresponding labeled data y Li The pixel value of the jth pixel in , P TLi j Indicates P TLi The pixel value of the jth pixel on the left, δ L represents the second threshold set artificially;
[0047] Unlabeled query sample: B U For each data x Ui Input the student model to get the second secondary feature data Z SUi , input the teacher model to get the second segmentation result P TUi , from Z SUi Select an unlabeled query sample S for each segmentation category Uc , the formula is:
[0048] S Uc ={Z SUi j |y Ui j =c,P TUi j >δ U} (7)
[0049] Among them, Z SUi j Represents the second-level feature data Z output by the student model SUi The feature data of the j-th pixel in y Ui j Indicates giving x Ui Generated pseudo-label data y Ui The pixel value of the jth pixel on the top, P TUi j Indicates P TUi The pixel value of the jth pixel on the top, δ U Indicates the artificially set third threshold;
[0050] Merge the labeled query sample and the unlabeled query sample to obtain the query sample S of segmentation category c. c , the formula is:
[0051] S c =S Lc ∪S Uc (8)
[0052] Positive sample selection: The positive sample of segmentation category c is defined as the center of the query sample, and its formula is:
[0053]
[0054] in is a positive sample of category c, Z c Query sample S for segmentation category c c A characteristic data of
[0055] Negative sample selection:
[0056] Selection of labeled negative samples: B L For each data pair in Li Input the teacher model to get the third level feature data Z TLi And the fourth segmentation result P TLi , select the labeled negative sample for the segmentation category c through the formula, which is:
[0057]
[0058] Among them, Z TLi j Z TLi Feature data of the j-th pixel position in , y Li j y Li The pixel value of the jth pixel on the top, P TLi j P TLiThe pixel value of the jth pixel on the top, O(P TLi j =c) indicates that the teacher model is x Li The ranking of the predicted category of the j-th pixel among all possibilities, δ L represents the second threshold set artificially;
[0059] Unlabeled negative sample selection: B U For each data x Ui Input the teacher model to get the fourth-level feature data Z TUi and the second segmentation result P TUi , select unlabeled negative samples for the segmentation category c, and the formula is:
[0060]
[0061] Among them, Z TUi j Z TUi The feature data of the j-th pixel position in P TUi j P TUi The pixel value of the jth pixel on the top, O(P TUi j =c) indicates that the teacher model is x Ui The ranking of the predicted category of the j-th pixel among all possibilities, H(P TUi j ) is expressed as P TUi Calculate the entropy of the j-th pixel, δ L , δ U and δ H These are the second, third, and fourth thresholds set manually;
[0062] Difficult negative sample selection: B U For each data x Ui Input the teacher model to get the fourth-level feature data Z TUi and the second segmentation result P TUi , select difficult negative samples for segmentation category c, the formula is:
[0063]
[0064] And through D(P TUi j ) calculates the segmentation category, and the formula is:
[0065]
[0066] in, Represents Z TUi j and The cosine similarity of is:
[0067]
[0068] After merging the labeled negative samples, the unlabeled negative samples, and the difficult negative samples, the negative samples of the segmentation category c are obtained. The formula is as follows:
[0069]
[0070] For the selected query samples, positive samples and negative samples, the contrast loss is calculated using the following formula:
[0071]
[0072] in, express and The cosine similarity of is:
[0073]
[0074] τ is a parameter used to control the cosine similarity, For query sample S c The i-th secondary feature data in, for The jth secondary feature data in .
[0075] Compared with the prior art, the present invention has the following beneficial effects:
[0076] The present invention builds and trains an organ segmentation model based on semi-supervised learning, which can quickly and accurately perform organ segmentation on medical images. By processing labeled and unlabeled training data, it fully solves the problem that the generalization of the model's organ segmentation will be affected when there is less labeled training data during model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is a flow chart of a method for medical image organ segmentation based on semi-supervised learning according to an embodiment of the present invention;
[0078] Figure 2 Flowchart of a method for constructing and training an organ segmentation model according to an embodiment of the present invention;
[0079] Figure 3 This is a structural block diagram of a teacher model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0080] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0081] Example
[0082] like Figure 1-3 As shown,
[0083] The present invention provides a method for medical image organ segmentation based on semi-supervised learning, comprising the following steps:
[0084] Step S1: constructing an organ segmentation model and performing training to obtain a trained organ segmentation model;
[0085] Step S2: inputting the medical image data into the trained organ segmentation model;
[0086] Step S3: The trained organ segmentation model outputs the segmentation results of the medical image.
[0087] In some embodiments of the present invention, the step S1 of constructing an organ segmentation model and performing training comprises the following steps:
[0088] Step S11: Obtain a training data set;
[0089] Step S12: Building an organ segmentation model: An organ segmentation model is constructed based on a neural network. The organ segmentation model includes a teacher model and a student model. The teacher model and the student model have the same structure except for parameter weights. The teacher model and the student model each include an encoder, a segmentation decoder, and a feature representative. Medical image data is input into the encoder, which outputs primary feature data of the medical image. Subsequently, the medical image feature data is input into the segmentation encoder and the feature representative, respectively, and finally the segmentation result and secondary feature data are output respectively.
[0090] Step S13: Train the teacher model and the student model separately: the parameter weight of the student model is θ S , which is updated by optimizing the loss function using an optimization algorithm; the optimization algorithm is a gradient descent algorithm, a stochastic gradient descent method, a mini-batch gradient descent algorithm, an AdaGrad algorithm, an RMSProp algorithm, or any combination thereof. In this embodiment, the stochastic gradient descent algorithm (SGD) is used for optimization;
[0091] The parameter weight of the teacher model is θ T , which is updated using a moving average index according to the parameter weights of the student model, and the formula is:
[0092] θ T =αθ T +(1-α)θ S
[0093] Among them, α is a parameter used to control the direction of updating the teacher model parameter weights. At the end of training, a trained student model is obtained. The trained student model can be used as the final model for organ segmentation in medical images. The role of the teacher model is to generate pseudo labels during the training phase to help the student model use unlabeled training data for training.
[0094] In some embodiments of the present invention, the training data set includes: a labeled training data set and an unlabeled training data set, wherein:
[0095] Labeled training dataset D L is represented as:
[0096] D L ={(x L1 ,...,x Li ,...,x Ln ), (y L1 ,...,y Li ,...,y Ln )}
[0097] where x Li Annotated medical image data, y Li is x Li The corresponding labeled data, x Li and y Li Composed of labeled data pairs, D L There are n pairs of labeled data in total, L1...Li...Ln represent the serial numbers of the labeled data pairs respectively;
[0098] Unlabeled training dataset D U is represented as:
[0099] D U ={(x U1 ,...,x Ui ,...,x UN )}
[0100] where x Ui is unlabeled medical image data, D U There are N unlabeled data in total, U1…Ui…UN represent the serial numbers of the unlabeled data respectively, usually N>>n.
[0101] In some embodiments of the present invention, the specific process of training the teacher model and the student model in step S13 is as follows:
[0102] Step S131: Training data processing: respectively from D L With D U Sample B group with labeled data pairs B L and B unlabeled data B U ;
[0103] Step S132: Based on the data sampled in step S131, the teacher model and the student model are trained. During the training process, the labeled loss, unlabeled loss, and contrast loss need to be calculated respectively. The calculation process is as follows:
[0104] Calculate the labeled loss: B L For each data pair in Li Input the student model to get the first segmentation result P SLi , use the segmentation loss function to calculate the labeled loss L L Common segmentation loss functions include cross entropy loss function, weighted cross entropy loss function, Focal Loss function, BCELoss function and IoU Loss function. In this embodiment, weighted dice loss function and cross entropy loss function are used, and their formulas are as follows:
[0105]
[0106] Among them, l ce is the cross entropy loss, l dice is the dice loss;
[0107] Calculate the unlabeled loss: B U For each unlabeled data x Ui Do strong data augmentation, and then input the teacher model to get the second segmentation result P TUi , calculate P TUi The entropy of the j-th pixel in is:
[0108]
[0109] Where: P TUi j (c) is P TUi The pixel value of the jth pixel in the cth segmentation category, H(P TUi j ) represents P TUi j Entropy, C is the number of segmentation categories, c is a segmentation category in C;
[0110] According to the entropy calculated by the above formula, given an unlabeled data xUi Generate pseudo-label data y Ui , the formula is:
[0111]
[0112] where δ t It is the first threshold set manually in the t-th epoch. One epoch represents the number of updates when all training data in the learning process have been used once.
[0113] B U For each unlabeled data x Ui Input the student model to get the third segmentation result P SUi , use the segmentation loss function to calculate the unlabeled loss L U Common segmentation loss functions include cross entropy loss function, weighted cross entropy loss function, Focal Loss function, BCELoss function and IoU Loss function. In this embodiment, the cross entropy loss function is used, and its formula is:
[0114]
[0115] Among them, l ce is the cross entropy loss;
[0116] Calculate contrast loss: Select samples and calculate contrast loss for the selected samples.
[0117] The sample selection includes query sample selection, positive sample selection, negative sample selection, and difficult sample selection. The query sample represents the secondary feature data for which the contrast loss is to be calculated. The positive sample represents the secondary feature data that belongs to the same segmentation category as the query sample. The negative sample represents the secondary feature data that does not belong to the same segmentation category as the query sample. The specific selection process is as follows:
[0118] Ⅰ. Query sample selection:
[0119] There are labeled query samples: B L For each data pair in Li Input the student model to get the first secondary feature data Z SLi , input the teacher model to get the fourth segmentation result P TLi , from Z SLi Select a labeled query sample S for each segmentation category Lc , the formula is:
[0120] S Lc ={Z SLi j |y Li j =c,P TLij >δ L}
[0121] Among them, Z SLi j Represents the first secondary feature data Z output by the student model SLi The feature data of the jth pixel in y Li j Represents x Li The corresponding labeled data y Li The pixel value of the jth pixel in , P TLi j Indicates P TLi The pixel value of the jth pixel on the left, δ L represents the second threshold set artificially;
[0122] Unlabeled query sample: B U For each data x Ui Input the student model to get the second secondary feature data Z SUi , input the teacher model to get the second segmentation result P TUi , from Z SUi Select an unlabeled query sample S for each segmentation category Uc , the formula is:
[0123] S Uc ={Z SUi j |y Ui j =c,P TUi j >δ U}
[0124] Among them, Z SUi j Represents the second-level feature data Z output by the student model SUi The feature data of the jth pixel in y Ui j Indicates giving x Ui Generated pseudo-label data y Ui The pixel value of the jth pixel on the top, P TUi j Indicates P TUi The pixel value of the jth pixel on the left, δ U Indicates the artificially set third threshold;
[0125] Merge the labeled query sample and the unlabeled query sample to obtain the query sample S of segmentation category c. c , the formula is:
[0126] S c =S Lc ∪SUc
[0127] II. Positive sample selection: The positive sample of segmentation category c is defined as the center of the query sample, and its formula is:
[0128]
[0129] in is a positive sample of category c, Z c Query sample S for segmentation category c c A characteristic data of
[0130] III. Negative sample selection:
[0131] Selection of labeled negative samples: B L For each data pair in Li Input the teacher model to get the third level feature data Z TLi And the fourth segmentation result P TLi , select the labeled negative sample for the segmentation category c through the formula, which is:
[0132]
[0133] Among them, Z TLi j Z TLi The feature data of the j-th pixel position in y Li j y Li The pixel value of the jth pixel on the top, P TLi j P TLi The pixel value of the jth pixel on the top, O(P TLi j =c) indicates that the teacher model is x Li The ranking of the predicted category of the j-th pixel among all possibilities, δ L represents the second threshold set artificially;
[0134] Unlabeled negative sample selection: B U For each data x Ui Input the teacher model to get the fourth-level feature data Z TUi and the second segmentation result P TUi , select unlabeled negative samples for the segmentation category c, and the formula is:
[0135]
[0136] Among them, Z TUi j Z TUi The feature data of the j-th pixel position in P TUij P TUi The pixel value of the jth pixel on the top, O(P TUi j =c) indicates that the teacher model is x Ui The ranking of the predicted category of the j-th pixel among all possibilities, H(P TUi j ) is expressed as P TUi Calculate the entropy of the j-th pixel, δ L , δ U and δ H These are the second, third, and fourth thresholds set manually;
[0137] Difficult negative sample selection: B U For each data x Ui Input the teacher model to get the fourth-level feature data Z TUi and the second segmentation result P TUi , select difficult negative samples for segmentation category c, the formula is:
[0138]
[0139] And through D(P TUi j ) calculates the segmentation category, and the formula is:
[0140]
[0141] in, Represents Z TUi j and The cosine similarity of is:
[0142]
[0143] After merging the labeled negative samples, the unlabeled negative samples, and the difficult negative samples, the negative samples of the segmentation category c are obtained. The formula is as follows:
[0144]
[0145] For the selected query samples, positive samples and negative samples, the contrast loss is calculated using the following formula:
[0146]
[0147] in, express and The cosine similarity of is:
[0148]
[0149] τ is a parameter used to control the cosine similarity, For query sample S c The i-th secondary feature data in, for The jth secondary feature data in .
[0150] As a preferred embodiment, in some embodiments of the present invention, the step S11 of obtaining a training data set refers to obtaining a labeled training data set and an unlabeled training data set from any appropriate source, such as a hospital, a public data set, etc., where x Li is medical image data, the acquisition methods of which include but are not limited to positron emission tomography (PET), magnetic resonance imaging (MRI), magnetic resonance tomography (MRT), single photon emission computed tomography (SPECT), and any combination thereof;
[0151] y Li is x Li The corresponding annotation data includes but is not limited to any appropriate data related to the position, shape and size of the target volume, organs at risk (OARs) and any structures of interest, wherein the structures of interest include but are not limited to skin and bone structures.
[0152] As a preferred embodiment, Figure 3 As shown, in some embodiments of the present invention, the encoder in step S12 adopts the structure of ResNet50, the segmentation decoder adopts the structure of deeplab v3, and the feature representor is composed of three convolutional layers with different resolution levels and two upsampling layers, wherein the upsampling layer is the process of amplifying the image for feature selection, and the convolutional layer is to extract features from the image. Each convolutional layer can also include any appropriate operation operator, such as convolution operation, normalization operation, ReLU activation function, random drop operation, gating operation, etc. and any combination thereof.
[0153] As a preferred implementation, in some embodiments of the present invention, the strong data augmentation in step S132 may be any suitable strong data augmentation, such as CutMix, color dithering, etc., and any combination thereof.
[0154] Among them, it is worth mentioning that the present invention is proposed to solve the problem of organ segmentation in medical images. It can be understood that this method is implemented by processing images, so it can be correspondingly applied to image segmentation processing in other fields, such as industrial inspection and other fields, and the use of this method in different fields should also be within the scope of protection of the present invention.
[0155] The above description describes the basic principles and advantages of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be considered in all respects as illustrative and non-limiting. The scope of the present invention is defined by the appended claims, not the foregoing description. It is intended that all variations within the meaning and range of equivalents of the claims be included in the present invention, and any reference signs in the claims should not be construed as limiting the claims to which they relate.
Claims
1. A method for medical image organ segmentation based on semi-supervised learning, characterized by: The steps include: Step S1: constructing an organ segmentation model and performing training to obtain a trained organ segmentation model; The step S1 of constructing the organ segmentation model and training the model comprises the following steps: Step S11: Obtain a training data set; Step S12: Building an organ segmentation model: Building an organ segmentation model based on a neural network, the organ segmentation model includes a teacher model and a student model, the teacher model and the student model have the same structure but different parameter weights; The parameter weights of the student model are , which is updated by optimizing the loss function using an optimization algorithm; The parameter weights of the teacher model are , which is updated using a moving average index according to the parameter weights of the student model, and the formula is: (1) in It is a parameter used to control the update direction of the teacher model parameter weights; Step S13: train the teacher model and the student model separately; The training data set in step S11 includes a labeled training data set and an unlabeled training data set, wherein: Labeled training dataset is represented as: (2) in is annotated medical image data, yes The corresponding annotation data, and Composed of labeled data pairs, There are a total of For labeled data pairs, ... ... They represent the serial numbers of the labeled data pairs respectively; Unlabeled training dataset is represented as: (3) in It is unlabeled medical image data. There are a total of Unlabeled data, … … Respectively represent the serial numbers of unlabeled data, ; The specific steps of step S13 include: Step S131: Training data processing: and mid-sampling Group labeled data and Unlabeled data ; Step S132: training the teacher model and the student model based on the data sampled in step S131; In step S132, the labeled loss, unlabeled loss, and contrast loss are calculated during the training process. The calculation process is as follows: Calculate the labeled loss: For each data pair Input the student model to get the first segmentation result , use the segmentation loss function to calculate the labeled loss ; Calculate the unlabeled loss: Each data Do data augmentation, then input the teacher model to get the second segmentation result ,calculate Middle The entropy of pixels is: (4) in: yes Previous Pixels in the Pixel values on the segmentation categories, It means The entropy of is the number of segmentation categories, for A segmentation category in ; According to the entropy calculated above, it is an unlabeled data Generate pseudo-labeled data , the formula is: (5) in It is The first threshold is set manually in epochs. An epoch represents the number of updates when all training data in the learning process have been used once. Will Each unlabeled data Input the student model to get the third segmentation result , use the segmentation loss function to calculate the unlabeled loss ; Calculate contrast loss: Select samples and calculate contrast loss for the selected samples. The samples include query samples, positive samples, and negative samples. The query samples represent the secondary feature data for which contrast loss is to be calculated. The positive samples represent the secondary feature data that belongs to the same segmentation category as the query samples. The negative samples represent the secondary feature data that does not belong to the same segmentation category as the query samples. Step S2: inputting the medical image data into the trained organ segmentation model; Step S3: The trained organ segmentation model outputs the segmentation results of the medical image.
2. The method for medical image organ segmentation based on semi-supervised learning according to claim 1, wherein: described The acquisition method includes one or a combination of positron emission tomography, magnetic resonance imaging, magnetic resonance tomography, and single photon emission computed tomography; described This includes data regarding the location, shape, and size of the target volume, organs at risk, and any structures of interest.
3. The medical image organ segmentation method based on semi-supervised learning according to claim 1, wherein: In step S12, the teacher model and the student model both include an encoder, a segmentation decoder and a feature representative. In the constructed organ segmentation model, the medical image data is input into the encoder, and the encoder outputs the primary feature data of the medical image. The primary feature data of the medical image is input into the segmentation decoder and the feature representative respectively, and finally the segmentation result and the secondary feature data are output respectively.
4. The method for medical image organ segmentation based on semi-supervised learning according to claim 3, wherein: The feature representor is composed of three convolutional layers with different resolution levels and two upsampling layers. The convolutional layers contain operation operators, and the operation operators include one or more combinations of convolution operations, normalization operations, ReLU activation functions, random drop operations, and gating operations.
5. The method for medical image organ segmentation based on semi-supervised learning according to claim 1, wherein: The optimization algorithm includes one of the gradient descent algorithm, stochastic gradient descent algorithm, small batch gradient descent algorithm, AdaGrad algorithm and RMSProp algorithm.
6. The method for medical image organ segmentation based on semi-supervised learning according to claim 1, wherein: The process of selecting the query sample, the positive sample, and the negative sample, and the process of calculating the contrast loss are as follows: Query sample selection: There are labeled query samples: For each data pair Input the student model to get the first secondary feature data , input the teacher model to get the fourth segmentation result ,from In , a labeled query sample is selected for each segmentation category, and the formula is: (6) in, Represents the first secondary feature data output by the student model Middle The feature data of each pixel, express Corresponding annotation data Middle The pixel value of each pixel, express Previous The pixel value of pixels, represents the second threshold set artificially; Unlabeled query sample: Each data Input the student model to get the second secondary feature data , input the teacher model to get the second segmentation result ,from Select unlabeled query samples for each segmentation category , the formula is: (7) in, Represents the second-level feature data output by the student model Middle The feature data of each pixel, Expressed as Generated pseudo-labeled data Previous The pixel value of pixels, express Previous The pixel value of pixels, Indicates the artificially set third threshold; Merge the labeled query samples and the unlabeled query samples to obtain the category Sample query , the formula is: (8) Positive sample selection: segmentation category The positive sample is defined as the center of the query sample, and its formula is: (9) in For category The positive sample of For segmentation category Sample query A characteristic data of Negative sample selection: Selection of labeled negative samples: For each data pair Input the teacher model to obtain the third-level feature data and the fourth segmentation result , the split category is Select the labeled negative sample, and its formula is: (10) in, for Middle Feature data of pixel positions, for Previous The pixel value of pixels, for Previous The pixel value of pixels, The teacher model is Previous The ranking of the predicted categories of pixels among all possibilities, represents the second threshold set artificially; Unlabeled negative sample selection: Each data Input the teacher model to get the fourth level feature data and the second segmentation result , is the segmentation category Select unlabeled negative samples, the formula is: (11) in, for Middle Feature data of pixel positions, for Previous The pixel value of pixels, The teacher model is Previous The ranking of the predicted categories of pixels among all possibilities, Expressed as Calculated The entropy of pixels, 、 and These are the second, third, and fourth thresholds set manually; Difficult negative sample selection: Each data Input the teacher model to get the fourth level feature data and the second segmentation result , is the segmentation category The formula for selecting difficult negative samples is: (12) and through Calculate the segmentation category, the formula is: (13) in, express and The cosine similarity of is: (14) After merging the labeled negative samples, the unlabeled negative samples and the difficult negative samples, the segmentation category is obtained. The negative sample is as follows: (15) For the selected query samples, positive samples and negative samples, the contrast loss is calculated using the following formula: (16) in, express and The cosine similarity of is: (17) is a parameter used to control the cosine similarity, For query samples Middle Secondary feature data, for Middle Secondary feature data.
Citation Information
Patent Citations
Image segmentation processing method and device, computer equipment and storage medium
CN113538480A
Mutual learning-based semi-supervised medical image segmentation method and system
WO2023116635A1