3D medical image segmentation method based on mamba enhanced and gated fusion
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGCHUN UNIV
- Filing Date
- 2026-07-03
- Publication Date
- 2026-08-07
AI Technical Summary
传统的确定性映射无法对这种本质不确定性进行建模,在面临浸润边缘时易产生“过自信”的现象
提出的基于Mamba增强与门控融合的扩散分割网络架构(Mamba-Enhanced Gated-Fusion Diffusion Model, MEGF-Diff)深度整合了扩散模型的分布建模能力与Mamba的线性计算优势。通过条件引导与去噪过程的设计,模型在实现高精度分割的同时,显著降低了计算复杂度和内存开销,有效解决了高分辨率三维医疗影像在常规医疗硬件环境下难以实时推断的瓶颈。
Smart Images

Figure CN122530237A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image morphological segmentation technology, specifically involving a 3D medical image segmentation method based on Mamba enhancement and gating fusion. Background Technology
[0002] Three-dimensional medical image segmentation (such as MRI brain tumor identification) is a core component of precision medicine. Brain tumors exhibit high anatomical heterogeneity, and accurate identification of sub-regions such as necrotic areas and the tumor core is crucial for treatment planning. However, three-dimensional medical images contain massive amounts of voxel spatial information, which places extremely high demands on the algorithm's global perception capability, computational efficiency, and ability to discriminate fuzzy boundaries.
[0003] Recently, selective state-space algorithms, represented by Mamba, have provided a new direction for long sequence modeling with their linear computational complexity. However, existing "one-dimensional" Mamba applications typically flatten 3D volume data directly along a single path, artificially severing the natural anatomical connections between voxels on the three planes. This ignores the 3D spatial relationships formed by global paths and multiple orthogonal sectional paths, resulting in the model's inability to take into account both the macroscopic anatomical background and the microscopic orthogonal sectional details. This easily leads to discontinuities or topological distortions in the segmentation results along the vertical axis.
[0004] On the other hand, due to the partial volume effect, lesion edges often exhibit significant gray-level overlap. Traditional deterministic mapping cannot model this inherent uncertainty and is prone to "overconfidence" when facing infiltrative edges. Although diffusion models can model complex distributions, they are prone to introducing background noise during the reverse iteration process, and due to the lack of effective explicit boundary constraints and feature purification mechanisms, the final lesion contour description is still not accurate enough.
[0005] To address the aforementioned bottlenecks, designing a high-precision segmentation method that can maintain linear computational efficiency, deeply integrate spatial anatomical relationships in 3D images, and effectively model boundary uncertainties while suppressing iterative noise has become a pressing technical challenge in the field of intelligent 3D medical image processing. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention proposes a 3D medical image segmentation method based on Mamba enhancement and gating fusion.
[0007] Specifically: S1, 3D image preprocessing and auxiliary boundary label decoupling: Obtain the original multimodal 3D medical image volume data and preprocess it, then generate single-channel auxiliary boundary labels through gradient convolution decoupling. ; S2. Construct a diffusion segmentation network based on Mamba enhancement and gating fusion: The network includes a conditional guided coding branch responsible for feature injection, and a diffusion denoising branch composed of a denoising encoder and a gating decoder. S3. Model Training and Parameter Optimization: Input the preprocessed image into the network, perform the forward diffusion noise addition and backward noise reduction prediction process, and use the multi-task joint loss function for model training and parameter optimization. S4. Inference Segmentation and Post-processing: During the inference stage, a sliding window mechanism is used to input the test image. The accelerated sampling strategy and the three-dimensional Gaussian weight kernel are used to smoothly fuse the images to obtain the final 3D segmentation result.
[0008] Furthermore, the preprocessing in step S1 specifically involves: obtaining the original multimodal 3D medical image volume tensor, and utilizing the mean value of voxels in the non-background region. with standard deviation The input tensor is normalized by intensity, and the calculation formula is as follows: ;in, Represents the original input tensor. This represents the tensor after intensity normalization.
[0009] Furthermore, in step S1, single-channel auxiliary boundary labels are generated through gradient convolution decoupling. Specifically, this involves obtaining the original gold standard mask. Gradient convolution pairs using the three-dimensional Laplacian kernel operator By performing second-order differential convolution operations and capturing abrupt extreme points in the mask distribution, single-channel auxiliary boundary labels are generated through decoupling. The original gold standard mask For the true labels in medical image segmentation tasks.
[0010] Furthermore, in step S2, the specific structure of each part of the diffusion segmentation network based on Mamba enhancement and gating fusion is as follows: The conditional guided coding branch is constructed using a four-stage downsampling structure. Before entering each downsampling level, a lightweight feature refinement unit is used to recalibrate and refine the features, followed by feature enhancement through a parameterless attention unit. The three-dimensional feature tensor is reorganized into global paths and orthogonal tangential paths using global and orthogonal tangential scanning Mamba units for parallel modeling. A shared state space operator is used to capture cross-dimensional spatial dependencies, outputting a multi-scale conditional guided feature sequence. The orthogonal tangential path includes mutually perpendicular axial tangential paths and longitudinal profile tangential paths. The diffusion denoising branch adopts a U-shaped network structure, with the denoising encoder and gated decoder connected step by step. The denoising encoder has the same structure as the conditional guided coding branch. Each decoding unit of the gated decoder integrates a gated decoding convolutional block to achieve the injection of guided features. The gated decoding convolutional block uses the decoding end features and the corresponding image encoder level features to perform channel concatenation, and generates a spatial weight map through convolution and activation functions. It performs pixel-level filtering on the encoder level features to suppress random diffusion noise in the early stage of sampling.
[0011] Furthermore, the lightweight feature refinement unit includes two parallel spatial attention branches and a channel attention branch; The spatial attention branch reception dimension is: The input features are used to extract the geometric constraint weights between voxels using 3D depthwise separable convolution, and a weight map is generated using a nonlinear activation function to perform pixel-level feature recalibration. The channel attention branch uses a three-dimensional global average pooling layer to compress the spatial dimension into a one-dimensional feature vector, and uses a multilayer perceptron with a fixed feature reduction ratio to calculate the cross-correlation weights between modes, thereby achieving selective enhancement of key modal features. Finally, the weighted features from the two branches are concatenated by channel dimension, and the number of channels is restored by convolution and residual summation is performed. The parameterless attention unit evaluates the activity of neurons based on an energy function, generates pixel-level saliency weights, and performs feature purification.
[0012] Furthermore, the global and orthogonal tangential scanning Mamba units perform the following tensor dimension recombination and parallel modeling operations: First, a three-dimensional convolutional layer is used to divide the channel dimensions. Compressed to the latent space projection dimension Then, the following three paths are scanned and modeled: Full-space scan path: The feature map is flattened into a length of [length missing] using rearrangement instructions. Full space sequence This is used to capture the global spatial dependencies of 3D volume data; where, , , and These are the depth, height, width, and batch size of the input features, respectively; Orthogonal section path: includes axial section scanning path and cross-section longitudinal section scanning path; Axial section scanning path: uses a dimension substitution command to replace one of the spatial axes to the batch dimension, transforming the feature map into a sequence containing axial information. It is used to capture spatial topological features within a single anatomical axial section; cross-section longitudinal profile scanning path: using the dimension displacement command to replace another spatial axis to the batch dimension, transforming the feature map into a longitudinal profile sequence. It is used to capture the anatomical axis continuity of the lesion in the longitudinal section direction; Finally, the information from the entire space and the tangential information from the two orthogonal directions are weighted and fused through dynamic weights to output a feature tensor with three-dimensional stereo perception.
[0013] Furthermore, the specific operations in the gated decoding convolutional block are as follows: The current time step is processed through convolution, normalization, and nonlinear activation layers. Decoding features With the corresponding encoder level features Calculate the relevance weights and generate a spatial attention gating graph: ; in, This indicates a feature concatenation operation along the channel dimension. This is a 3D convolution operation. For batch normalization operations, and There are two activation functions; Using gating graphs Perform operations on encoder-level features: To suppress the background noise flow introduced by diffusion randomness in the early stage of denoising, and to filter the encoder level features and After splicing, the temporal embedding information is injected again and then fed into the subsequent convolutional layer.
[0014] Furthermore, the multi-task joint loss function is: ; in, For multi-task joint loss function, the main output layer joint loss is... It consists of three core loss functions. This represents the Dice similarity coefficient loss. Represents the binary cross-entropy loss. Indicates the mean square error loss; This indicates the loss from in-depth oversight. Decoders representing different resolution scales, This represents the auxiliary boundary loss term.
[0015] Further, step S4 specifically involves: for the test image, a sliding window inference mechanism is adopted, the window size and overlap rate are set, and a diffusion segmentation network based on Mamba enhancement and gating fusion is called to perform iterative prediction on each local window using an accelerated denoising strategy to obtain local reconstruction features. Subsequently, a smooth fusion process is performed on the overlapping area of the sliding window using weight kernels. Finally, a classification activation function is used for mapping and threshold determination to finally output a three-dimensional medical image segmentation mask.
[0016] Furthermore, the smooth fusion process specifically involves: using a three-dimensional Gaussian weight kernel for stable fusion, where the weight kernel... The definition is as follows: ; in, This represents the fusion weight of a certain feature voxel within the sliding window; , and These represent the relative spatial coordinates of the voxel in the depth, height, and width directions, respectively. These are the coordinates of the geometric center of the current sliding window; The standard deviation parameter is used to control the decay rate of the Gaussian distribution weights.
[0017] The beneficial effects of the method described in this invention are as follows: The proposed Mamba-Enhanced Gated-Fusion Diffusion Model (MEGF-Diff) deeply integrates the distribution modeling capabilities of the diffusion model with the linear computational advantages of Mamba. Through the design of conditional guidance and denoising processes, the model achieves high-precision segmentation while significantly reducing computational complexity and memory overhead, effectively addressing the bottleneck of real-time inference of high-resolution 3D medical images under conventional medical hardware environments.
[0018] A lightweight global and orthogonal-slice scanning Mamba layer (L-GOSM layer) core module was designed. This module integrates GOS-Mamba and compensates for the loss of anatomical structure caused by the one-dimensional flattening of traditional Mamba operators through parallel modeling of global paths, axial planes, and longitudinal sectional paths. Combined with LFRU, this module ensures cross-sectional spatial coherence of the model with low parameter cost, eliminating inter-layer discontinuity artifacts common in 3D reconstruction.
[0019] Unlike traditional diffusion models that simply concatenate features, this invention employs spatial gating logic in the decoding stage. This module utilizes the higher-order semantics of the decoder to generate pixel-level weight maps, performing saliency filtering and purification on the encoder-level features. This adaptive "filtering" mechanism effectively suppresses random background noise interference in the early stages of diffusion denoising, achieving precise alignment between guiding features and denoised features, and significantly improving the determinism of lesion boundary reconstruction. Attached Figure Description
[0020] Figure 1 Overall flowchart of the 3D medical image segmentation method based on Mamba enhancement and gating fusion in this embodiment of the invention; Figure 2 A schematic diagram of the overall architecture of MEGF-Diff in this embodiment of the invention; Figure 3 A schematic diagram of the internal tensor evolution of GOS-Mamba in this embodiment of the invention; Figure 4 A schematic diagram of the LFRU structure in an embodiment of the present invention; Figure 5 A schematic diagram of the MEGF-Diff topology in an embodiment of the present invention; Figure 6 A bar chart comparing the segmentation performance metrics of different models in this invention embodiment. Detailed Implementation
[0021] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0022] Example 1 This example provides a 3D medical image segmentation method based on Mamba enhancement and gating fusion, aiming to achieve the following objectives: 1. Solving the problem of topological information loss caused by selective state-space models: To address the anatomical structure breakage caused by one-dimensional flattening when the Mamba operator processes 3D images, a Global and Orthogonal-Slice Scanning Mamba (GOS-Mamba) unit is designed to achieve parallel collaborative modeling of 3D volume data on global paths and multiple orthogonal slicing paths composed of axial and longitudinal sections. This allows for deep capture of cross-dimensional spatial dependencies, ensuring that the segmentation model has excellent cross-slice spatial coherence and global topological stability.
[0023] 2. Achieve low-cost feature refinement: For the multimodal characteristics of medical images, a lightweight feature refinement unit (LFRU) and a parameterless attention unit are integrated before downsampling. Spatial and channel parallel constraints and energy function weighting are used to improve the purity of feature representation before downsampling without significantly increasing the number of parameters.
[0024] 3. Improve the guidance accuracy of the diffusion process: To address background noise interference during the diffusion denoising process, a Spatial Gated Fusion Module (SGFM) is integrated in the decoding stage. The weight map of the upsampled features at the current moment is used to perform pixel-level filtering on the encoder-level features, ensuring a high degree of determinism in mask reconstruction.
[0025] The method includes the following steps: Step 1: Decoupling 3D Image Preprocessing and Auxiliary Boundary Labels. First, intensity normalization is performed on the acquired raw multimodal 3D medical image volume data. Simultaneously, the initial segmentation label mask is applied using the 3D Laplacian operator. By performing second-order gradient convolution operations and capturing discrete abrupt changes in the mask distribution, high-frequency boundary signals are extracted, thereby decoupling and generating single-channel auxiliary boundary labels. Establish a dual task supervision mechanism for anatomical regions and geometric boundaries.
[0026] Step 2: Construct the MEGF-Diff network (a diffusion segmentation network based on Mamba enhancement and gating fusion, Mamba-Enhanced Gated-Fusion Diffusion Model). This network consists of a conditional guided coding branch and a diffusion denoising branch: The input to the conditional guided coding branch is the conditional guided image obtained in Step 1. Before entering each downsampling level, the features are recalibrated, refined, and purified using LFRU and an integrated parameterless attention unit. Then, GOS-Mamba is used to perform tensor axis reconstruction. Long-range anatomical correlation information is extracted in parallel by constructing a global scan path and mutually perpendicular orthogonal sectional scan paths, generating a multi-scale conditionally guided feature sequence. E ={ , ,…, The features extracted by GOS-Mamba include a macroscopic distribution prior across the entire volume, as well as orthogonal anatomical space constraints formed by axial and longitudinal sections, ensuring the feature sequence... E It possesses complete three-dimensional spatial continuity.
[0027] The input to the coding section of the diffusion denoising branch is a noisy tensor. This tensor is generated during the training phase from the initial segmentation label mask. Obtained through a forward noise addition process, it is random Gaussian noise during the inference stage. This branch adopts a U-shaped network structure and integrates SGFM in each decoding stage: This module calculates a pixel-level spatial gating map by fusing the upsampled features of the current layer with the corresponding encoder layer features, selectively filtering the background noise in the encoder features before performing feature concatenation, thereby achieving guided cross-layer information alignment.
[0028] GOS-Mamba performs the following tensor dimension transformation and modeling logic: (1) Full space scan path: The tensor is flattened into a one-dimensional long sequence containing full volume information by using memory rearrangement instructions, and global long-distance dependencies are captured by shared state space operators.
[0029] (2) Orthogonal tangent path: Axial section scanning path: Execute the dimension replacement command to replace the depth axis to the batch dimension and generate an intra-layer sequence; its physical meaning is to force the operator to perform state transition within the transverse anatomical section, simulating the clinical layer-by-layer reading logic to capture subtle infiltration textures.
[0030] Cross-sectional longitudinal section scanning path: Execute the dimension replacement command to replace the height axis to the batch dimension, generating an orthogonal longitudinal section sequence perpendicular to the axial position. This path aims to capture the geometric continuity features of lesions along the longitudinal axis of the human body, effectively eliminating artifacts caused by inter-layer discontinuities.
[0031] Finally, the outputs of the three scanning paths are reconstructed back into the high-dimensional tensor space. After processing by a set of learnable weight parameters through the Softmax normalization function, dynamic weighted fusion is performed on the global and orthogonal spatial information to output a feature tensor with multi-dimensional stereo perception capabilities.
[0032] The diffusion denoising network executes the following gated fusion logic at each decoding stage: After upsampling at each decoding stage, an SGFM is constructed, which receives the upsampled features at the current time and the corresponding encoder layer features, and then concatenates and fuses them before inputting them into cascaded convolutional, normalized, and nonlinear activation layers to generate a spatial gated weight map G. The weight map G is used to perform Hadamard product pixel-level weighting on the encoder layer features to obtain the purified features. Its technical effect is that when the noise level is high in the early stage of denoising, the higher-order semantics of the decoder are used as an adaptive filter to dynamically remove background noise interference in the conditional branch, thereby achieving highly deterministic feature-guided alignment.
[0033] The conditional guided coding branch in Step 2 includes an LFRU and a parameterless attention unit before GOS-Mamba, performing the following parallel recalibration and purification operations: ① Parallel construction of spatial attention branch and channel attention branch: depthwise separable convolution extracts the geometric constraint weights of the large receptive field in the neighborhood of voxels, and reduces complexity through parameter sharing; the channel attention branch uses global pooling and multilayer perceptron to calculate the cross-correlation weights between channels to achieve selective enhancement of key diagnostic signals.
[0034] ② The parameterless attention unit is located after the LFRU and performs pixel-level weight re-estimation based on the energy function, achieving feature refinement with zero parameter overhead.
[0035] Step 3: Model Training and Parameter Optimization. The preprocessed image is input into the segmentation network, and collaborative training is performed through a forward noise addition process, a backward noise reduction prediction process, and a joint loss function optimization process. The forward noise addition process is scheduled according to the timetable at each time step. Initial mask Mapping to a Gaussian distribution space to obtain a noisy tensor The inverse denoising prediction utilizes the joint constraints of the temporal embedding vector and the feature sequence E, and the diffusion denoising branch modulates the noisy tensor. Perform denoising prediction; construct a multi-task joint loss function during the joint loss function optimization process. The network parameters are updated, and the joint loss function includes the main output layer joint loss, deep supervision loss terms at three spatial resolution scales, and loss terms for specific layers. Boundary-aware loss term.
[0036] Joint loss function The physical weighting ratio is defined as follows: ; in, Includes Dice loss, BCE loss; deep supervision loss term Configured at multiple different resolution scales in the decoder, it aims to establish a "gradient relay station" to ensure that the underlying parameters receive stable semantic feedback throughout the denoising process; auxiliary boundary loss term The aim is to force the model to capture high-frequency geometric features of the lesion boundary, and to assist the boundary loss term. Used to measure single-channel auxiliary boundary labels The difference between the labels and the model's predicted results and These are the weighting coefficients.
[0037] Step 4: Inference Segmentation and Post-processing. In the inference stage, a sliding window mechanism is used on the full-resolution test image, with appropriate window size and overlap rate set. Under the guidance of conditional features, iterative prediction is performed using an accelerated denoising strategy, and a weighted kernel is used to perform smooth fusion processing on the overlapping areas of the sliding window, outputting a consistent 3D medical image segmentation mask.
[0038] Example 2 This embodiment is a further limitation and explanation of embodiment 1, combined with Figures 1-6 The technical solution in Embodiment 1 of the present invention will be clearly and completely described.
[0039] 3D image preprocessing and auxiliary boundary label decoupling This embodiment first follows the Step 1 process (see details). Figure 1 Standardize the original multimodal data. For example... Figure 2 As shown in the top left corner, during the data input phase, the raw multimodal 3D medical image volume data is first acquired, and intensity normalization is performed. To address the uneven distribution of MRI signals, the mean value of voxels in non-background regions is used. with standard deviation The input tensor is normalized by intensity, and the calculation formula is as follows: ;in, Represents the original input tensor. This represents the tensor after intensity normalization.
[0040] This operation aims to eliminate brightness deviations caused by non-uniform radio frequency fields in different medical scanning devices, ensuring that the model can learn biologically consistent feature expressions.
[0041] The core innovation of this embodiment lies in the auxiliary boundary label. Decoupling and extraction. This method first obtains, for example... Figure 2 The original gold standard mask shown in the top left corner refers to the ground truth label in a medical image segmentation task, obtained from the medical dataset (BraTs2021); subsequently, a... The three-dimensional discrete Laplace operator for this mask Perform a second-order gradient convolution operation. For example... Figure 1 As shown in Step 1, the absolute value of the convolution output is calculated. Precisely locate spatial abrupt changes in mask density, and finally decouple to generate single-channel auxiliary boundary labels. Its physical significance lies in: capturing the spatial frequency features of the mask through second-order differentials, transforming the originally overlapping region segmentation task into a dual-task learning mode of "anatomical region determination + geometric boundary definition". The generated... With a width of only 1-2 voxels, the model is forced to learn high-frequency geometric details of the lesion contour during the training phase, effectively solving the boundary blurring problem caused by partial volume effects at the tumor infiltration edge. Finally, the CropForegroundd operator is used to automatically remove large areas of blank background in the image, retaining only the smallest bounding box containing the lesion to significantly reduce unnecessary computation. In this step, the intensity-normalized 3D tensor... This is the conditional guided image, which serves as the initial input for the conditional guided coding branch in Step 2; while the decoupled auxiliary boundary labels... This is then used for loss function supervision in subsequent training phases.
[0042] MEGF-Diff Architecture and Topology The overall architecture of the decoupled segmentation network MEGF-Diff constructed in this invention is as follows: Figure 2 As shown, its detailed operator topology can be found in [reference needed]. Figure 5 .like Figure 5 As shown in the main architecture diagram, the network adopts a three-column parallel topology: the left column is the conditional guided coding branch; the middle column is the coding part of the diffusion denoising branch, which receives the noisy tensor input; and the right column is the decoding part of the diffusion denoising branch, which is responsible for generating the segmentation result.
[0043] (1) Initial projection of the starting stem block like Figure 5 As shown at the top of each branch, after an image or noise input, it first enters the Stem Block.
[0044] In the conditionally guided coding branch, the Stem Block consists of two cascaded layers. The three-dimensional convolution is responsible for projecting the original grayscale image with 1 channel onto a high-dimensional feature space to extract the initial anatomical structure features.
[0045] In the diffusion denoising branch, the Stem Block receives the noisy tensor generated from the forward diffusion process in Step 3. As input. Figure 2 and Figure 5 As shown, it simultaneously receives the projected timestep embedding vector (TimeStep). t ), and on the first floor Feature stacking is performed after convolution. For example... Figure 5 As indicated by the horizontal arrow at the top, it also receives anatomical feature injections from the StemBlock on the left. This fusion of multi-source information within the Stem Block ensures that the network can align image, noise, and temporal information in the initial stages of feature extraction.
[0046] After the initial projection, the coding portion of the diffusion denoising branch further extracts features through cascaded downsampling levels. The output of each level of this coding portion is a downsampled noisy latent representation; these representations are then passed to the corresponding decoding stage via skip connections and work together with the conditionally guided features E from the left branch in the subsequent reconstruction process.
[0047] (2) Intralayer structure of the hierarchical core L-GOSM Layer refer to Figure 5 The zoomed-in detail box on the left shows that each level of the conditionally guided coding branch (L-GOSM layer) strictly follows the following processing order: ① Lightweight Feature Refinement Unit (LFRU) Features first enter the LFRU. For example... Figure 4 As shown, LFRU is used to enhance the input features before each level of downsampling. The shape of the input tensor is fixed as follows. Where B is the batch size and C is the number of feature channels. This module constructs two attention paths in parallel: The top path is a spatial attention path, employing... 3D depthwise separable convolution (DSConv). Its calculation process is as follows: ;in, This represents the spatial attention weights.
[0048] Its technological innovation lies in achieving geometric constraint capture of hundreds of neighborhood voxels with a relatively low parameter cost (the number of parameters is only 1 / C of that of standard convolution). The design of large kernel convolution aims to provide robust local topological priors for subsequent state space operators.
[0049] The bottom path is the channel attention path, which compresses spatial information through global average pooling and uses a two-layer MLP with a hidden layer dimension reduction ratio of 8 to calculate the cross-correlation weights between modes: ; Final output features Sum the weighted residuals of the two paths: ; After the LFRU unit, such as Figure 5 The integrated parameterless attention unit is shown.
[0050] ② Parameterless attention unit The parameterless attention unit (LFRU) performs pixel-level feature refinement based on an energy function. This mechanism dynamically adjusts feature weights to maximize feature representation purity without significantly increasing computational power. Its underlying mechanism involves evaluating the importance of a single neuron by calculating the linear separability between it and its neighborhood. Specifically, for the three-dimensional feature tensor output by the LFRU... target voxels t Its corresponding energy function The definition is as follows: ; Where, μ and Let represent the mean and variance of all neurons in the spatial neighborhood of the voxel, respectively. This is a preset, small positive constant used to ensure the numerical stability of the calculation.
[0051] ③ Global and orthogonal plane scanning of Mamba elements GOS-Mamba This is the core underlying operator innovation of the present invention, aiming to solve the problem of loss of anatomical correlation caused by "one-dimensional flattening" when processing three-dimensional images using the selective state-space model (Mamba). Figure 3 As shown, the purified feature tensor First use Convolution compresses the number of channels to the projection dimension. Semantic principal components are extracted. Then, three-way parallel modeling is performed: Full-space scan path (mode0): uses memory rearrangement instructions to flatten the tensor into a one-dimensional long sequence. To capture global dependencies (such as) Figure 3 (As shown in the top branch) ; in, This represents the function for tensor dimension reorganization (or flattening).
[0052] The Mamba operator performs state transformations on the sequence, capturing the macroscopic distribution of lesions throughout the three-dimensional space and establishing global spatial anchor points.
[0053] Orthogonal tangent path: Axial section scan path (mode1): The depth axis is replaced by a dimension displacement command. Permutation to the batch dimension forces the operator to perform state transitions within the transverse anatomical section (e.g., Figure 3 (As shown in the middle branch) ; in, This represents a one-dimensional long sequence generated by the axial section scanning path. Represents the input three-dimensional feature tensor; Indicates the batch size. , , The depth axis, height axis, and width axis represent three-dimensional features; This represents the dimension of the compressed feature projection. (.) is the "tensor dimension permutation" function.
[0054] Its physical significance lies in simulating the visual logic of a radiologist reviewing images layer by layer, enabling the capture of subtle infiltration textures within the tumor.
[0055] Cross-sectional longitudinal profile scanning path (mode 2): The height axis H is replaced with the batch dimension to capture the geometric continuity of the lesion along the longitudinal axis of the body (e.g., ...). Figure 3 (As shown in the bottom branch) ; This represents the feature sequence output by the longitudinal profile scanning path across the cross section.
[0056] It effectively eliminates the vertical discontinuity artifacts caused by the difference in resolution between layers in traditional algorithms.
[0057] Finally, the outputs of the three scan paths mentioned above enter the shared_mamba operator and are aggregated through dynamic weighted fusion nodes: ; This mechanism ensures that the model can adaptively eliminate inter-layer discontinuity artifacts for different anatomical variations, enabling stereoscopic spatial perception of three-dimensional medical images.
[0058] ④ Downsampling: The features are finally downsampled by using max pooling and 1x1x1 convolution to reduce the size of the feature map.
[0059] (3) In-layer structure of hierarchical core gated decoding convolutional blocks refer to Figure 5 The magnified detail box on the right shows that each level of the diffusion denoising branch (gated decoding convolutional block) strictly follows the following processing order: ① UpSampling Block: This block receives feature tensors from the low-resolution decoding layer and uses 3D transposed convolution or linear interpolation in conjunction with convolution operations to simultaneously magnify the feature map by a factor of two in the D, H, and W dimensions. This step aims to restore the spatial resolution of the image and adjust the number of feature channels to match the corresponding encoder layer, laying the geometric foundation for subsequent feature injection and gating weight calculation.
[0060] ② Adaptive filtering of the spatial gating fusion module SGFM like Figure 5 As shown, the guiding features of the conditionally guided coding branch are injected into the middle column via horizontal arrows; the middle column features enter the right-side decoder via jump connections. SGFM is integrated into each decoding stage; details can be found in [link to documentation]. Figure 5 The detail box on the right is labeled "Gated". The features below the decoder are first enlarged in size by the upsampling block in ①, and then concatenated with the features of the middle column encoder level. The concatenated feature stream then passes through the first layer sequentially. 3D convolution, batch normalization, ReLU activation layer, then a second layer The 3D convolution is mapped to a single channel, and finally a spatially gated weight map is generated through a Sigmoid activation layer. This method utilizes this weighted graph. Encoder hierarchical features Perform the Hadamard product operation: ; in, This represents the encoder-level features after spatial gating filtering (or purification).
[0061] As shown in the figure As shown by the symbols. The filtered features are then subjected to "feature concatenation" again and fed into subsequent convolutional layers. Its technical advantage lies in: in the early stages of diffusion denoising (time... When the noise level is high, the gating mechanism uses high-order semantics from the decoder as an adaptive filter to dynamically shield noise streams in non-lesion regions, achieving highly deterministic feature-guided alignment.
[0062] ③ Convolutional Layer: After SGFM completes feature purification and secondary concatenation, the fused feature stream enters the two-layer convolutional layer. A convolutional layer consisting of three-dimensional convolutions. First, it passes through the first layer... Convolution performs initial integration and dimensionality reduction on the concatenated high-dimensional features; subsequently, a time-step embedding vector with nonlinear mapping is injected, enabling the feature reconstruction process to be aware of the current denoising state; finally, a second layer... Convolution performs deep nonlinear mapping, further smoothing the feature distribution and strengthening anatomical constraints, outputting the final scale-reconstructed feature tensor of this decoding level.
[0063] The diffusion denoising branch decoding section extracts scale-reconstructed feature tensors step by step, and finally outputs a consistent 3D medical image segmentation mask.
[0064] (4) Ratio of multi-task collaborative training and joint loss function The model training phase uses, for example Figure 2 The forward diffusion and backward prediction mechanism shown, time stept Injected at each level. Joint loss function. Defined as: ; Among them, the joint loss of the main output layer It consists of the following three core loss functions: The Dice similarity coefficient loss is used to globally measure the volumetric overlap between the model-predicted lesion segmentation region and the ground truth label in three-dimensional space. This loss is highly robust to changes in lesion size and can effectively alleviate the severe class imbalance problem commonly found in medical image segmentation (i.e., the imbalance between large healthy background voxels and small lesion voxels).
[0065] The binary cross-entropy loss is used to perform pixel-level classification cross-entropy calculations for each independent voxel in the 3D panoramic features. By penalizing the network's prediction probability bias at a single pixel, it provides a smooth and stable gradient update signal, prompting the model to converge faster and refining the prediction accuracy at the micro level.
[0066] Mean squared error loss: For the diffusion denoising model architecture integrated in this invention, this term is mainly used to constrain the model at the current time step. The Euclidean distance error between the denoised target predicted by the inverse projection and the true Gaussian distribution target. It forces the model to accurately fit the complex spatial data distribution, ensuring extremely high stability of the long-range iterative process of diffusion inverse denoising.
[0067] Combining the above three factors, the main output layer forms a multi-dimensional supervision mechanism through spatial overlap constraints, independent pixel probability constraints, and denoising distribution constraints.
[0068] Furthermore, to further optimize long-term training and boundary details, a joint loss function is used. It also introduces a deep monitoring mechanism and auxiliary boundary constraints: The deep supervision loss term is configured at three output heads with decoder resolutions of 48×48×48, 24×24×24, and 12×12×12. Its weight coefficient is set to 0.2, which physically establishes a "gradient relay station" in the diffusion iteration path. Since the backward iteration path of the diffusion model is long, gradient vanishing or semantic shift can easily occur. This mechanism ensures that gradient vanishing does not occur in the encoded hierarchical features during long-range iterations.
[0069] The auxiliary boundary loss term has a weight of 0.05, which is intended to force the model to perform sensitive regression on the high-frequency geometric properties of the lesion edge, thereby improving the determinism of the reconstruction of the invasive boundary.
[0070] (5) Gaussian weighted kernel window fusion during the inference phase In the inference phase (i.e., the testing and practical application phase after model training), for full-resolution images (i.e., the original-size test images to be segmented after Step 1 preprocessing), this method employs a sliding window inference mechanism, setting the window size to 96×96×96 and the overlap rate to 0.5. Specifically, guided by conditional features, the MEGF-Diff model is first invoked to perform iterative prediction on each local window using an accelerated denoising strategy to obtain local reconstruction features. Subsequently, a smooth fusion process is performed on the overlapping areas of the sliding windows using weight kernels. Finally, a classification activation function is used for mapping and thresholding, thereby ultimately outputting a globally consistent 3D medical image segmentation mask.
[0071] The smooth blending process specifically involves: This embodiment uses a three-dimensional Gaussian weight kernel for smooth fusion. The definition is as follows: ; in, This represents the fusion weight of a certain feature voxel within the sliding window; , , These represent the relative spatial coordinates of the voxel in the depth, height, and width directions, respectively. These are the coordinates of the geometric center of the current sliding window; The standard deviation parameter is used to control the decay rate of the Gaussian distribution weights. This method effectively counteracts the window stitching gaps and artifacts caused by traditional average fusion. To verify the performance of the proposed 3D medical image segmentation method based on the diffusion state space model, this invention compares the proposed model with several mainstream medical image segmentation methods. Comparative experiments were conducted on the BraTS2021 dataset with mainstream models such as 3D U-Net, SwinUNETR, and SegDiff. Using the Dice similarity coefficient (DSC), a widely accepted quantification metric in the medical image field, the segmentation accuracy of each model in three anatomical sub-regions—whole tumor (WT), tumor core (TC), and enhanced tumor (ET)—was calculated and compared, along with their corresponding average Dice similarity coefficients. Specific quantification metrics and the number of parameters (Params(M)) for each model are shown in Table 1. A visualization comparison of the Dice similarity coefficients of each model is shown in [Table 1]. Figure 6 .
[0072] Table 1: Parameter Evaluation Table
[0073] Combined with Table 1 Figure 6 The experimental data shown demonstrates that the model (MEGF-Diff) of this invention achieves a significant balance between segmentation performance and computational efficiency on the BraTS2021 dataset. Its average segmentation accuracy (Mean Dice) reaches 89.5%, which not only comprehensively outperforms existing mainstream models such as 3D U-Net, SwinUNETR, and SegDiff, but also exhibits outstanding technical advantages in model lightweighting. Its 13.1M parameter count is 78.9% lower than SwinUNETR (62.2M) based on a self-attention mechanism, and 61.7% lower than the similar diffusion model SegDiff (34.2M). This proves that by integrating global and orthogonal sectional scanning paths and state-space operators with linear complexity, this invention effectively models the uncertainty of lesion boundaries while successfully controlling the computational overhead of large-scale 3D volumetric data to a low level, thus solving the technical pain point of the trade-off between accurate segmentation of high-resolution medical images and resource consumption under conventional hardware environments.
Claims
1. A 3D medical image segmentation method based on Mamba enhancement and gating fusion, characterized in that, The method includes the following steps: S1. 3D Image Preprocessing and Auxiliary Boundary Label Decoupling: Obtain raw multimodal 3D medical image volume data and preprocess it. Generate single-channel auxiliary boundary labels through gradient convolution decoupling. ; S2. Construct a diffusion segmentation network based on Mamba enhancement and gating fusion: The network includes a conditional guided coding branch responsible for feature injection, and a diffusion denoising branch composed of a denoising encoder and a gating decoder. S3. Model Training and Parameter Optimization: Input the preprocessed image into the network, perform the forward diffusion noise addition and backward noise reduction prediction process, and use the multi-task joint loss function for model training and parameter optimization. S4. Inference Segmentation and Post-processing: During the inference stage, a sliding window mechanism is used to input the test image. The accelerated sampling strategy and the three-dimensional Gaussian weight kernel are used to smoothly fuse the images to obtain the final 3D segmentation result.
2. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 1, characterized in that, The preprocessing in step S1 specifically involves: obtaining the volume tensor of the original multimodal 3D medical image, and using the mean value of voxels in the non-background region. with standard deviation The input tensor is normalized by intensity, and the calculation formula is as follows: ;in, Represents the original input tensor. This represents the tensor after intensity normalization.
3. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 2, characterized in that, In step S1, single-channel auxiliary boundary labels are generated through gradient convolution decoupling. Specifically, this involves obtaining the original gold standard mask. Gradient convolution pairs using the three-dimensional Laplacian kernel operator By performing second-order differential convolution operations and capturing abrupt extreme points in the mask distribution, single-channel auxiliary boundary labels are generated through decoupling. The original gold standard mask For the true labels in medical image segmentation tasks.
4. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 3, characterized in that, In step S2, the specific structure of each part of the diffusion segmentation network based on Mamba enhancement and gating fusion is as follows: The conditional guided coding branch is constructed using a four-stage downsampling structure. Before entering each downsampling level, a lightweight feature refinement unit is used to recalibrate and refine the features, followed by feature enhancement through a parameterless attention unit. The three-dimensional feature tensor is reorganized into global paths and orthogonal tangential paths using global and orthogonal tangential scanning Mamba units for parallel modeling. A shared state space operator is used to capture cross-dimensional spatial dependencies, outputting a multi-scale conditional guided feature sequence. The orthogonal tangential path includes mutually perpendicular axial tangential paths and longitudinal profile tangential paths. The diffusion denoising branch adopts a U-shaped network structure, with the denoising encoder and gated decoder connected step by step. The denoising encoder has the same structure as the conditional guided coding branch. Each decoding unit of the gated decoder integrates a gated decoding convolutional block to achieve the injection of guided features. The gated decoding convolutional block uses the decoding end features and the corresponding image encoder level features to perform channel concatenation, and generates a spatial weight map through convolution and activation functions. It performs pixel-level filtering on the encoder level features to suppress random diffusion noise in the early stage of sampling.
5. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 4, characterized in that, The lightweight feature refinement unit includes two parallel spatial attention branches and a channel attention branch. The spatial attention branch reception dimension is: The input features are used to extract the geometric constraint weights between voxels using 3D depthwise separable convolution, and a weight map is generated using a nonlinear activation function to perform pixel-level feature recalibration. The channel attention branch uses a three-dimensional global average pooling layer to compress the spatial dimension into a one-dimensional feature vector, and uses a multilayer perceptron with a fixed feature reduction ratio to calculate the cross-correlation weights between modes, thereby achieving selective enhancement of key modal features. Finally, the weighted features from the two branches are concatenated by channel dimension, and the number of channels is restored by convolution and residual summation is performed. The parameterless attention unit evaluates the activity of neurons based on an energy function, generates pixel-level saliency weights, and performs feature purification.
6. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 5, characterized in that, The global and orthogonal tangential scanning of Mamba cells performs the following tensor dimension recombination and parallel modeling operations: First, a three-dimensional convolutional layer is used to divide the channel dimensions. Compressed to the latent space projection dimension Then, the following three paths are scanned and modeled: Full-space scan path: The feature map is flattened into a length of [length missing] using rearrangement instructions. Full space sequence This is used to capture the global spatial dependencies of 3D volume data; where, , , and These are the depth, height, width, and batch size of the input features, respectively; Orthogonal section path: includes axial section scanning path and cross-section longitudinal section scanning path; Axial section scanning path: uses a dimension substitution command to replace one of the spatial axes to the batch dimension, transforming the feature map into a sequence containing axial information. It is used to capture spatial topological features within a single anatomical axial section; cross-section longitudinal profile scanning path: using the dimension displacement command to replace another spatial axis to the batch dimension, transforming the feature map into a longitudinal profile sequence. It is used to capture the anatomical axis continuity of the lesion in the longitudinal section direction; Finally, the information from the entire space and the tangential information from the two orthogonal directions are weighted and fused through dynamic weights to output a feature tensor with three-dimensional stereo perception.
7. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 6, characterized in that, The specific operations in the gated decoding convolutional block are as follows: The current time step is processed through convolution, normalization, and nonlinear activation layers. Decoding features With the corresponding encoder level features Calculate the relevance weights and generate a spatial attention gating graph: ; in, This indicates a feature concatenation operation along the channel dimension. This is a 3D convolution operation. For batch normalization operations, and There are two activation functions; Using gating graphs Perform operations on encoder-level features: To suppress the background noise flow introduced by diffusion randomness in the early stage of denoising, and to filter the encoder level features and After splicing, the temporal embedding information is injected again and then fed into the subsequent convolutional layer.
8. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 7, characterized in that, The multi-task joint loss function is: ; in, For multi-task joint loss function, the main output layer joint loss is... It consists of three core loss functions. This represents the Dice similarity coefficient loss. This represents the binary cross-entropy loss. Indicates the mean square error loss; This indicates the loss of in-depth supervision. Decoders representing different resolution scales, This represents the auxiliary boundary loss term.
9. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 8, characterized in that, Step S4 is as follows: For the test image, a sliding window inference mechanism is adopted, the window size and overlap rate are set, and a diffusion segmentation network based on Mamba enhancement and gating fusion is called to perform iterative prediction on each local window using an accelerated denoising strategy to obtain local reconstruction features. Subsequently, a smooth fusion process is performed on the overlapping area of the sliding window using weight kernels. Finally, the classification activation function is used for mapping and threshold determination to finally output the three-dimensional medical image segmentation mask.
10. The 3D medical image segmentation method based on Mamba enhancement and gating fusion according to claim 9, characterized in that, The smooth fusion process specifically involves using a three-dimensional Gaussian weight kernel for stable fusion. The definition is as follows: ; in, This represents the fusion weight of a certain feature voxel within the sliding window; , and These represent the relative spatial coordinates of the voxel in the depth, height, and width directions, respectively. These are the coordinates of the geometric center of the current sliding window; The standard deviation parameter is used to control the decay rate of the Gaussian distribution weights.