A medical image fuzzy boundary segmentation system and method based on COD frequency domain guidance
By combining the FEA-Net model with multiple innovative modules, the problem of low accuracy of existing medical image segmentation methods in fuzzy boundary processing is solved, and high-precision segmentation of medical image boundaries is achieved. It is suitable for medical images with complex backgrounds and fuzzy boundaries.
Patent Information
- Application Number
- CN202510203032.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-02-24
Smart Images

Figure CN120125599B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image analysis, and in particular to a medical image fuzzy boundary segmentation system and method based on COD frequency domain guidance. Background Art
[0002] In recent years, with the rapid development of deep learning and computer vision technologies, the field of medical image analysis has made significant progress. Accurate boundary segmentation in medical images is crucial for disease diagnosis, condition assessment, and the formulation of treatment plans. However, because pathological tissues in medical images often have complex morphologies, irregular boundaries, and characteristics that are highly similar to surrounding tissues, traditional image segmentation methods are difficult to achieve ideal results. This boundary ambiguity problem is common in various medical imaging modalities: in dermatoscopic image analysis, lesion areas usually exhibit highly variable appearances and a gradual transition from healthy tissue; in colonoscopy, complex tissue textures and subtle intensity changes at lesion boundaries pose challenges to accurate detection; in glomerular pathology images, the subtle contrast differences between lesion tissue and healthy tissue make boundary delineation extremely difficult.
[0003] Currently, deep learning models, particularly convolutional neural network (CNN)-based methods, still face numerous challenges in addressing these challenges. Traditional spatial feature extraction methods are limited in handling fuzzy boundaries, making it difficult to effectively capture subtle boundary variations in medical images, particularly in gradient regions at tissue interfaces. Existing boundary detection techniques rely heavily on manual parameter tuning, significantly reducing their clinical applicability. Recent research has attempted to address this issue through various innovative approaches. The Simple Generic Method, while introducing a boundary-aware loss function, remains limited to spatial optimization and lacks a dedicated boundary feature extraction architecture. AEC-Net integrates a spatial attention mechanism with edge constraints through a dual-branch architecture, but its simplified edge branch has limited performance when handling complex medical image boundaries. SharpContour improves performance through contour optimization and bottom-up feature fusion, but remains insufficient when handling highly fuzzy medical image boundaries. Meanwhile, COD has achieved significant results in hidden object recognition in natural scenes. For example, DGNet and ERRNet, by effectively integrating contextual and edge information, have demonstrated initial success in medical applications such as polyp segmentation and pneumonia image segmentation. However, due to a lack of consideration of the unique frequency domain characteristics of medical images, these methods, when directly applied to medical images with blurred boundaries, perform significantly worse than in natural scenes. Quantitative analysis shows that these techniques require optimization specific to the medical field to achieve ideal results.
[0004] Therefore, there is an urgent need for an effective new method to improve the segmentation accuracy of fuzzy boundaries in medical images and provide more reliable technical support for clinical practice. Summary of the Invention
[0005] In view of the problems of blurred boundaries and low segmentation accuracy in the medical image segmentation in the prior art, the present invention proposes a medical image segmentation system and method based on COD frequency domain guidance.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, a medical image fuzzy boundary segmentation method based on COD frequency domain guidance comprises:
[0008] Step 1: Data preprocessing: Standardize the input medical image I to obtain a standard image;
[0009] Step 2: Model initialization: Build the FEA-Net image data processing model, pre-train PVTv2, and use the pre-trained PVTv2 weights to initialize the FEA-Net model;
[0010] Step 3: Image processing: Input the image into the FEA-Net model, perform semantic edge enhancement on the input standard image, continue to preliminarily locate and extract the boundary features of the standard image, output the processed image data, and then perform frequency domain feature-guided enhancement on the processed image data to strengthen the boundary feature representation and improve the accuracy of boundary prediction. Then, perform adaptive edge feature processing on the enhanced image, adaptively optimize the features of the enhanced image output, highlight the key boundary information, and achieve fine-grained expression of boundary features. Finally, perform contextual attention aggregation on the image data features processed above, and perform adaptive fusion of the multi-scale features obtained above under attention guidance, and finally output accurate segmentation results.
[0011] Step 4: Loss function calculation: Calculate the cross entropy loss LCE for the segmentation task, the Dice loss LDice for measuring morphological similarity, and the boundary loss LEdge for enhancing boundary learning. Then, combine these three losses into a comprehensive loss function L = α·LCE + β·LDice + γ·LEdge through weighted coefficients α, β, and γ to optimize the segmentation accuracy and boundary accuracy of the segmentation results.
[0012] Step 5: Iterative Training: The FEA-Net model is iteratively trained. In each training iteration, forward propagation is first performed to calculate the multi-task loss, followed by backpropagation to update the model parameters. The optimal model parameters are selected through performance evaluation on the validation set. After training, the test image is input into the optimized model to generate a segmentation prediction map. This prediction map accurately displays the boundary contours of the target region. Finally, the model outputs the final segmentation result of the medical image, ensuring clear segmentation of the boundary area.
[0013] Step 6: Validation and Evaluation: Regularly evaluate the model performance on the validation set and calculate relevant indicators such as mean PixelAccuracy, mean Intersection over Union, mean Dice coefficient, and F1-score to measure the segmentation performance of the model. After each round of evaluation, the model parameters with the best performance will be saved based on the validation results.
[0014] Furthermore, the data preprocessing in step 1 includes:
[0015] The input medical image is normalized using mean μ = [0.485, 0.456, 0.406] and standard deviation σ = [0.229, 0.224, 0.225], and the calculation formula is:
[0016]
[0017] Among them, μ is the mean of the image and σ is the standard deviation;
[0018] Data augmentation operations are also performed, including random horizontal and vertical flipping with a probability of 0.5, dynamic image resizing, and random cropping to enhance the robustness and generalization ability of the model.
[0019] Furthermore, in step 2, PVTv2 pre-trained on ImageNet is used as the backbone network. Through its hierarchical Transformer structure and local self-attention mechanism, feature maps of multiple scales from f1 to f4 are extracted layer by layer from the input image. This network structure effectively captures the local detail features and global context information of the image, providing rich feature representation for subsequent boundary enhancement processing.
[0020] Furthermore, in step 3, semantic edge enhancement processing is performed on the input standard image, and the boundary features of the standard image are further preliminarily located and extracted. The output processed image data specifically includes:
[0021] First, the spatial-channel self-attention mechanism is used to construct the dependency relationship of feature maps in the spatial and channel dimensions. The key mathematical expression is:
[0022]
[0023] It contains 8 attention heads with a window size of 8×8; among them, spatial self-attention is used to highlight important spatial location information, and channel self-attention is used to enhance the interaction between information channels.
[0024] Q h ,K h ,V h denote the query matrix, key matrix, and value matrix of the h-th attention head, respectively. d denotes the feature dimension used for scaling the attention scores, key and value matrices. and represents the average value of the feature in the horizontal and vertical directions, SA(·) represents the spatial attention operation;
[0025] Then, dilated spatial pyramid pooling is used for processing, and softmax represents the normalization function used to convert the attention score into a probability distribution;
[0026] F(X)=∑ r∈{2,3,6} α r Conv r (X)+A(X)
[0027] Where r represents the dilation rate of the dilated convolution, and the dilation rate configuration of [2, 3, 6] is adopted to capture multi-scale context information through different receptive field sizes and enhance the multi-scale representation ability of features; α r Represents the weight coefficient under different expansion rates, Conv r (·) represents a convolution operation with a dilation rate of r; X represents the input feature map, and A(X) represents the output of the aforementioned spatial-channel self-attention operation:
[0028] Finally, the processing is completed through feature fusion and enhancement steps:
[0029] Y=φ(concat[F(feat4),Conv 1×1 (feat1)])
[0030] Among them, feat1 represents the low-level features after 1×1 convolution dimensionality reduction, and the important spatial positions are highlighted after spatial attention. Feat4 is the high-level features processed by spatial-channel self-attention and ASPP. F(·) represents the multi-scale feature processing function mentioned above. Conv 1x1(·) indicates that the 1×1 convolution operation realizes the effective combination of low-level features and high-level features. concat(·) represents feature concatenation in the channel dimension. Finally, by concatenating feat4 and feat1 in the channel dimension and undergoing nonlinear transformations including convolution, batch normalization, and ReLU activation, φ(·) further fuses and refines the features to improve the boundary enhancement effect.
[0031] Furthermore, in step 3, the processed image data is enhanced by frequency domain feature guidance to strengthen the boundary feature representation and improve the accuracy of boundary prediction, which specifically includes:
[0032] Frequency-domain feature-guided enhancement uses a token fusion mechanism for adaptive frequency-domain enhancement. The key steps include the following mathematical expressions:
[0033] First, the features are converted to the frequency domain through two-dimensional fast Fourier transform:
[0034]
[0035] X reshape =Reshape(X f ,[B,N b ,,S b , H, W])
[0036] in, represents the orthogonal normalized two-dimensional Fourier transform, B is the batch size, N b =8 is the number of blocks, S b is the block size, H and W are the height and width of the feature map respectively; Reshape represents the tensor reshaping operation;
[0037] Feature enhancement is achieved through frequency domain block diagonal matrix transformation:
[0038] X′ real =σ(W1·X real -W2·X imag +b1)
[0039] X′ imag =σ(W1·X imag +W2·X real +b2)
[0040] Among them, X real , X imag Represent the real and imaginary parts of the frequency domain features, W1 and W2 are learnable complex domain block diagonal weight matrices, b1 and b2 are bias terms, and σ represents the activation function;
[0041] Next, the soft threshold function is used to denoise and select frequency domain features:
[0042] X λ =S λ (X) = sign(X)max(|X|-λ, 0)
[0043] Among them, S λ represents the soft threshold function, sign(X) represents the sign function, and λ = 0.01 is the sparsity threshold parameter used to control the sparsity of frequency domain features;
[0044] Finally, the spatial domain features are restored through Hadamard product and inverse Fourier transform:
[0045]
[0046] in, represents the inverse Fourier transform, ⊙ represents the Hadamard product (element-wise product), b is the final bias term, X λ represents the feature after soft threshold processing, X f Represents the original frequency domain features, realizes adaptive enhancement of frequency domain features and reconstruction of spatial domain features.
[0047] Furthermore, in step 3, adaptive edge feature processing is performed on the enhanced image, and the features of the enhanced image output are adaptively optimized to highlight key boundary information and achieve fine-grained expression of boundary features, specifically including:
[0048] First, the input features and boundary prediction weights are fused:
[0049] X=C⊙A+C
[0050] Among them, C represents the input feature map, A represents the boundary prediction weight, ⊙ represents element-level multiplication, and the original feature information is retained through the residual connection + C;
[0051] Then, the adaptive channel attention mechanism AFGCA is used for feature enhancement, where the convolution kernel size is obtained by adaptive calculation:
[0052]
[0053] Among them, C represents the channel dimension, and the convolution kernel size k is adaptively determined by the number of channels;
[0054] Finally, dynamic feature weighting is achieved through the Mix module:
[0055] Y=α·F1+(1-α)·F2
[0056] α=σ(w),w=-0.80
[0057] Among them, F1 and F2 are the features to be fused, α is the mixing factor calculated by the Sigmoid function σ, and the initial weight w is set to -0.80. This module achieves adaptive feature enhancement through residual connections and dynamic feature weighting.
[0058] Furthermore, in step 3, context attention aggregation is performed on the image data features processed above, and adaptive fusion of the multi-scale features obtained above is performed under attention guidance, including:
[0059] First, unify and concatenate low-level features and high-level features:
[0060]
[0061] Among them, L f and H f Represent low-level and high-level features respectively, Indicates that the bilinear interpolation operation adjusts the high-level features to the same size as the low-level features, concat indicates feature concatenation in the channel dimension, Conv 1×1 Represents the convolution operation;
[0062] Then perform multi-level feature fusion:
[0063]
[0064] in, is the attention weight, ⊙ represents element-by-element multiplication, φ is the nonlinear transformation, X i is the feature block;
[0065] Finally, global feature fusion is achieved:
[0066] Y=Conv(concat[Y2, Y3, X4])
[0067] Among them, Y2 and Y3 represent the results of two-feature and three-feature fusion respectively, and X4 is the fourth feature block.
[0068] In the second aspect, a system adopts a medical image fuzzy boundary segmentation method based on COD frequency domain guidance, including a semantic edge enhancement module, a frequency domain feature guidance enhancement module, an adaptive edge feature module and a contextual attention aggregation module;
[0069] The semantic edge enhancement module receives features extracted from the backbone network, performs preliminary boundary positioning and extraction, and strengthens boundary information;
[0070] The frequency domain feature guided enhancement module receives features from the backbone network and performs frequency domain processing to further improve the accuracy of boundary features;
[0071] The adaptive edge feature module receives the processed features from the semantic edge enhancement module and the frequency domain feature guided enhancement module, performs adaptive optimization, refines the boundary information, and highlights the key boundary features;
[0072] The contextual attention aggregation module receives multi-scale features from the adaptive edge feature module, performs adaptive fusion, and combines it with its own feature transfer to finally output accurate segmentation results to ensure clear and accurate boundaries.
[0073] The beneficial effects of the technical solution of the present invention are as follows:
[0074] To address the problem of accurate segmentation of medical images with blurred boundaries, this paper proposes a segmentation network based on COD frequency domain guidance. This innovatively combines frequency domain feature processing with an improved camouflaged object detection (COD) algorithm. Through modular design, the accuracy of segmentation is effectively improved, especially when dealing with complex backgrounds and blurred boundaries.
[0075] The Semantic Edge Enhancement Module (SEEM) proposed in this paper combines the spatial-channel self-attention mechanism and ASPP to significantly enhance the perception of boundaries. This multi-attention mechanism design enables the model to locate boundaries more accurately, overcoming the shortcomings of traditional methods in dealing with fuzzy boundaries.
[0076] The frequency-domain feature-guided enhancement module (FTEM) proposed in this paper achieves effective extraction of boundary information through frequency-domain processing and adaptive feature selection, improving the expressiveness of features while maintaining boundary integrity.
[0077] This invention innovatively strengthens and combines the SEEM and FTEM modules to form a progressive boundary optimization mechanism. SEEM first achieves preliminary boundary location through spatial domain processing, and FTEM then further refines these boundary features in the frequency domain. This complementary spatial-frequency domain design significantly improves the model's ability to describe complex medical image boundaries.
[0078] The Adaptive Edge Feature Module (AEFM) and Contextual Attention Aggregation Module (CAAM) proposed in this paper achieve effective fusion of multi-scale features and improve the model's adaptability to objects of different sizes.
[0079] The overall network architecture of this invention, through the synergistic effect of multiple innovative modules, effectively addresses issues such as loss of detail and blurred boundaries while maintaining high-precision segmentation, providing reliable technical support for medical image analysis. This invention not only improves segmentation accuracy but also enhances the model's interpretability and scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1Schematic diagram of the structure of the medical image fuzzy boundary segmentation system and method based on COD frequency domain guidance of the present invention;
[0081] Figure 2 Schematic diagram of the structure of the semantic edge enhancement module (SEEM) of the present invention;
[0082] Figure 3 Schematic diagram of the structure of the frequency domain feature guided enhancement module (FTEM) of the present invention;
[0083] Figure 4 Schematic diagram of the structure of the adaptive edge feature module (AEFM) of the present invention;
[0084] Figure 5 Schematic diagram of the results of the contextual attention aggregation module (CAAM) of the present invention;
[0085] Figure 6 This is a comparison chart of the boundary prediction effects of SEEM, FTEM and other methods of the present invention;
[0086] Figure 7 This is a comparison chart of the qualitative segmentation effects of FEA-Net of the present invention and other methods. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solution and effect of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and through specific examples. It should be emphasized that the examples described here are only used to help understand the present invention and are not intended to limit the scope of the present invention.
[0088] This paper uses an improved PVTv2 as the backbone network, enhancing feature extraction and global perception through its hierarchical design. It also innovatively combines a frequency-domain attention guidance mechanism with an improved Camouflaged Object Detection (COD) algorithm to achieve precise localization and segmentation of fuzzy boundaries, thus proposing an innovative medical image segmentation framework. This innovative application not only improves the accuracy of medical image segmentation but also opens up new research directions in the field of medical image analysis.
[0089] The core of this invention is a novel medical image segmentation framework, FEA-Net, which achieves progressive boundary optimization through four collaborative modules. Specifically, they include: the Semantic Edge Enhancement Module (SEEM), which uses a spatial-channel self-attention mechanism to generate initial edge features. This module enhances the perception of target-related edge features by effectively integrating low-level detail information and high-level semantic information; the Frequency Domain Feature Guided Enhancement Module (FTEM), which decomposes features into the frequency domain for processing, and enhances boundary-related high-frequency signals through block diagonal transformation and adaptive frequency selection operations while suppressing noise interference; the Adaptive Edge Feature Module (AEFM), which implements a fine-grained channel attention mechanism and adaptively adjusts feature responses based on boundary features; and the Contextual Attention Aggregation Module (CAAM), which uses an attention mechanism to achieve intelligent fusion of multi-scale features, effectively integrating global information while preserving boundary details.
[0090] By combining these modules, the present invention establishes a progressive feature optimization framework, from the spatial domain to the frequency domain and from the local to the global domain. This framework significantly improves the segmentation accuracy of fuzzy boundary regions in medical images. This method is particularly suitable for complex medical image segmentation tasks involving low contrast and unclear boundaries, providing more reliable technical support for clinical diagnosis.
[0091] A medical image fuzzy boundary segmentation method based on COD frequency domain guidance is as follows:
[0092] Data preprocessing:
[0093] The input medical images are normalized using mean μ = [0.485, 0.456, 0.406] and standard deviation σ = [0.229, 0.224, 0.225], calculated as I_norm = (I-μ) / σ. At the same time, data augmentation operations are performed, including random horizontal and vertical flipping with a probability of 0.5, dynamic image resizing, and random cropping, to enhance the robustness and generalization ability of the model.
[0094] Feature extraction:
[0095] The PVTv2 pre-trained on ImageNet is used as the backbone network. Through its hierarchical Transformer structure and local self-attention mechanism, feature maps of multiple scales from f1 to f4 are extracted layer by layer from the input image. This network structure can effectively capture the local detail features and global context information of the image at the same time, providing rich feature representation for subsequent boundary enhancement processing.
[0096] Semantic edge enhancement module processes:
[0097] First, 1×1 convolution is used to reduce the channel dimension of the f1 feature from the shallow layer to obtain a more compact feature representation. Then, the SCSA_RB block with 8 attention heads and a window size of 8×8 is used to process the deep f4 feature to explore long-range feature relationships. Then, the ASPP module with a dilation rate of [2, 3, 6] is used to capture multi-scale context information. The feature map size is matched through upsampling. Finally, the ConvBNR block is used to achieve fine fusion of multi-scale features and enhance the expression of boundary semantic information. Specifically:
[0098] First, the spatial-channel self-attention mechanism is used to construct the dependency relationship of feature maps in the spatial and channel dimensions. The key mathematical expression is:
[0099]
[0100] It contains 8 attention heads with a window size of 8×8; among them, spatial self-attention is used to highlight important spatial location information, and channel self-attention is used to enhance the interaction between information channels.
[0101] Q h ,K h ,V h denote the query matrix, key matrix, and value matrix of the h-th attention head, respectively. d denotes the feature dimension used for scaling the attention scores, key and value matrices. and represents the average value of the feature in the horizontal and vertical directions, SA(·) represents the spatial attention operation;
[0102] Then, dilated spatial pyramid pooling is used for processing, and softmax represents the normalization function used to convert the attention score into a probability distribution;
[0103] F(X)=∑ r∈{2,3,6} α r Conv r (X)+A(X)
[0104] Where r represents the dilation rate of the dilated convolution, and the dilation rate configuration of [2, 3, 6] is adopted to capture multi-scale context information through different receptive field sizes and enhance the multi-scale representation ability of features; α r Represents the weight coefficient under different expansion rates, Conv r (·) represents a convolution operation with a dilation rate of r; X represents the input feature map, and A(X) represents the output of the aforementioned spatial-channel self-attention operation:
[0105] Finally, the processing is completed through feature fusion and enhancement steps:
[0106] Y=φ(concat[F(feat4),Conv 1×1(feat1)])
[0107] Among them, feat1 represents the low-level features after 1×1 convolution dimensionality reduction, and the important spatial positions are highlighted after spatial attention. Feat4 is the high-level features processed by spatial-channel self-attention and ASPP. F(·) represents the multi-scale feature processing function mentioned above. Conv 1x1 (·) indicates that the 1×1 convolution operation realizes the effective combination of low-level features and high-level features. concat(·) represents feature concatenation in the channel dimension. Finally, by concatenating feat4 and feat1 in the channel dimension and undergoing nonlinear transformations including convolution, batch normalization, and ReLU activation, φ(·) further fuses and refines the features to improve the boundary enhancement effect.
[0108] Frequency domain feature guided enhancement module processing:
[0109] First, the f1 and f4 features of the backbone extraction network are reduced in dimension by 1×1 convolution, and then the features are mapped to the frequency domain space using a two-dimensional Fourier transform; in the frequency domain, N b = 8 blocks of complex domain diagonal matrix transform are used for feature processing, and adaptive frequency selection operation with soft threshold λ = 0.01 is performed to enhance high-frequency signals related to boundaries while suppressing noise. Finally, the enhanced features are restored to the spatial domain through Hadamard product and inverse Fourier transform, and the original boundary detail information is retained through residual connection. Specifically, the following steps are performed:
[0110] Frequency-domain feature-guided enhancement uses a token fusion mechanism for adaptive frequency-domain enhancement. The key steps include the following mathematical expressions:
[0111] First, the features are converted to the frequency domain through two-dimensional fast Fourier transform:
[0112]
[0113] X reshape =Reshape(X f ,[B,N b ,S b , H, W])
[0114] in, represents the orthogonal normalized two-dimensional Fourier transform, B is the batch size, N b =8 is the number of blocks, S b is the block size, H and W are the height and width of the feature map respectively; Reshape represents the tensor reshaping operation;
[0115] Feature enhancement is achieved through frequency domain block diagonal matrix transformation:
[0116] X′real =σ(W1·X real -W2·X imag +b1)
[0117] X′ imag =σ(W1·X imag +W2·X real +b2)
[0118] Among them, X real , X imag Represent the real and imaginary parts of the frequency domain features, W1 and W2 are learnable complex domain block diagonal weight matrices, b1 and b2 are bias terms, and σ represents the activation function;
[0119] Next, the soft threshold function is used to denoise and select frequency domain features:
[0120] X λ =S λ (X) = sign(X)mx(|X| - λ, 0)
[0121] Among them, S λ represents the soft threshold function, sign(X) represents the sign function, and λ = 0.01 is the sparsity threshold parameter used to control the sparsity of frequency domain features;
[0122] Finally, the spatial domain features are restored through Hadamard product and inverse Fourier transform:
[0123]
[0124] in, represents the inverse Fourier transform, ⊙ represents the Hadamard product (element-wise product), b is the final bias term, X λ represents the feature after soft threshold processing, X f Represents the original frequency domain features, realizes adaptive enhancement of frequency domain features and reconstruction of spatial domain features.
[0125] Adaptive edge feature module processing:
[0126] The input features and boundary prediction weights are fused element-wise by multiplication and skip connections are added to preserve the original information. An adaptive channel attention mechanism is then used to dynamically calculate the convolution kernel size (t = |(log2C+1) / 2|) based on the channel dimension C. A channel mixing function with an initial weight of -0.80 is used for feature modulation. Finally, a 3×3 convolution is used to capture local spatial patterns and residual connections are used for feature integration to achieve fine-grained enhancement of boundary features. Specifically,
[0127] First, the input features and boundary prediction weights are fused:
[0128] X=C⊙A+C
[0129] Among them, C represents the input feature map, A represents the boundary prediction weight, ⊙ represents element-level multiplication, and the original feature information is retained through the residual connection + C;
[0130] Then, the adaptive channel attention mechanism AFGCA is used for feature enhancement, where the convolution kernel size is obtained by adaptive calculation:
[0131]
[0132] Among them, C represents the channel dimension, and the convolution kernel size k is adaptively determined by the number of channels;
[0133] Finally, dynamic feature weighting is achieved through the Mix module:
[0134] Y=α·F1+(1-α)·F2
[0135] α=σ(w),w=-0.80
[0136] Among them, F1 and F2 are the features to be fused, α is the mixing factor calculated by the Sigmoid function σ, and the initial weight w is set to -0.80°. This module realizes adaptive enhancement of features through residual connection and dynamic feature weighting.
[0137] The contextual attention aggregation module processes:
[0138] First, the dimensions of N groups of input features are unified through 1×1 convolution, and the feature combination is calculated to obtain a global view; then the attention weight is calculated through 1×1 convolution and Softmax function.
[0139] W=softmax(Conv 1×1 (F)) performs a weighted feature fusion operation xi' = xi·Wi + xi based on the weights; finally, a 3×3 convolution operation with different expansion rates is used to process the weighted features to effectively capture multi-scale context information, including:
[0140] First, unify and concatenate low-level features and high-level features:
[0141]
[0142] Among them, L f and H f Represent low-level and high-level features respectively, Indicates that the bilinear interpolation operation adjusts the high-level features to the same size as the low-level features, concat indicates feature concatenation in the channel dimension, Conv 1×1 Represents the convolution operation;
[0143] Then perform multi-level feature fusion:
[0144]
[0145] in, is the attention weight, ⊙ represents element-by-element multiplication, φ is the nonlinear transformation, X i is the feature block;
[0146] Finally, global feature fusion is achieved:
[0147] Y=Conv(concat[Y2, Y3, X4])
[0148] Among them, Y2 and Y3 represent the results of two-feature and three-feature fusion respectively, and X4 is the fourth feature block.
[0149] Loss function calculation:
[0150] The cross entropy loss LCE for the segmentation task, the Dice loss LDice for measuring morphological similarity, and the boundary loss LEdge for enhancing boundary learning are calculated separately. Then, these three losses are combined into a comprehensive loss function L = α·LCE+β·LDice+γ·LEdge through weighted coefficients α, β, and γ to achieve the joint optimization of segmentation accuracy and boundary accuracy, specifically including:
[0151] A weighted combination of cross entropy loss, Dice loss, and boundary loss is used to optimize the segmentation task, ensuring that the model can achieve good segmentation results in the case of class imbalance and complex boundaries. The loss function is defined as:
[0152] L=α*LCE+β*LDice+γ*LEdge
[0153] Where LCE is the cross entropy loss, LDice is the Dice loss, LEdge is the boundary loss, and α, β, and γ are balance factors. This combination can simultaneously take into account the accuracy of global classification, the accuracy of local area matching, and the accuracy of boundary positioning.
[0154] Among them, the Adam optimizer is used. The Adam optimizer has good robustness and fast convergence when dealing with complex optimization problems. The initial learning rate lr = 1e-4;
[0155] Model training:
[0156] The training batch size was set to 16, and the Adam optimizer was used for parameter optimization. The initial learning rate was set to 1e-4, and dynamic adjustment was performed using a poly strategy with a power of 0.9. Training was performed on an NVIDIA 4090D GPU for 50 epochs until the model converged. The entire training process took approximately 2-6 hours, and the optimal model was selected based on performance evaluation on the validation set.
[0157] Then, the learning rate is scheduled and a polynomial decay strategy is used to dynamically adjust the learning rate. The learning rate is gradually reduced as the training progresses to prevent overfitting or oscillation in the later stages of training. The learning rate update formula is:
[0158]
[0159] Where t is the current iteration number, T is the total number of iterations, lr0 is the initial learning rate, and power is a hyperparameter that controls the decay rate, set to 0.9. This scheduling strategy ensures more stable fine-tuning of the model in the later stages of training.
[0160] Output:
[0161] The test image is input into the trained model to generate a segmentation prediction map that clearly shows the boundary contours of the target area; finally, the final segmentation result of the medical image is output.
[0162] Figure 1 This is a schematic diagram of the structure of the medical image boundary segmentation system based on frequency-domain edge attention. As shown in the figure, the system includes a feature extraction module, a semantic edge enhancement module (SEEM), a frequency-domain feature-guided enhancement module (FTEM), an adaptive edge feature module (AEFM), and a contextual attention aggregation module (CAAM). These modules work together to form an end-to-end segmentation network architecture for high-precision medical image segmentation.
[0163] refer to Figure 1 and Figure 2 The Semantic Edge Enhancement Module (SEEM) is innovative in that it combines the spatial channel self-attention mechanism with Atrous Spatial Pyramid Pooling (ASPP) to enhance the perception of boundary features. The SA mechanism highlights important spatial locations in the feature map, while the CA mechanism weights channels to further optimize the representation of boundary-related features. Furthermore, the ASPP module expands the receptive field through multi-scale convolution, effectively addressing objects of varying sizes and shapes. This module extracts initial boundary features through the fusion and refinement of multi-scale features.
[0164] refer to Figure 1 and Figure 3The innovation of the Frequency Domain Feature Guided Enhancement Module (FTEM) lies in enhancing boundary features through frequency domain processing. This module transforms features into the frequency domain for processing, achieving feature enhancement through complex domain block diagonal matrix transformation and adaptive frequency selection. Finally, the spatial features are restored through inverse transformation, effectively enhancing the feature expression of the blurred boundary region. Compared to the boundary processing of the SEEM module in the spatial domain, FTEM can more accurately capture subtle boundary changes through the synergy of frequency domain transformation and multi-scale attention.
[0165] refer to Figure 2 and Figure 3 The comparison of SEEM and FTEM in boundary extraction is shown. SEEM captures the spatial-channel relationship by introducing the SCSA attention mechanism, showing better target contour delineation capabilities. To further enhance boundary feature learning, FTEM extends this capability through Fourier preprocessing and adaptive frequency selection mechanisms, especially showing more accurate boundary delineation when dealing with fuzzy boundaries. This progressive enhancement from SEEM to FTEM fully demonstrates the effectiveness of our boundary optimization strategy in dealing with complex medical image boundaries. For example, in the ISIC dataset, the initial boundaries captured by SEEM are broken ( Figure 6 ), while after FTEM is enhanced in the frequency domain, the boundary continuity is significantly improved ( Figure 6 This progressive optimization mechanism achieves accurate characterization of complex boundaries through the complementarity of spatial domain positioning and frequency domain enhancement.
[0166] refer to Figure 1 、 Figure 4 and Figure 5 The Adaptive Edge Feature Module (AEFM) and Contextual Attention Aggregation Module (CAAM) achieve dynamic fusion of multi-scale features. AEFM enhances boundary feature representation through an adaptive channel attention mechanism, while CAAM captures multi-scale contextual information through convolution operations with different dilation rates and achieves dynamic weighted fusion of features. This design significantly enhances the model's ability to understand complex structures.
[0167] To validate the performance of our system, we conducted comprehensive experimental evaluations on three medical image datasets: ISIC2018, Kvasir-SEG, and KPIs2024. These datasets cover a variety of medical imaging modalities, from histopathology to dermatology and endoscopy, each posing different challenges for boundary delineation.
[0168] We compared our method with a variety of cutting-edge methods, including traditional segmentation methods such as DeepLabV3+ and U-Net3+, as well as disguised target detection methods such as SINetV2, PFNet, and BGNet. The experimental results are shown in Table 1. Our method achieved the best results in all indicators, showing significant performance advantages. Specifically, our method achieved continuous improvement over the most advanced models. Compared with the second-best performing model on each indicator and dataset, FEA-NET's mPA increased by an average of 0.60%, mIoU increased by an average of 1.33%, and mDice increased by an average of 0.84%. It is worth noting that FEA-NET achieved a larger improvement than the third-ranked model (for example, the improvement in mIoU was +1.63%).
[0169] Table 1 Quantitative comparison evaluation of method performance
[0170]
[0171] In terms of boundary exploration, Figure 6 A visual comparison of EAM (from baseline), SEEM and FTEM in boundary refinement is shown. From the visualization results, EAM utilizes the multi-scale features (f2 and f5) of the backbone network for edge detection, but has difficulty in capturing complex boundary patterns, resulting in suboptimal boundary localization in medical image segmentation. Based on EAM, SEEM introduces SCSA attention to capture spatial channel relationships, thereby enhancing boundary detection capabilities and showing higher performance in object contour segmentation. To further enhance boundary feature learning, our FTEM extends boundary feature learning with Fourier preprocessing through adaptive frequency selection and label mixing mechanism, thereby achieving more accurate boundary segmentation, especially for fuzzy edges. The gradual enhancement from EAM to SEEM and FTEM demonstrates the effectiveness of our boundary refinement strategy in dealing with challenging medical image boundaries, which is also evidenced by the increasingly accurate and detailed segmentation results.
[0172] In terms of qualitative analysis, Figure 7 A qualitative comparison of different methods on several representative samples is shown. As intuitively demonstrated, our method provides more accurate predictions, with finer details and more complete structural preservation. Specifically, compared to other methods such as DeepLabV3+, UNet3+, and Segformer, our method maintains more precise boundary delineation for complex medical imaging cases with diverse tissue morphologies. These results intuitively demonstrate that our method is better able to handle challenging cases where traditional methods often fail, such as those with unclear boundaries or complex anatomical structures.
[0173] To further validate the effectiveness of the proposed model, we also conduct comprehensive ablation experiments. These experiments aim to evaluate the effects of our proposed individual modules and how they work together to improve the overall performance.
[0174] The ablation experiment results are shown in Table 2. The integration of FTEM+AEFM+CAAM brings significant improvements on all three datasets. Most notably, on the challenging KPIs2024 dataset, the model's mIoU and F1-score are significantly improved by 3.4% and 3.8%, respectively, which demonstrates FTEM's superior ability to capture subtle boundary features through frequency domain processing. This improvement is particularly important given the complex histopathological characteristics of the dataset. The continued performance improvement on ISIC2018 (+2.2% mIoU, +0.9% F1-score) and Kvasir-SEG (+1.0% mIoU, +0.8% F1-score) further verifies the effectiveness of FTEM in processing various medical imaging modalities with different boundary features;
[0175] Table 2 Ablation experiment results
[0176]
[0177] The synergistic combination of SEEM, AEFM, and CAAM achieves robust improvements across all evaluation metrics. On the KPIs2024 dataset, this configuration achieves significant gains (+2.4% mIoU, +2.6% F1-score), while maintaining consistent improvements on ISIC2018 (+1.8% mIoU, +0.6% F1-score) and Kvasir-SEG (+0.7% mIoU, +0.6% F1-score). These results demonstrate the effectiveness of our enhanced semantic edge learning and adaptive feature fusion mechanism in capturing multi-scale contextual information.
[0178] FTEM+SEEM+AEFM+CAAM achieves the best performance across all metrics, with an average improvement of 0.93% in mPA, 2.67% in mIoU, 2.20% in mDice, and 2.47% in F1-score. The synergistic effect is particularly evident in challenging cases, with the highest gain on KPIs2024 (+3.8% mIoU), followed by consistent gains on ISIC2018 (+2.7% mIoU) and Kvasir-SEG (+1.5% mIoU).
[0179] A deeper analysis of module interactions reveals that FTEM's frequency-domain processing provides complementary information to SEEM's spatial-domain features. When examining performance on complex cases in KPIs2024, we observed that regions with subtle intensity variations exhibited particularly significant improvements (+3.8% improvement in boundary accuracy) compared to regions with clearer boundaries (+2.1%). This demonstrates that frequency-domain processing effectively captures features that are less obvious in spatial-domain analysis; these overall improvements demonstrate the strong complementarity of our proposed module in tackling challenging medical image segmentation tasks, especially in situations with unclear tissue boundaries and complex anatomical structures.
[0180] In summary, the proposed system and method for medical image fuzzy boundary segmentation based on COD frequency domain guidance effectively addresses the challenges faced by existing methods in processing fuzzy boundaries in medical images by innovatively combining frequency domain processing with an improved camouflaged target detection algorithm. This system not only significantly improves the segmentation accuracy and boundary localization precision of fuzzy boundary regions in medical images, but also provides new technical ideas and methods for other medical image analysis tasks, opening up a new research direction for combining frequency domain enhancement with camouflaged target detection algorithms in medical image analysis.
[0181] It should be understood that those skilled in the art, inspired by the technical concept of the present invention, can make various improvements or changes based on the above description without departing from the content of the present invention, but this still falls within the scope of protection of the present invention.
Claims
1. A medical image fuzzy boundary segmentation method based on COD frequency domain guidance, characterized in that: include: Step 1: Data preprocessing: Standardize the input medical image I to obtain a standard image; Step 2: Model initialization: Build the FEA-Net image data processing model, pre-train PVTv2, and use the pre-trained PVTv2 weights to initialize the FEA-Net model; Step 3: Image processing: Input the image into the FEA-Net model, perform semantic edge enhancement on the input standard image, continue to preliminarily locate and extract the boundary features of the standard image, output the processed image data, and then perform frequency domain feature-guided enhancement on the processed image data to strengthen the boundary feature representation and improve the accuracy of boundary prediction. Then, perform adaptive edge feature processing on the enhanced image, adaptively optimize the features of the enhanced image output, highlight key boundary information, and achieve fine-grained expression of boundary features. Finally, perform contextual attention aggregation on the image data features processed above, and perform adaptive fusion of the obtained multi-scale features under attention guidance to finally output accurate segmentation results. Step 4: Loss function calculation: Calculate the cross entropy loss LCE for the segmentation task, the Dice loss LDice for measuring morphological similarity, and the boundary loss LEdge for enhancing boundary learning. Then, combine these three losses into a comprehensive loss function L = α·LCE + β·LDice + γ·LEdge through weighted coefficients α, β, and γ to optimize the segmentation accuracy and boundary accuracy of the segmentation results. Step 5: Iterative training: The FEA-Net model is iteratively trained. In each training iteration, forward propagation is performed to calculate the multi-task loss. Then, the model parameters are updated through backpropagation. The optimal model parameters are selected through performance evaluation on the validation set. The test image is then input into the trained model to generate a segmentation prediction map that clearly shows the boundary contours of the target area. Finally, the final segmentation result of the medical image is output. Step 6: Validation and Evaluation: Regularly evaluate the model performance on the validation set and calculate relevant indicators such as mean pixel accuracy, mean intersection over union, mean Dice coefficient, and F1-score to measure the segmentation performance of the model. After each round of evaluation, the best performing model parameters will be saved based on the validation results. In step 3, the processed image data is enhanced by frequency domain feature guidance to strengthen the boundary feature representation and improve the accuracy of boundary prediction, which specifically includes: Frequency-domain feature-guided enhancement uses a token fusion mechanism for adaptive frequency-domain enhancement. The key steps include the following mathematical expressions: First, the features are converted to the frequency domain through two-dimensional fast Fourier transform: X reshape =Reshape(X f ,[B,N b ,S b ,H,W]) in, represents the orthogonal normalized two-dimensional Fourier transform, B is the batch size, N b =8 is the number of blocks, S b is the block size, H and W are the height and width of the feature map respectively; Reshape represents the tensor reshaping operation; Feature enhancement is achieved through frequency domain block diagonal matrix transformation: X′ real =σ(W1·X real -W2·X imag +b1) X′ imag =σ(W1·X imag +W2·X real +b2) Among them, X real 、X imag Represent the real and imaginary parts of the frequency domain features, W1 and W2 are learnable complex domain block diagonal weight matrices, b1 and b2 are bias terms, and σ represents the activation function; Next, the soft threshold function is used to denoise and select frequency domain features: X λ =S λ (X)=sign(X)max(|X|-λ,0) Among them, S λ represents the soft threshold function, sign(X) represents the sign function, and λ = 0.01 is the sparsity threshold parameter used to control the sparsity of frequency domain features; Finally, the spatial domain features are restored through Hadamard product and inverse Fourier transform: in, represents the inverse Fourier transform, ⊙ represents the Hadamard product, b is the final bias term, X λ represents the feature after soft threshold processing, X f Represents the original frequency domain features, realizes adaptive enhancement of frequency domain features and reconstruction of spatial domain features.
2. The medical image fuzzy boundary segmentation method based on COD frequency domain guidance according to claim 1 is characterized in that: The data preprocessing in step 1 includes: The input medical image is normalized using mean μ = [0.485, 0.456, 0.406] and standard deviation σ = [0.229, 0.224, 0.225], and the calculation formula is: Among them, μ is the mean of the image and σ is the standard deviation; Data augmentation operations are also performed, including random horizontal and vertical flipping with a probability of 0.5, dynamic image resizing, and random cropping, to enhance the robustness and generalization ability of the model.
3. The medical image fuzzy boundary segmentation method based on COD frequency domain guidance according to claim 1 is characterized in that: In step 2, PVTv2 pre-trained on ImageNet is used as the backbone network. Through its hierarchical Transformer structure and local self-attention mechanism, feature maps of multiple scales from f1 to f4 are extracted layer by layer from the input image. The structure of this network effectively captures the local detail features and global context information of the image, providing rich feature representation for subsequent boundary enhancement processing.
4. The medical image fuzzy boundary segmentation method based on COD frequency domain guidance according to claim 1 is characterized in that: In step 3, semantic edge enhancement processing is performed on the input standard image, and the boundary features of the standard image are further preliminarily located and extracted. The output processed image data specifically includes: First, the spatial-channel self-attention mechanism is used to construct the dependency relationship of feature maps in the spatial and channel dimensions. The key mathematical expression is: It contains 8 attention heads with a window size of 8×8, where spatial self-attention is used to highlight important spatial location information, channel self-attention is used to enhance the interaction between information channels, and Q h , K h 、V h denote the query matrix, key matrix, and value matrix of the h-th attention head, respectively. d denotes the feature dimension used for scaling the attention score. and represents the average value of the feature in the horizontal and vertical directions, SA(·) represents the spatial attention operation; Then, dilated spatial pyramid pooling is used for processing, and softmax represents the normalization function used to convert the attention score into a probability distribution; F(X)=∑ r∈{2,3,6} α r Conv r (X)+A(X) Where r represents the dilation rate of the dilated convolution, and the dilation rate configuration of [2, 3, 6] is adopted to capture multi-scale context information through different receptive field sizes and enhance the multi-scale representation ability of features; α r Represents the weight coefficient under different expansion rates, Conv r (·) represents a convolution operation with a dilation rate of r; X represents the input feature map, and A(X) represents the output of the aforementioned spatial-channel self-attention operation: Finally, the processing is completed through feature fusion and enhancement steps: Y=φ(concat[F(feat4),Conv 1×1 (feat1)]) Among them, feat1 represents the low-level features after 1×1 convolution dimensionality reduction, and the important spatial positions are highlighted after spatial attention. Feat4 is the high-level features processed by spatial-channel self-attention and ASPP. F(·) represents the multi-scale feature processing function. Conv 1x1 (·) indicates that the 1×1 convolution operation realizes the effective combination of low-level features and high-level features. concat(·) represents feature concatenation in the channel dimension. Finally, by concatenating feat4 and feat1 in the channel dimension and undergoing nonlinear transformations including convolution, batch normalization, and ReLU activation, φ(·) further fuses and refines the features to improve the boundary enhancement effect.
5. The medical image fuzzy boundary segmentation method based on COD frequency domain guidance according to claim 1 is characterized in that: In step 3, adaptive edge feature processing is performed on the enhanced image, and features of the enhanced image output are adaptively optimized to highlight key boundary information and achieve fine-grained expression of boundary features, specifically including: First, the input features and boundary prediction weights are fused: X=C⊙A+C Among them, C represents the input feature map, A represents the boundary prediction weight, ⊙ represents element-level multiplication, and the original feature information is retained through the residual connection + C; Then, the adaptive channel attention mechanism AFGCA is used for feature enhancement, where the convolution kernel size is obtained by adaptive calculation: Among them, C represents the channel dimension, and the convolution kernel size k is adaptively determined by the number of channels; Finally, dynamic feature weighting is achieved through the Mix module: Y=α·F1+(1-α)·F2 α=σ(w),w=-0.80 Among them, F1 and F2 are the features to be fused, α is the mixing factor calculated by the Sigmoid function σ, and the initial weight w is set to -0.
80. This module realizes adaptive enhancement of features through residual connection and dynamic feature weighting.
6. The medical image fuzzy boundary segmentation method based on COD frequency domain guidance according to claim 1 is characterized in that: In step 3, the image data features processed above are subjected to contextual attention aggregation, and the multi-scale features obtained above are subjected to attention-guided adaptive fusion, including: First, unify and concatenate low-level features and high-level features: Among them, L f and H f Represent low-level and high-level features respectively, Indicates that the bilinear interpolation operation adjusts the high-level features to the same size as the low-level features, concat indicates feature concatenation in the channel dimension, Conv 1×1 Represents the convolution operation; Then perform multi-level feature fusion: in, is the attention weight, ⊙ represents element-by-element multiplication, φ is the nonlinear transformation, X i is the feature block, σ represents the Sigmoid activation function; Finally, global feature fusion is achieved: Y=Conv(concat[Y2,Y3,X4]) Among them, Y2 and Y3 represent the results of two-feature and three-feature fusion respectively, and X4 is the fourth feature block.
7. A system using the COD frequency domain guided medical image fuzzy boundary segmentation method according to claim 1, characterized in that: It includes semantic edge enhancement module, frequency domain feature guided enhancement module, adaptive edge feature module and contextual attention aggregation module; The semantic edge enhancement module receives features extracted from the backbone network, performs preliminary boundary positioning and extraction, and strengthens boundary information; The frequency domain feature guided enhancement module receives features from the backbone network and performs frequency domain processing to improve the accuracy of boundary features; The adaptive edge feature module receives the processed features from the semantic edge enhancement module and the frequency domain feature guided enhancement module, performs adaptive optimization, refines the boundary information, and highlights the key boundary features; The contextual attention aggregation module receives multi-scale features from the adaptive edge feature module, performs adaptive fusion, and combines it with its own feature transfer to finally output accurate segmentation results to ensure clear and accurate boundaries.