Adaptive edge-aware three-dimensional medical image segmentation method

By using an adaptive edge-aware 3D medical image segmentation method, which combines hybrid attention convolutional blocks and an adaptive weight matching module, the problem of insufficient segmentation accuracy of existing models in small lesions and boundary regions is solved, achieving higher segmentation accuracy and robustness.

CN122289294APending Publication Date: 2026-06-26ZHEJIANG SCI-TECH UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG SCI-TECH UNIV
Filing Date
2026-03-24
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing 3D medical image segmentation models lack sufficient segmentation accuracy for small lesions and boundary regions, resulting in high Hausdorff Distance values ​​(95%), which limits the robustness and practicality of the models in high-risk clinical scenarios.

Method used

An adaptive edge-aware 3D medical image segmentation method is adopted, which combines Hybrid Attention ConvBlock (HAC) and Adaptive Weight Matching (AWM) module. Through adaptive feature fusion mechanism and cross-stage feature propagation strategy, the HD95 and DICE indices are optimized to improve the boundary segmentation accuracy.

Benefits of technology

It significantly improved the DICE coefficient, reduced the HD95 value, enhanced the accuracy and robustness of boundary segmentation, and strengthened the model's segmentation ability in complex lesions and boundary regions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289294A_ABST
    Figure CN122289294A_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive edge-aware 3D medical image segmentation method, with the following specific steps: S1, constructing an adaptive edge-aware network, which includes an encoder and a decoder, with a skip connection between the encoder and decoder; S2, acquiring and processing a 3D medical image; S3, inputting the preprocessed image from step S2 into the encoder of the adaptive edge-aware network through a patch partitioning layer, then into the decoder through residual blocks and adaptive weight matching blocks. The decoder output and the original input image are skip-connected through adaptive weight matching blocks, and finally, the image segmentation result is output through residual blocks and Fourier convolution. This invention exhibits stronger robustness and boundary accuracy in multi-organ 3D segmentation tasks, providing an efficient and scalable solution for medical image segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of 3D medical image segmentation technology, and relates to a deep learning-based medical image segmentation method, specifically an adaptive edge-aware 3D medical image segmentation method. Background Technology

[0002] 3D medical image segmentation is a fundamental practical task in clinical medicine, aiming to accurately segment specific organs or lesions in volumetric images such as CT and MRI, providing indispensable support for subsequent pathological diagnosis, surgical planning, and efficacy evaluation. In the development of this field, the advancements in artificial intelligence and computer vision have made significant contributions, with U-Net and its variants laying a solid foundation. Its classic U-shaped symmetric encoder-decoder architecture with skip connections enables efficient end-to-end learning, greatly reducing computational load and improving computational efficiency. In this architecture, the encoder part extracts contextual information with rich spatial details, while the decoder part recovers the spatial structure and semantic information of the target. Skip connections fuse low-level features from the encoder and high-level features from the decoder, ensuring accurate localization.

[0003] However, the convolution-based U-Net architecture is limited by the locality of convolution operations, resulting in a limited receptive field. This makes it difficult to capture long-range dependencies in images, thus limiting the model's ability to model complex lesions globally.

[0004] In recent years, the rise of Visual Transformer (ViT) has provided a new approach to addressing this bottleneck. Its powerful global self-attention mechanism (composed of channel attention and spatial attention) can capture long-range dependencies between any pixels in an image, significantly improving the model's segmentation capabilities in complex scenes. Researchers have quickly attempted to combine the global modeling advantages of Transformer with the local feature extraction capabilities of CNN. For example, UNETR uses Transformer as its encoder, effectively capturing global context while preserving local details, and performs excellently in multi-organ segmentation tasks. Models such as SwinUNETR, nnFormer, and SwinUNETRV2 further explore the modeling of multi-scale features and long-range dependencies by introducing mechanisms such as shifted windows, staggered convolutions, and self-attention.

[0005] While these hybrid models have made significant progress on overall segmentation metrics (such as DICE), they face a common core challenge: unsatisfactory segmentation accuracy for small lesions and boundary regions. This directly leads to a high Hausdorff Distance 95% (HD95) value, indicating a significant deviation between the segmented contour and the true boundary, severely limiting the robustness and practicality of the models in high-risk clinical scenarios. Some subsequent studies (such as UNETR++ and PFormer) have made improvements on specific metrics, but have not yet achieved breakthroughs in the crucial boundary segmentation and edge perception capabilities. Summary of the Invention

[0006] To improve the boundary accuracy of 3D medical image segmentation, this invention proposes an adaptive edge-aware 3D medical image segmentation method.

[0007] The preferred embodiment of this invention employs a decoder combining a novel Hybrid Attention ConvBlock (HAC) and an Adaptive Weight Matching (AWM) module. This decoder is designed to directly optimize for two key medical image metrics: HD95 and DICE, aiming to achieve more accurate boundary segmentation. The decoder features an adaptive feature fusion mechanism that dynamically integrates simplified and deep features from different stages of the encoder through learnable channel weights (α, β). This design enhances feature discriminative power through channel-level recalibration. Simultaneously, HAC fuses spatial and channel attention to capture richer local texture and global contextual information, significantly improving sensitivity to edge features. Furthermore, this invention introduces a cross-stage feature propagation strategy, passing fusion information from the previous stage to the next stage for further weighted optimization, thereby generating accurate segmentation boundaries. Experimental results show that the method of this invention significantly reduces the HD95 value while improving the DICE coefficient, demonstrating its superior performance in boundary segmentation.

[0008] The present invention adopts the following technical solution:

[0009] An adaptive edge-aware 3D medical image segmentation method, the specific steps of which are as follows:

[0010] S1. Construct an adaptive edge-aware network, which includes an encoder and a decoder, with a seamless skip connection between the encoder and decoder.

[0011] S2. Acquire three-dimensional medical images and perform preprocessing;

[0012] S3. The image preprocessed in step S2 is input into the encoder of the adaptive edge perception network through the patch partition layer, and then enters the decoder through the residual block and the adaptive weight matching block. The output of the decoder is connected to the original input image through the adaptive weight matching block. Finally, the image segmentation result is output through the residual block and Fourier convolution.

[0013] Preferably, in step S1, the constructed adaptive edge-aware network is as follows: Figure 1 As shown, this adaptive edge-aware network employs an encoder-decoder architecture, which preferably consists of four encoder and decoder layers, with skip connections between the encoder and decoder. The encoder part includes a Swing Transformer module and a downsampling layer (patchmerging), while the decoder part consists of Hybrid Attention Convolutional Blocks (HAC) and upsampling layers. Through residual blocks and adaptive weight matching blocks, the feature maps output by the corresponding encoder sub-networks are skip-connected to the decoder output. When connecting the shallowest decoder layer, the shallow features of the patch partitioning module replace the encoder output, achieving effective fusion of multi-scale features. The deepest encoder layer only needs to pass features to the decoder using residual blocks. Finally, the original input data is processed through the corresponding residual blocks; simultaneously, after upsampling, the shallowest decoder branch skips-connects the two through adaptive weight matching blocks, achieving feature alignment and weighted fusion. The fused features are further refined by residual blocks and finally mapped to the target segmentation result through convolutional layers.

[0014] Preferably, in step S2, three-dimensional medical input images are acquired. The acquired input images, such as CT and MRI images, are divided into data and subjected to a series of preprocessing operations, such as cropping and rotation, before being input into the network model in step S1.

[0015] Preferably, in step S3, the preprocessed input image is first passed to the patch partitioning layer. The patch partitioning layer can map the original input data from its original space to its feature representation and divide the original data into three-dimensional patch embedding blocks with fixed resolution and dimensions. Specifically, the input 3D data is processed by the patch partitioning layer to reduce the original patch size... Divided into new patch sizes ,in These represent the patch depth, patch height, and patch width, respectively, where D is the depth of the input image, H is the height of the input image, and W is the width of the input image. Then, Projected into a three-dimensional embedding space of dimension C, and with a linear projection matrix Perform multiplication to obtain a more compact and representative feature representation. This provides input for the subsequent Swing Transformer encoding process, and the input projected into the embedding space C is represented as:

[0016] (1)

[0017] in, R indicates that Z0 is a real number. B represents the batch size. Input the number of channels (e.g., 4 MRI (magnetic resonance imaging) channels). For the output tensor of the patch partition layer, The linear projection weight matrix is This is the linear projection bias term.

[0018] Preferably, in step S3, the encoder processing consists of four stages, each stage including a Swing Transformer block and downsampling (i.e., Figure 1 The patch merging layer in the code forms a single encoding block. The Swin Transformer, through local window attention and shifting window mechanisms, significantly improves computational efficiency while maintaining the global modeling advantages of the Transformer, and enables multi-scale modeling, crucial in vision tasks. The downsampling following each Swin Transformer reduces the resolution to half its original value.

[0019] A complete workflow of the Swin Transformer is divided into layers l, l+1, and l+2, mainly consisting of four steps. The first step (as shown in Equation 2) involves in-window self-attention (W-MSA), first... (The output of the patch partition layer) undergoes LayerNorm (linear normalization), followed by self-attention computation within non-overlapping local windows. (Explanation of window attention computation: Window attention reduces computational complexity from quadratic to linear by limiting self-attention to local windows. Simultaneously, it works with a shift window mechanism to compensate for insufficient receptive field caused by locality, enabling the Swin Transformer to handle both high-resolution images and model long-range dependencies, making it a classic architecture in visual Transformers.) Then, residual connections are used to add back the original features to generate the l-th layer. The second step (as shown in Formula 3) involves channel nonlinear mapping, performing another linear normalization (LayerNorm), multilayer perceptron (MLP), and residual generation on the features after the l-th layer attention. The third step (as shown in Equation 4) is Moving Window Attention (SW-MSA), which differs from W-MSA in that the window is shifted by half its size, forming the output features of layer l+1. The fourth step (as in Formula 5), ​​which is layer l+2, is exactly the same as the second step, generating the Swing Transformer output. The overall process can be summarized as follows: first, model within a local window; then, use MLP to blend them; then, use shift windows to connect different windows; and finally, use MLP to blend them.

[0020]

[0021] Wherein, W-MSA and SW-MSA represent regular multi-head self-attention and window-partitioned multi-head attention, respectively; MLP and LN represent layer normalization and multilayer perceptron, respectively. These are the outputs of W-MSA and MLP, respectively.

[0022] These are the outputs of SW-MSA and MLP, respectively. To more efficiently calculate the window shifting mechanism, the following formula is given:

[0023]

[0024] To enhance the model's expressive power and feature decomposition capabilities, the input feature X is uniformly divided into h subspaces, each corresponding to an independent attention head. The symbol i represents the index of the i-th attention head, where... The symbol h represents the number of attention heads used in Multi-Head Self-Attention (MHSA). Let represent the query, key, and value, respectively; each attention head i has its own set of projection matrices; d represents the size of the query and key. For similarity, The correlation of each token in each head with other tokens, divided by This is to ensure numerical stability and prevent softmax gradient explosion. It is an (M×M) bias matrix taken from the relative position table, which gives attention spatial awareness; It is AttentionMask, which prevents a token from focusing on tokens that do not belong to the same window. If there is no AttentionMask, the value is 0. It is a linear projection matrix. The overall process includes first passing through... Obtain the weight distribution of each token's attention to other tokens for each attention head. ; and again Perform a weighted summation, reading the most relevant information from all tokens; then concatenate the results using multiple heads. Enrich the information; finally use Integrate the multi-headed information back into the original channel dimension.

[0025] Softmax is used to exponentially normalize the scaled dot product score, mapping it to a set of attention weights that sum to 1, thereby characterizing the relative importance between different positions. .

[0026] The formula for Softmax can be expressed as:

[0027] (9)

[0028] in, The input value / score (logit) corresponding to the i-th category is usually obtained by the linear transformation of the last layer of the network and is not normalized. Similarly, K is the total number of categories, and e is the natural exponential function. In the preferred encoder of this invention, the encoder patch size is set to 2×2×2, the feature dimension is 32, and the embedding space size is set to 16. In the hierarchical encoder structure of this invention, the encoder consists of four stages, and each stage contains multiple Swing Transformer blocks. After the patch partitioning layer, the resolution transmitted to the first stage of the encoder becomes 48×48×48, while the number of channels remains 16. After the first stage of the encoder, through the patch merging layer operation, the downsampling resolution becomes the original. The number of channels is then doubled using a linear layer. The second, third, and fourth stages follow the same operation, with the resolution becoming... .

[0029] Preferably, the residual block in step S3: Since the encoder uses a Swing Transformer for multi-scale global feature extraction, while the decoder uses a U-Net-style convolutional upsampling structure for spatial resolution restoration, there are differences in their feature representations. The residual block enhances local details and reshapes channel features of the high-level semantic features output by the Transformer encoder through convolution, normalization, and non-linear activation operations, making it more suitable for subsequent feature fusion and reconstruction by the convolutional decoder. Simultaneously, the residual connection preserves the original information of the input features, allowing the network to learn only the residual information relative to the input features, thereby effectively alleviating the gradient vanishing and feature degradation problems in deep networks and improving training stability. For medical image segmentation tasks, this structure helps to strengthen the expression of local boundaries and fine-grained structures while preserving global contextual information, thereby improving the segmentation accuracy of organ boundaries and small target regions.

[0030] Preferably, in step S3, the core module of the skip connection is an adaptive weight matching module (AWM module), such as... Figure 2 As shown: Inspired by skip connections in U-Net, this invention further proposes an adaptive weight matching strategy to enhance feature fusion without increasing overhead. Existing ordinary skip connections treat all channels equally, without distinguishing which channels are more important. While this helps to supplement spatial details in deep semantic information, it may introduce redundant or irrelevant features. The adaptive weight matching strategy of this invention overcomes the shortcomings of the indiscriminate treatment of channels in existing skip connections, adaptively allocating weights according to the number of channels to achieve better feature fusion. This invention introduces a set of adaptively learned weights at each decoder stage. Each set of adaptive weights has a dimension of C×1×1×1, where C corresponds to the number of channels. The adaptive learnable weights adaptively adjust the contribution rate between multi-scale shortcut connections and hierarchical deep features through a discriminative attention mechanism, thereby dynamically adjusting the fusion process. Specifically, the upsampled decoder output features from the deep layer and the encoder output features from the current layer are respectively compared with a C×1×1×1 dimension... The process involves multiplying Hardmard products, concatenating them using concat, and finally performing a Fourier convolution to highlight key features and suppress irrelevant information. The formula processed by this adaptive weight matching module is as follows:

[0031] (10)

[0032] Among them, adaptive weights Adaptive weights C Skip C represents the number of output channels of the encoder. InpX is the number of channels from the upsampled output of the deep decoder. Skip X is the output from the encoder. Inp Conv1 is a 1×1×1 convolutional block, which is the output after upsampling from the deep decoder.

[0033] Preferably, in step S3, the decoder part includes four processing stages, each stage containing a Hybrid Attention Convolutional Block (HAC) module and upsampling. Existing hybrid modules have limited performance in utilizing salient foreground features, and their extraction of non-salient foreground edge features suffers from poor convergence due to insufficient interaction. To address this, this invention further refines feature learning from both spatial and channel dimensions, proposing an efficient attention convolutional module (HAC). This module integrates channel attention and spatial attention mechanisms, strengthening the interaction between features and improving the perception and modeling of spatial and channel information, thereby significantly enhancing the representation ability of non-salient foreground features. In each stage, the decoder first upsamples the output features from the deep decoder (the closer the decoder is to the output, the shallower the layer; the closer it is to the bottom layer of the network, the deeper the layer; the higher the resolution, the shallower the layer; for example, the decoder at the bottom of the network is the deepest layer, and the layer closest to the output is the shallowest layer) to the same resolution as the encoder in the same layer. Then, through an adaptive weight matching module, the upsampled features are skip-connected with the output features of the encoder in the same layer before being input into the HAC model of the decoder for channel and spatial modeling.

[0034] like Figure 3 As shown in the HAC model architecture diagram, this invention assumes that the input feature map First, X is input into the Interactive Feature Selector (IFS) to generate a shared query (Q). share ), shared key (K) share Spatial attention value (V) SA ) and channel attention value (V CA The matrix is ​​then processed, and the last two dimensions are transposed to prepare for subsequent matrix multiplications. The space is then flattened, flattening the original 3D spatial coordinates (H×W×D) into a one-dimensional sequence, followed by dimensional transformation, since attention is typically performed on sequences. IFS generates Q... share K share V SA V CA It can be represented as:

[0035] (11)

[0036] Regarding spatial attention, a linear projection matrix is ​​used to reduce the dimensionality of the key and the spatial attention value. The complexity was reduced from the original HWD dimension to the P dimension. Reduced to Furthermore, to accommodate learnable temperatures, L2 normalization was applied to the query and key, improving the stability of attention computation. Subsequently, by... transpose multiplied by We compute a spatial attention map, and then use the softmax function to measure the feature similarity between each spatial location and other locations. Finally, we combine the obtained attention weights with... Multiply and project to generate a final spatial attention in the form of HWD×C. The formula for spatial attention is as follows:

[0037]

[0038] In the formula, represents the shared query, the projected shared key, and the projected spatial value layer, respectively, and d is the size of each vector.

[0039] Regarding channel attention, through... The channel attention map and channel-specific value layer are generated using the softmax function. Matrix multiplication enables interaction and recalibration between feature channels. This operation effectively captures the interdependencies between different feature channels and weights and aggregates features based on their correlation, thereby highlighting the contribution of important channels, suppressing the influence of redundant or noisy channels, and ultimately achieving efficient feature channel recalibration. Channel attention is defined as follows:

[0040] (15)

[0041] In the formula, represents the shared query, shared key, and projected channel value layers, respectively, and d is the size of each vector.

[0042] When invoking attention, the input features passed to the dual attention are first normalized. Then through dual attention Enhanced features are extracted and their weights are controlled by a learnable factor γ. Finally, the output of the dual attention is directly added to the original input, preserving the original information and superimposing the enhanced information to make the gradient flow smoother and the features more stable, resulting in the fused attention features. This part can be described as:

[0043] (16)

[0044] In the formula, X is the initial input, γ is the learnable factor, and X SA For spatial attention output, X CA For channel attention output, LN is normalization.

[0045] Finally, this invention first addresses X. attn The output is reshaped to obtain A. skip Next, rich feature representations are obtained through two residual blocks and one convolutional block, and finally, residual connections are made to A. skip This greatly alleviates the gradient vanishing problem, ensures training stability and network convergence to a certain extent, protects the original input information, promotes the reuse and refinement of hierarchical features, and enhances the model's ability to extract and fit complex features. The specific definitions are as follows:

[0046] (17)

[0047] In the formula, A is the output of the hybrid attention convolution block. skip For X attn The output is reshaped, with Conv1 being a 1×1×1 convolutional block and ResBlock being a residual convolutional block.

[0048] Preferably, in step S3, the original input is first processed through a residual block and then connected to the output of the shallowest decoder after upsampling via an adaptive weight matching block. This connection is then followed by a residual block and a 3D Fourier convolution. The residual block processing flow is as follows: the input features are sequentially processed through two batch normalized and ReLU 3×3×3 convolutional layers to extract residual features. The main path output is then added to the input via a skip connection (if the number of channels does not match, a 1×1×1 convolution projection is performed first). Finally, the output is activated by ReLU. The 3D Fourier convolution processing flow is as follows: a 3D FFT (Fast Fourier Transform) is performed on the input to transform it to the frequency domain. This is then multiplied point-by-point with a learnable complex filter to achieve frequency domain filtering with a large receptive field. Finally, a 3DIFFT (Inverse Fast Fourier Transform) is used to restore the input to the spatial domain, often in conjunction with a 1×1×1 convolution to efficiently adjust the channel dimensions. This achieves both global understanding and local precision, resulting in refined segmentation results.

[0049] In summary, to improve the boundary accuracy of 3D medical image segmentation, inspired by UNETR++ and SimpleUnet (UNETR++ further enhances the collaborative modeling capability of the Transformer and U-Net decoding structures based on UNETR, and more effectively captures global context and fine-grained spatial information in 3D medical images through multi-level feature interaction and improved skip connections; SimpleUNet adopts a lightweight encoder-decoder structure, achieving stable local feature extraction with lower parameter count and computational overhead, suitable for 3D medical image segmentation tasks under resource constraints), this invention proposes an adaptive edge-aware 3D medical image segmentation method. It adopts a decoder that combines a novel Hybrid Attention ConvBlock (HAC) and an Adaptive Weight Matching (AWM) module. The design goal of this decoder is to optimize for key indicators of medical images (especially HD95 and DICE) to achieve more accurate boundary segmentation. This decoder features an adaptive feature fusion mechanism that dynamically integrates simplified and deep features from different stages of the encoder using learnable channel weights (α, β). This design enhances the discriminative power of features through channel-level recalibration. Simultaneously, HAC integrates spatial and channel attention to capture richer local texture and global contextual information, significantly improving sensitivity to edge features. Furthermore, this invention introduces a cross-stage feature propagation strategy, passing fusion information from the previous stage to the next stage for further weighted optimization, thereby generating accurate segmentation boundaries. Experimental results show that this method significantly reduces the HD95 value while improving the DICE coefficient, demonstrating its superior performance in boundary segmentation. Attached Figure Description

[0050] Figure 1 is a flowchart of an adaptive edge-aware three-dimensional medical image segmentation method according to a preferred embodiment of the present invention.

[0051] Figure 2 is a structural diagram of the AWM adaptive weight matching module in a preferred embodiment of the present invention.

[0052] Figure 3 is a structural diagram of the preferred embodiment of the present invention, HAC, which is a hybrid attention convolution module.

[0053] Figure 4 is a structural diagram of the Swing Transformer module of a preferred embodiment of the present invention.

[0054] Figure 5 is a data processing flowchart.

[0055] Figure 6 is a comparison chart of the segmentation visualization results of the present invention and the prior art on the BTCV dataset.

[0056] Figure 7 is a comparison chart of the segmentation visualization results of the present invention and the prior art on the Synapse dataset.

[0057] Figure 8 is a comparison of the segmentation visualization results of the present invention and existing technologies on the BraTS dataset.

[0058] Figure 9 is Figure 2-4 The diagram illustrates the symbols involved.

[0059] Specific implementation methods

[0060] To provide a clearer understanding of the technical solution of the present invention, the present invention will now be described in detail with reference to specific implementation examples.

[0061] In a preferred embodiment of the present invention, an adaptive edge-aware 3D medical image segmentation method is adopted, which uses the EASNet (Adaptive Edge-Aware Network) model based on Swin-Transformer. The specific steps are as follows:

[0062] Step 1: Construct an adaptive edge-aware network, such as Figure 1 As shown, the network architecture consists of a hierarchical encoder-decoder structure, divided into four stages, with a certain number of channels. The number of blocks is [32, 64, 128, 256], and each stage has three HAC blocks. A jump connection is used between the encoder and decoder.

[0063] Step 2: Acquire 3D medical images and process the data.

[0064] In this step, the data processing system includes three steps: data segmentation, image preprocessing and enhancement, and data loading.

[0065] Data partitioning: On the BraTS dataset, we use 80% of the samples for training, 15% for validation, and 5% for testing. During both training and inference, all MRI volumes are cropped into 128×128×128 cubes as input. On the BTCV dataset, we randomly partition the data into a 60% training set and a 40% test set. On the Synapse dataset, the training and validation sets are partitioned in a 6:4 ratio. The partitioning of each dataset is detailed in the JSON file.

[0066] Image Preprocessing and Enhancement: A series of composite spatial geometric transformations and intensity domain enhancement operators were designed to address the characteristics of medical images (MRI, CT, and other 3D volumetric data) and improve the model's robustness to imaging differences, noise interference, and geometric deformation. The preprocessing workflow during training follows this sequence: data loading and dimensionality normalization, spatial registration and voxel normalization, intensity normalization, random sampling and spatial enhancement, intensity domain perturbation and artifact simulation, and tensorized output. This workflow achieves fully automated generation from raw images to standardized, randomly enhanced training samples, significantly improving the diversity of training data and the model's generalization performance. During the validation and testing phases, the system performs only deterministic transformations to maintain input consistency.

[0067] Data Loading: This function encapsulates a pre-processed Dataset (or CacheDataset) into a high-efficiency DataLoader, supporting batch reading and multi-threaded prefetching. The specific data processing flow is as follows: Figure 5 As shown.

[0068] Step 3: Feature Fusion and Image Segmentation: The preprocessed image from Step S2 is input into the encoder of the adaptive edge-aware network through a patch partitioning layer. Then, it passes through residual blocks and adaptive weight matching blocks before entering the decoder. The decoder output and the original input image are connected via a skip connection through adaptive weight matching blocks. Finally, the image segmentation result is output through residual blocks and Fourier convolution. Details are as follows:

[0069] The main processing flow in this step is as follows: encoder - skip connections - decoder. First, the input data is divided into three-dimensional patch tokens (patch embedding blocks) with fixed resolution and dimensions. A patch embedding layer maps the original space to feature representations, which are then fed into an encoder consisting of four stages. Each stage contains multiple Swing Transformers and a downsampling layer. After each layer, the resolution is halved, while the number of channels doubles through linear layers. After four layers, the resolution decreases from 96×96×96 to 6×6×6. To better fuse the features extracted by the encoder with the decoder, an adaptive weight matching module is used instead of traditional skip connections. This adaptive weight matching module adaptively adjusts the weights of the current layer's encoder output and the deep decoder output based on the number of channels, dynamically adjusting the fusion process and passing information to the shallow decoder. The decoder combines a hybrid attention convolution module with upsampling, continuously restoring the resolution by a factor of two, thus reducing the number of channels. In the layer following the decoder, a residual convolutional block replaces the hybrid attention convolutional module of this invention, and an operation is also performed immediately afterward to achieve better feature fusion and extraction with the original input data without increasing overhead. Finally, the final segmentation result is generated through convolution.

[0070] The following experiment compares the present invention with existing technologies.

[0071] In a preferred embodiment of this invention, an adaptive edge-aware 3D medical image segmentation method employs the EASNet (Adaptive Edge-Aware Network) model based on Swin-Transformer. This model is implemented in PyTorch and trained on an NVIDIA GeForce RTX 4090 GPU with 24GB of memory, with a peak memory usage of 2225MB during training. To ensure fair comparison with baselines such as SwinUNETR, UNETR++, and nnFormer, standard practices are followed, using the same input size, preprocessing strategy, data segmentation method, and without additional training data. Table 1 shows the network configuration for each dataset, including parameters such as batch size, crop size, and initial learning rate. The same SGD optimizer as PFormer, nnFormer, and UNETR++ is used during network training, with weight decay. The momentum was set to 0.99. An initial learning rate was set using a polygon learning rate strategy. For the Synapse dataset, all models have a uniform input size of 64×128×128, and the number of multi-head attention heads used in different encoder stages is [6, 12, 24, 48], with a depth of 3. For the BTCV dataset (abdominal multi-organ dataset), the same training strategy as nnFormer is followed, with the number of attention heads [6, 12, 24, 48] and a depth of 3, and all models are trained at 96×96×96. For the BraTs dataset (brain tumor dataset), the number of attention heads for all models is uniformly [3, 6, 12, 24], and all models are trained at 128×128×128, with all hyperparameters being the same as nnFormer.

[0072] The final segmentation result is compared with multiple baselines to generate visualizations, and the visualizations ( Figure 6 , 7 8) The segmentation effect shown is combined with the segmentation data generated by the model to illustrate the advanced nature of the model of the present invention.

[0073] The experimental results are as follows:

[0074] The following section presents a comparison of EASNet (the present invention) with state-of-the-art methods on the Synapse, BTCV, and BraTS datasets. All experiments using EASNet described below were trained from scratch.

[0075] 1. Experimental results on the Synapse dataset

[0076] To verify the effectiveness of this invention, the segmentation results were validated on eight organs (aorta, gallbladder, left kidney, right kidney, liver, pancreas, spleen, and stomach) in the Synapse dataset. As shown in Table 1, the proposed method EASNet achieves state-of-the-art segmentation performance on most organs, and outperforms other methods in both DSC and HD95 metrics. This invention's method is benchmarked against eight mature techniques: TransUnet, UNETR, Swin-Unet, DAE-Former, Swin-UNETR, nnFormer, Pformer, and MSAT. Specifically, regarding DSC, the proposed method shows significant segmentation performance on the kidney and spleen / stomach. Compared to the best Sota method MSAT, the DSC value increased by 6.68% for the right kidney, 7.33% for the left kidney, and 0.42% for the spleen / stomach. The overall DSC increased by 0.65% relative to the Sota method MSAT. Visualization results are shown below. Figure 6 .

[0077] Table 1. Comparison of the present invention with existing advanced multi-organ segmentation models

[0078] (Bold: Best result; Underline: Second result. Each column corresponds to the segmented DSC of the corresponding organ.)

[0079]

[0080] 2. Experimental results on the BTCV dataset

[0081] Experimental results on the BTCV dataset are shown in Table 2. The aim was to segment 13 abdominal organs from CT images. The proposed technique, EASNet, was compared with five benchmarks: UNETR++, nnUNet, nnFormer, Swim-UNETR, and SegFormer3D. The results show that EASNet outperforms the compared methods in DSC scores for most organs. Compared to the state-of-the-art method UNETR++, the DSC is improved by nearly 0.63%. Visualized segmentation on BTCV is shown below. Figure 7 As shown.

[0082] Table 2 Comparison of the present invention with other state-of-the-art methods on the BTCV dataset

[0083]

[0084] 3. Experimental results on the BraTS dataset

[0085] To expand the performance evaluation of the model of this invention, experiments were conducted using the BraTS 2021 dataset, aiming to identify ET, TC, and WT from brain MRI images. The results of this invention were compared with five benchmark methods: nnUNet, nnFormer, UNETR++, SegFormer3D, and MSAT. The results are shown in Table 3. Although the model EASNet of this invention is inferior to MSAT in WT segmentation, it achieves the best overall segmentation performance for ET and TC. Compared with the state-of-the-art method MSAT, it improves by 1.55%. The visualization results on BraTS 2021 are shown below. Figure 8 .

[0086] Table 3. Comparison of the present invention with other state-of-the-art methods on the BraTS dataset.

[0087]

[0088] Through comprehensive experiments on three different modalities (MRI and CT), different organ ranges (single organ and multiple organs), and different task characteristics, the robustness and generalization ability of the proposed EASNet in cross-modal and cross-anatomical scenarios were verified. The results show that EASNet achieves excellent performance on all datasets, demonstrating strong task adaptability and structural robustness. It exhibits particularly high accuracy and robustness in segmenting complex boundary and fine-structure regions.

[0089] Despite significant differences in imaging modalities, anatomical regions, and annotation granularity across datasets, EASNet maintains stable performance, demonstrating that the proposed adaptive feature fusion and hybrid attention mechanism has good generalization ability across data distributions.

[0090] In summary, this invention proposes an Edge-Aware Self-Adaptive Network (EASNet) to enhance the recognition of complex structures and fine boundaries in 3D medical image segmentation. EASNet achieves high-precision voxel-level segmentation by strengthening local edge representation while maintaining global semantic consistency through adaptive feature fusion and multi-scale context modeling.

[0091] EASNet's AWM module introduces a learnable weight mechanism that dynamically adjusts the fusion ratio of multi-scale features based on feature importance, achieving an adaptive balance between deep semantic information and shallow spatial details, significantly reducing information redundancy and feature conflicts in traditional skip connections. EASNet's HAC module combines channel attention and spatial attention, modeling both local and global contexts simultaneously through a lightweight convolutional attention structure, highlighting key anatomical regions and edge structures, thereby enhancing the model's boundary awareness and segmentation accuracy.

[0092] Overall, EASNet employs an encoder-decoder architecture, effectively restoring spatial resolution and enhancing edge response by integrating AWM and HAC modules in the decoding stage. Experimental results demonstrate that EASNet exhibits stronger robustness and boundary accuracy in multi-organ 3D segmentation tasks, providing an efficient and scalable solution for medical image segmentation.

[0093] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.

Claims

1. An adaptive edge-aware 3D medical image segmentation method, characterized by: The specific steps are as follows: S1. Construct an adaptive edge-aware network, which includes an encoder and a decoder, with a seamless skip connection between the encoder and decoder. S2. Acquire and process three-dimensional medical images; S3. The image preprocessed in step S2 is input into the encoder of the adaptive edge perception network through the patch partition layer, and then enters the decoder through the residual block and the adaptive weight matching block. The output of the decoder is connected to the original input image through the adaptive weight matching block. Finally, the image segmentation result is output through the residual block and Fourier convolution.

2. The adaptive edge-aware 3D medical image segmentation method as described in claim 1, characterized in that, In step S1, the encoder includes a Swing Transformer block and a patch merging layer, and the decoder includes a Hybrid Attention Convolutional Block (HAC) and an upsampling layer. The encoder and decoder in the same layer are connected by an adaptive weight matching block.

3. The adaptive edge-aware 3D medical image segmentation method as described in claim 1 or 2, characterized in that, In step S1, four encoders are set, and correspondingly, four decoders are also set.

4. The adaptive edge-aware 3D medical image segmentation method as described in claim 1, characterized in that, In step S3, the patch partitioning layer maps the input raw data from the original space to the feature representation, and the image is divided into three-dimensional patch embedding blocks with fixed resolution and dimensions.

5. The adaptive edge-aware 3D medical image segmentation method as described in claim 4, characterized in that, In step S3, the input image is processed through a patch partitioning layer to reduce the original patch size ( Divided into new patch sizes Where D is the depth of the input image, H is the height of the input image, and W is the width of the input image. These represent the patch depth, patch height, patch width, and the output tensor of the patch partition layer. Projected into a three-dimensional embedding space of dimension C, and with a linear projection matrix Perform multiplication to obtain a representable feature representation. The input projected onto the embedding space C is represented as: (1) in, R indicates that Z0 is a real number. B represents the batch size. Input the number of channels. For the output tensor of the patch partition layer, The linear projection weight matrix is This is the linear projection bias term.

6. The adaptive edge-aware 3D medical image segmentation method as described in claim 5, characterized in that, In step S3, the encoder processing consists of four stages, each of which includes a Swing Transformer block and a patch merging layer for processing; the Swing Transformer block uses local window attention and shift window mechanism, and the patch merging layer reduces the resolution to 1 / 2 of the original.

7. The adaptive edge-aware 3D medical image segmentation method as described in claim 6, characterized in that, The processing flow of the SwinTransformer block is divided into layers l, l+1, and l+2, and consists of four steps: Step 1, outputting the patch partition layer. Perform linear normalization using LayerNorm, independently compute self-attention within non-overlapping local windows, and then use residual connections to add back the original features to generate the output of layer l. ; The second step is to process the features after attention from the l-th layer. Perform another linear normalization LayerNorm, multilayer perceptron MLP, and residual generation window block output. The third step is to... First, perform linear normalization. Then, independently compute self-attention in non-overlapping local windows while shifting the entire window by half a window. Finally, perform residual connections with the input features to form the output features of layer l+1. Step 4: Apply attention to the features after the (l+1)th layer. Perform another linear normalization LayerNorm, multilayer perceptron MLP, and residual connection to generate the output of the Swing Transformer. .

8. The adaptive edge-aware 3D medical image segmentation method as described in claim 7, characterized in that, In step S3, the residual block performs local detail enhancement and channel feature reshaping on the high-level semantic features output by the encoder through convolution, normalization, and nonlinear activation operations.

9. The adaptive edge-aware 3D medical image segmentation method as described in claim 8, characterized in that, In step S3, a set of adaptive learning weights α and β are introduced in each decoder processing stage. The dimension of each set of adaptive weights is C×1×1×1, where C corresponds to the number of channels. The output features of the deep layer decoder after upsampling and the output features of the current layer encoder are multiplied by β and α of dimension C×1×1×1 using Hardmard products, then concatenated using concat, and finally subjected to Fourier convolution. The formula for the adaptive weight matching module processing in this stage is as follows: (10) Among them, adaptive weights Adaptive weights C Skip C represents the number of output channels of the encoder. Inp X is the number of channels in the output after upsampling from the deep decoder. Skip X is the output from the encoder. Inp Conv1 is a 1×1×1 convolutional block, which is the output after upsampling from the deep decoder.

10. The adaptive edge-aware 3D medical image segmentation method as described in claim 9, characterized in that, In step S3, the decoder processing includes four stages. Each stage includes a Hybrid Attention Convolutional Block (HAC) and upsampling. In each stage, the decoder first upsamples the output features from the deep decoder to the same resolution as the encoder in the same layer. Then, through the adaptive weight matching module, the upsampled features are skipped and connected with the output features of the encoder in the same layer before being input into the decoder's HAC for channel and spatial modeling.