Method for brain tumor segmentation based on diffusion model of dynamic enhancement
By using multi-scale feature adaptive fusion and step size uncertainty fusion of the DED-UNet network, the accuracy and robustness issues of brain tumor segmentation in existing technologies are solved, achieving lightweight and efficient brain tumor segmentation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-04-02
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, fixed convolution kernels lead to insufficient feature fusion, making it impossible to accurately model the hierarchical structure of brain tumors. This results in missed detection of small lesions, blurred segmentation boundaries, and difficulty in balancing model lightweighting with segmentation accuracy, as well as low efficiency in utilizing multi-step prediction results.
A lightweight dynamic attention denoising UNet network (LDA-DU network) is combined with a lightweight global enhancement feature encoder (LG-FE) to achieve multi-scale feature adaptive fusion. The multi-step prediction results are optimized through a step size uncertainty fusion module to construct the DED-UNet network.
It achieves precise segmentation of brain tumor regions, improves segmentation accuracy and robustness, and reduces computational complexity, thus meeting the needs of rapid diagnosis of non-ideal clinical data.
Smart Images

Figure CN122177374A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image processing technology, specifically relating to a brain tumor segmentation method based on a diffusion model with dynamic enhancement. Background Technology
[0002] Multimodal MRI brain tumor segmentation is a key task in the field of medical image analysis. Commonly used datasets include four modalities: T1, T1ce, T2, and FLAIR. Accurate segmentation of three regions is required: the entire tumor (WT), the tumor core (TC), and the enhanced tumor (ET). This type of data has significant characteristics: heterogeneous and complementary information from different modalities; hierarchical inclusion relationships within tumor regions; and a low proportion and blurred boundaries of small lesions such as ET. Furthermore, it is affected by non-ideal factors such as differences in scanning equipment and image noise, leading to significant challenges in accurate segmentation. It requires not only effectively fusing local and global features from multiple modalities but also considering the representation of small lesions, class balance, and robust adaptation.
[0003] Existing technologies can be mainly divided into three categories: Traditional CNN methods (3DU-Net, SegResNet) extract multi-scale features through encoder-decoder structures with fixed convolutional kernels, but the feature fusion mode of local receptive field limitation and fixed kernel cannot achieve adaptive matching of global spatial dependence and local detailed features, and cannot model tumor hierarchical relationships, resulting in weak representation ability of small lesions; Transformer-type methods (UNETR, TransBTS) enhance global features through self-attention, but still rely on fixed convolutional kernels for basic feature extraction, failing to solve the problem of insufficient hierarchical structure modeling, and having the derivative defect of high computational complexity; Diffusion model-type methods (MedSegDiff, Diff-UNet) improve robustness through iterative denoising, but existing 3D diffusion segmentation methods still use fixed convolutional kernels for feature fusion, resulting in low feature fusion efficiency, inability to adapt to the needs of brain tumor hierarchical segmentation, and the derivative problem of low utilization efficiency of multi-step prediction results.
[0004] In summary, the core pain points of existing technologies are: the fixed convolution kernel feature processing mode leads to insufficient fusion of global and local features, making it impossible to accurately model the hierarchical inclusion relationship of brain tumors WT / TC / ET, directly causing the core problems of missed detection of small lesions and blurred segmentation boundaries; at the same time, it also leads to secondary problems such as the difficulty in balancing model lightweighting and segmentation accuracy, and low efficiency in utilizing multi-step prediction results, which seriously limit the accuracy and robustness of brain tumor segmentation. To address this, this invention provides a brain tumor segmentation method based on a diffusion model with dynamic enhancement. Summary of the Invention
[0005] This invention proposes a brain tumor segmentation method based on a dynamically enhanced diffusion model, abbreviated as DED-UNet. This method addresses the core pain points of existing technologies, such as insufficient feature fusion due to fixed convolutional kernels and inadequate modeling of brain tumor hierarchical structures. The core design incorporates a dynamically enhanced kernel-driven multi-scale feature adaptive fusion mechanism implemented in a lightweight dynamic attention denoising UNet network, abbreviated as LDA-DU. Simultaneously, a lightweight global enhanced feature encoder LG-FE provides a high-quality multi-scale feature base for this core mechanism, and a step size uncertainty fusion module (SUF) adaptively fuses the multi-step outputs of this core mechanism. Through this end-to-end architecture of "core mechanism + supporting modules," accurate 3D brain tumor segmentation (WT / TC / ET) is achieved. This also addresses the trade-offs between lightweight design and accuracy, and the low efficiency of multi-step prediction, improving the model's robustness to non-ideal clinical data and providing technical support for rapid and accurate clinical diagnosis of brain tumors.
[0006] The specific technical solution adopted by this invention is as follows: A brain tumor segmentation method based on a dynamically enhanced diffusion model includes the following steps: Step 1: Training phase; During training, multimodal MRI brain tumor data and single-channel segmentation label maps are first input. The single-channel labels are converted into multi-channel one-hot encoded labels by the label embedding module, and Gaussian noise is added to them step by step to obtain a label map with t-step noise. The initial features of multi-scale global enhancement of multimodal MRI brain tumor data are extracted by the lightweight global enhancement feature encoder LG-FE. The multimodal MRI brain tumor data and the noisy label map channels are concatenated and input into the lightweight dynamic attention denoising UNet network, i.e., LDA-DU network. The enhanced features output by the lightweight global enhancement feature encoder LG-FE are fused and the multi-scale feature adaptive fusion is completed by dynamic convolution skip connections to output the predicted segmentation label map. The training process uses a combination of loss functions of BCE loss, MSE loss and Dice loss, with clear one-hot encoded labels as supervision to complete the training of the DED-UNet network. Step 2: Testing Phase; The testing process utilizes a multi-step iterative denoising process based on the Denoising Diffusion Implicit Model Sampling (DDIM) method. The multimodal MRI brain tumor data is input into the trained DED-UNet network, and the corresponding brain tumor segmentation prediction result is output in each denoising iteration. Referring to the uncertainty calculation method of Monte Carlo dropout, and combining the stochastic characteristics of the diffusion model, the uncertainty matrix of each prediction result is calculated. Adaptive fusion weights are designed based on the progressive characteristics of the iteration step size and the uncertainty matrix. These weights are then used to weight and fuse the segmentation prediction results of each step, outputting the final brain tumor voxel segmentation result, achieving accurate segmentation of the WT, TC, and ET regions.
[0007] The technical effects achieved by this invention are as follows: This invention addresses the technical problems of existing diffusion-based medical voxel segmentation networks, which suffer from large parameter counts, low inference efficiency, insufficient global spatial feature representation, and inability to effectively model the hierarchical inclusion relationship of the three regions of a brain tumor (WT), tumor core (TC), and enhanced tumor (ET), thus limiting segmentation accuracy and robustness. To address these issues, a dedicated segmentation network is constructed, with a lightweight dynamic attention denoising UNet network (LDA-DU network) as the core innovative module and a lightweight global enhancement feature encoder LG-FE as the supporting component. As the core of this invention, the lightweight dynamic attention denoising UNet network, based on a lightweight and dynamic feature fusion design, achieves adaptive dynamic fusion of multi-scale features between the encoder and decoder. This solves the shortcomings of traditional denoising UNet, such as low feature fusion efficiency and insufficient representation of subtle lesions in brain tumors, while accurately modeling the hierarchical inclusion relationship of the three regions, significantly improving the targeting and accuracy of segmentation. Simultaneously, its lightweight design effectively reduces computational complexity, alleviating the problems of large model parameters and low inference efficiency. The lightweight global enhancement feature encoder LG-FE serves as a complementary module. Through its lightweight architecture and global feature enhancement mechanism, it addresses the issues of local modeling bias and insufficient global feature extraction in traditional convolutional encoders. It provides a high-quality, multi-scale global feature base for the LDA-DU network while further reducing the number of parameters and computational complexity, thus complementing the LDA-DU network's lightweight design. The two modules work together to enable the DED-UNet network of this invention to achieve both model lightweighting and dynamic feature enhancement while retaining the high robustness, multi-label segmentation, and end-to-end segmentation advantages of the diffusion model. This balances the real-time deployment of clinical edge devices with the accuracy and robustness of brain tumor segmentation, enabling precise voxel segmentation of the WT, TC, and ET regions. Attached Figure Description
[0008] Figure 1 This is an overall architecture diagram of the DED-UNet network in the brain tumor segmentation method based on the dynamically enhanced diffusion model of this invention; Figure 2 This is the overall architecture diagram of the lightweight global enhanced feature encoder LG-FE and the lightweight dynamic attention denoising UNet network in this invention; Figure 3 This is an overall architecture diagram of the global feature enhancement module in the lightweight global enhanced feature encoder LG-FE of the present invention; Figure 4 This is the overall architecture diagram of the dynamic attention module in the lightweight dynamic attention denoising UNet network of this invention. Detailed Implementation
[0009] To make the objectives and advantages of this invention clearer, the invention will be specifically described below with reference to embodiments. It should be understood that the following text is merely used to describe one or more specific embodiments of the invention and does not strictly limit the scope of protection specifically claimed by the invention.
[0010] like Figures 1-4 As shown, the brain tumor segmentation method based on a dynamically enhanced diffusion model includes the following steps: Step 1: Training phase; During training, multimodal MRI brain tumor data and single-channel segmentation label maps are first input. The single-channel labels are converted into multi-channel one-hot encoded labels by the label embedding module, and Gaussian noise is added to them step by step to obtain a label map with t-step noise. The initial features of multi-scale global enhancement of multimodal MRI brain tumor data are extracted by the lightweight global enhancement feature encoder LG-FE. The multimodal MRI brain tumor data and the noisy label map channels are concatenated and input into the lightweight dynamic attention denoising UNet network, i.e., LDA-DU network. The enhanced features output by the lightweight global enhancement feature encoder LG-FE are fused and the multi-scale feature adaptive fusion is completed by dynamic convolution skip connections to output the predicted segmentation label map. The training process uses a combination of loss functions of BCE loss, MSE loss and Dice loss, with clear one-hot encoded labels as supervision to complete the training of the DED-UNet network. Step 2: Testing Phase; The testing process is based on a multi-step iterative denoising process using a denoising diffusion implicit model sampling method. Multimodal MRI brain tumor data is input into the trained DED-UNet network, and the corresponding brain tumor segmentation prediction result is output in each denoising iteration. Referring to the uncertainty calculation method of Monte Carlo dropout, the uncertainty matrix of each prediction result is calculated in combination with the stochastic characteristics of the diffusion model. Adaptive fusion weights are designed based on the progressive characteristics of the iteration step size and the uncertainty matrix. The segmentation prediction results of each step are weighted and fused using these weights to output the final brain tumor voxel segmentation result, achieving accurate segmentation of the WT, TC, and ET regions.
[0011] like Figure 1 As shown, the Figure 1 The overall architecture of the DED-UNet network is demonstrated, including the training and testing phases. During training, the input image is processed by a lightweight global augmentation feature encoder (LG-FE) to extract features, which are then concatenated with noisy labels and input into a lightweight dynamic attention denoising UNet network. The denoising map is learned under the supervision of a loss function. During testing, the noisy feature map and image features are denoised iteratively multiple times, and then fused with uncertainty to output the final segmentation result.
[0012] Preferably, the lightweight global enhancement feature encoder LG-FE is embedded in the front end of the DED-UNet network as the core feature extraction module for multimodal MRI brain tumor data. It connects the input layer with the lightweight dynamic attention denoising UNet network. The lightweight global enhancement feature encoder LG-FE extracts multi-scale global enhancement features, solving the problems of local feature modeling bias and insufficient global spatial feature extraction in traditional convolutional encoders. At the same time, the lightweight design significantly reduces the number of parameters and computational complexity of the feature extraction process. The lightweight global enhancement feature encoder LG-FE consists of a lightweight encoder layer and a global feature enhancement module.
[0013] like Figure 2 As shown, Figure 2 The processing steps after inputting the image and labels are described. The lightweight global enhancement feature encoder LG-FE extracts global features through multiple sets of lightweight encoding layers and enhancement modules. The denoising network takes noisy features and encoder output as input, and gradually achieves feature denoising and enhancement through a lightweight decoding layer and a lightweight dynamic attention denoising UNet network.
[0014] like Figure 3 As shown, Figure 3 The design of the global feature enhancement module is demonstrated. The input is normalized by layers and window attention, then normalized by layers and multilayer perceptron, and the output is enhanced features after two residual fusions.
[0015] Preferably, the sub-steps performed by the lightweight global enhancement feature encoder LG-FE are as follows: First: After the multimodal MRI brain tumor data is input into the lightweight global enhancement feature encoder LG-FE, the initial lightweight convolutional feature extraction operation is performed first, and then the extracted features are subjected to multi-scale downsampling processing in sequence. After each layer of downsampling processing is completed, a global feature enhancement module that matches the current feature dimension is connected. Then, the features processed by the above steps are input into the global feature enhancement module, which sequentially performs window partitioning, self-attention calculation and MLP feature transformation to achieve global feature enhancement. The lightweight global enhancement feature encoder LG-FE finally outputs the initial features of multi-scale global enhancement and feeds them into the lightweight dynamic attention denoising UNet network to complete the subsequent feature fusion operation.
[0016] Preferably, the lightweight dynamic attention denoising UNet network is embedded in the core of the DED-UNet network architecture. The lightweight dynamic attention denoising UNet network connects the lightweight global enhanced feature encoder LG-FE and the step size uncertainty fusion module, and is the core denoising segmentation module of the DED-UNet network. The lightweight dynamic attention denoising UNet network is used to realize the adaptive dynamic fusion of multi-scale features between the encoder and decoder, which solves the technical problems of low feature fusion efficiency and insufficient representation of subtle lesions in brain tumors in traditional denoising UNet. At the same time, the lightweight architecture design reduces the computational complexity of the model and achieves accurate modeling of the hierarchical inclusion relationship of the three regions WT, TC and ET of brain tumors. The lightweight dynamic attention denoising UNet network consists of a lightweight encoder-decoder layer and a dynamic attention module.
[0017] like Figure 4 As shown, Figure 4 This paper demonstrates the design of a lightweight dynamic attention-based denoising UNet network. Global context features are projected onto the context and fused with concatenated local features. These features are then convolved and fed into a dynamic convolution kernel generation module. The module generates dynamic convolution kernels through bi-branch convolution, group normalization, average pooling, and matrix multiplication. These kernels are then weighted and upsampled to drive large and small convolution kernels, respectively. The outputs of the large and small convolution kernels are processed by relative position bias weights, normalized, and weighted fusion. Finally, they undergo attention gating, a multilayer perceptron, and layer scaling to output enhanced features. like Figures 2-4 As shown, preferably, the lightweight dynamic attention denoising UNet network performs the following sub-steps for denoising segmentation: First, the diffusion time step parameters are converted into high-dimensional time step embedding features and integrated into the feature extraction process of each layer. The enhanced features output by the lightweight global enhancement feature encoder LG-FE are concatenated with the channels of the noisy one-hot label image and then input into the module, and the initial feature extraction is completed by depthwise separable convolution. Then, by using the lightweight global augmentation feature encoder LG-FE to perform multi-scale downsampling feature concatenation, context guidance features and features from the previous decoder layer are generated from the deepest features. These two features are respectively input to the dynamic attention module as global context features and concatenated local features. In the lightweight dynamic attention denoising UNet network, the global context features are first input to the context projection module, and their channel dimensions are adjusted to match the dimensions of the local concatenated features through convolution and non-linear activation operations. Subsequently, the projected global context features and local concatenated features are concatenated along the channel dimension to obtain a fused feature map. The fused feature map undergoes convolution operations to achieve spatial downsampling and channel compression, yielding the features to be processed. These features, along with the context projection features, are then input into the dynamic convolution kernel submodule. During the dynamic convolution kernel generation stage, the two input features are treated as two parallel branches, which sequentially perform convolution, group normalization, and average pooling operations to obtain global and local statistical features. The output features of the two branches are then converted into matrix form through dimensional rearrangement, followed by matrix multiplication to generate the initial weight matrix of the dynamic convolution kernel. This initial weight matrix is then weighted and projected onto the target channel dimension to form the final dynamic convolution kernel parameters. Finally, an upsampling operation restores the dynamic convolution kernel parameters to match the input features. Figure 1 To achieve the desired spatial resolution, the generated dynamic convolutional kernel parameters are divided into two parts, driving a 5×5×5 small convolutional kernel and a 7×7×7 large convolutional kernel path respectively. The small convolutional kernel is used to capture local detail features, while the large convolutional kernel is used to model global structural features. Relative positional bias weights are calculated for the output feature maps of the large and small convolutional kernels. These weights, based on learnable positional encoding parameters, are used to explicitly model spatial positional dependencies, enhancing the positional awareness of the convolutional operation. The two sets of relative positional bias weights are concatenated along the channel dimension and then normalized to obtain the attention weight map. The normalized attention weights are then compared with the output features of the large and small convolutional kernels. The feature maps are multiplied element-wise and then weighted summation is performed to obtain fused multi-scale features. The fused multi-scale features are then input into the channel attention gating module, where global average pooling and two fully connected layers are used to learn the dependencies between channels, generating channel attention weights, which are then multiplied element-wise with the original feature maps to enhance important channels. The gated feature maps are then input into the multilayer perceptron module, where the channel dimensions are first expanded by 1×1 convolution, then enhanced by depthwise convolution and global response normalization, and finally restored to the target channel dimensions by 1×1 convolution to obtain the enhanced feature representation. The obtained features are then fed into the stride uncertainty fusion module.
[0018] Preferably, the step size uncertainty fusion module (SUF) is embedded at the end of the DED-UNet network architecture, connecting to the lightweight dynamic attention denoising UNet network, and is the final result fusion output module of the DED-UNet network. The step size uncertainty fusion module solves the technical problem of insufficient robustness of traditional diffusion models that only select the output of the last iteration as the segmentation result. Combining the progressive characteristics of the DDIM iteration step size and the uncertainty of the prediction results of each step, it performs adaptive weighted fusion of multi-step segmentation prediction results, which is suitable for non-ideal data scenarios with noise in clinical MRI images. The step size uncertainty fusion module consists of an uncertainty calculation submodule, an adaptive fusion weight generation submodule, and a multi-step prediction result weighted fusion submodule.
[0019] Preferably, the sub-steps for the step-size uncertainty fusion module to execute the fusion output are as follows: First, the brain tumor segmentation prediction results output by the lightweight dynamic attention denoising UNet network in the multi-step iterative denoising process based on the denoising diffusion implicit model sampling method are obtained at each step. Multiple prediction samples are generated for each prediction step. Then, based on the Monte Carlo dropout idea, the uncertainty matrix of the prediction results at each step is calculated using the multiple prediction samples. Then, combining the iterative step size progression characteristic and the uncertainty matrix, the sigmoid function is used to generate adaptive fusion weights for the prediction results of each step, and these fusion weights are used to perform a weighted summation of the brain tumor segmentation prediction results of all iterative steps, outputting the final brain tumor voxel segmentation result, thus completing the accurate segmentation of the three regions WT, TC, and ET.
[0020] Preferably, the training process in step 1 uses a combined loss function of Dice loss, BCE loss, and MSE loss, specifically: By calculating the binary cross-entropy loss, the pixel-level class probability prediction accuracy of the one-hot encoded multi-channel labels is optimized, enabling the network to accurately distinguish the target and background attributes of each voxel and improve the clarity of the segmentation boundary; BCE loss is the binary cross-entropy loss. The calculation formula is as follows: ; in The total number of samples, The total number of categories, where, For the sample Category The true label, The predicted value output by the model; Mean squared error loss is used for optimization and The pixel-level numerical fitting degree reduces noise interference in the prediction results, improves the overall smoothness and numerical stability of the segmentation results, and helps to enhance the consistency of the segmented regions. MSE loss is the mean squared error loss. The calculation formula is as follows: ; The parameters are defined in the same way as in the formula for the binary cross-entropy loss function; Cross-entropy loss is supervised in conjunction with the other two loss functions. and The region overlap is reduced to address the class imbalance problem (low proportion of ET region) in brain tumor segmentation, thereby enhancing the network's ability to accurately segment tumor target regions; where Dice loss is the cross-entropy loss. The calculation formula is as follows: ; The parameters are defined in the same way as in the two loss function formulas above; The total loss function during training combines three loss functions: Dice loss to address class imbalance, BCE loss to optimize pixel-level probability prediction, and MSE loss to improve result smoothness. This comprehensive approach guides network learning, ensuring segmentation accuracy, robustness, and clinical applicability. Its total loss function... The calculation formula is as follows: .
[0021] In specific implementations of this invention, for example: The specific implementation method is as follows: Step 1: Training Phase The training phase uses multimodal MRI brain tumor data (T1, T1ce, T2, FLAIR) and three region segmentation labels (WT, TC, and ET) as input to achieve collaborative training of a lightweight global enhancement feature encoder LG-FE and a lightweight dynamic attention denoising UNet network. The specific process includes data preprocessing, image feature extraction, and image denoising, as follows: Firstly, in the data preprocessing, both image data and label data are preprocessed. The original MRI medical body image data is first resampled to a uniform spatial resolution to eliminate the resolution differences of the original data and ensure the consistency of the model input dimension. The preprocessed image data is then converted into tensor format, and the original labels are converted from single-channel discrete tensors to multi-channel one-hot encoded labels to obtain pure multi-channel label tensors.
[0022] Then the resulting multi-channel one-hot labels Perform the transformation and add t steps of continuous random noise. The forward diffusion process is completed to obtain noisy labels. The formula is as follows: ; in This is the cumulative coefficient for the diffusion process, used to control the weighting of noise addition. To add Gaussian noise, The multi-channel labels containing t-step noise are concatenated with the original volume image and then input into the model's denoising module.
[0023] Then: In image feature extraction, the preprocessed multimodal MRI brain tumor data is input into LG-FE. First, the input data is convolved through the lightweight encoder layer of LG-FE to obtain initial features and output them to the global feature enhancement module. After window partitioning, self-attention calculation and MLP feature transformation, the global spatial features are enhanced and the enhanced features are output. Subsequently, the lightweight encoder layer is used to complete downsampling. After each downsampling layer, the corresponding dimension of the global feature enhancement module is connected to the module, and finally, the multi-scale global enhanced features are output.
[0024] Finally, during image denoising, multimodal MRI brain tumor data and noisy labels are concatenated and then input into a lightweight dynamic attention denoising UNet network. Simultaneously, the multi-scale global enhancement features obtained in the previous step are progressively input into the encoder layers of the lightweight dynamic attention denoising UNet network, integrating them into the feature extraction process at each layer to obtain further extracted features. The downsampled features from each layer are processed by the encoder layers of the lightweight dynamic attention denoising UNet network, outputting features at different scales. The bottleneck features of the last downsampled layer are processed and used as context features, which are then fed into the lightweight decoder for upsampling. Each upsampling layer includes a dynamic attention module. The input to this module is the features passed from the corresponding downsampled layer via skip connections, the concatenated features from the previous downsampled layer, and the context features. This module adaptively fuses the input features using dynamic convolutions with large and small kernels, and outputs the fused result to the next upsampling layer. The lightweight dynamic attention denoising UNet network finally outputs a predicted segmentation label map. Based on this prediction result, the combined loss of Dice loss, binary cross-entropy loss and mean squared error loss is calculated. The network parameters of the lightweight global augmentation feature encoder LG-FE and the lightweight dynamic attention denoising UNet network are updated through backpropagation. The training is iterated until the loss converges.
[0025] Step 2: Testing Phase This implementation phase takes preprocessed multimodal MRI brain tumor data to be segmented as input, and outputs the three-region segmentation results of the brain tumor through the trained DED-UNet. The core implementation includes forward inference and step-size uncertainty fusion modules, including: Firstly, in the forward inference process, the multimodal MRI brain tumor data to be segmented is first input into the trained lightweight global enhancement feature encoder LG-FE to extract the initial features of multi-scale global enhancement. Then, the features and the initial noisy label map are input into the lightweight dynamic attention denoising UNet network. The DDIM sampling method is used to perform 10-step iterative denoising, and each DDIM sampling step is performed 4 times for repeated sampling. Each sampling outputs the corresponding brain tumor segmentation prediction result, resulting in a total of 40 prediction samples under different sampling scenarios.
[0026] Finally, the step-size uncertainty fusion first calculates the uncertainty matrix. Based on the Monte Carlo method, it performs four repeated samplings for each of the 10 DDIM sampling steps. It first calculates the voxel-level average prediction value of the predicted samples from the four repeated samplings in the i-th DDIM step. The formula is as follows: ; in i =1,2,…,10 are the indices of the DDIM sampling steps. S =4 is the number of repeated samples for each DDIM step. For the first i The voxel-level prediction value obtained from the s-th repeated sampling in each DDIM sampling step.
[0027] Based on this average forecast value The voxel-level prediction variance of the predicted samples in four repeated samplings at each of the 10 DDIM sampling steps was statistically analyzed, and the result was calculated by combining the variance with the average predicted value. i Uncertainty matrix corresponding to each DDIM sampling step The formula is as follows: ; The uncertainty matrices corresponding to the 10 DDIM sampling steps are used for adaptive weight generation. This process takes into account the characteristic in DDIM that the larger the step size, the closer the prediction result is to the true segmentation label and the lower the uncertainty. Based on the above uncertainty matrices, the uncertainty matrices of each step are normalized using the sigmoid function to generate the adaptive fusion weights corresponding to each DDIM sampling step. The formula is as follows: ; in, for sigmoid Activation function scale This is a scaling factor used to match the numerical range of the DDIM sampling step, 1− u i It is the complementary value of the uncertainty matrix, realizing the regulation logic that the lower the prediction uncertainty, the higher the weight ratio.
[0028] Finally, a multi-step result fusion is performed. Based on the adaptive fusion weights corresponding to each DDIM sampling step, the predicted samples from the 10 DDIM sampling steps are weighted and summed according to the adaptive fusion weights of the corresponding steps to obtain the final fusion result. Y The formula is as follows: ; The final segmentation result is output, with three channels corresponding to the WT, TC, and ET regions, respectively, to achieve accurate segmentation of the brain tumor.
[0029] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.
Claims
1. A brain tumor segmentation method based on a dynamically enhanced diffusion model, characterized in that: Includes the following steps: Step 1: Training phase; During training, multimodal MRI brain tumor data and single-channel segmentation label maps are first input. The single-channel labels are converted into multi-channel one-hot encoded labels by the label embedding module. Gaussian noise is added to the labels step by step to obtain a label map with t-step noise. The initial features for multi-scale global enhancement of multimodal MRI brain tumor data are extracted by the lightweight global enhancement feature encoder LG-FE. The multimodal MRI brain tumor data and the noisy label map channels are concatenated and input into the lightweight dynamic attention denoising UNet network, i.e., LDA-DU network. The enhanced features output by the lightweight global enhancement feature encoder LG-FE are fused and the multi-scale feature adaptive fusion is completed through dynamic convolution skip connections to output the predicted segmentation label map. The training process uses a combination of loss functions, including BCE loss, MSE loss, and Dice loss, with clear one-hot encoded labels as supervision to complete the training of the DED-UNet network. Step 2: Testing Phase; The testing process is based on a multi-step iterative denoising process using a denoising diffusion implicit model sampling method. The multimodal MRI brain tumor data is input into the trained DED-UNet network, and the corresponding brain tumor segmentation prediction result is output in each denoising iteration. Referring to the uncertainty calculation method of Monte Carlo dropout, the uncertainty matrix of each prediction result is calculated in combination with the stochastic characteristics of the diffusion model. Adaptive fusion weights are designed based on the progressive characteristics of the iteration step size and the uncertainty matrix. The segmentation prediction results of each step are weighted and fused using these weights to output the final brain tumor voxel segmentation result, achieving accurate segmentation of the WT, TC, and ET regions.
2. The brain tumor segmentation method based on a dynamically enhanced diffusion model according to claim 1, characterized in that: The lightweight global enhancement feature encoder LG-FE is embedded in the front end of the DED-UNet network as the core feature extraction module for multimodal MRI brain tumor data. It connects the input layer with the lightweight dynamic attention denoising UNet network. The lightweight global enhancement feature encoder LG-FE extracts multi-scale global enhancement features. The lightweight global enhancement feature encoder LG-FE consists of a lightweight encoder layer and a global feature enhancement module.
3. The brain-tumor segmentation method based on a dynamically enhanced diffusion model according to claim 2, characterized in that: The lightweight global augmentation feature encoder LG-FE performs the following sub-steps: First: After the multimodal MRI brain tumor data is input into the lightweight global enhancement feature encoder LG-FE, the initial lightweight convolutional feature extraction operation is performed first, and then the extracted features are subjected to multi-scale downsampling processing in sequence. After each layer of downsampling processing is completed, a global feature enhancement module that matches the current feature dimension is connected. Then, the features processed by the above steps are input into the global feature enhancement module, and window partitioning, self-attention calculation and MLP feature transformation operations are performed in sequence to realize global feature enhancement processing; the lightweight global enhancement feature encoder LG-FE finally outputs the initial features of multi-scale global enhancement and inputs them into the lightweight dynamic attention denoising UNet network to complete the subsequent feature fusion operation.
4. The brain tumor segmentation method based on a dynamically enhanced diffusion model according to claim 3, characterized in that: The lightweight dynamic attention denoising UNet network is embedded in the core of the DED-UNet network architecture. The lightweight dynamic attention denoising UNet network connects the lightweight global enhanced feature encoder LG-FE and the step size uncertainty fusion module, and is the core denoising segmentation module of the DED-UNet network. The lightweight dynamic attention denoising UNet network is used to achieve adaptive dynamic fusion of multi-scale features between the encoder and decoder; the lightweight dynamic attention denoising UNet network consists of a lightweight encoder-decoder layer and a dynamic attention module.
5. The brain tumor segmentation method based on a dynamically enhanced diffusion model according to claim 4, characterized in that: The lightweight dynamic attention denoising UNet network performs the following sub-steps for denoising and segmentation: First, the diffusion time step parameters are converted into high-dimensional time step embedding features and integrated into the feature extraction process of each layer. The enhanced features output by the lightweight global enhanced feature encoder LG-FE are concatenated with the noisy one-hot label map channel and then input into the module, where the initial feature extraction is completed by depthwise separable convolution. Then, by using the lightweight global augmentation feature encoder LG-FE to perform multi-scale downsampling feature concatenation, context guidance features and features from the previous decoder layer are generated from the deepest features. These two features are input into the dynamic attention module as global context features and concatenated local features, respectively. In the lightweight dynamic attention denoising UNet network, the global context features are first input into the context projection module, and their channel dimensions are adjusted to match the dimensions of the local concatenated features through convolution and non-linear activation operations. Subsequently, the projected global context features and local concatenated features are concatenated along the channel dimension to obtain a fused feature map. Convolution operations are performed on this fused feature map to achieve spatial downsampling and channel compression, resulting in the feature to be processed. This feature to be processed and the context projection features are then input into the dynamic attention module. The convolution kernel submodule: In the dynamic convolution kernel generation stage, the two input features are treated as two parallel branches, and convolution, group normalization, and average pooling operations are performed sequentially to obtain global statistical features and local statistical features. The output features of the two branches are transformed into matrix form through dimensional rearrangement, and matrix multiplication is performed to generate the initial weight matrix of the dynamic convolution kernel. The initial weight matrix is weighted and projected to the target channel dimension to form the final dynamic convolution kernel parameters. Finally, the dynamic convolution kernel parameters are restored to the same spatial resolution as the input feature map through upsampling. The generated dynamic convolution kernel parameters are divided into two parts, which drive a 5×5×5 small convolution kernel and a 7×7×7 large convolution kernel path, respectively. The small convolution kernel is used to capture local detail features, and the large convolution kernel is used to model global structural features. For the output feature maps of large and small convolutional kernels, relative positional bias weights are calculated respectively. These weights, based on learnable positional encoding parameters, are used to explicitly model spatial positional dependencies and enhance the positional awareness of convolutional operations. The two sets of relative positional bias weights are concatenated along the channel dimension and then normalized to obtain an attention weight map. The normalized attention weights are then multiplied element-wise with the output feature maps of large and small convolutional kernels respectively, followed by a weighted summation operation to obtain fused multi-scale features. The fused multi-scale features are input into the channel attention gating module, which learns the dependencies between channels through global average pooling and two fully connected layers, generates channel attention weights, and multiplies them element-wise with the original feature map to enhance important channels. The gated feature map is then input into the multilayer perceptron module, where the channel dimension is first expanded through 1×1 convolution, then enhanced through depthwise convolution and global response normalization, and finally restored to the target channel dimension through 1×1 convolution to obtain the enhanced feature representation. The obtained features are then fed into the stride uncertainty fusion module.
6. The brain tumor segmentation method based on a dynamically enhanced diffusion model according to claim 1, characterized in that: The step size uncertainty fusion module is embedded at the end of the DED-UNet network architecture and connects to the lightweight dynamic attention denoising UNet network. It is the final result fusion output module of the DED-UNet network. Combining the progressive characteristics of the DDIM iteration step size and the uncertainty of the prediction results of each step, it performs adaptive weighted fusion of multi-step segmentation prediction results to adapt to the non-ideal data scenarios of clinical MRI image noise. The step-size uncertainty fusion module consists of an uncertainty calculation submodule, an adaptive fusion weight generation submodule, and a multi-step prediction result weighted fusion submodule.
7. The brain tumor segmentation method based on a dynamically enhanced diffusion model according to claim 6, characterized in that: The sub-steps for the step-size uncertainty fusion module to perform the fusion output are as follows: First, the brain tumor segmentation prediction results output by the lightweight dynamic attention denoising UNet network at each step in the multi-step iterative denoising process of DDIM are obtained, and multiple prediction samples are generated for each prediction step. Then, based on the Monte Carlo dropout idea, the uncertainty matrix of the prediction results at each step is calculated using the multiple prediction samples. Then, combining the iterative step size progression characteristic and the uncertainty matrix, the sigmoid function is used to generate adaptive fusion weights for the prediction results of each step, and these fusion weights are used to perform a weighted summation of the brain tumor segmentation prediction results of all iterative steps, outputting the final brain tumor voxel segmentation result, thus completing the accurate segmentation of the three regions WT, TC, and ET.
8. The brain tumor segmentation method based on a dynamically enhanced diffusion model according to claim 1, characterized in that: The training process in step 1 uses a combined loss function of Dice loss, BCE loss, and MSE loss, specifically: The BCE loss is the binary cross-entropy loss. The calculation formula is as follows: ; in The total number of samples, The total number of categories, where, For the sample Category The true label, The predicted value output by the model; The MSE loss is the mean square error loss. The calculation formula is as follows: ; The parameters are defined in the same way as in the formula for the binary cross-entropy loss function; Cross-entropy loss is supervised in conjunction with the other two loss functions. and The region overlap, wherein the Dice loss is the cross-entropy loss. The calculation formula is as follows: ; The parameters are defined in the same way as in the two loss function formulas above; Its total loss function The calculation formula is as follows: 。