Medical image segmentation method and imaging method based on edge guidance

By constructing a medical image segmentation model based on U-net and edge guidance, the accuracy and stability issues of existing methods in complex tissue segmentation are solved, achieving high-precision and reliable medical image segmentation that is applicable to various imaging devices and terminals.

CN121330291APending Publication Date: 2026-01-13CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511486451.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing medical image segmentation methods suffer from poor segmentation accuracy, method stability, and repeatability when dealing with nonlinear differences between complex tissues and regions. Furthermore, deep learning methods have high computational complexity in high-resolution medical images and are highly dependent on labeled data, making them difficult to apply effectively.

Method used

A medical image segmentation model is constructed using the U-net-based scheme, edge guidance scheme, two-dimensional state space modeling scheme, skip connection scheme, and channel-space attention scheme. By combining encoder and decoder, edge attention map and skip connection features are used for medical image segmentation. The model is further improved by combining depthwise separable convolution and cross-scale alignment modules.

Benefits of technology

It achieves high-precision and reliable segmentation results in complex medical images, has a wide range of applications, significantly improves indicators such as Dice coefficient and mIoU, reduces false positive and false negative areas, and enhances the segmentation accuracy of blurred boundary and tissue transition areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330291A_ABST
    Figure CN121330291A_ABST
Patent Text Reader

Abstract

The invention discloses a medical image segmentation method based on edge guidance. The method comprises the steps that an existing target area medical image segmentation data set is acquired and preprocessed to construct a training data set; constructing a medical image segmentation initial model based on a U-net scheme, an edge guidance scheme, a two-dimensional state space modeling scheme, a convolution scheme, a jump connection scheme and a channel-space attention scheme, and training to obtain a medical image segmentation model; and carrying out actual medical image segmentation on the target region by adopting the obtained medical image segmentation model. The invention also discloses an imaging method comprising the medical image segmentation method based on edge guidance. According to the method, medical image segmentation and imaging based on edge guidance can be realized, the reliability is higher, the accuracy is better, and the application range is wider.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, specifically relating to an edge-guided medical image segmentation method and imaging method. Background Technology

[0002] Medical image segmentation is one of the core tasks in medical image analysis. It aims to accurately extract and segment target regions from complex medical images, providing reliable data support for clinical and basic medical research.

[0003] Currently, with the rapid development of imaging equipment resolution and multimodal fusion technology, tissue structures in medical images exhibit greater complexity and diversity, with a significant increase in grayscale differences, noise interference, and blurred boundary issues between different regions. Traditional segmentation methods based on thresholding, region growing, or manual features struggle to handle complex tissues and nonlinear differences between regions; therefore, these segmentation schemes suffer from poor segmentation accuracy, method stability, and repeatability.

[0004] In recent years, deep learning methods have made rapid progress in the field of medical image segmentation. Existing medical image segmentation schemes have all been applied to some extent: Convolutional Neural Networks (CNNs), with their local receptive fields and parameter sharing mechanisms, perform excellently in texture detail modeling and spatial feature extraction; however, these schemes are limited by the local modeling characteristics of fixed convolutional kernels, resulting in shortcomings in capturing long-range dependencies and global semantic consistency. The Transformer structure based on the self-attention mechanism can establish dependencies between pixels globally, thereby improving structural semantic modeling capabilities; however, the computational complexity of this scheme increases quadratically with the input resolution, limiting its application in high-resolution medical images. Moreover, the Transformer scheme is highly dependent on large-scale labeled data, making it difficult to achieve efficient transfer and generalization under conditions of scarce labeled data in medical scenarios. Summary of the Invention

[0005] One of the objectives of this invention is to provide a reliable, accurate, and widely applicable edge-guided medical image segmentation method.

[0006] A second objective of this invention is to provide an imaging method that includes the aforementioned edge-guided medical image segmentation method.

[0007] The edge-guided medical image segmentation method provided by this invention includes the following steps:

[0008] S1. Obtain an existing medical image segmentation dataset for the target region;

[0009] S2. Preprocess the image data obtained in step S1 to construct a training dataset;

[0010] S3. Based on the U-net scheme, edge guidance scheme, two-dimensional state space modeling scheme, convolution scheme, skip connection scheme and channel-space attention scheme, an initial model for medical image segmentation is constructed;

[0011] S4. Using the training dataset constructed in step S2, train the initial medical image segmentation model constructed in step S3 to obtain the medical image segmentation model;

[0012] S5. Using the medical image segmentation model obtained in step S4, perform actual medical image segmentation on the target region.

[0013] Step S3, which involves constructing an initial medical image segmentation model based on the U-net scheme, edge guidance scheme, two-dimensional state space modeling scheme, convolution scheme, skip connection scheme, and channel-space attention scheme, includes the following steps:

[0014] The constructed initial model for medical image segmentation includes an encoder, a skip connection module, and a decoder;

[0015] An encoder is constructed based on a two-dimensional state-space modeling scheme; the encoder is used to encode and extract features from the input medical images.

[0016] A skip connection module is constructed based on the channel-space attention scheme and the convolution scheme. The skip connection module is used to generate an edge attention map and several skip connection features based on several intermediate features of the encoder, and to skip the edge attention map and skip connection features to the decoder to achieve edge guidance in the decoder part.

[0017] A decoder is constructed based on a two-dimensional state space modeling scheme and a convolution scheme. The decoder is used to decode the features output by the encoder and the features of skip connections to achieve segmentation of target regions in medical images.

[0018] The encoder's processing flow specifically includes the following steps:

[0019] The input image is divided into patches of a set size; then it is processed by depthwise separable convolution and linear embedding to map to a feature space of a set dimension and obtain initial features;

[0020] The initial features are processed sequentially through the encoding input Path embedding module, the encoding first gated hybrid visual state modeling module, the encoding first Path embedding module, the encoding second gated hybrid visual state modeling module, the encoding second Path embedding module, the encoding third gated hybrid visual state modeling module, the encoding third Path embedding module, and the encoding fourth gated hybrid visual state modeling module to obtain the encoder's output features;

[0021] Specifically, the output of the input Path embedding module is used as the first intermediate feature; the output of the first Path embedding module is used as the second intermediate feature; the output of the second Path embedding module is used as the third intermediate feature; the output of the third Path embedding module is used as the fourth intermediate feature; and the first to fourth intermediate features are all used as the input of the skip connection module.

[0022] The decoder's processing flow specifically includes the following steps:

[0023] The encoder's output features are processed by the decoding input gated hybrid vision state modeling module to obtain the decoded input features. The decoded input features are summed with the fourth feature output from the jump connection module to obtain the fourth summed feature. This fourth summed feature is then processed sequentially by the decoding first patch extension module and the decoding first gated hybrid vision state modeling module to obtain the decoded first feature. The decoded first feature is summed with the third feature output from the jump connection module to obtain the third summed feature. The fourth summed feature is used as a high-dimensional feature, and the third summed feature is used as a low-dimensional feature, along with the edge attention output from the jump connection module. Figure 1 The input is processed by the first cross-scale alignment module of the decoder; the output of the first cross-scale alignment module is then processed by the second patch extension module and the second gated hybrid visual state modeling module of the decoder to obtain the second decoded feature; the second decoded feature is summed with the second feature of the jump connection module output to obtain the second summed feature; the third summed feature is used as the high-dimensional feature, and the second summed feature is used as the low-dimensional feature, and is combined with the edge attention output by the jump connection module. Figure 1 The input is processed by the second cross-scale alignment module of the decoder; the output of the second cross-scale alignment module is then processed by the third patch extension module, the third gated hybrid visual state modeling module of the decoder, and the decoder output projection module in sequence to obtain the final image segmentation result;

[0024] The decoding output projection module is a convolution module.

[0025] The structures of the first gated hybrid visual state modeling module, the fourth gated hybrid visual state modeling module, the first gated hybrid visual state modeling module, the third gated hybrid visual state modeling module, and the input gated hybrid visual state modeling module are all the same.

[0026] The processing steps of the gated hybrid vision state modeling module include the following:

[0027] Input features Normalization is performed to obtain normalized features. for , This is a normalization process;

[0028] The normalized features are projected through three linear layers to obtain the query features. for Key features for Sum value characteristics for ;in, For querying the matrix, The key matrix, It is a value matrix;

[0029] Calculate the attention weights for , in Let k be the neighborhood window centered at position i, and k be the position index within the window, used to divide the denominator pair. Summing all positions in the middle, therefore ; The feature dimensions of the query and key in the l-th layer attention are, i.e. ;

[0030] Calculate individual local features for j is the neighborhood window The position index within the range is used to represent the positions of interest within the neighborhood when calculating the local features at position i; all individual local features constitute the local features. ;

[0031] The normalized features are processed using a two-dimensional state-space modeling scheme to obtain global features. ;

[0032] The gating weight value is calculated. for ,in For the gated matrix, Use the Sigmoid activation function;

[0033] Finally, the output of the gated hybrid vision state modeling module is calculated. for ,in For element-wise multiplication, For Stochastic Depth operations;

[0034] The processing procedure of the jump connection module includes the following steps:

[0035] Set the Sobel convolution kernel in the horizontal direction Sobel convolution kernels in the vertical direction ;

[0036] Encode the first intermediate feature Through respectively and Processing yields the first level gradient. for First vertical gradient for ;

[0037] Encode the fourth intermediate feature Through respectively and Processing yields the fourth level gradient. for Fourth vertical gradient for ;

[0038] The first initial edge response map was calculated. for Simultaneously, the fourth initial edge response map was calculated. for ,in This is the set numerical stability constant;

[0039] Will and Adding them together yields the first intermediate primary feature. ,Will and Adding them together yields the fourth intermediate primary feature. ;

[0040] Will pass The first intermediate feature is obtained by compressing the channel dimension of the convolution. ,Will pass The fourth intermediate feature is obtained by compressing the channel dimension of the convolution. ;

[0041] The single-channel edge response map is calculated using the following formula. :

[0042] In the formula for The convolution process; It is the ReLU activation function; for The convolution process; For channel splicing operations; This is an upsampling operation;

[0043] Will The edge attention map is obtained by normalization using the Sigmoid function. for ;

[0044] Encode the second intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the second feature of the skip connection. ;

[0045] Encode the third intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the third feature of the skip connection. ;

[0046] Encode the fourth intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the fourth feature of the skip connection. .

[0047] The decoding first cross-scale alignment module and the decoding second cross-scale alignment module have the same structure; the processing of the cross-scale alignment module specifically includes the following steps:

[0048] Bilinear interpolation upsampling is performed on the input high-dimensional features to obtain high-dimensional sampled features. This ensures that the obtained features have the same resolution as the low-dimensional features;

[0049] Will The structural enhancement features are obtained by averaging the outputs of three sets of depthwise separable convolutions with different dilation rates. for ,in For depthwise separable convolution operations with an inflation rate set to the d-th value;

[0050] Input low-dimensional features and structural enhancement features Perform linear projection of the query, key, and value to obtain scale-aligned query features. for Scale alignment key features for and scale alignment value features for ,in This is the query matrix in the scale alignment module. This refers to the key matrix in the scale alignment module. This is the value matrix in the scale alignment module;

[0051] edge attention map Resampling to Consistent size yields resampled edge attention maps Then, the attention weights under edge guidance are calculated by processing the data through an embedding function to generate additivity biases. for ,in The softmax activation function is used. For the channel attention branch, the feature dimension of the query and key vector is... , This refers to the process of embedding functions;

[0052] Calculate attention features for ;

[0053] The output features of the cross-scale alignment module are calculated using the following formula. :

[0054] In the formula For ReLU functions; For batch normalization operation; for Convolution operations; This is a channel-dimensional splicing operation.

[0055] The present invention also provides an imaging method including the aforementioned edge-guided medical image segmentation method, further comprising the following steps:

[0056] S6. The segmentation results of the medical image obtained in step S5 are marked and re-imaged on the original medical image to obtain a medical image with the segmentation results.

[0057] The edge-guided medical image segmentation and imaging method provided by this invention constructs and trains a medical image segmentation model based on the U-net scheme, edge-guided scheme, two-dimensional state space modeling scheme, convolution scheme, skip connection scheme and channel-space attention scheme. Therefore, this invention can not only realize edge-guided medical image segmentation and imaging, but also has higher reliability, better accuracy and wider applicability. Attached Figure Description

[0058] Figure 1 This is a schematic diagram of the segmentation method of the present invention.

[0059] Figure 2 This is a schematic diagram illustrating the segmentation effect of the segmentation method embodiment of the present invention on the ISIC 2017 dataset.

[0060] Figure 3 This is a schematic diagram illustrating the segmentation effect of the segmentation method embodiment of the present invention on the ISIC 2018 dataset.

[0061] Figure 4 This is a schematic diagram illustrating the segmentation effect of the segmentation method of the present invention on the CVC-ClinicDB dataset.

[0062] Figure 5 This is a schematic diagram illustrating the segmentation effect of the segmentation method of the present invention on the ACDC dataset.

[0063] Figure 6 This is a schematic diagram illustrating the segmentation effect of the segmentation method embodiment of the present invention on the Synapse dataset.

[0064] Figure 7 This is a schematic diagram of the imaging method of the present invention. Detailed Implementation

[0065] like Figure 1 The diagram shows a flowchart of the segmentation method of the present invention: This edge-guided medical image segmentation method disclosed in the present invention includes the following steps:

[0066] S1. Obtain an existing medical image segmentation dataset for the target region;

[0067] S2. Preprocess the image data obtained in step S1 to construct a training dataset;

[0068] S3. Based on the U-net scheme, edge-guided scheme, 2D state-space modeling scheme, convolution scheme, skip connection scheme, and channel-spatial attention scheme, construct an initial model for medical image segmentation; including the following steps:

[0069] The constructed initial model for medical image segmentation includes an encoder, a skip connection module, and a decoder;

[0070] An encoder is constructed based on a two-dimensional state-space modeling scheme; the encoder is used to encode and extract features from the input medical images.

[0071] A skip connection module is constructed based on the channel-space attention scheme and the convolution scheme. The skip connection module is used to generate an edge attention map and several skip connection features based on several intermediate features of the encoder, and to skip the edge attention map and skip connection features to the decoder to achieve edge guidance in the decoder part.

[0072] A decoder is constructed based on a two-dimensional state space modeling scheme and a convolution scheme; the decoder is used to decode the features output by the encoder and the features of skip connections to achieve segmentation of target regions in medical images;

[0073] In practice, the encoder's processing flow includes the following steps:

[0074] The input image is divided into patches of a set size; then it is processed by depthwise separable convolution and linear embedding to map to a feature space of a set dimension and obtain initial features;

[0075] The initial features are processed sequentially through the encoding input Path embedding module, the encoding first gated hybrid visual state modeling module, the encoding first Path embedding module, the encoding second gated hybrid visual state modeling module, the encoding second Path embedding module, the encoding third gated hybrid visual state modeling module, the encoding third Path embedding module, and the encoding fourth gated hybrid visual state modeling module to obtain the encoder's output features;

[0076] Specifically, the output of the input Path embedding module is used as the first intermediate feature; the output of the first Path embedding module is used as the second intermediate feature; the output of the second Path embedding module is used as the third intermediate feature; the output of the third Path embedding module is used as the fourth intermediate feature; and the first to fourth intermediate features are all used as inputs to the skip connection module.

[0077] In practice, the decoder's processing flow includes the following steps:

[0078] The encoder's output features are processed by the decoding input gated hybrid vision state modeling module to obtain the decoded input features. The decoded input features are summed with the fourth feature output from the jump connection module to obtain the fourth summed feature. This fourth summed feature is then processed sequentially by the decoding first patch extension module and the decoding first gated hybrid vision state modeling module to obtain the decoded first feature. The decoded first feature is summed with the third feature output from the jump connection module to obtain the third summed feature. The fourth summed feature is used as a high-dimensional feature, and the third summed feature is used as a low-dimensional feature, along with the edge attention output from the jump connection module. Figure 1 The input is processed by the first cross-scale alignment module of the decoder; the output of the first cross-scale alignment module is then processed by the second patch extension module and the second gated hybrid visual state modeling module of the decoder to obtain the second decoded feature; the second decoded feature is summed with the second feature of the jump connection module output to obtain the second summed feature; the third summed feature is used as the high-dimensional feature, and the second summed feature is used as the low-dimensional feature, and is combined with the edge attention output by the jump connection module. Figure 1 The input is processed by the second cross-scale alignment module of the decoder; the output of the second cross-scale alignment module is then processed by the third patch extension module, the third gated hybrid visual state modeling module of the decoder, and the decoder output projection module in sequence to obtain the final image segmentation result;

[0079] Among them, the decoding output projection module is a convolution module;

[0080] In specific implementation, the structures of the encoding first gated hybrid visual state modeling module to the encoding fourth gated hybrid visual state modeling module, the decoding first gated hybrid visual state modeling module to the decoding third gated hybrid visual state modeling module, and the decoding input gated hybrid visual state modeling module are all the same;

[0081] The processing steps of the gated hybrid vision state modeling module include the following:

[0082] Input features Normalization is performed to obtain normalized features. for , This is a normalization process;

[0083] In the local branch, a neighborhood attention mechanism is introduced to improve the model's ability to recognize boundary and texture details, and to ensure the modeling of high-frequency details and boundary contours within the local space.

[0084] The normalized features are projected through three linear layers to obtain the query features. for Key features for Sum value characteristics for ;in, For querying the matrix, The key matrix, It is a value matrix;

[0085] Calculate the attention weights for , in Let k be the neighborhood window centered at position i, and k be the position index within the window, used to divide the denominator pair. Summing all positions in the middle, therefore ; The feature dimensions of the query and key in the l-th layer attention are, i.e. ;

[0086] Calculate individual local features for j is the neighborhood window The position index within the range is used to represent the positions of interest within the neighborhood when calculating the local features at position i; all individual local features constitute the local features. ;

[0087] The normalized features are processed using a two-dimensional state-space modeling scheme to obtain global features. ;

[0088] The gating weight value is calculated. for ,in For the gated matrix, Use the Sigmoid activation function;

[0089] Finally, the output of the gated hybrid vision state modeling module is calculated. for ,in For element-wise multiplication, For Stochastic Depth operations;

[0090] The gated hybrid vision state modeling module maintains fine-grained boundary sensitivity through local window attention, captures global dependencies through a two-dimensional state space modeling scheme (SS2D), and establishes a dynamic trade-off between the two using a gating mechanism. This scheme can effectively alleviate the challenges caused by boundary blurring and scale differences in medical image segmentation tasks, enabling the model to simultaneously possess the ability to depict local details and preserve global structure.

[0091] In practice, the processing steps of the jump connection module include the following:

[0092] Set the Sobel convolution kernel in the horizontal direction Sobel convolution kernels in the vertical direction ;

[0093] Encode the first intermediate feature Through respectively and Processing yields the first level gradient. for First vertical gradient for ;

[0094] Encode the fourth intermediate feature Through respectively and Processing yields the fourth level gradient. for Fourth vertical gradient for ;

[0095] The first initial edge response map was calculated. for Simultaneously, the fourth initial edge response map was calculated. for ,in This is a set numerical stability constant used to avoid computational instability when the gradient magnitude is zero;

[0096] Will and Adding them together yields the first intermediate primary feature. ,Will and Adding them together yields the fourth intermediate primary feature. ;

[0097] Will pass The first intermediate feature is obtained by compressing the channel dimension of the convolution. ,Will pass The fourth intermediate feature is obtained by compressing the channel dimension of the convolution. ;

[0098] The single-channel edge response map is calculated using the following formula. :

[0099] In the formula for The convolution process; It is the ReLU activation function; for The convolution process; For channel splicing operations; This is an upsampling operation;

[0100] Will The edge attention map is obtained by normalization using the Sigmoid function. for ;

[0101] Encode the second intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the second feature of the skip connection. ;

[0102] Encode the third intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the third feature of the skip connection. ;

[0103] Encode the fourth intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the fourth feature of the skip connection. ;

[0104] The skip connection module effectively integrates shallow high-frequency boundary information with deep semantic contours to generate a high-quality edge prior map. This prior enhances the model's response to boundary regions in the skip connection, alleviates the edge degradation problem in deep semantic features, and provides stable structural constraints for cross-scale feature alignment, thereby significantly improving the model's segmentation accuracy in blurred boundary and organizational transition regions.

[0105] In practice, the decoding first cross-scale alignment module and the decoding second cross-scale alignment module have the same structure; the processing of the cross-scale alignment module specifically includes the following steps:

[0106] Bilinear interpolation upsampling is performed on the input high-dimensional features to obtain high-dimensional sampled features. This ensures that the obtained features have the same resolution as the low-dimensional features;

[0107] Will The structural enhancement features are obtained by averaging the outputs of three sets of depthwise separable convolutions with different dilation rates. for ,in For depthwise separable convolution operations with a dilation rate set to a value of d, processing with depthwise separable convolutions of different dilation rates can enhance their structural expressiveness.

[0108] Input low-dimensional features and structural enhancement features Perform linear projection of the query, key, and value to obtain scale-aligned query features. for Scale alignment key features for and scale alignment value features for ,in This is the query matrix in the scale alignment module. This refers to the key matrix in the scale alignment module. This is the value matrix in the scale alignment module;

[0109] edge attention map Resampling to Consistent size yields resampled edge attention maps Then, the attention weights under edge guidance are calculated by processing the data through an embedding function to generate additivity biases. for ,in The softmax activation function is used. For the channel attention branch, the feature dimension of the query and key vector is... , This refers to the process of embedding functions;

[0110] Calculate attention features for ;

[0111] The output features of the cross-scale alignment module are calculated using the following formula. :

[0112] In the formula For ReLU functions; For batch normalization operation; for Convolution operations; This is a channel-level splicing operation;

[0113] The cross-scale alignment module constructs explicit spatial alignment relationships between semantic features at different levels through an edge-guided cross-scale attention mechanism, which significantly improves the decoder's ability to model structural continuity and boundary fineness. Especially in scenarios with complex contours or blurred boundaries, the model can exhibit stronger structural recovery ability and localization stability.

[0114] S4. Using the training dataset constructed in step S2, train the initial medical image segmentation model constructed in step S3 to obtain the medical image segmentation model;

[0115] S5. Using the medical image segmentation model obtained in step S4, perform actual medical image segmentation on the target region.

[0116] The segmentation method of the present invention will be further described below with reference to an embodiment:

[0117] To systematically evaluate the segmentation performance of the model across different modalities of medical images, this invention selects five publicly available medical image segmentation datasets, covering dermoscopy images, colonoscopy images, cardiac MRI images, and abdominal CT images, encompassing various structural types such as skin detection, polyp detection, cardiac organs, and multiple abdominal organs. Each dataset exhibits significant differences in imaging modality, tissue structure, and boundary complexity, allowing for multi-dimensional validation of the model's structural adaptability, boundary modeling ability, and cross-modal generalization capability.

[0118] All experiments were implemented using Python 3.8 and PyTorch 1.8.1, and conducted on an Ubuntu 18.04 system equipped with an NVIDIA Tesla V100 SGPU (32GB VRAM). All images were scaled to a fixed resolution before input. During training, standard data augmentation operations were employed, including random horizontal flipping, vertical flipping, and random angle rotation. The optimizer used was AdamW, with an initial learning rate set to [value missing]. The weight decay coefficient is The batch size was uniformly set to 8, and the number of training epochs was fixed at 420. All experiments used the same hyperparameter settings, without any additional adjustments for specific datasets.

[0119] This section presents a systematic comparative experiment on typical medical image segmentation tasks, covering multiple public datasets and mainstream network architectures. The selected methods include convolutional neural network models such as U-Net, U-Net++, Attention Unet, and ConDSeg; visual Transformer methods based on self-attention mechanisms such as UCTransNet, TransUNet, and MedT; and Mamba architecture models based on state-space modeling such as VM-UNet, VM-UNet v2, H-vmunet, and CCViM.

[0120] The quantitative evaluation results on the ISIC 2017 dataset are shown in Table 1:

[0121] The method of this invention achieves top performance in several core metrics, including Dice coefficient and mIoU. The improvement in Dice coefficient is particularly significant, with a 4.31% improvement in Dice, a 6.99% improvement in mIoU, and a 2.19% improvement in sensitivity compared to U-Net, a representative convolutional network method. Compared to UCTransNet with its Transformer architecture, the method of this invention achieves improvements of 2.91%, 4.77%, and 2.32% in Dice, mIoU, and sensitivity, respectively. Furthermore, for the state-space modeling method H-vmunet, this method outperforms it by 3.25% and 5.32% in Dice and mIoU, respectively. Figure 2 This paper presents the segmentation results of various methods on typical images in the ISIC2017 dataset. The results show that different methods differ in terms of structural restoration and boundary characterization of the region of interest (ROI). Taking CCViM as an example, this method has certain advantages in maintaining the overall shape of the ROI, but it is still prone to false positives and false negatives when dealing with ROIs with complex boundary shapes or significant structural changes, and the segmentation accuracy of boundary details is also insufficient. For example, in the first and second rows of samples, CCViM showed obvious local misclassification at the edge of the ROI. In contrast, the method of this invention is more stable in terms of boundary continuity and fine-grained structure restoration, and the segmentation results are highly consistent with the real annotations, effectively reducing misclassified and missed areas, further verifying its accuracy and robustness in skin region segmentation tasks.

[0122] The quantitative results on the ISIC 2018 dataset are shown in Table 2:

[0123] The method of this invention achieves top performance across multiple mainstream evaluation metrics, demonstrating a significant overall segmentation advantage. Specifically, the Dice similarity coefficient and average intersection-union ratio reach 91.67% and 84.62%, respectively, showing the most outstanding performance in terms of region overlap and structure reconstruction. Compared to ConDSeg, which has the second-best performance, the method of this invention improves these two metrics by 1.34% and 2.26%, respectively. In terms of accuracy and specificity, the method of this invention reaches 95.91% and 97.02%, respectively, representing improvements of approximately 1.21% and 1.93% over UCTransNet and 0.60% and 1.16% over CCViM. These results indicate that the method of this invention not only possesses higher segmentation accuracy but also exhibits more robust performance in suppressing false recognition of non-interest regions. Figure 3 Visualized segmentation results of various methods on typical images in the ISIC2018 test set are presented. Visual comparison reveals that while methods based on self-attention mechanisms, such as TransUNet, have certain advantages in modeling the global structure, they still exhibit significant omissions and contour loss in the segmentation of edge details, particularly noticeable in the third and fifth rows of samples. VM-UNet v2 in the Mamba method shows stable performance in reconstructing the main structure of the region of interest, but exhibits a tendency for segmentation to extend beyond boundaries, with normal skin tissue being misclassified in the first and fifth rows of samples. In contrast, the method of this invention demonstrates higher consistency in boundary continuity, region of interest integrity, and fine-grained structure restoration, significantly reducing false positive and false negative regions, and further improving the overlap between the segmentation results and the true labels, thus verifying the boundary modeling ability and generalization performance of the method of this invention in complex skin scenes.

[0124] The quantitative results of the CVC-ClinicDB test set are shown in Table 3:

[0125] The method of this invention achieved optimal or near-optimal results in all five evaluation metrics, indicating its balanced and stable performance across multiple dimensions. Regarding region overlap accuracy, the Dice similarity coefficient and average intersection-union ratio were 93.32% and 87.49%, respectively, significantly outperforming various comparative methods, with improvements of 2.13% and 3.69% compared to ConDSeg. Classification accuracy and specificity reached 98.92% and 99.34%, respectively, effectively controlling misclassification of non-lesion regions while maintaining sensitivity. Compared to methods such as MedT and H-vmunet, sensitivity was also significantly improved, reaching 94.12%. Figure 4The visualization results of various methods on typical colorectal polyp images are presented. Overall, convolutional methods such as Attention UNet are prone to boundary jitter and structural breaks, affecting the complete reconstruction of lesion contours. Transformer methods such as UCTransNet and TransUNet can achieve good coverage of the main region, but their edge localization accuracy is still unstable, with some regions of interest showing edge shrinkage or local missing parts. Mamba architecture methods such as VM-UNet maintain structural consistency in most samples, but boundary expansion and increased false positives can be observed in the second and fifth rows of images, indicating that there is still room for improvement in boundary discrimination. In contrast, the method of this invention is more robust in terms of contour fitting, region coverage, and background suppression, and the prediction results are highly consistent with the ground truth annotations.

[0126] Table 4 shows the segmentation performance of each method on the ACDC dataset for the left ventricle, right ventricle, and myocardial regions.

[0127] The results show that the method of this invention achieves optimal or near-optimal Dice similarity coefficients in all three structural regions, while also exhibiting small errors in the average Hausdorff distance index, demonstrating excellent modeling capabilities for the fine structures of multiple tissues in the heart. Specifically, in the left ventricular region, the Dice coefficient of the method of this invention is 91.71%, which is approximately 2.03% and 1.57% higher than U-Net and AttentionUnet, respectively; in right ventricular segmentation, it achieves 90.32%, higher than all comparative methods, including a 1.21% improvement compared to ConDSeg; and in myocardial segmentation, it reaches 96.23%, achieving optimized boundary accuracy while maintaining structural consistency. In terms of overall indicators, the method of this invention has an average Dice of 92.75% and an HD of 1.09, both of which are the best values ​​among the current comparative methods. Figure 5The visualization results of segmentation by various methods in representative regions of interest are presented. Most methods show stability in the central structural regions, but segmentation errors often occur in samples with complex tissue boundaries and significant morphological variations. Taking the Transformer architecture MedT as an example, it exhibits obvious contour breaks in the myocardial region and significant right ventricular boundary shifts, resulting in insufficient overall structural continuity. Mamba methods such as H-vmunet and VM-UNet v2 show boundary retraction and missed segmentation of the right ventricle in some samples, particularly noticeable in the first and second rows of images. While convolutional methods such as U-Net++ accurately predict the main structural positions, their ability to identify thin-walled regions is insufficient, resulting in discontinuities in the outer edge of the myocardium. In contrast, the method of this invention maintains a high degree of consistency with the ground truth labels in the segmentation results of all three structural regions, with good boundary fit. It maintains stable segmentation performance, especially in images with thin myocardial layers or blurred ventricular boundaries, further validating its accuracy advantage and robustness in cardiac anatomical modeling.

[0128] The performance of each method in the Synapse multi-organ segmentation task is shown in Table 5:

[0129] The method of this invention exhibits stable and superior overall performance across all evaluation metrics, achieving an average Dice coefficient of 81.63% and the lowest Hausdorff distance at only 14.44, significantly outperforming all comparative methods. Specifically, in organs with complex structures and blurred outlines, such as the stomach, gallbladder, and pancreas, the method of this invention achieves accuracy rates of 82.39%, 76.27%, and 59.19%, respectively, surpassing most methods in terms of accuracy. Taking the gallbladder as an example, the Dice index is 4.21% higher than CCViM, and in the right kidney, a notoriously difficult-to-segment structure, it is also 5.48% higher than UCTransNet. In easily segmented organs such as the liver and spleen, the method of this invention achieves accuracy rates of 94.90% and 92.70%, respectively, demonstrating that it can maintain the integrity of the main structural components while still considering the boundary modeling of smaller organs. Overall, while convolutional methods exhibit some stability in large organs, their performance is limited in the segmentation of small-volume structures; Transformer methods have advantages in global modeling, but are insufficient in fine contour processing; Mamba series methods are competitive in some metrics, but still have shortcomings in structural coherence and boundary robustness. Figure 6The visualization results of each method on typical samples are presented. It can be observed that convolutional methods such as U-Net and U-Net++ perform well in segmenting large organs such as the aorta and liver, but often exhibit missed detections or oversegmentation of structures with unclear outlines and blurred boundaries, such as the gallbladder and pancreas. Transformer-based methods such as UCTransNet and TransUNet improve image context awareness, but are prone to boundary breaks in morphologically complex regions. Mamba methods such as VM-UNet v2 and CCViM show acceptable boundary continuity in some samples, but incomplete region recognition of the gallbladder and pancreas can still be observed in the first and third rows of samples, with some structures showing breaks or blurred outlines. In comparison, the method of this invention demonstrates stronger structure preservation and boundary accuracy in organ segmentation, with segmented regions highly consistent with the ground truth labels. Especially in cases of multiple adjacent organs and significant anatomical variations, it maintains good region consistency and discrimination accuracy, demonstrating superior generalization ability and boundary modeling performance.

[0130] like Figure 7 The diagram shown is a flowchart of the imaging method of the present invention: The imaging method disclosed in this invention, which includes the aforementioned edge-guided medical image segmentation method, includes the following steps:

[0131] S1. Obtain an existing medical image segmentation dataset for the target region;

[0132] S2. Preprocess the image data obtained in step S1 to construct a training dataset;

[0133] S3. Based on the U-net scheme, edge guidance scheme, two-dimensional state space modeling scheme, convolution scheme, skip connection scheme and channel-space attention scheme, an initial model for medical image segmentation is constructed;

[0134] S4. Using the training dataset constructed in step S2, train the initial medical image segmentation model constructed in step S3 to obtain the medical image segmentation model;

[0135] S5. Using the medical image segmentation model obtained in step S4, perform actual medical image segmentation on the target region;

[0136] S6. The segmentation results of the medical image obtained in step S5 are marked and re-imaged on the original medical image to obtain a medical image with the segmentation results.

[0137] The imaging method provided by this invention can be directly applied to existing medical imaging equipment (such as X-ray machines, CT scanners, MRI scanners, etc.) or directly applied to a terminal (such as a computer). In specific applications, existing methods are used to acquire actual medical images, and then the acquired data is input into the corresponding machine or terminal. At this time, the machine or terminal can obtain the segmentation result of the actual medical image according to the imaging method disclosed in this invention, and mark and display the segmentation result on the original image through different types of representation (such as color), and then perform secondary imaging and output. At this time, the output image is the medical image of the segmentation result, which can reflect the actual medical image and the corresponding segmentation result content, thereby greatly facilitating the subsequent work of clinical medical personnel and laboratory experimental personnel.

Claims

1. An edge-guided medical image segmentation method, comprising the following steps: S1. Obtain an existing medical image segmentation dataset for the target region; S2. Preprocess the image data obtained in step S1 to construct a training dataset; S3. Based on the U-net scheme, edge guidance scheme, two-dimensional state space modeling scheme, convolution scheme, skip connection scheme and channel-space attention scheme, an initial model for medical image segmentation is constructed; S4. Using the training dataset constructed in step S2, train the initial medical image segmentation model constructed in step S3 to obtain the medical image segmentation model; S5. Using the medical image segmentation model obtained in step S4, perform actual medical image segmentation on the target region.

2. The edge-guided medical image segmentation method according to claim 1, characterized in that... Step S3, which involves constructing an initial medical image segmentation model based on the U-net scheme, edge guidance scheme, two-dimensional state space modeling scheme, convolution scheme, skip connection scheme, and channel-space attention scheme, includes the following steps: The constructed initial model for medical image segmentation includes an encoder, a skip connection module, and a decoder; An encoder is constructed based on a two-dimensional state-space modeling scheme; the encoder is used to encode and extract features from the input medical images. A skip connection module is constructed based on the channel-space attention scheme and the convolution scheme. The skip connection module is used to generate an edge attention map and several skip connection features based on several intermediate features of the encoder, and to skip the edge attention map and skip connection features to the decoder to achieve edge guidance in the decoder part. A decoder is constructed based on a two-dimensional state space modeling scheme and a convolution scheme. The decoder is used to decode the features output by the encoder and the features of the skip connections in order to segment the target region in medical images.

3. The edge-guided medical image segmentation method according to claim 2, characterized in that... The encoder's processing flow specifically includes the following steps: The input image is divided into patches of a set size; then it is processed by depthwise separable convolution and linear embedding to map to a feature space of a set dimension and obtain initial features; The initial features are processed sequentially through the encoding input Path embedding module, the encoding first gated hybrid visual state modeling module, the encoding first Path embedding module, the encoding second gated hybrid visual state modeling module, the encoding second Path embedding module, the encoding third gated hybrid visual state modeling module, the encoding third Path embedding module, and the encoding fourth gated hybrid visual state modeling module to obtain the encoder's output features; Specifically, the output of the input Path embedding module is used as the first intermediate feature; the output of the first Path embedding module is used as the second intermediate feature; the output of the second Path embedding module is used as the third intermediate feature; the output of the third Path embedding module is used as the fourth intermediate feature; and the first to fourth intermediate features are all used as the input of the skip connection module.

4. The edge-guided medical image segmentation method according to claim 3, characterized in that... The decoder's processing flow specifically includes the following steps: The encoder's output features are processed by the decoding input gated hybrid vision state modeling module to obtain the decoded input features; the decoded input features are summed with the fourth feature of the jump connection output by the jump connection module to obtain the fourth summed feature; the fourth summed feature is processed sequentially by the decoding first patch extension module and the decoding first gated hybrid vision state modeling module to obtain the decoded first feature; the decoded first feature is summed with the third feature of the jump connection output by the jump connection module to obtain the third summed feature; The fourth summation feature is used as a high-dimensional feature, and the third summation feature is used as a low-dimensional feature. Together with the edge attention map output by the skip connection module, they are input into the first cross-scale alignment module for decoding. The output of the first cross-scale alignment module is then processed by the decoding second patch extension module and the decoding second gated hybrid visual state modeling module to obtain the decoded second feature; the decoded second feature is summed with the jump connection second feature output by the jump connection module to obtain the second summed feature; The third summation feature is used as a high-dimensional feature, and the second summation feature is used as a low-dimensional feature. Together with the edge attention map output by the skip connection module, they are input into the second cross-scale alignment module for decoding. The output of the second cross-scale alignment module is then processed sequentially by the third Patch extension module, the third gated hybrid visual state modeling module, and the decoding output projection module to obtain the final image segmentation result. The decoding output projection module is a convolution module.

5. The edge-guided medical image segmentation method according to claim 4, characterized in that... The structures of the first gated hybrid visual state modeling module, the fourth gated hybrid visual state modeling module, the first gated hybrid visual state modeling module, the third gated hybrid visual state modeling module, and the input gated hybrid visual state modeling module are all the same. The processing steps of the gated hybrid vision state modeling module include the following: Input features Normalization is performed to obtain normalized features. for , This is a normalization process; The normalized features are projected through three linear layers to obtain the query features. for Key features for Sum value characteristics for ;in, For querying the matrix, The key matrix, It is a value matrix; Calculate the attention weights for , in Let k be the neighborhood window centered at position i, and k be the position index within the window. The feature dimensions of the query and key in the l-th layer attention; Calculate individual local features for j is the neighborhood window Internal location index; local features comprised of all individual local features ; The normalized features are processed using a two-dimensional state-space modeling scheme to obtain global features. ; The gating weight value is calculated. for ,in For the gated matrix, Use the Sigmoid activation function; Finally, the output of the gated hybrid vision state modeling module is calculated. for ,in For element-wise multiplication, This is a random depth operation.

6. The edge-guided medical image segmentation method according to claim 5, characterized in that... The processing procedure of the jump connection module specifically includes the following steps: Set the Sobel convolution kernel in the horizontal direction Sobel convolution kernels in the vertical direction ; Encode the first intermediate feature Through respectively and Processing yields the first horizontal gradient. for First vertical gradient for ; Encode the fourth intermediate feature Through respectively and Processing yields the fourth level gradient. for Fourth vertical gradient for ; The first initial edge response map was calculated. for Simultaneously, the fourth initial edge response map was calculated. for ,in This is the set numerical stability constant; Will and Adding them together yields the first intermediate primary feature. ,Will and Adding them together yields the fourth intermediate primary feature. ; Will pass The first intermediate feature is obtained by compressing the channel dimension of the convolution. ,Will pass The fourth intermediate feature is obtained by compressing the channel dimension of the convolution. ; The single-channel edge response map is calculated using the following formula. : In the formula for The convolution process; It is the ReLU activation function; for The convolution process; For channel splicing operations; This is an upsampling operation; Will The edge attention map is obtained by normalization using the Sigmoid function. for ; Encode the second intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the second feature of the skip connection. ; Encode the third intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the third feature of the skip connection. ; Encode the fourth intermediate feature Processed via the Channel-Spatial Attention Module (CBAM), and then upsampled... After performing element-wise multiplication, then through The convolution is processed to obtain the fourth feature of the skip connection. .

7. The edge-guided medical image segmentation method according to claim 6, characterized in that... The decoding first cross-scale alignment module and the decoding second cross-scale alignment module have the same structure; the processing procedure of the cross-scale alignment module specifically includes the following steps: Bilinear interpolation upsampling is performed on the input high-dimensional features to obtain high-dimensional sampled features. This ensures that the obtained features have the same resolution as the low-dimensional features; Will The structural enhancement features are obtained by averaging the outputs of three sets of depthwise separable convolutions with different dilation rates. for ,in For depthwise separable convolution operations with an inflation rate set to the d-th value; Input low-dimensional features and structural enhancement features Perform linear projection of the query, key, and value to obtain scale-aligned query features. for Scale alignment key features for and scale alignment value features for ,in This is the query matrix in the scale alignment module. This refers to the key matrix in the scale alignment module. This is the value matrix in the scale alignment module; edge attention map Resampling to Consistent size yields resampled edge attention maps Then, the attention weights under edge guidance are calculated by processing the data through an embedding function to generate additivity biases. for ,in The softmax activation function is used. For channel attention branches, consider the feature dimensions of the query and key vector. This refers to the process of embedding functions; Calculate attention features for ; The output features of the cross-scale alignment module are calculated using the following formula. : In the formula For ReLU functions; For batch normalization operation; for Convolution operations; This is a channel-dimensional splicing operation.

8. An imaging method comprising the edge-guided medical image segmentation method according to any one of claims 1 to 7, characterized in that... It also includes the following steps: S6. The segmentation results of the medical image obtained in step S5 are marked and re-imaged on the original medical image to obtain a medical image with the segmentation results.