Medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement
By employing a dual-domain feature injection and adaptive edge enhancement method, the problems of edge perception, noise suppression, and resolution restoration in medical image segmentation models were solved, achieving high-precision lesion segmentation and improving the robustness and clinical application value of medical image segmentation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-26
AI Technical Summary
Existing medical image segmentation models suffer from insufficient edge perception when capturing semantic information in complex pathological regions, difficulty in suppressing noise, easy blurring when restoring resolution, and insufficient long-distance semantic transmission, resulting in poor segmentation performance.
We employ a dual-domain feature injection and adaptive edge enhancement approach. We extract multi-scale features through a pyramid visual Transformer, combine an adaptive learning edge guidance module and a gated dynamic-static collaborative upsampling module, and utilize a dual-domain global injection mechanism to fuse global context information, explicitly extract edge features and restore resolution.
It significantly improves the accuracy and robustness of medical image segmentation, reduces the Hausdorff distance of segmentation results, enhances the segmentation effect of lesions in complex backgrounds, and strengthens the reliability of clinical diagnosis.
Smart Images

Figure CN122289295A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image segmentation technology, specifically relating to a medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement. Background Technology
[0002] In modern medicine, medical image segmentation, as an effective data processing method, plays a crucial role in effectively identifying abnormal regions. Over the past few decades, deep learning-based semantic segmentation techniques have attracted significant attention from researchers due to their higher efficiency compared to manual annotation. Essentially, semantic segmentation involves classifying pixel values, enabling pixel-level annotation of complex pathological regions in medical images, such as lesions, tumors, or entire organs. Recently, with the increasing need to model hundreds of tissues, efficient segmentation models have become increasingly required.
[0003] Semantic segmentation models based on deep convolutional neural networks have been widely used in various vision tasks, with encoder-decoder architectures (such as U-net) becoming the standard paradigm. The encoder captures semantic and contextual information through successive convolutional layers and downsampling, while the decoder reconstructs the output mask through progressive upsampling.
[0004] However, despite the effectiveness of the aforementioned structures, three key challenges remain in practical applications when pursuing high-precision segmentation (especially for polyps, dermoscopy, and pathological images): 1. Most existing edge-aware networks tend to directly utilize shallow features from the encoder to generate edge maps. However, simple low-level features lack guidance from high-level semantic information, only capturing local texture changes rather than semantically consistent object contours. In complex medical scenarios, this semantic deficiency makes it difficult for the network to suppress high-frequency noise unrelated to lesions. In other words, existing structures cannot dynamically tell the shallow network where the key areas are and where the background is, thus limiting the model's feature focusing ability under blurred boundaries. 2. When restoring resolution, bilinear interpolation is too simple and easily causes blurring, deconvolution easily produces a checkerboard effect, and content-based operators like CARAFE are computationally too expensive. In our research, we explore whether there is a mechanism that can perceive semantic shape like dynamic convolution while maintaining pixel-level local filling efficiency. 3. In most existing structures, simple skip connections are used to directly concatenate layer noise features and deep semantic features. While this traditional attention mechanism can alleviate the problem, it often only focuses on local alignment and ignores the guiding role of the underlying global context for each decoder layer. Summary of the Invention
[0005] The purpose of this invention is to provide a medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement to solve the above-mentioned problems.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement, the specific steps of which are as follows:
[0007] S1. Acquire the medical image data to be segmented and preprocess the image data to form the medical image to be processed. The preprocessing includes: uniformizing the size of the input medical image; performing data augmentation on the medical image; normalizing the image pixels; and binarizing the annotation mask. The normalization process uses a fixed-parameter channel-by-channel standardization method, specifically including: first dividing the image pixel values by 255 to map them to the [0,1] interval, and then standardizing the RGB channels according to preset mean [0.485, 0.456, 0.406] and preset standard deviation [0.229, 0.224, 0.225] respectively. The annotation mask is a single-channel mask image, processed using a fixed threshold binarization method, where the threshold is 0; pixels with pixel values greater than 0 are marked as target areas, and pixels with pixel values less than or equal to 0 are marked as background.
[0008] S2. Construct a multi-scale feature encoding channel, use the Pyramid Visual Transformer (PVT-v2) as the backbone network to extract hierarchical features from the input medical image, and at the end of the encoding channel, perform a dilated spatial pyramid pooling operation on the highest level deep feature map to finally obtain multi-level deep feature maps and generate a global context feature vector.
[0009] S3, input the feature map of the shallowest layer in the encoding channel into the adaptive learning edge guidance module, model the local geometric texture through a learnable convolution sequence, and generate a dynamic weight map using a spatial adaptive gating mechanism to perform pixel-level weighted filtering on the texture features, thereby explicitly extracting the edge enhancement features that suppress background noise.
[0010] S4, construct a cascaded decoding channel, which includes multiple levels of decoding stages; each level of decoding stage includes two core modules: a gated dynamic-static collaborative upsampling module and a dual-domain global injection module. In each decoding stage, the decoding output features of the previous level, the corresponding encoder features, and the global context feature vector are fused to output the decoded feature map.
[0011] S5, using the feature refinement and edge fusion module, the edge enhancement features are fused with the decoded feature map; based on the fused feature map, the final medical image segmentation mask is output through the segmentation head.
[0012] Preferably, the specific processing procedure of the adaptive learning edge guidance module in S3 is as follows: First, feature transformation is performed on the shallow features through consecutive convolutional layers, normalization layers, and activation functions to extract initial geometric features containing rich texture information; Second, the initial geometric features are context-aware through a large-size convolutional kernel, and a spatial weight map is generated through a sigmoid activation function. The spatial weight map represents the confidence level that a pixel belongs to the true boundary; The initial geometric features are multiplied element-wise with the spatial weight map to obtain the edge enhancement features; The values in the spatial adaptive gating map represent the probability confidence level that the corresponding pixel belongs to the true anatomical boundary.
[0013] Preferably, the formula for calculating the spatial weight map is: ;
[0014] in, Represents a spatial weighted graph. This represents the Sigmoid activation function. This indicates a convolution operation with a kernel size of 7×7. This represents the initial geometric feature.
[0015] Preferably, the specific structure of the gated dynamic-static cooperative upsampling mechanism in S4 includes:
[0016] Structure Preserves Static Flow: Configured to perform bilinear interpolation upsampling on the input feature map and feature smoothing through depthwise separable convolution, aiming to preserve texture continuity of the image in flat regions;
[0017] Content-Aware Dynamic Flow: Configured to dynamically predict the sampling offset of each pixel based on the content of the input feature map using the DySample operator or a content-aware reassembly operator, and to reassemble the feature map pixels based on the offset, aiming to adapt to the irregular deformation of lesions and restore sharp semantic boundaries; Selective Fusion Gating: Configured to generate a pixel-level fusion weight map based on the input features, and to perform a weighted summation of the features output by the static flow and the features output by the dynamic flow based on the weight map, thereby dominating the static flow in smooth regions and the dynamic flow in complex texture regions.
[0018] Preferably, the dual-domain global injection mechanism in S4 includes a channel domain semantic injection step and a spatial domain structure injection step:
[0019] The channel domain semantic injection step includes: compressing local features using global average pooling, and using global context features as guidance to generate channel attention weight vectors through a cross-domain multilayer perceptron. The vectors are then used to recalibrate each channel of the local features in order to select feature channels related to the target lesion category.
[0020] The spatial domain structure injection step includes: upsampling global context features to the same spatial resolution as local features and concatenating the two; generating a spatial attention mask through a convolutional layer, and using the mask to filter local features in spatial location to suppress background region responses that are inconsistent with global semantics;
[0021] It also includes constructing an explicit global stream, which performs residual connections between the features after the above injection process and the original aligned global context features to ensure that deep semantic information is transmitted to the decoding end without loss.
[0022] Preferably, the processing steps of the feature refinement and edge fusion module include: determining whether the edge enhancement feature input exists; if it exists, concatenating the edge enhancement feature with the current decoded feature in the channel dimension and fusing them through a convolutional layer; enhancing the fused feature using a parameterless attention module; and processing the enhanced feature using a multi-scale convolutional block, wherein the multi-scale convolutional block contains multiple parallel convolutional kernels of different sizes.
[0023] Preferably, the method further includes constructing a hybrid loss function to train the network, wherein the hybrid loss function... Defined as: ,in and Let be the binary cross-entropy loss and cross-union ratio loss output at the i-th decoding stage, respectively. For the corresponding weight system; The binary cross-entropy loss is the difference between the edge prediction map and the ground truth edge value. These are the edge loss weighting coefficients.
[0024] Preferably, the ground truth edge values are obtained by real-time gradient calculation of the real medical image segmentation mask using the Sobel operator.
[0025] The system also includes a medical image segmentation system based on dual-domain feature injection and adaptive edge enhancement. The system comprises: an image acquisition module configured to acquire a medical image to be segmented; a multi-scale feature encoding module configured to extract multi-scale features from the medical image and generate global context features; an adaptive edge perception module configured to extract edge enhancement features using learnable convolutional sequences and a spatial adaptive gating mechanism; a collaborative decoding and fusion module configured to restore feature resolution using a gated dynamic-static collaborative upsampling module, fuse global and local features using a dual-domain global injection module, and fuse the edge enhancement features using a feature refinement and edge fusion module; and a segmentation output module configured to generate a final medical image segmentation mask.
[0026] Technical effects and advantages of this invention: This invention achieves differentiable adaptive edge extraction: The ALEM proposed in this application abandons traditional non-differentiable and noise-sensitive operators such as Canny. Through an end-to-end learning mechanism and spatial gating technology, it can accurately locate lesion boundaries in medical images filled with speckle noise. Experiments show that this design significantly reduces the Hausdorff distance (HD95) of the segmentation results, effectively solving the problem of boundary overflow or missing values.
[0027] This application addresses the balance between detail and semantics during upsampling: Through the GDSCU module, it innovatively combines the stability of static interpolation with the flexibility of dynamic sampling. This collaborative mechanism ensures that when restoring image resolution, the network avoids edge blurring as seen with traditional interpolation and severe checkerboard artifacts as seen with single dynamic sampling, significantly improving the sharpness of segmentation edges.
[0028] Breaking through the bottleneck of long-distance semantic transmission: The DDGI module designed in this application is not just a simple feature concatenation, but rather "injects" global contextual information into local features through two orthogonal dimensions: channel and space. This mechanism is like equipping shallow features with "global navigation," enabling them to suppress irrelevant background texture responses based on the overall semantics of the image (such as organ location), greatly improving the robustness of the model in complex backgrounds.
[0029] Improved reliability of clinical auxiliary diagnosis: Based on the above improvements, the method of this application has achieved better performance than the state-of-the-art methods on several challenging medical segmentation datasets, especially with excellent segmentation effect on small lesions with irregular shapes and blurred boundaries, which has high clinical application value. Attached Figure Description
[0030] Figure 1 This is a flowchart of the segmentation network training method of the present invention;
[0031] Figure 2 This is a schematic diagram of the segmentation network of the present invention;
[0032] Figure 3 This is a schematic diagram of the adaptive learning edge guidance module of the present invention;
[0033] Figure 4 This is a schematic diagram of the gated dynamic-static collaborative upsampling module of the present invention;
[0034] Figure 5 This is a schematic diagram of the dual-domain global injection module of the present invention;
[0035] Figure 6 This is a schematic diagram of the feature refinement and edge blending module of the present invention;
[0036] Figure 7 This is a system block diagram of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] This invention provides, for example Figures 1-6The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement shown herein includes the following steps: Step S1: Acquire the medical image data to be segmented and preprocess the image data; Step S2: Construct a multi-scale feature encoding channel, using a Pyramid Visual Transformer (PVT-v2) as the backbone network to extract hierarchical features from the input medical image, obtaining feature maps at four different resolution scales from shallow to deep; wherein, the shallow feature map retains high-resolution spatial details, and the deep feature map contains highly abstract semantic information; Step S3: At the end of the encoding channel, perform dilated spatial pyramid pooling (ASPP) on the highest-level deep feature map, capturing multi-scale context through dilated convolutions with different dilation rates, and generating a global context feature vector; Step S4: Construct an adaptive edge-aware channel, inputting the shallowest feature map from the encoding channel into an adaptive learning edge guidance module (ALEM). The ALEM module does not rely on preset gradient operators but models local geometric textures using learnable convolutional sequences and generates dynamic weight maps using a large receptive field spatial gating mechanism. It performs pixel-level weighted filtering on texture features, thereby explicitly extracting edge enhancement features that suppress background noise. Step S5: Construct a cascaded decoding channel, which includes multiple decoding stages. In each decoding stage, the decoding output features from the previous stage, the corresponding encoder features, and the global context features are fused. Step S6: During feature upsampling in the decoding stage, a gated dynamic-static collaborative upsampling mechanism (GDSCU) is employed. This mechanism includes parallel static and dynamic streams, respectively using bilinear interpolation to maintain structural stability and point sampling operators to recover semantic shape. The two streams of features are adaptively fused using learned gating weights to recover a high-resolution feature map. Step S7: During the feature fusion process in the decoding stage, a dual-domain global injection mechanism (DDGI) is adopted. This mechanism orthogonally injects the global context features into local features in both the channel dimension and the spatial dimension, and suppresses the feature response of the background region by calculating the correlation between global semantics and local features. Step S8: The feature map processed by the decoding channel is fused with the edge enhancement features output by the adaptive edge perception channel, and the final medical image segmentation mask is output through the segmentation head.
[0039] The specific processing steps of the Adaptive Learning Edge Guidance Module (ALEM) are as follows: First, shallow features are transformed using consecutive convolutional layers, normalization layers, and activation functions to extract initial geometric features containing rich texture information. Second, the initial geometric features are context-aware using a large-size convolutional kernel (preferably a 7×7 convolution), and a spatial adaptive gating map with values ranging from 0 to 1 is generated using a Sigmoid activation function. The values in the spatial adaptive gating map represent the probability confidence that the corresponding pixel belongs to the true anatomical boundary. Finally, the initial geometric features are multiplied element-wise with the spatial adaptive gating map, and the low-confidence regions in the gating map are used to suppress speckle noise, while retaining high-confidence continuous boundary features, and the final edge feature map is output.
[0040] The specific structure of the gated dynamic-static collaborative upsampling mechanism (GDSCU) includes: Structure-preserving static flow: configured to perform bilinear interpolation upsampling on the input feature map and smooth features through depthwise separable convolution, aiming to maintain the texture continuity of the image in flat regions; Content-aware dynamic flow: configured to dynamically predict the sampling offset of each pixel based on the content of the input feature map using the DySample operator or a similar content-aware reconstruction operator, and to reconstruct pixels in the feature map based on the offset, aiming to adapt to irregular deformations of lesions and restore sharp semantic boundaries; Selective fusion gating: configured to generate a pixel-level fusion weight map based on the input features, and to perform a weighted summation of the features output by the static flow and the features output by the dynamic flow based on this weight map, thereby dominating the static flow in smooth regions and the dynamic flow in complex texture regions.
[0041] The Dual-Domain Global Injection (DDGI) mechanism includes a channel-domain semantic injection step and a spatial-domain structure injection step. The channel-domain semantic injection step involves: compressing local features using global average pooling; using global context features as guidance; generating channel attention weight vectors through a cross-domain multilayer perceptron (MLP); and recalibrating each channel of the local features using these vectors to filter out feature channels related to the target lesion category. The spatial-domain structure injection step involves: upsampling global context features to the same spatial resolution as the local features and concatenating the two; generating a spatial attention mask through a convolutional layer; and using this mask to filter local features spatially to suppress background region responses inconsistent with global semantics. Furthermore, it includes constructing an explicit global stream, performing residual connections between the injected features and the original aligned global context features to ensure lossless transmission of deep semantic information to the decoding end.
[0042] In a second aspect of the system architecture, this application also provides a medical image segmentation system based on dual-domain feature injection and adaptive edge enhancement. This system includes: a data acquisition module for acquiring and preprocessing medical ultrasound or CT / MRI images to be segmented; a multi-scale encoding module integrating a PVT-v2 backbone network for extracting multi-level pyramid features from the image; an edge extraction module integrating an adaptive learning edge guidance unit for explicitly extracting the geometric boundary information of lesions based on shallow features and filtering background noise; a feature decoding module integrating a gated dynamic-static collaborative upsampling unit and a dual-domain global injection unit for progressively restoring feature resolution and fusing global semantics with local details; and a multi-task prediction module for simultaneously outputting edge prediction maps and semantic segmentation maps, and calculating a loss function based on a multi-scale deep supervision strategy to optimize network parameters.
[0043] Working principle: Example 1: Overall network architecture construction as follows Figure 2 As shown, this embodiment proposes a medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement. The network mainly consists of an encoder, a bottleneck layer, a decoder, and an adaptive edge-aware branch.
[0044] Specifically, the encoder uses a pre-trained PVT-v2-B2 network as its backbone. The input image size is... The encoder consists of four stages, each outputting feature maps at four different scales. , , , Their resolutions are respectively those of the original image. The number of channels are respectively , , , (For example: 64,128,320,512).
[0045] At the end of the encoder, the hollow spatial pyramid pooling (ASPP) module is used to process deep features. ASPP captures multi-scale contextual information and generates global contextual features by employing dilated convolutions with different dilation rates (e.g., 1, 3, 5). .
[0046] Example 2: Adaptive Learning Edge Guidance Module (ALEM) Figure 3 As shown, in order to solve the problems of blurred boundaries and speckle noise interference in medical images, this embodiment introduces an adaptive learning edge guidance module in Stage 1 of the encoder.
[0047] Unlike traditional Sobel or Canny operators, this module employs a learnable mechanism. The specific steps are as follows: First, using... Convolutional layers for shallow layers Processing is performed to extract features from the initial set. :
[0048] = ;
[0049] in represents the ReLU activation function, and BN represents batch normalization.
[0050] Next, to filter out false background edges, a spatially adaptive gating mechanism is introduced. This utilizes a large receptive field. Convolution kernel generates spatial weight map :
[0051] ;
[0052] in, This represents the Sigmoid activation function, with an output value of [0,1], which indicates the confidence level that the pixel belongs to the true boundary.
[0053] Finally, the weight map is multiplied element-wise with the initial features, and the final edge enhancement features are obtained through a thinning layer. :
[0054] ;
[0055] In addition, this module also uses a Convolution output edge probability prediction graph The binary cross-entropy loss (BCE Loss) is calculated using real edge labels for supervision.
[0056] Example 3: The decoder consists of three cascaded decoding stages, each of which mainly includes two core modules: Gated Dynamic-Static Cooperative Upsampling Module (GDSCU) and Dual-Domain Global Injection Module (DDGI).
[0057] Gated Dynamic-Static Cooperative Upsampling (GDSCU) module, such as Figure 4 As shown, to balance structure preservation and shape restoration, the GDSCU module comprises two parallel paths: A static flow employs bilinear interpolation and depthwise separable convolutions to maintain the stability of smooth regions. A dynamic flow uses a content-aware remodeling operator (DySample). The network dynamically predicts the sampling offset for each pixel based on the input features and resamples the features based on these offsets.
[0058] ;
[0059] Finally, through the learned gating weights For static features and dynamic features Perform weighted fusion.
[0060] ;
[0061] Dual-Domain Global Injection Module (DDGI) Figure 5 As shown, in order to bridge the semantic gap, the DDGI module incorporates global contextual features. Injected into local features Channel domain injection: Channel attention weights are generated through global average pooling and MLP. Recalibrate local features:
[0062] ;
[0063] Spatial domain injection: Global features are upsampled and concatenated with local features to generate a spatial gating mask. Filter background noise:
[0064] ;
[0065] Finally, an explicit global flow is introduced to add and fuse the processed features with the global features.
[0066] Feature Refinement and Edge Blending Module (FRB) Figure 6 As shown, to further optimize the feature representation in the decoding stage and effectively integrate the edge features extracted by the Adaptive Edge Awareness Module (ALEM) into the segmentation backbone, this embodiment configures a Feature Refinement Module (FRB) at the end of the first stage (Stage 1) and subsequent stages of the decoder. The dashed path represents optional edge feature injection, which achieves feature fusion through concatenation and convolution operations; SimAM and multi-scale convolution are used to further extract refined contextual features.
[0067] The specific structure and processing flow of this module are as follows: First, edge feature fusion is performed: This module has a conditional judgment mechanism. When edge enhancement features from ALEM are received... At this time, first compare the edge features with the currently decoded features. The stitching is performed along the channel dimension. Then, through a... A fusion layer consisting of convolutional layers, batch normalization (BN) layers, and activation functions reduces the dimensionality of the concatenated feature channels to the original input dimension, thereby explicitly embedding the geometric constraints of the edges into the semantic features. The formula is expressed as:
[0068] ;
[0069] Note: If there are no edge features input at the current level, skip this step and process the input features directly.
[0070] Next, attention enhancement and multi-scale extraction are performed: the fused features are sequentially passed through a parameterless attention module to enhance feature saliency, and then through multi-scale convolutional blocks utilizing convolutional kernels of different sizes. Parallel extraction of multi-receptor field features ultimately outputs refined segmentation features. This is used to generate the final prediction mask.
[0071] Example 4: Loss Function Design To achieve accurate segmentation and accelerate network convergence, this example designs a hybrid loss function architecture, including structural loss and edge-assisted loss, and employs a multi-scale deep supervision strategy.
[0072] For medical image segmentation tasks, a single loss function often struggles to balance pixel-level accuracy and global structure. This embodiment constructs a structural loss function. It is composed of a weighted sum of binary cross-entropy loss and cross-union ratio loss.
[0073] ;
[0074] in, Used to measure classification accuracy pixel by pixel, ensuring pixel-level classification precision; It is used to measure the degree of overlap between the predicted region and the real region, and is more sensitive to global structural information. During training, the weights of both are set to 1.0.
[0075] To enhance the network's ability to perceive lesion boundaries, the adaptive learning edge guidance module ALEM is used to output edge prediction maps. Simultaneously, the gradient of the ground truth mask is calculated in real time using the Sobel operator to generate edge ground truth. Marginal loss Defined as binary cross-entropy loss:
[0076] ;
[0077] The weight coefficient of the loss function is set to 0.5 to assist the backbone network in learning boundary features and prevent marginal tasks from overly dominating the training process. ;
[0078] This embodiment employs a multi-scale deep supervision strategy to analyze the prediction maps at four scales output by the decoder. Calculate the structural losses separately. Total loss function. Defined as:
[0079] ;
[0080] in, The weights are at different scales, [1.0, 0.8, 0.5, 0.5], which are designed to force the network to maintain high prediction accuracy even in deep features.
[0081] Example 5: Model Training and Experiment Setup The training process of this method is implemented based on the PyTorch deep learning framework and is carried out on a computing platform equipped with an NVIDIA GPU4090.
[0082] To prevent model overfitting and improve generalization ability, a variety of online data augmentation techniques were used during the training phase, including: (1) Geometric transformation: random horizontal flipping, random vertical flipping, random rotation (-45° to +45°), translation and scaling; (2) Pixel enhancement: random brightness and contrast adjustment, Gaussian noise injection; (3) Normalization and size adjustment: the input image was uniformly adjusted to 224 × 224 resolution and normalized.
[0083] Model parameter optimization uses the Adam optimizer, with an initial learning rate set to... The weight decay is set to To achieve better convergence, a cosine annealing strategy was used to dynamically adjust the learning rate, with the minimum learning rate set to 1% of the initial learning rate and the maximum number of training epochs set to 130.
[0084] Mixed precision training (AMP) was used during training to reduce memory usage and accelerate computation. The batch size was set to 16. Five-fold cross-validation was used to evaluate model performance, and the final result was the average of the five-fold test results. Evaluation metrics included Dice coefficient, intersection-over-union (IoU), and 95% Hausdorff distance (HD95).
[0085] Figure 7 This application provides a block diagram of a medical image segmentation system based on dual-domain feature injection and adaptive edge enhancement, according to one embodiment. The system includes the following modules: an image acquisition module 701, a multi-scale feature encoding module 702, an adaptive edge perception module 703, a collaborative decoding and fusion module 704, and a segmentation output module 705.
[0086] Image acquisition module 701 is used to acquire medical image data to be segmented. Optionally, the image acquisition module is further configured to preprocess the medical image, perform size unification processing on the input medical image to meet the network input size requirements, and perform normalization processing on the input image. The normalization processing adopts a channel-by-channel normalization method with fixed parameters, specifically including: first dividing the image pixel value by 255 to map it to the [0,1] interval, and then normalizing the three RGB channels according to the preset mean [0.485, 0.456, 0.406] and the preset standard deviation [0.229, 0.224, 0.225] respectively. The label mask is a single-channel mask image, processed using a fixed threshold binarization method, where the threshold is 0; pixels with pixel values greater than 0 are marked as target areas, and pixels with pixel values less than or equal to 0 are marked as background.
[0087] The multi-scale feature encoding module 702 is used to extract features from the medical image through the Pyramid Visual Transformer (PVT-v2) backbone network to generate feature maps at four different scales; the multi-scale feature encoding module is also configured with a Hollow Spatial Pyramid Pooling (ASPP) unit to capture global context features at the end of the encoding.
[0088] The adaptive edge perception module 703 is used to receive the shallow features output by the multi-scale feature encoding module, explicitly extract edge features using learnable convolutional sequences and spatial adaptive gating mechanisms, generate an edge prediction map to assist supervised training, and output edge enhancement features.
[0089] The collaborative decoding and fusion module 704 is used to decode, restore, and fuse features. This module specifically includes: a gated dynamic-static collaborative upsampling unit (GDSCU): used to restore feature resolution using a parallel streaming architecture; a dual-domain global injection unit (DDGI): used to inject the global context features from the channel domain and spatial domain into local features; and a feature refinement unit (FRB): used to receive the edge enhancement features output by the adaptive edge perception module 630, fuse them with the decoded features through channel concatenation and convolution fusion mechanisms, and further refine the feature representation through parameter-free attention and multi-scale convolution.
[0090] The segmentation output module 705 is used to generate the final medical image segmentation mask based on the feature map processed by the collaborative decoding and fusion module through the segmentation head.
[0091] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement, characterized in that: The specific steps are as follows: S1, acquire the medical image data to be segmented, and preprocess the image data to form the medical image to be processed; The preprocessing includes: uniformizing the size of the input medical image; performing data augmentation on the medical image; normalizing the image pixels; S2, constructing a multi-scale feature encoding channel, using the Pyramid Visual Transformer (PVT-v2) as the backbone network to extract hierarchical features from the input medical image, and at the end of the encoding channel, performing a dilated spatial pyramid pooling operation on the highest-level deep feature map to finally obtain multi-level deep feature maps and generate a global context feature vector; S3, input the feature map of the shallowest layer in the encoding channel into the adaptive learning edge guidance module, model the local geometric texture through a learnable convolution sequence, and generate a dynamic weight map using a spatial adaptive gating mechanism to perform pixel-level weighted filtering on the texture features, thereby explicitly extracting the edge enhancement features that suppress background noise. S4, construct a cascaded decoding channel, which includes multiple levels of decoding stages; each level of decoding stage includes two core modules: a gated dynamic-static collaborative upsampling module and a dual-domain global injection module. In each decoding stage, the decoding output features of the previous level, the corresponding encoder features, and the global context feature vector are fused to output the decoded feature map. S5, using the feature refinement and edge fusion module, the edge enhancement features are fused with the decoded feature map; based on the fused feature map, the final medical image segmentation mask is output through the segmentation head.
2. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 1, characterized in that: The specific processing procedure of the adaptive learning edge guidance module in S3 is as follows: First, the shallow features are transformed by continuous convolutional layers, normalization layers and activation functions to extract the initial geometric features containing rich texture information. Secondly, the initial geometric features are context-aware through a large-size convolutional kernel, and a spatial weight map is generated through a sigmoid activation function. The spatial weight map represents the confidence that a pixel belongs to the true boundary. The initial geometric features are then multiplied element-wise with the spatial weight map to obtain the edge enhancement features. The numerical values in the spatial adaptive gating graph represent the probability confidence level of a corresponding pixel belonging to the true anatomical boundary.
3. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 2, characterized in that: The formula for calculating the spatial weight map is: ; in, Represents a spatial weighted graph. This represents the Sigmoid activation function. This indicates a convolution operation with a kernel size of 7×7. This represents the initial geometric feature.
4. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 1, characterized in that: The specific structure of the gated dynamic-static cooperative upsampling mechanism in S4 includes: Structure Preserves Static Flow: Configured to perform bilinear interpolation upsampling on the input feature map and feature smoothing through depthwise separable convolution, aiming to preserve texture continuity of the image in flat regions; Content-Aware Dynamic Flow: Configured to dynamically predict the sampling offset of each pixel based on the content of the input feature map using the DySample operator or a content-aware reassembly operator, and to reassemble the feature map pixels based on the offset, aiming to adapt to the irregular deformation of lesions and restore sharp semantic boundaries; Selective Fusion Gating: Configured to generate a pixel-level fusion weight map based on the input features, and to perform a weighted summation of the features output by the static flow and the features output by the dynamic flow based on the weight map, thereby dominating the static flow in smooth regions and the dynamic flow in complex texture regions.
5. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 1, characterized in that: The dual-domain global injection mechanism in S4 includes a channel domain semantic injection step and a spatial domain structure injection step: The channel domain semantic injection step includes: compressing local features using global average pooling, and using global context features as guidance to generate channel attention weight vectors through a cross-domain multilayer perceptron. The vectors are then used to recalibrate each channel of the local features in order to select feature channels related to the target lesion category. The spatial domain structure injection step includes: upsampling global context features to the same spatial resolution as local features and concatenating the two; generating a spatial attention mask through a convolutional layer, and using the mask to filter local features in spatial location to suppress background region responses that are inconsistent with global semantics; It also includes constructing an explicit global stream, which performs residual connections between the features after the above injection process and the original aligned global context features to ensure that deep semantic information is transmitted to the decoding end without loss.
6. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 1, characterized in that: The processing steps of the feature refinement and edge fusion module include: determining whether the edge enhancement feature input exists; if it exists, concatenating the edge enhancement feature with the current decoded feature in the channel dimension and fusing them through a convolutional layer; enhancing the fused feature using a parameterless attention module; and processing the enhanced feature using a multi-scale convolutional block, wherein the multi-scale convolutional block contains multiple parallel convolutional kernels of different sizes.
7. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 1, characterized in that: It also includes constructing a hybrid loss function to train the network, wherein the hybrid loss function Defined as: ,in and Let be the binary cross-entropy loss and cross-union ratio loss output at the i-th decoding stage, respectively. For the corresponding weight system; The binary cross-entropy loss is the difference between the edge prediction map and the ground truth edge value. These are the edge loss weighting coefficients.
8. The medical image segmentation method based on dual-domain feature injection and adaptive edge enhancement according to claim 6, characterized in that: The ground truth edge values are obtained by real-time gradient calculation of the segmentation mask of the real medical image using the Sobel operator.