A saliency reference and decoupled diffusion segmentation method for esophageal tumor CT images
Through a multi-task learning framework of significance reference and decoupling, combined with significance pseudo-notation and diffusion model, the problems of signal similarity, boundary ambiguity and noise interference in esophageal tumor CT image segmentation are solved, and the segmentation accuracy and robustness are significantly improved.
Patent Information
- Application Number
- CN202411807262.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The CT image segmentation task of esophageal tumors faces the problems of signal similarity, boundary ambiguity and noise interference, which leads to the reduction of segmentation accuracy and robustness of traditional methods in high noise environments.
A significant reference and decoupling method for esophageal tumor CT image diffusion segmentation is proposed. By combining significance pseudo-notation and diffusion model, a multi-task learning framework for decoupling segmentation and denoising tasks is constructed to improve tumor region segmentation accuracy and noise resistance.
It significantly improves the accuracy and robustness of esophageal tumor CT image segmentation, solves the problem of difficult boundary identification in traditional methods in high noise environments, and reduces the risk of false detection and missed detection.
Smart Images

Figure CN119273704B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a medical image processing technology, in particular to a significant reference and decoupled esophageal tumor CT image diffusion segmentation method. Background Art
[0002] With the rapid development of medical imaging technology, CT (computed tomography) has become an important tool for diagnosing esophageal tumors due to its high resolution, non-invasiveness and comprehensiveness. Image segmentation technology for esophageal tumors is crucial for the accurate identification and positioning of lesions, and provides an important basis for the formulation of clinical treatment plans. However, there are many challenges in the segmentation task of esophageal tumors, including the signal similarity between tumor tissue and surrounding normal tissue, the fuzziness of tumor boundaries, and the interference of image artifacts and noise. These factors significantly increase the risk of false detection and missed detection in the segmentation process, bringing great technical bottlenecks to the traditional manual feature segmentation method.
[0003] In recent years, deep learning medical image segmentation technology has made significant progress, especially convolutional neural networks (CNNs) have shown excellent performance in feature extraction and target segmentation. However, due to the local receptive field limitations of CNNs, they are insufficient in dealing with long-range dependencies and complex boundary areas. In addition, artifacts and noise in CT images further limit the model's accurate capture of features, resulting in reduced accuracy and robustness of segmentation results. Although some studies have introduced global context modeling techniques to improve segmentation results, it is still difficult to meet clinical needs under high noise conditions.
[0004] As an emerging generative model, the diffusion model has demonstrated excellent performance in image generation and denoising tasks. By simulating the forward noise addition and reverse denoising process, it can gradually restore image details and eliminate noise. However, the combination of the diffusion model and the medical image segmentation task is still in the exploratory stage. In response to the above problems, the present invention proposes a saliency reference and decoupling learning framework. By combining saliency pseudo-annotation with the diffusion model, a multi-task learning framework for decoupling segmentation and denoising is constructed, which effectively improves the segmentation network's capabilities in boundary recognition, noise resistance, and global information modeling, thereby providing an innovative solution for the accurate segmentation of esophageal tumor CT images. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention proposes a saliency reference and decoupled diffusion segmentation method for esophageal tumor CT images. By combining the segmentation network of saliency pseudo-annotation with the denoising network of the conditional diffusion model, a multi-task learning framework that decouples the segmentation and denoising tasks is constructed, which significantly improves the accuracy of tumor region segmentation. In order to achieve the above purpose, the technical solution of the present invention is as follows:
[0006] A saliency reference and decoupled esophageal tumor CT image diffusion segmentation method, characterized by comprising the following steps:
[0007] 11) Preparation of the saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images: Preprocess the esophageal tumor CT image data, including normalization, cropping, saliency label generation and optimization steps to ensure the consistency of input data and the accuracy of salient area labeling;
[0008] 12) Construct the segmentation network and diffusion network of the esophageal tumor CT image diffusion segmentation network with significant reference and decoupled: construct a segmentation network with input as preprocessed CT images and significant pseudo labels, the network consists of a multi-layer encoder, a decoder, a jump connection module and a significant feature fusion module; a diffusion model, construct a diffusion network with input as noisy CT images and significant pseudo labels; the diffusion network contains a multi-layer convolution module to complete the forward addition and reverse denoising operations; the specific steps are as follows:
[0009] 121) Construct a segmentation network of saliency reference and decoupled diffusion segmentation network of esophageal tumor CT images, the steps are as follows:
[0010] 1211) Construct a spatial downsampling structure. The spatial downsampling structure includes an encoder module, which consists of 4 layers of downsampling units. The specific structure of each layer is as follows:
[0011] 12111) Two 3*3 convolutional layers, with the stride set to 1 and the padding method the same;
[0012] 12112) A RELU linear activation unit is added after each convolutional layer for activation;
[0013] 12113) A maximum pooling layer with a kernel size of 2*2;
[0014] 1212) Construct a spatial upsampling structure. The spatial upsampling structure includes a decoder module, which consists of 4 layers of upsampling units. The specific structure of each layer is as follows:
[0015] 12121) A deconvolution layer with a convolution kernel size of 2*2;
[0016] 12122) Two 3*3 convolutional layers, with the stride set to 1 and the padding method the same;
[0017] 12123) A RELU linear activation unit is added after each convolutional layer for activation;
[0018] 1213) Construct an interactive structure of downsampling structure and upsampling structure. The specific structure is as follows:
[0019] 12131) Use four skip connections to concatenate the feature map of the output of each downsampling layer with the output of the upsampling layer;
[0020] 12132) After the last layer of downsampling, it passes through two 3*3 convolutional layers;
[0021] 1214) Construct a saliency fusion module, whose specific structure is as follows:
[0022] 12141) The salient pseudo-label is embedded in each layer of the decoder through skip connections, and the fusion formula is as follows:
[0023] ,
[0024] in, represents the fused decoder features, represents the decoder features before fusion, represents the significant pseudo-label feature, and λ=0.5 represents the weight of the significant feature;
[0025] The specific steps are as follows:
[0026] CT images are passed through a saliency detection network to obtain saliency pseudo labels;
[0027] The saliency pseudo-labels pass through a four-layer encoder structure, which is consistent with the encoder structure of the segmentation network;
[0028] Then, each salient pseudo-label that passes through the encoder layer is concatenated with the input of the segmentation network encoder through a skip connection;
[0029] 122) Construct a diffusion network for esophageal tumor CT image diffusion segmentation network with significant reference and decoupling, the steps are as follows:
[0030] 1221) Forward diffusion process: The forward diffusion process gradually inputs the CT image Add Gaussian noise to gradually change from structured data to random noise. The specific formula is as follows:
[0031] ,
[0032] in = , indicating signal strength; [0.0001, 0.02] is the intensity of adding noise at each step; N is a normal distribution; a linear variance schedule is used, and after T=1000 steps of diffusion, the initial image Transformed into completely random noise ;
[0033] 1222) Reverse denoising process: Reverse denoising predicts noise through a neural network and gradually restores the image. The formula is as follows:
[0034] ,
[0035] in is the variance, representing the noise scale in the diffusion process; is the mean, indicating that from the current noise image Predict the next step Central location;
[0036] The mean calculation formula is:
[0037] ,
[0038] in, is the noise distribution predicted by the neural network; is the accumulated signal strength;
[0039] Reverse generation from random noise Start by gradually denoising to generate a restored image ;
[0040] 1223) The diffusion network of the esophageal tumor CT image diffusion segmentation method with saliency reference and decoupling adopts the encoder-decoder architecture of UNet and is designed in combination with time embedding and residual blocks. Its specific structure is as follows:
[0041] 12231) The encoder extracts multi-scale features by downsampling layer by layer. The encoder module contains the following components:
[0042] 122311) Convolutional layer, each layer contains two 3*3 convolution operations, the convolution kernel filling method is the same, and each convolution layer is followed by batch normalization BN and a RELU linear activation unit;
[0043] 122312) Maximum pooling layer, used for downsampling, the pooling kernel size is 2*2;
[0044] 12232) The decoder module gradually restores the image size by upsampling layer by layer, and contains the following components:
[0045] 122321) A deconvolution layer, using a 2*2 size deconvolution and to restore the spatial resolution of the feature map;
[0046] 122322) Convolutional layer, each layer contains two 3*3 convolution operations, the convolution kernel filling method is the same, and each convolution layer is followed by batch normalization BN and a RELU linear activation unit;
[0047] 12233) Time embedding module: Time embedding runs through the entire encoder and decoder. It is responsible for mapping the time information t into a feature vector, passing through the linear layer and then injecting it into the feature map of each convolution layer to ensure the model's dynamic perception of noise at each step;
[0048] 12234) Skip connection structure, each layer of the encoder splices the features of the corresponding layer to the decoder feature map through a skip connection;
[0049] 13) Training a saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images: ensuring complementary optimization of segmentation and denoising tasks, and designing a joint optimization strategy by combining cross entropy loss function, Dice loss function, mean square error function, and consistency loss;
[0050] 14) Testing and solving the saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images: Inferring unlabeled data through the trained network and combining morphological operations to improve the accuracy of segmentation boundaries.
[0051] The preparation of the model of the significant reference and decoupled esophageal tumor CT image diffusion segmentation method includes the following steps:
[0052] 21) Data normalization: Normalize the pixel values of the CT image to the interval [0, 1], the formula is as follows:
[0053] ,
[0054] in, and are the minimum and maximum pixel values of the input image, respectively. is the normalized CT image, is the CT image before normalization;
[0055] 22) Image cropping: The CT images were cropped using the sliding window method, with the window size set to 256*256*64 and the step length set to 128, ensuring that each cropping covered the entire image area;
[0056] 23) Saliency pseudo-label generation: The ResNet-50 saliency detection model is used to generate pseudo labels, marking pixels with a saliency score higher than 0.5 as tumor areas and the remaining pixels as background;
[0057] 24) Optimization of saliency pseudo-labeling: Gaussian blurring is performed on the generated saliency pseudo-labels with a blur kernel size of 5*5 to improve the connectivity of the pseudo-labeled areas;
[0058] 25) Data division: The processed data is divided into training set and validation set in a ratio of 7:3 and saved in .nii format for training of segmentation and diffusion networks.
[0059] The training of the significant reference and decoupled esophageal tumor CT image diffusion segmentation network includes the following detailed steps:
[0060] 31) First, preprocess and load the data. The detailed steps of data preprocessing and loading are as follows:
[0061] 311) Load the preprocessed CT image nuclear saliency labels into the data loader respectively;
[0062] 312) Input CT image Perform normalization so that the pixel value distribution is in the interval [0, 1];
[0063] 313) Saliency Pseudo-Labels Convert to binary form, set the pixel value greater than 0.5 in the saliency pseudo-label to 1, and set the pixel value less than or equal to 0.5 to 0;
[0064] 32) The detailed steps of the forward propagation of the segmentation network are as follows:
[0065] 321) and Sent as input to the encoder part of the segmentation network;
[0066] 322) then execute the encoder structure;
[0067] The first layer encoder performs a 3*3 convolution operation with 3 input channels and 64 output channels, then a linear RELU activation unit, and then performs a 3*3 convolution operation with 64 input channels and 64 output channels, and then a linear RELU activation unit to obtain the un-downsampled feature map A1;
[0068] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F1;
[0069] The second layer encoder performs a 3*3 convolution operation with an input channel of 64 and an output channel of 128, then a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear activation unit RELU, with an input channel of 128 and an output channel of 128, and then passes through a linear RELU activation unit to obtain the un-downsampled feature map A2;
[0070] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F2;
[0071] The third layer encoder performs a 3*3 convolution operation with an input channel of 128 and an output channel of 256, then passes through a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear RELU activation unit, with an input channel of 256 and an output channel of 256, then passes through a linear RELU activation unit to obtain the un-downsampled feature map A3;
[0072] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F3;
[0073] The fourth layer encoder performs a 3*3 convolution operation with an input channel of 256 and an output channel of 512, then passes through a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear RELU activation unit, with an input channel of 512 and an output channel of 512, then passes through a linear RELU activation unit to obtain the un-downsampled feature map A4;
[0074] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F4;
[0075] Each layer output A1, A2, A3, A4 is passed to the decoder part through skip connection for multi-scale fusion;
[0076] 323) Execute decoder structure;
[0077] The first layer decoder performs a deconvolution operation on F4 and outputs feature map U4;
[0078] Then, U4 and A4 are concatenated and two 3*3 convolutional layers are executed. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D3.
[0079] The second layer decoder performs a deconvolution operation on D3 and outputs feature map U3;
[0080] Then concatenate U3 and A3 and perform two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D2.
[0081] The third layer decoder performs a deconvolution operation on D2 and outputs the feature map U2;
[0082] Then concatenate U2 and A2 and perform two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D1.
[0083] The fourth layer decoder performs a deconvolution operation on D1 and outputs the feature map U1;
[0084] Then concatenate U1 and A1 and execute two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit. The input channel is 512 and the output channel is 256. The final output segmentation probability map is obtained. ;
[0085] 33) The detailed steps of the forward propagation of the diffusion network are as follows:
[0086] 331) Perform Gaussian noise addition operation;
[0087] Add noise to the input CT image I according to the diffusion step number t, and generate ;
[0088] 332) Execution encoder structure:
[0089] After a 3*3 convolutional layer, the number of channels increases from 3 to 64;
[0090] After a linear activation unit RELU;
[0091] After a 3*3 convolutional layer, the number of channels remains 64;
[0092] After a linear activation unit RELU;
[0093] After a 2*2 maximum pooling layer, the feature map F1 is obtained;
[0094] After a 3*3 convolutional layer, the number of channels is increased from 64 to 128;
[0095] After a linear activation unit RELU;
[0096] After a 3*3 convolutional layer, the number of channels remains 128;
[0097] After a linear activation unit RELU;
[0098] After a 2*2 maximum pooling layer, the feature map F2 is obtained;
[0099] After a 3*3 convolutional layer, the number of channels is changed from 128 to 256;
[0100] After a linear activation unit RELU, feature map A1 is obtained;
[0101] After a 3*3 convolutional layer, the number of channels remains 256;
[0102] After a linear activation unit RELU, feature map A2 is obtained;
[0103] After a 2*2 maximum pooling layer, the feature map F3 is obtained;
[0104] After a 3*3 convolutional layer, the number of channels changes from 256 to 512;
[0105] After a linear activation unit RELU, feature map A3 is obtained;
[0106] After a 3*3 convolutional layer, the number of channels remains 512;
[0107] After a linear activation unit RELU, feature map A4 is obtained;
[0108] After a 2*2 maximum pooling layer, the feature map F4 is obtained;
[0109] 333) Connect A1, A2, A3, A4 to F1, F2, F3, F4 to the decoder through skip connection;
[0110] 334) Execute decoder structure:
[0111] F4 passes through a 2*2 deconvolution layer, doubling the spatial size;
[0112] After concatenating with A4, it passes through a 3*3 convolutional layer, and the number of channels increases from 1024 to 512;
[0113] After a linear activation unit RELU;
[0114] After a 3*3 convolutional layer, the number of channels increases from 512 to 256;
[0115] After a linear activation unit RELU, the output feature map U3 is obtained;
[0116] U3 goes through a 2*2 deconvolution layer to double the spatial size;
[0117] After concatenating with A3, it passes through a 3*3 convolutional layer, and the number of channels increases from 512 to 256;
[0118] After a linear activation unit RELU;
[0119] After a 3*3 convolutional layer, the number of channels increases from 256 to 128;
[0120] After a linear activation unit RELU, the output feature map U2 is obtained;
[0121] F4 passes through a 2*2 deconvolution layer, doubling the spatial size;
[0122] After concatenating with A2, it passes through a 3*3 convolutional layer, and the number of channels increases from 256 to 128;
[0123] After a linear activation unit RELU;
[0124] After a 3*3 convolutional layer, the number of channels increases from 128 to 64;
[0125] After a linear activation unit RELU, the output feature map U1 is obtained;
[0126] F4 passes through a 2*2 deconvolution layer, doubling the spatial size;
[0127] After concatenating with A1, it passes through a 3*3 convolutional layer, and the number of channels increases from 128 to 64;
[0128] After a linear activation unit RELU;
[0129] After a 3*3 convolutional layer, the number of channels decreases from 64 to 1;
[0130] After a linear activation unit RELU, the final denoised image is obtained ;
[0131] 34) Denoised image Input the segmentation network to get the optimized segmentation probability map ;
[0132] 35) After the forward propagation of the segmentation network and the diffusion network is completed, the back propagation and weight update are further performed. The specific steps are as follows:
[0133] 351) Calculate the segmentation loss, denoising loss, consistency loss and total loss respectively. The specific steps are as follows:
[0134] 3511) Calculate segmentation loss , the formula is as follows:
[0135] ,
[0136] in, is the cross entropy loss, is the Dice loss, =0.5;
[0137] 3512) Calculate denoising loss , the formula is as follows:
[0138] ,
[0139] in, is the expected value symbol, represents the real noise, represents the prediction noise;
[0140] 3513) Execute the calculation of segmentation probability map And denoised probability map The consistency formula is as follows:
[0141] ,
[0142] in is the consistency loss, which ensures the mutual promotion and synergy of the segmentation network and the diffusion network in the output;
[0143] 3514) Calculate total loss :
[0144] Combining all loss functions, the formula is as follows:
[0145] ,
[0146] in, =0.3, =0.1, is the segmentation loss, is the denoising loss, is the consistency loss;
[0147] 352) Perform gradient calculation and weight update. The specific steps are as follows:
[0148] 3521) Gradient calculation:
[0149] according to Perform back propagation and calculate gradients;
[0150] 3522)Optimizer settings:
[0151] Use the Adam optimizer, set the learning rate to 0.001, and the weight decay factor to 0.0001;
[0152] 353) Set the training termination conditions, where the specific settings are:
[0153] 3531) After each round of training, evaluate the specific model performance on the validation set and record the Dice coefficient;
[0154] 3532) If the Dice sparseness of the validation set does not improve for 10 consecutive times, the training is terminated;
[0155] 3533) If the upper limit of training rounds is not reached, continue training.
[0156] The testing and post-processing includes the following steps:
[0157] 41) Perform segmentation network inference. The specific steps are as follows:
[0158] 411) Input the test CT image into the trained segmentation network to generate a diffusion segmentation probability map ;
[0159] 412) Apply the Sigmoid activation function to the segmentation probability map and normalize the output to [0, 1];
[0160] 413) Set the segmentation threshold T = 0.5, perform binarization on the segmentation probability map, and obtain the segmentation result ;
[0161] 42) Perform diffusion network inference. The specific steps are as follows:
[0162] 421) Add Gaussian noise to the test CT image to generate a noisy image , the noise intensity is set according to the number of diffusion steps T;
[0163] 422) Use the trained diffusion network to gradually reverse thrust and restore the initial CT image ;
[0164] 423) Input the restored image into the segmentation network to generate an optimized segmentation probability map ;
[0165] 43) Perform the segmentation result fusion operation. The specific steps are as follows:
[0166] The output of the fusion segmentation network and the denoising network is as follows:
[0167] ,
[0168] in, =0.7, is the weight, is the final output segmentation probability map, is the segmentation probability map, is the diffusion segmentation probability map;
[0169] 44) Perform morphological post-processing operations. The specific steps are as follows:
[0170] 441) Perform dilation operation, use 5*5 dilation convolution to dilate the segmented area and fill small gaps;
[0171] 442) Perform the erosion operation, use the 3*3 erosion convolution to erode the boundary area and remove isolated noise points;
[0172] 45) Perform connected domain analysis:
[0173] The connected domains of the binary segmentation results are marked, the connected domains with an area greater than 500 pixels are retained, and the areas smaller than the area threshold are set as the background;
[0174] 46) Perform boundary smoothing operations as follows:
[0175] Use Gaussian blur with a kernel size of 3*3 to smooth the segmentation boundary, reduce the jagged effect, and optimize the segmentation contour;
[0176] 47) Execute the operations of outputting visualization results and saving output results. The specific steps are as follows:
[0177] 471) Overlay the processed segmentation results with the original CT image to generate a visual segmentation result;
[0178] 472) The output results are saved as PNG or .nii format files for clinical analysis.
[0179] Beneficial Effects
[0180] The present invention combines saliency pseudo-labels with diffusion models through a multi-task segmentation framework of saliency reference and decoupled learning, significantly improving the accuracy and robustness of esophageal tumor CT image segmentation. The gradual denoising capability of the diffusion model is utilized to solve the problem of difficult boundary recognition of traditional segmentation networks in high-noise environments, and the characteristic differences between tumor areas and background tissues are enhanced through saliency pseudo-labels, reducing the risk of false detection and missed detection. At the same time, the segmentation and denoising tasks and decoupling design enable the network to independently optimize each task, thereby improving the overall segmentation performance and the generalization ability of the model. While improving the segmentation accuracy, the present invention has an efficient training and reasoning process, and can provide stable and reliable esophageal tumor segmentation results in complex clinical scenarios, providing important technical support for subsequent tumor diagnosis and treatment planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0181] Figure 1 It is a flow chart of a saliency reference and decoupled diffusion segmentation method for esophageal tumor CT images;
[0182] Figure 2 It is a model diagram of a diffusion segmentation method for esophageal tumor CT images with significant reference and decoupling;
[0183] Figure 3 It is a structural diagram of the segmentation network in the esophageal tumor CT image diffusion segmentation method based on saliency reference and decoupling;
[0184] Figure 4 It is a structural diagram of the diffusion network in the diffusion segmentation method of esophageal tumor CT images based on saliency reference and decoupling; DETAILED DESCRIPTION
[0185] In order to have a further understanding and recognition of the structural features and the effects achieved by the present invention, a preferred embodiment and accompanying drawings are used for detailed description as follows:
[0186] like Figure 1As shown, the esophageal tumor CT image diffusion segmentation method of the present invention with significant reference and decoupling includes the following steps:
[0187] The first step is the preparation of the saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images:
[0188] The esophageal tumor CT image data was preprocessed, including normalization, cropping, significant label generation and optimization steps, to ensure the consistency of input data and the accuracy of significant area labeling. The specific steps are as follows:
[0189] (1) Data normalization: Normalize the pixel values of the CT image to the interval [0, 1] using the following formula:
[0190] ,
[0191] in, and are the minimum and maximum pixel values of the input image, respectively. is the normalized CT image, is the CT image before normalization;
[0192] (2) Image cropping: The CT images were cropped using the sliding window method. The window size was set to 256*256*64 and the step size was 128, ensuring that each cropping covered the entire image area.
[0193] (3) Generation of saliency pseudo-labels: The ResNet-50 saliency detection model is used to generate pseudo-labels, marking pixels with a saliency score higher than 0.5 as tumor areas and the remaining pixels as background.
[0194] (4) Optimization of saliency pseudo-labeling: Gaussian blurring is performed on the generated saliency pseudo-labels with a blur kernel size of 5*5 to improve the connectivity of the pseudo-labeled areas.
[0195] (5) Data partitioning: The processed data is divided into a training set and a validation set in a ratio of 7:3 and saved in .nii format for training the segmentation and diffusion networks.
[0196] The second step is to construct the segmentation network and diffusion network of the saliency reference and decoupled esophageal tumor CT image diffusion segmentation network:
[0197] The specific steps are as follows:
[0198] (1) Constructing a segmentation network of saliency reference and decoupled diffusion segmentation network of esophageal tumor CT images, the steps are as follows:
[0199] (1-1) Construct a spatial downsampling structure. The spatial downsampling structure includes an encoder module, which consists of 4 layers of downsampling units. The specific structure of each layer is as follows:
[0200] (1-1-1) Two 3*3 convolutional layers, with the stride set to 1 and the padding method the same;
[0201] (1-1-2) A RELU linear activation unit is added after each convolutional layer for activation;
[0202] (1-1-3) A maximum pooling layer with a kernel size of 2*2;
[0203] (1-2) Construct a spatial upsampling structure. The spatial upsampling structure includes a decoder module, which consists of 4 layers of upsampling units. The specific structure of each layer is as follows:
[0204] (1-2-1) A deconvolution layer with a convolution kernel size of 2*2;
[0205] (1-2-2) Two 3*3 convolutional layers, with the stride set to 1 and the padding method the same;
[0206] (1-2-3) A RELU linear activation unit is added after each convolutional layer for activation;
[0207] (1-3) Construct the interactive structure of the downsampling structure and the upsampling structure. The specific structure is as follows:
[0208] (1-3-1) Use four skip connections to concatenate the feature map of the output of each downsampling layer with the output of the upsampling layer;
[0209] (1-3-2) After the last layer of downsampling, it passes through two 3*3 convolutional layers;
[0210] (1-4) Construct a saliency fusion module, whose specific structure is as follows:
[0211] (1-4-1) The saliency pseudo-label is embedded in each layer of the decoder through a skip connection, and the fusion formula is as follows:
[0212] ,
[0213] in, represents the fused decoder features, represents the decoder features before fusion, represents the significant pseudo-label feature, and λ=0.5 represents the weight of the significant feature;
[0214] The specific steps are as follows:
[0215] CT images are passed through a saliency detection network to obtain saliency pseudo labels;
[0216] The saliency pseudo-labels pass through a four-layer encoder structure, which is consistent with the encoder structure of the segmentation network;
[0217] Then, each salient pseudo-label that passes through the encoder layer is concatenated with the input of the segmentation network encoder through a skip connection;
[0218] (2) Constructing a diffusion network of saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images, the steps are as follows:
[0219] (2-1) Forward diffusion process: The forward diffusion process gradually inputs the CT image Add Gaussian noise to gradually change from structured data to random noise. The specific formula is as follows:
[0220] ,
[0221] in = , indicating signal strength; [0.0001, 0.02] is the intensity of adding noise at each step; N is a normal distribution; a linear variance schedule is used, and after T=1000 steps of diffusion, the initial image Transformed into completely random noise ;
[0222] (2-2) Reverse denoising process: Reverse denoising predicts noise through a neural network and gradually restores the image. The formula is as follows:
[0223] ,
[0224] in is the variance, representing the noise scale in the diffusion process; is the mean, indicating that from the current noise image Predict the next step Central location;
[0225] The mean calculation formula is:
[0226] ,
[0227] in, is the noise distribution predicted by the neural network; is the accumulated signal strength;
[0228] Reverse generation from random noise Start by gradually denoising to generate a restored image ;
[0229] (2-3) The diffusion network of the esophageal tumor CT image diffusion segmentation method with saliency reference and decoupling adopts the encoder-decoder architecture of UNet and is designed in combination with time embedding and residual blocks. Its specific structure is as follows:
[0230] (2-3-1) The encoder extracts multi-scale features by downsampling layer by layer. The encoder module contains the following components:
[0231] (2-3-1-1) Convolutional layer, each layer contains two 3*3 convolution operations, the convolution kernel filling method is the same, and each convolution layer is followed by batch normalization BN and a RELU linear activation unit;
[0232] (2-3-1-2) Maximum pooling layer, used for downsampling, the pooling kernel size is 2*2;
[0233] (2-3-2) The decoder module gradually restores the image size by upsampling layer by layer and contains the following components:
[0234] (2-3-2-1) A deconvolution layer, using a 2*2 deconvolution sum to restore the spatial resolution of the feature map;
[0235] (2-3-2-2) Convolutional layer, each layer contains two 3*3 convolution operations, the convolution kernel filling method is the same, and each convolution layer is followed by batch normalization BN and a RELU linear activation unit;
[0236] (2-3-3) Time embedding module: Time embedding runs through the entire encoder and decoder. It is responsible for mapping the time information t into a feature vector, passing through the linear layer and then injecting it into the feature map of each convolution layer to ensure the model's dynamic perception of noise at each step;
[0237] (2-3-4) Skip connection structure: each layer of the encoder concatenates the features of the corresponding layer to the decoder feature map through a skip connection.
[0238] The third step is to train the diffusion segmentation network of esophageal tumor CT images with significant reference and decoupled:
[0239] The segmentation network with preprocessed CT images and salient pseudo labels as input is constructed. The network consists of a multi-layer encoder, a decoder, a jump connection module, and a salient feature fusion module. The diffusion model constructs a diffusion network with noisy CT images and salient pseudo labels as input. The diffusion network contains multi-layer convolution modules to complete the forward addition and reverse denoising operations. The specific steps are as follows:
[0240] (1) First, preprocess and load the data. The detailed steps of data preprocessing and loading are as follows:
[0241] (1-1) Load the preprocessed CT image nuclear saliency labels into the data loader respectively;
[0242] (1-2) Input CT image Perform normalization so that the pixel value distribution is in the interval [0, 1];
[0243] (1-3) Saliency Pseudo Labels Convert to binary form, set the pixel value greater than 0.5 in the saliency pseudo-label to 1, and set the pixel value less than or equal to 0.5 to 0;
[0244] (2) The detailed steps of the forward propagation of the segmentation network are as follows:
[0245] (2-1) and Sent as input to the encoder part of the segmentation network;
[0246] (2-2) Then execute the encoder structure;
[0247] The first layer encoder performs a 3*3 convolution operation with 3 input channels and 64 output channels, then a linear RELU activation unit, and then performs a 3*3 convolution operation with 64 input channels and 64 output channels, and then a linear RELU activation unit to obtain the un-downsampled feature map A1;
[0248] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F1;
[0249] The second layer encoder performs a 3*3 convolution operation with an input channel of 64 and an output channel of 128, then a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear activation unit RELU, with an input channel of 128 and an output channel of 128, and then passes through a linear RELU activation unit to obtain the un-downsampled feature map A2;
[0250] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F2;
[0251] The third layer encoder performs a 3*3 convolution operation with an input channel of 128 and an output channel of 256, then passes through a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear RELU activation unit, with an input channel of 256 and an output channel of 256, then passes through a linear RELU activation unit to obtain the un-downsampled feature map A3;
[0252] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F3;
[0253] The fourth layer encoder performs a 3*3 convolution operation with an input channel of 256 and an output channel of 512, then passes through a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear RELU activation unit, with an input channel of 512 and an output channel of 512, then passes through a linear RELU activation unit to obtain the un-downsampled feature map A4;
[0254] Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F4;
[0255] Each layer output A1, A2, A3, A4 is passed to the decoder part through skip connection for multi-scale fusion;
[0256] (2-3) Execute decoder structure;
[0257] The first layer decoder performs a deconvolution operation on F4 and outputs feature map U4;
[0258] Then, U4 and A4 are concatenated and two 3*3 convolutional layers are executed. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D3.
[0259] The second layer decoder performs a deconvolution operation on D3 and outputs feature map U3;
[0260] Then concatenate U3 and A3 and perform two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D2.
[0261] The third layer decoder performs a deconvolution operation on D2 and outputs the feature map U2;
[0262] Then concatenate U2 and A2 and perform two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D1.
[0263] The fourth layer decoder performs a deconvolution operation on D1 and outputs the feature map U1;
[0264] Then concatenate U1 and A1 and execute two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit. The input channel is 512 and the output channel is 256. The final output segmentation probability map is obtained. ;
[0265] (3) The detailed steps of the forward propagation of the diffusion network are as follows:
[0266] (3-1) Perform Gaussian noise addition operation;
[0267] Add noise to the input CT image I according to the diffusion step number t, and generate ;
[0268] (3-2) Execution encoder structure:
[0269] (3-2-1) After a 3*3 convolutional layer, the number of channels increases from 3 to 64;
[0270] After a linear activation unit RELU;
[0271] After a 3*3 convolutional layer, the number of channels remains 64;
[0272] After a linear activation unit RELU;
[0273] After a 2*2 maximum pooling layer, the feature map F1 is obtained;
[0274] After a 3*3 convolutional layer, the number of channels is increased from 64 to 128;
[0275] After a linear activation unit RELU;
[0276] After a 3*3 convolutional layer, the number of channels remains 128;
[0277] After a linear activation unit RELU;
[0278] After a 2*2 maximum pooling layer, the feature map F2 is obtained;
[0279] After a 3*3 convolutional layer, the number of channels is changed from 128 to 256;
[0280] After a linear activation unit RELU, feature map A1 is obtained;
[0281] After a 3*3 convolutional layer, the number of channels remains 256;
[0282] After a linear activation unit RELU, feature map A2 is obtained;
[0283] After a 2*2 maximum pooling layer, the feature map F3 is obtained;
[0284] After a 3*3 convolutional layer, the number of channels changes from 256 to 512;
[0285] After a linear activation unit RELU, feature map A3 is obtained;
[0286] After a 3*3 convolutional layer, the number of channels remains 512;
[0287] After a linear activation unit RELU, feature map A4 is obtained;
[0288] After a 2*2 maximum pooling layer, the feature map F4 is obtained;
[0289] (3-3) Connect A1, A2, A3, A4 to F1, F2, F3, F4 to the decoder through skip connection;
[0290] (3-4) Execution decoder structure:
[0291] F4 passes through a 2*2 deconvolution layer, doubling the spatial size;
[0292] After concatenating with A4, it passes through a 3*3 convolutional layer, and the number of channels increases from 1024 to 512;
[0293] After a linear activation unit RELU;
[0294] After a 3*3 convolutional layer, the number of channels increases from 512 to 256;
[0295] After a linear activation unit RELU, the output feature map U3 is obtained;
[0296] U3 goes through a 2*2 deconvolution layer to double the spatial size;
[0297] After concatenating with A3, it passes through a 3*3 convolutional layer, and the number of channels increases from 512 to 256;
[0298] After a linear activation unit RELU;
[0299] After a 3*3 convolutional layer, the number of channels increases from 256 to 128;
[0300] After a linear activation unit RELU, the output feature map U2 is obtained;
[0301] F4 passes through a 2*2 deconvolution layer, doubling the spatial size;
[0302] After concatenating with A2, it passes through a 3*3 convolutional layer, and the number of channels increases from 256 to 128;
[0303] After a linear activation unit RELU;
[0304] After a 3*3 convolutional layer, the number of channels increases from 128 to 64;
[0305] After a linear activation unit RELU, the output feature map U1 is obtained;
[0306] F4 passes through a 2*2 deconvolution layer, doubling the spatial size;
[0307] After concatenating with A1, it passes through a 3*3 convolutional layer, and the number of channels increases from 128 to 64;
[0308] After a linear activation unit RELU;
[0309] After a 3*3 convolutional layer, the number of channels decreases from 64 to 1;
[0310] After a linear activation unit RELU, the final denoised image is obtained ;
[0311] (4) Denoised image Input the segmentation network to get the optimized segmentation probability map ;
[0312] (5) After the forward propagation of the segmentation network and the diffusion network is completed, further back propagation and weight update are performed. The specific steps are as follows:
[0313] (5-1) Calculate the segmentation loss, denoising loss, consistency loss and total loss respectively. The specific steps are as follows:
[0314] (5-1-1) Calculate segmentation loss , the formula is as follows:
[0315] ,
[0316] in, is the cross entropy loss, Dice loss, α=0.5;
[0317] (5-1-2) Calculate denoising loss , the formula is as follows:
[0318] ,
[0319] in, is the expected value symbol, represents the real noise, represents the prediction noise;
[0320] (5-1-3) Calculate the segmentation probability map And denoised probability map The consistency formula is as follows:
[0321] ,
[0322] in is the consistency loss, which ensures the mutual promotion and synergy of the segmentation network and the diffusion network in the output;
[0323] (5-1-4) Calculation of total losses :
[0324] Combining all loss functions, the formula is as follows:
[0325] ,
[0326] in, =0.3, =0.1, is the segmentation loss, is the denoising loss, is the consistency loss;
[0327] (5-2) Perform gradient calculation and weight update. The specific steps are as follows:
[0328] (5-2-1) Gradient calculation:
[0329] according to Perform back propagation and calculate gradients;
[0330] (5-2-2) Optimizer settings:
[0331] Use the Adam optimizer, set the learning rate to 0.001, and the weight decay factor to 0.0001;
[0332] (5-3) Set the training termination conditions, where the specific settings are:
[0333] (5-3-1) After each round of training, evaluate the specific model performance on the validation set and record the Dice coefficient;
[0334] (5-3-2) If the Dice sparseness of the validation set does not improve for 10 consecutive times, the training is terminated;
[0335] (5-3-3) If the upper limit of the number of training rounds is not reached, continue training.
[0336] The fourth step is to test and post-process the significant reference and decoupled esophageal tumor CT image diffusion segmentation method:
[0337] The specific steps are as follows:
[0338] (1) Perform segmentation network inference. The specific steps are as follows:
[0339] (1-1) Input the test CT image into the trained segmentation network to generate a segmentation probability map ;
[0340] (1-2) Apply the Sigmoid activation function to the segmentation probability map and normalize the output to [0, 1];
[0341] (1-3) Set the segmentation threshold T = 0.5, perform a binarization operation on the segmentation probability map, and obtain the segmentation result ;
[0342] (2) Perform diffusion network inference. The specific steps are as follows:
[0343] (2-1) Add Gaussian noise to the test CT image to generate a noisy image , the noise intensity is set according to the number of diffusion steps T;
[0344] (2-2) Use the trained diffusion network to gradually reverse thrust and restore the initial CT image ;
[0345] (2-3) Input the restored image into the segmentation network to generate an optimized segmentation probability map ;
[0346] (3) Perform the segmentation result fusion operation. The specific steps are as follows:
[0347] The output of the fusion segmentation network and the denoising network is as follows:
[0348] ,
[0349] in, =0.7, is the weight;
[0350] (4) Perform morphological post-processing operations. The specific steps are as follows:
[0351] (4-1) Perform the dilation operation, using a 5*5 dilated convolution to dilate the segmented area and fill small gaps;
[0352] (4-2) Perform the erosion operation, use 3*3 erosion convolution to erode the boundary area and remove isolated noise points;
[0353] (5) Perform connected domain analysis:
[0354] The connected domains of the binary segmentation results are marked, the connected domains with an area greater than 500 pixels are retained, and the areas smaller than the area threshold are set as the background;
[0355] (6) Perform boundary smoothing operation as follows:
[0356] Use Gaussian blur with a kernel size of 3*3 to smooth the segmentation boundary, reduce the jagged effect, and optimize the segmentation contour;
[0357] (7) Execute the operations of outputting visualization results and saving output results. The specific steps are as follows:
[0358] (7-1) Superimposing the processed segmentation result with the original CT image to generate a visual segmentation result;
[0359] (7-2) The output results are saved as PNG or .nii format files for clinical analysis.
[0360] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A saliency reference and decoupled diffusion segmentation method for esophageal tumor CT images, characterized in that: The following steps are involved: 11) Preparation of the saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images: Preprocessing of esophageal tumor CT image data, including normalization, cropping, saliency label generation and optimization steps, to ensure the consistency of input data and the accuracy of salient area labeling; 12) Construct a segmentation network and a diffusion network of a saliency reference and decoupled esophageal tumor CT image diffusion segmentation network: construct a segmentation network whose input is a preprocessed CT image and a saliency pseudo-label, and the network consists of a multi-layer encoder, a decoder, a jump connection module, and a saliency feature fusion module; a diffusion model, construct a diffusion network whose input is a noisy CT image and a saliency pseudo-label; the diffusion network contains a multi-layer convolution module to complete forward addition and reverse denoising operations; the specific steps are as follows: 121) Construct a segmentation network of a saliency reference and decoupled esophageal tumor CT image diffusion segmentation network, and the steps are as follows: 1211) Construct a spatial downsampling structure, the spatial downsampling structure includes an encoder module, which consists of 4 layers of downsampling units, and the specific structure of each layer is as follows: 12111) Two 3*3 convolutional layers, the stride is set to 1, and the padding method is the same; 12112) A RELU linear activation unit is added after each convolutional layer for activation; 12113) A maximum pooling layer with a kernel size of 2*2; 1212) construct a spatial upsampling structure, which includes a decoder module consisting of 4 layers of upsampling units, and the specific structure of each layer is as follows: 12121) a deconvolution layer with a convolution kernel size of 2*2; 12122) Two 3*3 convolutional layers, the stride is set to 1, and the padding method is the same; 12123) A RELU linear activation unit is added after each convolutional layer for activation; 1213) construct an interactive structure of the downsampling structure and the upsampling structure, the specific structure is as follows: 12131) Use four skip connections to concatenate the output feature map of each downsampling layer with the output of the upsampling layer; 12132) After the last layer of downsampling, it passes through two 3*3 convolutional layers; 1214) constructs a saliency fusion module, the specific structure of which is as follows: The saliency pseudo-label is embedded in each layer of the decoder through skip connections, and the fusion formula is as follows: F enhanced =F decoder +λ·F saliency , Among them, F enhanced represents the fused decoder features, F decoder represents the decoder features before fusion, F saliency represents the significant pseudo-label feature, λ=0.5 represents the weight of the significant feature; The specific steps are as follows: CT images are passed through a saliency detection network to obtain saliency pseudo labels; The saliency pseudo-labels pass through a four-layer encoder structure, which is consistent with the encoder structure of the segmentation network; Then, each salient pseudo-label that passes through the encoder layer is concatenated with the input of the segmentation network encoder through a skip connection; 122) Constructing a diffusion network of saliency reference and decoupled diffusion segmentation network of esophageal tumor CT images, the steps are as follows: 1221) Forward diffusion process: The forward diffusion process gradually transfers the input CT image I input Add Gaussian noise to gradually change from structured data to random noise. The specific formula is as follows: where α t =1-β t , indicating signal strength; β t ∈[0.0001, 0.02], is the intensity of adding noise at each step; N is a normal distribution; a linear variance schedule is used, and after T = 1000 steps of diffusion, the initial image x o Transformed into completely random noise x T ; 1222) Reverse denoising process: Reverse denoising predicts noise through a neural network and gradually restores the image. The formula is as follows: in is the variance, representing the noise scale in the diffusion process; μ θ (x t ) is the mean, indicating that from the current noise image x t Predict the next step x t-1 Central location; The mean calculation formula is: Among them, ε θ (x t , t) is the noise distribution predicted by the neural network; is the accumulated signal strength; Reverse generation from random noise x T Start by gradually denoising to generate the restored image x o ; 1223) The diffusion network of the esophageal tumor CT image diffusion segmentation method based on saliency reference and decoupling adopts the encoder-decoder architecture of UNet and is designed in combination with time embedding and residual blocks. Its specific structure is as follows: 12231) The encoder extracts multi-scale features by downsampling layer by layer. The encoder module contains the following components: 122311) convolutional layer, each layer contains two 3*3 convolution operations, the convolution kernel filling method is the same, and each convolution layer is followed by batch normalization BN and a RELU linear activation unit; 122312) Maximum pooling layer, used for downsampling, the pooling kernel size is 2*2; 12232) The decoder module gradually restores the image size by upsampling layer by layer, and contains the following components: 122321) a deconvolution layer, using a 2*2 deconvolution sum to restore the spatial resolution of the feature map; 122322) convolutional layer, each layer contains two 3*3 convolution operations, the convolution kernel filling method is the same, and each convolution layer is followed by batch normalization BN and a RELU linear activation unit; 12233) Time embedding module: Time embedding runs through the entire encoder and decoder, and is responsible for mapping the time information t into a feature vector, which is then injected into the feature map of each convolution layer through the linear layer to ensure the model's dynamic perception of noise at each step; 12234) skip connection structure, each layer of the encoder splices the features of the corresponding layer to the decoder feature map through a skip connection; 13) Train a saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images: Ensure complementary optimization of segmentation and denoising tasks, and design a joint optimization strategy by combining cross entropy loss function, Dice loss function, mean square error function, and consistency loss; 14) Testing and solving the saliency reference and decoupled diffusion segmentation network of esophageal tumor CT images: Inferring unlabeled data through the trained network and combining morphological operations to improve the accuracy of segmentation boundaries.
2. The method for diffusion segmentation of esophageal tumor CT images based on saliency reference and decoupling according to claim 1, characterized in that: The preparation of the saliency reference and decoupled esophageal tumor CT image diffusion segmentation network includes the following steps: 21) Data normalization: Normalize the pixel values of the CT image to the interval [0, 1], the formula is as follows: Among them, I min and I max are the minimum and maximum values of the input image pixel values, I norm is the CT image after normalization, and I is the CT image before normalization; 22) Image cropping: The CT images were cropped using the sliding window method, with the window size set to 256*256*64 and the step length set to 128, ensuring that each cropping covered the entire image area; 23) Saliency pseudo-label generation: The ResNet-50 saliency detection model is used to generate pseudo labels, marking pixels with a saliency score higher than 0.5 as tumor areas and the remaining pixels as background; 24) Optimization of saliency pseudo-labeling: Gaussian blurring is performed on the generated saliency pseudo-labels with a blur kernel size of 5*5 to improve the connectivity of the pseudo-labeled areas; 25) Data partitioning: The processed data is divided into training set and validation set in a ratio of 7:3 and saved in .nii format for training of segmentation and diffusion networks.
3. The method for diffusion segmentation of esophageal tumor CT images based on saliency reference and decoupling according to claim 1, characterized in that: Training the saliency reference and decoupled diffusion segmentation network for esophageal tumor CT images includes the following detailed steps: 31) First, the data is preprocessed and loaded. The detailed steps of data preprocessing and loading are as follows: 311) loading the preprocessed CT image nuclear saliency labels into the data loader respectively; 312) Input CT image I input Perform normalization so that the pixel value distribution is in the interval [0, 1]; 313)Saliency pseudo label S label Convert to binary form, set the pixel value greater than 0.5 in the saliency pseudo-label to 1, and set the pixel value less than or equal to 0.5 to 0; 32) The detailed steps of the forward propagation of the segmentation network are as follows: 321) Will I input and S label Sent as input to the encoder part of the segmentation network; 322) then execute the encoder structure; The first layer encoder performs a 3*3 convolution operation with 3 input channels and 64 output channels, then a linear RELU activation unit, and then performs a 3*3 convolution operation with 64 input channels and 64 output channels, and then a linear RELU activation unit to obtain the un-downsampled feature map A1; Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F1; The second layer encoder performs a 3*3 convolution operation with an input channel of 64 and an output channel of 128, then a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear activation unit RELU, with an input channel of 128 and an output channel of 128, and then passes through a linear RELU activation unit to obtain the un-downsampled feature map A2; Perform the maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F2; The third-layer encoder performs a 3*3 convolution operation with an input channel of 128 and an output channel of 256, then passes through a linear RELU activation unit, then performs a 3*3 convolution operation, then passes through a linear RELU activation unit, with an input channel of 256 and an output channel of 256, then passes through a linear RELU activation unit to obtain the un-downsampled feature map A3; performs a maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F3; The fourth-layer encoder performs a 3*3 convolution operation with an input channel of 256 and an output channel of 512, then passes through a linear RELU activation unit, and then performs a 3*3 convolution operation, then passes through a linear RELU activation unit, with an input channel of 512 and an output channel of 512, and then passes through a linear RELU activation unit to obtain the un-downsampled feature map A4; performs a maximum pooling operation with a pooling kernel size of 2*2 to obtain the downsampled feature map F4; Each layer output A1, A2, A3, A4 is passed to the decoder part through skip connection for multi-scale fusion; 323) Execute decoder structure; The first layer decoder performs a deconvolution operation on F4 and outputs feature map U4; Then, U4 and A4 are concatenated and two 3*3 convolutional layers are executed. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D3. The second layer decoder performs a deconvolution operation on D3 and outputs feature map U3; Then concatenate U3 and A3 and perform two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D2. The third layer decoder performs a deconvolution operation on D2 and outputs the feature map U2; Then concatenate U2 and A2 and perform two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit, with an input channel of 512 and an output channel of 256, to obtain the output feature map D1. The fourth layer decoder performs a deconvolution operation on D1 and outputs the feature map U1; Then concatenate U1 and A1 and execute two 3*3 convolutional layers. Each convolutional layer is followed by a linear RELU activation unit. The input channel is 512 and the output channel is 256. The final output segmentation probability map P is obtained. seg ; 33) The detailed steps of the forward propagation of the diffusion network are as follows: 331) performing a Gaussian noise adding operation; Add noise to the input CT image I according to the diffusion step number t, and generate x t ; 332) Execution encoder structure: After a 3*3 convolutional layer, the number of channels increases from 3 to 64; After a linear activation unit RELU; After a 3*3 convolutional layer, the number of channels remains 64; After a linear activation unit RELU; After a 2*2 maximum pooling layer, the feature map F1 is obtained; After a 3*3 convolutional layer, the number of channels is increased from 64 to 128; After a linear activation unit RELU; After a 3*3 convolutional layer, the number of channels remains 128; After a linear activation unit RELU; After a 2*2 maximum pooling layer, the feature map F2 is obtained; After a 3*3 convolutional layer, the number of channels is changed from 128 to 256; After a linear activation unit RELU, feature map A1 is obtained; After a 3*3 convolutional layer, the number of channels remains 256; After a linear activation unit RELU, feature map A2 is obtained; After a 2*2 maximum pooling layer, the feature map F3 is obtained; After a 3*3 convolutional layer, the number of channels changes from 256 to 512; After a linear activation unit RELU, feature map A3 is obtained; After a 3*3 convolutional layer, the number of channels remains 512; After a linear activation unit RELU, feature map A4 is obtained; After a 2*2 maximum pooling layer, the feature map F4 is obtained; 333) connect A1, A2, A3, A4, respectively to F1, F2, F3, F4 to the decoder through skip connection; 334) Execute decoder structure: F4 passes through a 2*2 deconvolution layer, doubling the spatial size; After concatenating with A4, it passes through a 3*3 convolutional layer, and the number of channels increases from 1024 to 512; After a linear activation unit RELU; After a 3*3 convolutional layer, the number of channels increases from 512 to 256; After a linear activation unit RELU, the output feature map U3 is obtained; U3 goes through a 2*2 deconvolution layer to double the spatial size; After concatenating with A3, it passes through a 3*3 convolutional layer, and the number of channels increases from 512 to 256; After a linear activation unit RELU; After a 3*3 convolutional layer, the number of channels increases from 256 to 128; After a linear activation unit RELU, the output feature map U2 is obtained; F4 passes through a 2*2 deconvolution layer, doubling the spatial size; After concatenating with A2, it passes through a 3*3 convolutional layer, and the number of channels increases from 256 to 128; After a linear activation unit RELU; After a 3*3 convolutional layer, the number of channels increases from 128 to 64; After a linear activation unit RELU, the output feature map U1 is obtained; F4 passes through a 2*2 deconvolution layer, doubling the spatial size; After concatenating with A1, it passes through a 3*3 convolutional layer, and the number of channels increases from 128 to 64; After a linear activation unit RELU; After a 3*3 convolutional layer, the number of channels decreases from 64 to 1; After a linear activation unit RELU, the final denoised image x0 is obtained; 34) Input the denoised image x0 into the segmentation network to obtain the optimized segmentation probability map P denoise ; 35) After the forward propagation of the segmentation network and the diffusion network is completed, the back propagation and weight update are further performed. The specific steps are as follows: 351) Calculate the segmentation loss, denoising loss, consistency loss and total loss respectively. The specific steps are as follows: 3511) Calculate the segmentation loss L seg , the formula is as follows: L seg =L CE +α·L Dice , Among them, L CE is the cross entropy loss, L Dice Dice loss, α = 0.5; 3512) Calculate the denoising loss L denoise , the formula is as follows: in, is the expected value symbol, ∈ represents the real noise, ∈ θ (x t , t) represents the prediction noise; 3513) Execute the calculation of the segmentation probability map P seg and denoised probability map P denoise The consistency formula is as follows: L consistency =||P denoise -P seg || 2 , Where L consistency is the consistency loss, which ensures the mutual promotion and synergy of the segmentation network and the diffusion network in the output; 3514) Calculate the total loss L total : Combining all loss functions, the formula is as follows: L total =L seg +β·L denoise +γ·L consistency , Among them, β=0.3, γ=0.1, L seg is the segmentation loss, L denoise is the denoising loss, L consistency is the consistency loss; 352) performs gradient calculation and weight update. The specific steps are as follows: 3521) Gradient calculation: According to L total Perform back propagation and calculate gradients; 3522)Optimizer settings: Use the Adam optimizer, set the learning rate to 0.001, and the weight decay factor to 0.0001; 353) Set the training termination conditions, where the specific settings are: 3531) After each round of training, the specific model performance is evaluated on the validation set and the Dice coefficient is recorded; 3532) If the Dice sparseness of the validation set does not improve for 10 consecutive times, the training is terminated; 3533) If the upper limit of the number of training rounds is not reached, continue training.
4. The method for diffusion segmentation of esophageal tumor CT images based on saliency reference and decoupling according to claim 1, characterized in that: The testing and post-processing includes the following steps: 41) Perform segmentation network inference. The specific steps are as follows: 411) Input the test CT image into the trained segmentation network to generate the segmentation probability map P seg ; 412) Apply the Sigmoid activation function to the segmentation probability map and normalize the output to [0, 1]; 413) Set the segmentation threshold T = 0.5, perform a binarization operation on the segmentation probability map, and obtain the segmentation result P seg ; 42) Perform diffusion network inference. The specific steps are as follows: 421) Add Gaussian noise to the test CT image to generate a noise image x T , the noise intensity is set according to the number of diffusion steps T; 422) Use the trained diffusion network to gradually reverse thrust and restore the initial CT image x0; 423) Input the restored image into the segmentation network to generate the optimized segmentation probability map P denoise ; 43) Perform the segmentation result fusion operation. The specific steps are as follows: The output of the fusion segmentation network and the denoising network is as follows: P final =ω·P seg +(1-ω)·P denoise , Among them, ω = 0.7, is the weight; 44) Perform morphological post-processing operations. The specific steps are as follows: 441) Perform a dilation operation, using a 5*5 dilated convolution to dilate the segmented area and fill small gaps; 442) Perform an erosion operation, use a 3*3 erosion convolution to erode the boundary area and remove isolated noise points; 45) Perform connected domain analysis: The connected domains of the binary segmentation results are marked, the connected domains with an area greater than 500 pixels are retained, and the areas smaller than the area threshold are set as the background; 46) Perform boundary smoothing operations as follows: Use Gaussian blur with a kernel size of 3*3 to smooth the segmentation boundary, reduce the jagged effect, and optimize the segmentation contour; 47) Execute the operation of outputting visualization results and saving output results. The specific steps are as follows: 471) superimposing the processed segmentation result with the original CT image to generate a visual segmentation result; 472) The output results are saved as PNG or .nii format files for clinical analysis.
Citation Information
Patent Citations
Medical image segmentation method based on conditional Bernoulli diffusion
CN116309682A
Medical image tumor segmentation method based on diffusion model and multi-modal fusion
CN116664605A