Semi-supervised medical image segmentation method based on domain adaptation
By constructing a semi-supervised medical image segmentation model and using data information from the source and target domains for iterative training, the problem of low segmentation accuracy in existing technologies is solved and higher medical image segmentation accuracy is achieved.
Patent Information
- Application Number
- CN202310817491.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-07-05
AI Technical Summary
Existing semi-supervised medical image segmentation methods based on domain adaptation have low segmentation accuracy in the target domain. The reason is that it is difficult to find a source domain dataset with the same pathology as the target domain dataset, resulting in the inability to fully utilize the source domain data.
By constructing a semi-supervised medical image segmentation model including a domain adaptive teacher model, a target domain teacher model and a student model, the domain adaptive images contained in the source domain training sample set are used, and the spatial domain and frequency domain information of the source domain data and the target domain data are combined to perform iterative training to improve the segmentation accuracy.
The source domain data is effectively utilized, the accuracy of medical image segmentation is improved, and the problem of low segmentation accuracy caused by the mismatch between the source domain and target domain modalities in the existing technology is avoided.
Smart Images

Figure CN117115180B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing and relates to a medical image segmentation method, specifically to a semi-supervised medical image segmentation method based on domain adaptation, which can be used in the field of medical imaging. Background Art
[0002] Image segmentation is a key task in computer vision. It is the process of dividing a digital image into distinct parts or regions. Its purpose is to classify pixels in an image according to their semantic information, thereby separating and understanding the image. Image segmentation is currently widely used in autonomous driving, video surveillance, medical imaging and other fields.
[0003] Medical image segmentation involves identifying pixels of anatomical structures and lesion areas from the background of medical images, thereby obtaining clinical information such as the shape and volume of the anatomical structures and lesion areas to assist doctors in diagnosis. However, the segmentation and annotation of medical images requires the guidance of professional doctors, and obtaining large-scale segmentation maps with segmentation labels is relatively difficult. Semi-supervised medical image segmentation methods, by using a large amount of unlabeled data and a small amount of labeled data, can not only reduce the annotation cost of medical images, but also obtain segmentation results comparable to fully supervised medical image segmentation. However, semi-supervised medical image segmentation methods still rely on a large amount of unlabeled data. In clinical settings, collecting a large number of unlabeled images is also difficult and expensive. Despite the small training sample set and the lack of annotations for given medical images, many existing public datasets are fully annotated. Using models from these public datasets (source domains) to adapt to specific target datasets (target domains) to improve the performance of tasks in the target domain is called domain adaptation.
[0004] Semi-supervised medical image segmentation methods based on domain adaptation leverage the correlation between source and target domain medical images to transform them into target domain medical images, thereby improving the performance and generalization of semi-supervised medical image segmentation methods. For example, Xiaofeng Liu et al. published a paper titled "ACT: Semi-supervised Domain-adaptive Medical Image Segmentation with Asymmetric Co-Training" at the 2022 Medical Image Computing and Computer Assisted Intervention Society (MICCAI) conference. The paper describes a semi-supervised domain-adaptive medical image segmentation method based on domain adaptation. This method uses asymmetric co-training to separate the semi-supervised domain adaptation task into two asymmetric subtasks: semi-supervised learning and unsupervised domain adaptation. This method employs an asymmetric co-training framework, leveraging the different knowledge of two segmenters to distinguish between source and target label supervision. The knowledge learned by the two segmenters is then asymmetrically co-trained using confidence-aware pseudo-labels, and the two segmenters are iteratively updated through mutual teaching. This method utilizes labeled source domain data and target domain data as well as unlabeled target domain data in a unified manner to improve the segmentation accuracy of the target domain. However, its disadvantage is that this method needs to ensure that the source domain image and the target domain image are different modalities of the same lesion. However, it is still difficult to obtain such data in reality. As a result, this method cannot fully utilize these source domain data when it is difficult to find a source domain dataset with the same pathology as the target domain dataset, resulting in low segmentation accuracy. Summary of the Invention
[0005] The purpose of the present invention is to address the defects of the above-mentioned prior art and propose a semi-supervised medical image segmentation method based on domain adaptation to solve the technical problem of low segmentation accuracy in the prior art.
[0006] To achieve the above object, the technical solution adopted by the present invention includes the following steps:
[0007] (1) Preprocessing of source and target domain 3D medical images:
[0008] For the obtained Z s The dimension is D s ×H s ×W s 3D source domain medical images and their corresponding segmentation labels, as well as Z t The dimension is D t ×H t ×Wt The 3D target domain medical images are preprocessed respectively to obtain the preprocessed K s Source domain image slices of dimension H×W and their corresponding segmentation labels And the preprocessed dimension is H×W K t target domain image slice where Z s ≥150, D s ≥10, H s ≥100,W s ≥100, K s =Z s ×D s , Z t ≥50, D t ≥10, H t ≥100,W t ≥100, H≥100, W≥100, K t =Z t ×D t ; and represent the kth source domain image slice and its corresponding segmentation label, respectively. represents the k'th target domain image slice;
[0009] (2) Obtain source domain training sample set:
[0010] Calculate each source domain image slice x after preprocessing s The amplitude spectrum F A (x s ) and phase spectrum F P (x s ) and x s The corresponding grayscale matching image r st The amplitude spectrum F A (r st ), and through F A (x s ), F P (x s ) and F A (r st ) Calculate r st Domain-adapted image x s→t , and then the domain adaptation images and their labels corresponding to all source domain image slices constitute the source domain training sample set
[0011] (3) Obtain the labeled target domain training sample set, the unlabeled target domain test sample set, and the target domain training sample set:
[0012] After preprocessing, K tThe E target domain images in the image are labeled, and then the P target domain images and their labels are combined into a labeled target domain training sample set. The remaining N target domain images and their labels are combined into a labeled target domain test sample set The remaining U preprocessed target domain images are combined into an unlabeled target domain training sample set Where E + U = K t , P+N=E, U>>E,
[0013] (4) Construct a semi-supervised medical image segmentation model O and define its loss function Loss:
[0014] Construct a domain adaptive teacher model ξ1, a target domain teacher model ξ2 and a student model ξ arranged in parallel ψ Semi-supervised medical image segmentation model O; ξ1, ξ2 and ξ ψ All use encoders including serial connections Decoder And the random loss segmentation network of the output module Out; the loss function Loss of the medical image segmentation model O is:
[0015] Loss = L sup +λL unsup
[0016] Among them L sup , L unsup Represents supervised loss function and unsupervised loss function respectively, and λ represents L sup With L unsup The balance coefficient;
[0017] (5) Initialization parameters:
[0018] The number of initial iterations is r, the maximum number of iterations is R, R>10000, the current semi-supervised medical image segmentation network model O r The middle domain adaptive teacher model ξ1, the target domain teacher model ξ2 and the student model ξ ψ The weight parameters are and θ ψr , and let r = 1;
[0019] (6) Training the semi-supervised medical image segmentation model O:
[0020] The source domain training sample set T sa , labeled target domain training sample set T tla And the unlabeled target domain training sample set T tuaAs the input of the semi-supervised medical image segmentation model O, forward propagation is performed to obtain the corresponding The predicted probability map pr s→t ,r,ξ1 corresponding to Q predicted probability graphs ξ2 corresponds to The predicted probability map pr s→t,r , ξ2 corresponds to Q predicted probability graphs and ξ ψ Corresponding Prediction probability plot of
[0021] (7) Update the weight parameters of the semi-supervised medical image segmentation model O:
[0022] By ξ1 corresponding The predicted probability map pr s→t ,r,ξ1 corresponding to Q predicted probability graphs ξ2 corresponds to Q predicted probability graphs ξ ψ Corresponding Prediction probability plot of and tags Compute segmentation model O r The current loss value d r and through d r The domain adaptive teacher model ξ1, the target domain teacher model ξ2 and the student model ξ ψ The weight parameter and θ ψr Update and obtain the semi-supervised medical image segmentation model O of this iteration r ;
[0023] (8) Obtain the trained semi-supervised medical image segmentation network model:
[0024] Determine whether r = R. If so, get the trained semi-supervised medical image segmentation network model O*. Otherwise, let r = r + 1, O r =0, and execute step (6);
[0025] (9) Obtaining the segmentation results of semi-supervised medical images:
[0026] The target domain test sample set T tla As the input of the trained semi-supervised medical image segmentation model O*, the target domain teacher network Perform forward reasoning on each target domain test sample to obtain the segmentation result map of each test sample.
[0027] Compared with the prior art, the present invention has the following advantages:
[0028] The source domain training sample set of the present invention includes domain adaptive images corresponding to all source domain image slices. The domain adaptive images combine the spatial domain and frequency domain information of the source domain data image and the target domain data. In the process of training the semi-supervised medical image segmentation model, the uncertainty of the domain adaptive teacher model and the target domain teacher model is used to guide the student model to learn more reliable target domain prediction probability maps and domain adaptive prediction probability maps, thereby effectively utilizing the source domain data and avoiding the limitation of the prior art that the source domain image and the target domain image must be different modalities of the same lesion, as well as the defect that these source domain data cannot be fully utilized when it is difficult to find a source domain data set with the same pathology as the target domain data set, thereby effectively improving the segmentation accuracy of medical images. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Flowchart for the implementation of the present invention;
[0030] Figure 2 This is a flowchart of the implementation of the present invention for obtaining a source domain training sample set;
[0031] Figure 3 Schematic diagram of the structure of the random loss segmentation network of the present invention;
[0032] Figure 4 Schematic diagram of the structure of the convolution module of the present invention. DETAILED DESCRIPTION
[0033] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0034] Reference Figure 1 , the present invention comprises the following steps:
[0035] Step 1) Obtain source and target domain 3D medical images and preprocess them:
[0036] Step 1a) Obtain Z from the BraTS brain tumor segmentation dataset s The dimension is D s ×H s ×W s The 3D brain tumor medical images in the flair mode and their corresponding segmentation labels constitute the 3D source domain medical images and their corresponding 3D segmentation labels, and Z is obtained from the ICHS brain hemorrhage segmentation dataset. t The dimension is D t ×H t ×W t The 3D cerebral hemorrhage medical image constitutes a 3D target domain medical image. In this embodiment, Z s=246, D s =155,H s =240,W s =240, Z t =270, D t =32, H t =240,W t =255.
[0037] Step 1b) Along Z s The dimension is D s ×H s ×W s The 3D source domain medical image and its corresponding dimension are divided into D s ×H s ×W s The dimension D of the 3D segmentation labels s Extract the vertical s Slice the axis to get K s The dimension is H s ×W s The original image slice of the source domain; at the same time along Z t The dimension is D t ×H t ×W t The dimension D of the 3D target domain medical image t Extract the vertical t Slice the axis to get K t The dimension is H t ×W t The original image slice of the target domain, where K s =Z s ×D s , K t =Z t ×D t In this embodiment, K s =38130,K t =8640.
[0038] Step 1c) K s The dimension is H s ×W s The source domain original image slices and their corresponding labels, as well as K t The dimension is H t ×W t The original image slices of the target domain are respectively center-cropped with a dimension of H×W, and the center-cropped original image slices of the source domain and the cropped original image slices of the target domain are normalized to obtain the preprocessed K s Source domain image slices of dimension H×W and their corresponding segmentation labels And the preprocessed dimension is H×W Kt target domain image slice In this embodiment, H=256, W=256.
[0039] Step 2) Obtain the source domain training sample set, and the implementation process is as follows Figure 2 As shown;
[0040] Step 2a) The pre-processed K s Source domain image slices and their labels Each source domain image slice x in s Take the preprocessed target domain image slice x t Perform grayscale histogram matching on the template to obtain the grayscale matching image r st ; for x s and r st Perform fast Fourier transform respectively to get x s The amplitude spectrum F A (x s ), x s The amplitude spectrum F P (x s ) and r st The amplitude spectrum F A (r st ).
[0041] Step 2b) Calculate F A (r st ) and the binary rectangular mask M λ The Hadamard product of r st The low-frequency information of A (x s ) and the binary rectangular mask inverse 1 H,W -M λ The Hadamard product of x s High-frequency information; then the amplitude spectrum and x of the domain adaptive image obtained by summing the high-frequency information and the low-frequency information s The phase spectrum F P (x s ) performs inverse Fourier transform to obtain r st Domain-adapted image x s→t , where the binary rectangular mask M λ Expression, domain adaptive image x s→t The generation formulas are:
[0042]
[0043]
[0044] Among them, λ∈(0,1), is the indicator function, h represents Mλ The hth row, w represents M λ The wth column of F -1 is the inverse Fourier transform, 1 H,W represents a matrix of dimension H×W with all elements set to 1. represents the Hadamard product. In this embodiment,
[0045] The domain adaptation images and their labels corresponding to all source domain image slices constitute the source domain training sample set
[0046] Step 3) Obtain the labeled target domain training sample set, the unlabeled target domain test sample set, and the target domain training sample set:
[0047] After preprocessing, K t The E target domain images in the image are labeled, and then the P target domain images and their labels are combined into a labeled target domain training sample set. The remaining N target domain images and their labels are combined into a labeled target domain test sample set The remaining U preprocessed target domain images are combined into an unlabeled target domain training sample set Where E + U = K t , P+N=E; in this embodiment, E=2560, P=1280, N=1280, U=6080.
[0048] Step 4) Construct a semi-supervised medical image segmentation model O and define its loss function Loss:
[0049] Step 4a) Construct a domain adaptive teacher model ξ1, a target domain teacher model ξ2, and a student model ξ1 arranged in parallel ψ Semi-supervised medical image segmentation model O; ξ1, ξ2 and ξ ψ All use encoders including serial connections Decoder And the random loss segmentation network of the output module Out, its structure is as follows Figure 3 As shown, the encoder It includes a sequentially connected convolution module Conv and a level I convolution Conv-encoding En module; a decoder It includes I-level convolution Conv-decoding De modules connected in sequence; the input end of the i-th level convolution Conv-encoding En module is connected to the middle position of the I-i+1-th level convolution Conv-decoding De module. In this embodiment, I=4.
[0050] The structure of the convolution module Conv is as follows Figure 4As shown in the figure: the first convolution layer → the first batch of regularization layers → the first nonlinear function layer → Dropout layer → the second convolution layer → the second batch of regularization layers → the second nonlinear function layer. The first nonlinear function layer and the second nonlinear function layer in all Conv modules use the Leakyrelu nonlinear activation function. The loss probability of the Dropout layer is set to 0.5. The Dropout layer randomly inactivates the neurons in the network model with a probability of 0.5, that is, the output of the neuron is set to 0. The first convolution layer and the second convolution layer have the same structure. The convolution kernel in the first convolution layer and the second convolution layer in the convolution module Conv is set to 3×3, the number is 16, the stride is 1, and the surrounding padding is 1. The first-level encoding submodule En1 includes the maximum pooling layer and the first convolution module Conv1 connected in sequence, where the first convolution layer and the second convolution layer in Conv1 are The convolution kernel in the convolution layer is set to 3×3, the number is 32, the step size is 1, and the surrounding padding is 1; the second-level encoding submodule En2 includes a maximum pooling layer and a second convolution module Conv2 connected in sequence, wherein the convolution kernels in the first convolution layer and the second convolution layer in Conv2 are set to 3×3, the number is 64, the step size is 1, and the surrounding padding is 1; the third-level encoding submodule En3 includes a maximum pooling layer and a third convolution module Conv3 connected in sequence, wherein the convolution kernels in the first convolution layer and the second convolution layer in Conv3 are set to 3×3, the number is 128, the step size is 1, and the surrounding padding is 1; the fourth-level encoding submodule En4 includes a maximum pooling layer and a fourth convolution module Conv4 connected in sequence, wherein the convolution kernels in the first convolution layer and the second convolution layer in Conv4 are set to 3×3, the number is 256, the step size is 1, and the surrounding padding is 1.
[0051] Decoder It includes 4 levels of decoding submodules De connected in sequence j, where the first-level decoding submodule De1 includes the first deconvolution layer and the fifth-level convolution module Conv5 connected in sequence, where the convolution kernel of the first deconvolution layer is set to 2×2, the number is 128, the step size is 2, and the surrounding padding is 0, the convolution kernels in the first convolution layer and the second convolution layer in Conv5 are set to 3×3, the number is 128, the step size is 1, and the surrounding padding is 1; the second-level decoding submodule De2 includes the second deconvolution layer and the sixth-level convolution module Conv6 connected in sequence, where the convolution kernel of the second deconvolution layer is set to 2×2, the number is 64, the step size is 2, and the surrounding padding is 0, the convolution kernels in the first convolution layer and the second convolution layer in Conv6 are set to 3×3, the number is 64, the step size is 1, and the surrounding padding is 1. is 1; the third-level decoding submodule De3 includes a third deconvolution layer and a seventh-level convolution module Conv7 connected in sequence, wherein the convolution kernel of the third deconvolution layer is set to 2×2, the number is 32, the step size is 2, and the surrounding padding is 0, and the convolution kernels in the first convolution layer and the second convolution layer in Conv7 are set to 3×3, the number is 32, the step size is 1, and the surrounding padding is 1; the fourth-level decoding submodule De4 includes a fourth deconvolution layer and an eighth-level convolution module Conv8 connected in sequence, wherein the convolution kernel of the fourth deconvolution layer is set to 2×2, the number is 16, the step size is 2, and the surrounding padding is 0, and the convolution kernels in the first convolution layer and the second convolution layer in Conv8 are set to 3×3, the number is 16, the step size is 1, and the surrounding padding is 1.
[0052] The output layer Out includes the output convolution layer and the softmax layer connected in sequence, where the convolution kernel in the output convolution layer is set to 3×3, the number is 2, the stride is 1, and the surrounding padding is 1.
[0053] Step 4b) Define the loss function Loss of the semi-supervised medical image segmentation model O:
[0054] Loss = L sup +λL unsup
[0055] Among them L sup , L unsup Represents supervised loss function and unsupervised loss function respectively, and λ represents L sup With L unsup Balance coefficient; supervised loss function, unsupervised loss function L sup , L unsup , whose expressions are:
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064] Among them, pr s→t Represents x s→t Get x through ξ1 s→t The supervised prediction probability map, pr t express Get x through ξ2 t The supervised prediction probability map, L dice (pr,y) represents the dice loss function between the predicted probability and the true label, L ce (pr,y) represents the cross entropy loss function between the predicted probability and the true label. represents the indicator function, u represents the overall uncertainty estimate of the teacher network, H represents the uncertainty threshold, express The qth time through the network ξ i The prediction result obtained, Q represents The number of times through ξ1, {P i |i=1,2} means Q times through ξ i The sum of the predicted probabilities obtained, C represents x t The total number of categories that need to be predicted, β represents the balance coefficient between P1 and P2, μ c represents the weighted average probability of P1 and P2 of the cth class, i p Indicates the corresponding position between the predicted probability and the true label. In this embodiment, Q = 4, C = 2,
[0065] Step 5) Initialize parameters:
[0066] The number of initial iterations is r, the maximum number of iterations is R, R>10000, the current semi-supervised medical image segmentation network model O r The middle domain adaptive teacher model ξ1, the target domain teacher model ξ2 and the student model ξ ψ The weight parameters are and θ ψr , and let r = 1. In this embodiment, R = 30000;
[0067] Step 6) Train the semi-supervised medical image segmentation model O:
[0068] Encoder in the domain adaptive teacher model ξ1 right Encode, decode right The adaptive coding features obtained by encoding are decoded, and the output module Out The adaptive decoding features obtained by decoding are predicted to obtain the corresponding The predicted probability map pr s→t,r ; At the same time encoder right Encode, decode right The adaptive coding features obtained by encoding are decoded, and the output module Out The adaptive decoding features obtained by decoding are predicted for a total of Q times to obtain the corresponding Q predicted probability graphs Due to the influence of the dropout layer in the convolution module Conv in the domain adaptation teacher model ξ1, each neuron in the dropout layer will be inactivated with a fixed probability, resulting in Q+1 different network structures, each of which corresponds to a different prediction probability map, where pr s→t,r is regarded as the prediction result of the current domain adaptation teacher model ξ1, The corresponding Q prediction probability maps are used to calculate the uncertainty of ξ1. The domain adaptive teacher model also makes full use of the source domain training sample set T sa Domain Adaptive Image
[0069] The target domain teacher model ξ2 is Perform a random model inference, Through the encoder Encode to obtain the target domain encoding features, and the target domain encoding features are passed through the decoder Decode to obtain the target decoding features, which are predicted by the output module Out to obtain the corresponding The predicted probability map pr t,r ξ2 pairs Perform Q random model inferences in sequence, Through the encoder Perform Q encoding to obtain Q target encoding features, and pass the Q target encoding features through the decoder in turn Decode and obtain Q target decoding features, and predict the Q target decoding features through the output module Out in turn to obtain the corresponding Q predicted probability graphs Due to the influence of the dropout layer in the convolution module Conv in the target domain teacher model ξ2, each neuron in the dropout layer will be inactivated with a fixed probability, resulting in Q+1 different network structures, each of which corresponds to a different prediction probability map, where pr t,r is regarded as the prediction result of the current domain adaptation teacher model ξ2, The corresponding Q predicted probability maps are used to calculate the uncertainty of ξ2.
[0070] Student Model ψ Encoder in right Encode, decode right The student coding features obtained by encoding are decoded, and the output module Out The student decoding features obtained by decoding are predicted to obtain ξ ψ Corresponding Prediction probability plot of
[0071] in The predicted probability map generated by the domain adaptive teacher model ξ1 and the target domain teacher model ξ2 as well as The uncertainty of the predicted probability maps is calculated by the uncertainty calculation formula in step 4b), and the uncertainty threshold is used to filter the segmentation parts with higher confidence to guide the student model ξ ψ A more accurate prediction probability map can be learned.
[0072] Step 7) Domain adaptive teacher model ξ1, target domain teacher model ξ2 and student model ξ ψ The weight parameters θξ1r, and θ ψr To update:
[0073] Step 7a) adopts the loss function Loss defined in step (4) and passes pr s→t,r 、pr t,r 、 Calculate the loss value d of the semi-supervised medical image segmentation model O r ; Step 7b) Calculate the loss value d r right θ ψr The partial derivative of g ψr ; Using stochastic gradient descent method, through partial derivatives g ψr right θψr Update, the update formula is:
[0074]
[0075]
[0076]
[0077] in, Represent weight parameters and θ ψr The update result of α r represents the learning rate. In this embodiment, α1=0.01, α r =α r-1 (1.0-r / R) 0.9 ; r>1, the semi-supervised medical image segmentation model O of this iteration is obtained r ;
[0078] Step 8) Obtain the trained semi-supervised medical image segmentation network model:
[0079] Determine whether r = R. If so, get the trained semi-supervised medical image segmentation network model O*. Otherwise, let r = r + 1, O r =0, and execute step 6);
[0080] Step 9) Obtain the segmentation results of the semi-supervised medical image:
[0081] The target domain test sample set T tla As the input of the trained semi-supervised medical image segmentation model O*, the target domain teacher network Perform forward reasoning on each target domain test sample to obtain the segmentation result map of each test sample.
[0082] The following is a further description of the technical effects of the present invention in conjunction with simulation experiments:
[0083] 1. Simulation conditions:
[0084] The hardware platform used in the simulation experiment is CPU Core TM i9-9980XE, 3GHz, 128GB RAM, Nvidia RTX 3090 GPU. Software platform: Python 3.7 and PyCharm 2019.3.3 x64. Operating system: Ubuntu 18.04LTS x64.
Claims
1. A semi-supervised medical image segmentation method based on domain adaptation, characterized in that: The steps include: (1) Preprocessing of source and target domain 3D medical images: For the obtained Z s The dimension is D s ×H s ×W s 3D source domain medical images and their corresponding segmentation labels, as well as Z t The dimension is D t ×H t ×W t The 3D target domain medical images are preprocessed respectively to obtain the preprocessed K s Source domain image slices of dimension H×W and their corresponding segmentation labels And the preprocessed dimension is H×W K t target domain image slice where Z s ≥150, D s ≥10, H s ≥100,W s ≥100, K s =Z s ×D s , Z t ≥50, D t ≥10, H t ≥100,W t ≥100, H≥100, W≥100, K t =Z t ×D t ; and represent the kth source domain image slice and its corresponding segmentation label, respectively. represents the k'th target domain image slice; (2) Obtain source domain training sample set: Calculate each source domain image slice x after preprocessing s The amplitude spectrum F A (x s ) and phase spectrum F P (x s ) and x s The corresponding grayscale matching image r st The amplitude spectrum F A (r st ), and through F A (x s ), F P (x s ) and F A (r st ) Calculate r st Domain-adapted image x s→t , and then the domain adaptation images and their labels corresponding to all source domain image slices constitute the source domain training sample set (3) Obtain the labeled target domain training sample set, the unlabeled target domain test sample set, and the target domain training sample set: After preprocessing, K t The E target domain images in the image are labeled, and then the P target domain images and their labels are combined into a labeled target domain training sample set. The remaining N target domain images and their labels are combined into a labeled target domain test sample set The remaining U preprocessed target domain images are combined into an unlabeled target domain training sample set Where E + U = K t , P+N=E; (4) Construct a semi-supervised medical image segmentation model O and define its loss function Loss: Construct a domain adaptive teacher model ξ1, a target domain teacher model ξ2 and a student model ξ arranged in parallel ψ Semi-supervised medical image segmentation model O; ξ1, ξ2 and ξ ψ All use encoders including serial connections Decoder And the random loss segmentation network of the output module Out; the loss function Loss of the medical image segmentation model O is: Loss=L sup +λL unsup Among them L sup , L unsup Represents supervised loss function and unsupervised loss function respectively, and λ represents L sup With L unsup The balance coefficient; (5) Initialization parameters: The number of initial iterations is r, the maximum number of iterations is R, R>10000, the current semi-supervised medical image segmentation network model O r The middle domain adaptive teacher model ξ1, the target domain teacher model ξ2 and the student model ξ ψ The weight parameters are and θ ψr , and let r = 1; (6) Training the semi-supervised medical image segmentation model O: The source domain training sample set T sa , labeled target domain training sample set T tla And the unlabeled target domain training sample set T tua As the input of the semi-supervised medical image segmentation model O, forward propagation is performed to obtain the corresponding The predicted probability map pr s→t,r , ξ1 corresponds to Q predicted probability graphs ξ2 corresponds to The predicted probability map pr s→t,r , ξ2 corresponds to Q predicted probability graphs and ξ ψ Corresponding Prediction probability plot of (7) Update the weight parameters of the semi-supervised medical image segmentation model O: By ξ1 corresponding The predicted probability map pr s→t,r , ξ1 corresponds to Q predicted probability graphs ξ2 corresponds to Q predicted probability graphs ξ ψ Corresponding Prediction probability plot of and tags Compute segmentation model O r The current loss value d r and through d r The domain adaptive teacher model ξ1, the target domain teacher model ξ2 and the student model ξ ψ The weight parameter and θ ψr Update and obtain the semi-supervised medical image segmentation model O of this iteration r ; (8) Obtain the trained semi-supervised medical image segmentation network model: Determine whether r = R. If so, get the trained semi-supervised medical image segmentation network model O*. Otherwise, let r = r + 1, O r =0, and execute step (6); (9) Obtaining the segmentation results of semi-supervised medical images: The target domain test sample set T tla As the input of the trained semi-supervised medical image segmentation model O*, the target domain teacher network Perform forward reasoning on each target domain test sample to obtain the segmentation result map of each test sample.
2. The method according to claim 1, characterized in that The steps for preprocessing the source domain and target domain 3D medical images in step (1) are as follows: (1a) Along Z s The dimension is D s ×H s ×W s The 3D source domain medical image and its corresponding dimension are divided into D s ×H s ×W s The dimension D of the 3D segmentation labels s Extract the vertical s Slice the axis to get K s The dimension is H s ×W s The original image slice of the source domain; at the same time along Z t The dimension is D t ×H t ×W t The dimension D of the 3D target domain medical image t Extract the vertical t Slice the axis to get K t The dimension is H t ×W t The original image slice of the target domain; where K s =Z s ×D s , K t =Z t ×D t ; (1b) for K s The dimension is H s ×W s The source domain original image slices and their corresponding labels, as well as K t The dimension is H t ×W t The original image slices of the target domain are respectively center-cropped with a dimension of H×W, and the center-cropped original image slices of the source domain and the cropped original image slices of the target domain are normalized to obtain the preprocessed K s Source domain image slices of dimension H×W and their corresponding segmentation labels And the preprocessed dimension is H×W K t target domain image slice 3. The method according to claim 1, characterized in that Each source domain image slice x after calculation preprocessing described in step (2) s The amplitude spectrum F A (x s ) and phase spectrum F P (x s ) and x s Converted grayscale matching image r st The amplitude spectrum F Am (r(x s ,x t )), the implementation steps are: The preprocessed K s Source domain image slices and their labels Each source domain image slice x in s Slice the target domain image x t Perform grayscale histogram matching on the template to obtain the grayscale matching image r st ; for x s and r st Perform fast Fourier transform respectively to get x s The amplitude spectrum F A (x s ), x s The amplitude spectrum F P (x s ) and r st The amplitude spectrum F A (r st ).
4. The method according to claim 1, wherein The step (2) described in F A (x s ), F P (x s ) and F A (r st ) Calculate r st Domain-adapted image x s→t , the implementation steps are: Calculate F A (r st ) and the binary rectangular mask M λ The Hadamard product of r st The low-frequency information of A (x s ) and the binary rectangular mask inverse 1 H,W -M λ The Hadamard product of x s High-frequency information; then the amplitude spectrum and x of the domain adaptive image obtained by summing the high-frequency information and the low-frequency information s The phase spectrum F P (x s ) performs inverse Fourier transform to obtain r st Domain-adapted image x s→t , Among them, the binary rectangular mask M λ Expression, domain adaptive image x s→t The generation formulas are: Among them, λ∈(0,1), is the indicator function, h represents M λ The hth row, w represents M λ The wth column of F -1 is the inverse Fourier transform, 1 H,W represents a matrix of dimension H×W with all elements set to 1. represents the Hadamard product.
5. The method according to claim 1, characterized in that The semi-supervised medical image segmentation model O is constructed as described in step (4), where the encoder It includes a sequentially connected convolution module Conv and a I-level convolution Conv-encoding En module; a decoder It includes sequentially connected I-level convolution Conv-decoding De modules; the input end of the i-th level convolution Conv-encoding En module is connected to the middle position of the I-i+1-th level convolution Conv-decoding De module.
6. The method according to claim 1, characterized in that The supervised loss function and unsupervised loss function L described in step (4) sup , L unsup , whose expressions are: Among them, pr s→t Represents x s→t Get x through ξ1 s→t The supervised prediction probability map, pr t express Get x through ξ2 t The supervised prediction probability map, L dice (pr,y) represents the dice loss function between the predicted probability and the true label, L ce (pr,y) represents the cross entropy loss function between the predicted probability and the true label. represents the indicator function, u represents the overall uncertainty estimate of the teacher network, H represents the uncertainty threshold, express The qth time through the network ξ i The prediction result obtained, Q represents The number of times through ξ1, {P i |i=1,2} means Q times through ξ i The sum of the predicted probabilities obtained, C represents x t The total number of categories that need to be predicted, β represents the balance coefficient between P1 and P2, μ c represents the weighted average probability of P1 and P2 of the cth class, i p Indicates the corresponding position between the predicted probability and the true label.
7. The method according to claim 1, characterized in that The ξ1 described in step (6) corresponds to The predicted probability map pr s→t,r , ξ1 corresponds to Q predicted probability graphs ξ2 corresponds to The predicted probability map pr s→t,r , ξ2 corresponds to Q predicted probability graphs and ξ ψ Corresponding Prediction probability plot of The acquisition process includes the following steps: (6a) Encoder in the domain adaptive teacher model ξ1 right Encode, decode right The adaptive coding features obtained by encoding are decoded, and the output module Out The adaptive decoding features obtained by decoding are predicted to obtain the corresponding The predicted probability map pr s→t,r ; At the same time encoder right Encode, decode right The adaptive coding features obtained by encoding are decoded, and the output module Out The adaptive decoding features obtained by decoding are predicted for a total of Q times to obtain the corresponding Q predicted probability graphs (6b) Encoder in the target domain teacher model ξ2 right Encode, decode right The target domain encoding features obtained by encoding are decoded, and the output module Out is used to The decoded target domain encoding features are predicted to obtain the corresponding The predicted probability map pr t,r ; At the same time encoder right Encode, decode right The target domain encoding features obtained by encoding are decoded, and the output module Out is used to The decoded target domain encoding features are predicted for Q times to obtain the corresponding Q predicted probability graphs (6c) Student model ξ ψ Encoder in right Encode, decode right The student coding features obtained by encoding are decoded, and the output module Out The student decoding features obtained by decoding are predicted to obtain ξ ψ Corresponding Prediction probability plot of 8. The method according to claim 1, characterized in that The domain adaptive teacher model ξ1, target domain teacher model ξ2 and student model ξ described in step (7) ψ The weight parameter and θ ψr To update, the steps are: (7a) Use the loss function Loss defined in step (4) and pass pr s→t,r 、pr t,r 、 Calculate the loss value d of the semi-supervised medical image segmentation model O r ; (7b) Calculate the loss value d respectively r right θ ψr The partial derivative of g ψr ; Using stochastic gradient descent method, through partial derivatives g ψr right θ ψr Update, the update formula is: in, Represent weight parameters and θ ψr The update result of α r Represents the learning rate.
Citation Information
Patent Citations
Unsupervised domain adaptive remote sensing road semantic segmentation method based on GAN network
CN113888547A
Cross-modal unsupervised domain adaptive medical image segmentation method
CN115731178A