Vessel segmentation method based on improved u-shaped network

By improving the data enhancement, multi-scale feature fusion and hybrid attention mechanism of the U-net, combined with the Mamba lightweight decoder and frequency domain learning module, the problem of insufficient generalization of the U-Net model in retinal vessel segmentation of fundus images is solved, and higher segmentation accuracy and robustness are achieved.

CN119228813BActive Publication Date: 2025-10-10FUJIAN AGRI & FORESTRY UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411260165.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-10-10
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

The existing U-Net model lacks adaptive learning ability, insufficient generalization and robustness in retinal vessel segmentation of fundus images, and is sensitive to noise, resulting in poor segmentation results.

Method used

An improved U-shaped network is adopted to improve the segmentation accuracy and generalization ability of the model through data enhancement, multi-scale feature fusion, hybrid attention mechanism, Mamba lightweight decoder, global feature fusion, spatial channel attention and frequency domain learning module.

Benefits of technology

The accuracy of retinal vessel segmentation and the generalization ability of the model are improved, the dependence on training data is reduced, the robustness to noise is enhanced, and overfitting is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228813B_ABST
    Figure CN119228813B_ABST
Patent Text Reader

Abstract

The application discloses a blood vessel segmentation method based on an improved U-shaped network, and comprises the following steps: S1, acquiring fundus image data sets, performing data enhancement on fundus images to be segmented, obtaining preprocessed fundus images, and dividing the preprocessed fundus images into a training set and a test set; S2, constructing a fundus image segmentation convolutional neural network model for accurately segmenting retinal blood vessels in the fundus images; S3, training the fundus image segmentation convolutional neural network model using the preprocessed fundus images until the network model converges; and S4, inputting the fundus images to be segmented into the trained fundus image segmentation convolutional neural network model to obtain fundus image retinal blood vessel segmentation results. The application can accurately segment fine blood vessels and low-contrast blood vessel structures, and improves the generalization and robustness of the network model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image processing, and in particular to a method for segmenting retinal blood vessels in fundus images based on an improved U-shaped network. Background Art

[0002] Diabetes, hypertension, cardiovascular disease, and other conditions can cause retinal vascular lesions. Therefore, fundus examinations can be used to analyze and determine the type and severity of the disease. Fundus images captured by a fundus camera have significant clinical diagnostic value. Because manual analysis by doctors is inefficient and costly, the use of computer-aided diagnosis (CAD) technology to automatically segment retinal vessels in fundus images is of great value.

[0003] Current methods for retinal vessel segmentation in fundus images are primarily divided into traditional segmentation methods and deep learning approaches. Traditional methods include edge detection methods such as Sobel and Canny, threshold segmentation, region growing, and morphological operations. However, these methods are sensitive to noise, suffer from poor robustness and generalization, and are ineffective at segmenting small vessels and lesions. These shortcomings limit their practical clinical application and have prompted the continued development of deep learning technology. The most well-known of these is the U-Net model, which boasts a symmetrical encoder-decoder structure and skip connections, enabling the fusion of multi-level features for image segmentation. Inspired by the U-Net model, several variants have emerged in the deep learning field.

[0004] "SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation" proposes a spatial attention U-Net model for retinal vessel segmentation. "A Data-Aware Deep Supervised Method for Retinal Vessel Segmentation" introduces a deep supervision module into the segmentation network, where the supervision layer increases attention to fine vessels. U-Net networks and their variants demonstrate excellent performance on retinal fundus images, but lack adaptive learning capabilities and generalization. They are also affected by various noise factors in fundus images and lack robustness. Furthermore, due to information loss, there is room for improvement in processing local feature maps. Summary of the Invention

[0005] To solve the above problems, the present invention proposes a method for retinal blood vessel segmentation in fundus images based on an improved U-shaped network to improve the segmentation accuracy and generalization ability of the model.

[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is: a blood vessel segmentation method based on an improved U-shaped network, characterized by comprising the following steps:

[0007] S1: Obtain a fundus image dataset, perform data enhancement on the segmented fundus images to obtain preprocessed fundus images, and divide the preprocessed fundus images into a training set and a test set;

[0008] S2: Build a convolutional neural network model for fundus image segmentation to accurately segment retinal blood vessels in fundus images;

[0009] S3: Use the preprocessed fundus images to train the fundus image segmentation convolutional neural network model until the network model converges;

[0010] S4: Input the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model to obtain the fundus image retinal blood vessel segmentation result.

[0011] Furthermore, S1 specifically includes the following steps:

[0012] S1.1: Obtain fundus images from three public color fundus image databases: DRIVE, STARE, and CHASE_DB1;

[0013] S1.2: Use horizontal random rotation and vertical random rotation to perform data augmentation on the original dataset.

[0014] Furthermore, the fundus image segmentation convolutional neural network model described in S2 is based on the U-Net architecture. A multi-scale feature fusion module is introduced into the model. Through three different convolution operations, namely 1×1 convolution, 3×3 convolution, and 3×3 dilated convolution, multi-scale features in the input feature map are extracted, and the extracted features are fused. Then, batch normalization is used to standardize the fused features.

[0015] Furthermore, after the third convolution layer, after feature fusion, the dual-domain banded attention mechanism is continued to be used to enhance the representation ability of the feature map;

[0016] The dual-domain banded attention mechanism mainly consists of three parts: 1) global average pooling to extract global features; 2) local average pooling to extract local features; 3) finally, global features are fused with local features to extract global and local frequency domain features.

[0017] Furthermore, the encoder in the fundus image segmentation convolutional neural network model consists of the following three parts:

[0018] The first part includes an input layer and hidden layers, each layer of which has a convolutional structure identical to each other; in this part, the feature map is firstly down-sampled by a pooling layer and then extracted by a convolutional layer, both of which are connected by cascading connection;

[0019] Batch normalization operation is performed after each convolutional layer and connected with LeakyRelu activation function, and then further connected with Dropout layer to set part of the input to zero;

[0020] The convolutional layer and the pooling layer are set as follows: the convolution kernel size is 3*3, the step is 1, and the number of convolution kernels is 32, 64, 96, 128, and 256 in turn; the pooling layer adopts the maximum pooling operation, and the convolution kernel size is 2*2 and the step is 2;

[0021] The second part includes a feature fusion module which fuses input features by standard convolution and dilated convolution; the feature fusion module includes three convolutional layers, and the input feature map is added after passing through the three convolutional layers and connected with a batch normalization layer; the specific parameter settings are as follows: the convolution kernel size is 1, 3, and 3 respectively, and the dilated rate of dilated convolution is 2, and the padding is 0, 1, and 2 respectively;

[0022] The formula of the feature fusion module is as follows:

[0023]

[0024] Wherein, X is the input, and Y is the output;

[0025] The third part includes a dual-domain strip attention module which combines global strip attention and local strip attention mechanisms; in the encoder, the dual-domain strip attention mechanism is applied in the middle process, the convolution kernel size of the global strip attention module is 7 and 11 respectively, which is consistent with the local strip attention module, and then the output feature maps processed by the global strip attention and the local strip attention are spliced to integrate attention information of different scales;

[0026] The formula of the dual-domain strip attention module is as follows:

[0027] X' = Conv 1×1 (GSA k=7 (X) + GSA k=11 (X) + GSA global (X) (2)

[0028] Wherein, GSA global represents the global strip attention mechanism in the full range, and X' represents the output feature;

[0029] X1, X2 = Split (X') (3)

[0030] Among them, Split means feature splitting in the channel dimension, X1 and X2 respectively represent the two parts of features after splitting;

[0031]

[0032] Among them, LSA represents the local band attention mechanism; [,] represents feature splicing in the channel dimension, Represents the output features.

[0033] Furthermore, the decoder module of the fundus image segmentation convolutional neural network model introduces a Mamba lightweight decoder, a global feature fusion mechanism, and a spatial channel attention mechanism;

[0034] The Mamba lightweight decoder is a residual upsampling module that includes normalization, activation, and depth-wise separable convolution, passing the input directly to the output via residual connections;

[0035] At the end of the decoder, a global feature fusion mechanism and a spatial channel attention mechanism are used; the global feature fusion mechanism extracts global context features and performs convolution operations; the spatial attention mechanism adjusts important information in the feature map by combining channel attention and spatial attention.

[0036] Furthermore, the decoder in the fundus image segmentation convolutional neural network model consists of the following three parts:

[0037] Part 1: Double upsampling module, where the input of the hidden layer is the output of the last layer of the encoder after feature fusion. The double upsampling module upsamples the feature map of the previous layer to the same spatial size as the feature map of the current layer through bilinear interpolation, then concatenates them in the channel dimension, and further implements feature fusion through convolution operation. The parameters are set as follows: convolution kernel size is 3×3, stride is 1, and the number of convolution kernels is 128, 96, 64, and 32 respectively.

[0038] A Mamba lightweight decoder is added after each hidden layer. The Mamba lightweight decoder is a residual upsampling module, which includes two normalization layers and a ReLU activation function. Features are then extracted through a combination of depthwise convolution and pointwise convolution. Residual connections add input features directly to the convolution output, fusing features from different levels.

[0039] Part II: The global context module effectively integrates global context features into image features by simplifying the computation of non-local blocks. The global context module undergoes three-stage operations: global attention pooling, bottleneck transformation, and feature fusion. The parameters are set as follows: the simplified non-local block convolution kernel size is 1×1 and the bottleneck ratio is 16.

[0040] The formula of the global context module is as follows:

[0041]

[0042] Among them, α i represents the attention weight of the i-th position, x i represents the feature of the i-th position in the input feature map, W 1×1 Indicates a convolution operation with a convolution kernel size of 1×1, x m represents the mth feature;

[0043]

[0044] Among them, f() represents the bottleneck transformation operation, Represents global context features;

[0045]

[0046] Among them, y i Represents the feature of the i-th position in the output feature map, Represents element-by-element addition.

[0047] Part III: Channel-Spatial Attention Mechanism, which improves segmentation accuracy by combining channel attention and spatial attention;

[0048] The channel attention performs global average pooling and global maximum pooling operations on the feature map output by the last layer of the decoder to obtain two feature vectors, and generates a channel attention map through a shared fully connected layer;

[0049] The spatial attention is to perform average pooling and maximum pooling on the feature map output by the last layer of the decoder in the channel direction, splice the two generated two-dimensional feature maps, and finally pass them through a 7×7 convolution layer to generate a spatial attention map; finally, the two attention maps are normalized using the sigmoid activation function.

[0050] Furthermore, the fundus image segmentation convolutional neural network model introduces a frequency domain learning module on the basis of erasing high confidence predictions.

[0051] Furthermore, the fundus image segmentation convolutional neural network model also includes a generalizer for enhancing the generalization ability of the model;

[0052] The network uses a clue erasure mechanism to erase some high-confidence predictions during training. The loss function randomly sets pixels with confidence levels above a threshold to 0, while also introducing a frequency domain learning module.

[0053] The introduced frequency domain learning module consists of a high-frequency image representation module and a high-frequency feature representation module;

[0054] The high-frequency image representation module converts the input image into the frequency domain using Fourier transform, applies Gaussian filtering to extract the high-frequency components in the image, and then uses inverse Fourier transform to convert the high-frequency information back to the image space;

[0055] The high-frequency feature representation module is used to perform the same operations on the spatial dimension and channel dimension of the feature map as the former, by extracting the high-frequency information of the feature map;

[0056] The formula of the frequency domain learning module is as follows:

[0057] x h =IF(B h (F(x))) (8)

[0058] Among them, F(x) represents the extraction of high-frequency components, B h is a high-pass filter, IF is the inverse Fourier transform, x h Represents the high-frequency component of the output;

[0059]

[0060] in, Indicates performing inverse Fourier transform in the spatial dimension and extracting high-frequency components, FFT W,H Indicates Fourier transform in spatial dimension, X i Represents the input feature at the i-th position;

[0061]

[0062] in, Indicates that the inverse Fourier transform is performed on the channel dimension and the high-frequency components are extracted. FFT C Indicates Fourier transform in the channel dimension, X i Represents the input feature at the i-th position.

[0063] Furthermore, step S4 is as follows:

[0064] Input the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model;

[0065] The training network sets the training data batch size to 4, the network learning rate to 0.0005, and the Adam optimizer is used for network parameter optimization. The loss function uses the Dice loss function and the regularization loss function. After 5000 iterations of training, the parameter model is saved.

[0066] The target domain test set is input into the model to obtain the retinal vessel segmentation results of the fundus image.

[0067] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:

[0068] Compared with the original classic U-Net fundus image retinal vessel segmentation network, the robust retinal vessel segmentation model based on the improved U-net proposed in this paper uses preprocessing methods such as data augmentation to expand the data set, ensuring the diversity of training data and preventing overfitting during network training; adopts a hybrid attention mechanism and multi-scale feature fusion to fully utilize multi-scale information, and combines it with Mamba to effectively improve the accuracy of retinal vessel segmentation; uses a frequency domain learning module and removes high-confidence predictions to improve the generalization of the model while maintaining computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0070] Figure 1 This is a simplified flowchart of the blood vessel segmentation method based on the improved U-shaped network of the present invention;

[0071] Figure 2 It is a structural diagram of the convolutional neural network model for fundus image segmentation;

[0072] Figure 3 This is the overall network architecture diagram. DETAILED DESCRIPTION

[0073] The present invention will be described in further detail below with reference to the accompanying drawings and examples. It is particularly noted that the following examples are intended only to illustrate the present invention and are not intended to limit the scope of the present invention. Similarly, the following examples are only some embodiments of the present invention and are not intended to be exhaustive. All other embodiments obtained by those of ordinary skill in the art without creative effort are intended to fall within the scope of protection of the present invention.

[0074] Refer to the attached Figure 1-3 As shown, this embodiment provides a blood vessel segmentation method based on an improved U-shaped network, which specifically includes the following steps:

[0075] S1: Obtain a fundus image dataset, perform data enhancement on the segmented fundus images to obtain preprocessed fundus images, and divide the preprocessed fundus images into a training set and a test set. Specifically, the steps include:

[0076] S1.1: Obtain fundus images from three public color fundus image databases: DRIVE, STARE, and CHASE DB1;

[0077] S1.2: Use horizontal random rotation and vertical random rotation to perform data augmentation on the original dataset.

[0078] In one embodiment, in order to increase the generalization and robustness of the model, data augmentation is performed on the fundus color images to expand the dataset. The specific image augmentation method is as follows:

[0079] 1) Flip the image horizontally;

[0080] 2) Flip the image vertically;

[0081] 3) Flip the image 45 degrees clockwise;

[0082] 4) Rotate the image 45 degrees counterclockwise.

[0083] The specific public image databases used for training and testing convolutional neural networks are shown in the following table:

[0084]

[0085] S2: Construct a convolutional neural network model for fundus image segmentation to accurately segment retinal vessels in fundus images. The constructed convolutional neural network model for fundus image segmentation includes a hybrid attention mechanism (i.e., the dual-domain banded attention mechanism is implemented by the dual-domain banded attention module), a feature fusion module, a codec module, and a frequency domain learning module.

[0086] Among them, the convolutional neural network model for fundus image segmentation follows the U-Net architecture. At each layer of the encoder, the present invention introduces a multi-scale feature fusion module, which extracts multi-scale features from the input feature map through three different convolution operations (1×1 convolution, 3×3 convolution, and 3×3 dilated convolution). By fusing these features, a richer and more comprehensive feature expression can be obtained. Afterwards, batch normalization is used to standardize the fused features. After the third layer of convolution, after feature fusion, the dual-domain banded attention mechanism is continued to be used to enhance the representation capability of the feature map.

[0087] The dual-domain banded attention mechanism consists of three main components: global average pooling to extract global features, local average pooling to extract local features, and finally, feature fusion of global and local features to extract global and local frequency domain features, better capturing important information in the image. Improvements to the decoder module include the introduction of the Mamba lightweight decoder, a global feature fusion mechanism, and a spatial channel attention mechanism into the decoder module of the existing network.

[0088] The Mamba lightweight decoder is a residual upsampling module that includes normalization, activation, and depthwise separable convolutions. It passes the input directly to the output via residual connections, helping the model capture more features while maintaining computational efficiency. A global feature fusion mechanism and spatial channel attention are used at the end of the decoder.

[0089] The global feature fusion mechanism effectively incorporates diverse information from input features through global context feature extraction and convolution operations, improving the quality of feature representation. The spatial attention mechanism adaptively adjusts important information within the feature map, thereby improving model performance. Finally, by removing high-confidence predictions, a high-frequency image representation and high-frequency feature representation module (i.e., a frequency domain learning module) is introduced. This increases the uncertainty of the training data while also reducing the model's reliance on specific training sources by extracting and utilizing high-frequency information, thereby improving the model's generalization capabilities.

[0090] Specifically, the fundus image segmentation convolutional neural network model structure in this embodiment is as follows:

[0091] (1) Encoder: The encoder consists of three parts, and the structure of each part is as follows:

[0092] Part 1: The input layer and hidden layer take the fundus image preprocessed in step S1 as input. The convolutional structures of each layer in the input and hidden layers are identical. In this part, the feature map is first downsampled by the pooling layer, and then extracted by the convolutional layer, which are connected in cascade. Batch normalization is performed after each convolutional layer and connected with the LeakyRelu activation function, which can alleviate the problem of zero gradients in negative regions. It is further connected with the Dropout layer, which sets part of the input to zero to reduce overfitting. The parameters are set as follows: convolution kernel size is 3×3, stride is 1, and the number of convolution kernels is: 32, 64, 96, 128, and 256, respectively. The pooling layer uses a maximum pooling operation, with a convolution kernel size of 2×2 and a stride of 2.

[0093] The second part is the feature fusion module. This module uses standard convolution and dilated convolution to fuse input features. These operations capture feature information at different scales and ultimately combine them to enhance feature representation. The feature fusion module consists of three convolutional layers. The input feature maps are summed after passing through these three convolutional layers and then connected to a batch normalization layer. The specific parameters are set as follows: the convolution kernel sizes are 1, 3, and 3, respectively, while the dilation rate of the dilated convolution is 2, and the padding is 0, 1, and 2, respectively.

[0094] The formula of the feature fusion module is as follows:

[0095]

[0096] Among them, X is input and Y is output;

[0097] Part III: Dual-domain Banded Attention Module, which combines global banded attention and local banded attention to enhance the selectivity of feature representation. In the encoder, the dual-domain banded attention mechanism is applied in the intermediate process.

[0098] Among them, the dual-domain strip attention module captures contextual information of different scales by using GSA and LSA with different strip sizes, thereby enhancing the ability to handle degradation problems of various sizes. GSA separates features into low-frequency and high-frequency components through frequency separation and modulation techniques, and modulates them using lightweight attention weights, so that it can selectively focus on information-rich frequencies. LSA aggregates the contextual information of each pixel in its neighboring positions through horizontal and vertical strip operations, effectively expanding the network's receptive field. By simplifying the attention weight generation process and adopting lightweight convolution branches, this significantly reduces computational complexity and improves computational efficiency.

[0099] Specifically, the convolution kernel sizes of the global banded attention module are 7 and 11, respectively, consistent with the local banded attention module. The output feature maps from the global and local banded attention operations are then concatenated to integrate attention information at different scales. The combined effect of these modules enables the network to perform detailed processing of feature maps at different scales.

[0100] The formula of the dual-domain strip attention module is as follows:

[0101] X′=Conv 1×1 (GSA k=7 (X)+GSA k=11 (X)+GSA global (X)) (2)

[0102] Among them, GSA globalrepresents the global banded attention mechanism in the whole range, X′ represents the output feature;

[0103] X1,X2=Split(X′) (3)

[0104] Among them, Split means feature splitting in the channel dimension, X1 and X2 respectively represent the two parts of features after splitting;

[0105]

[0106] Among them, LSA represents the local band attention mechanism; [,] represents feature splicing in the channel dimension, Represents the output features.

[0107] (2) Decoder: The decoder consists of three parts, and the structure of each part is as follows:

[0108] The first part is a double upsampling module. The input to the hidden layer is the output of the last encoder layer after feature fusion. In this module, the feature maps of the previous layer are upsampled to the same spatial size as the feature maps of the current layer through bilinear interpolation. They are then concatenated along the channel dimension, and further convolution is performed to achieve feature fusion. The parameters are set as follows: the convolution kernel size is 3×3, the stride is 1, and the number of convolution kernels is 128, 96, 64, and 32, respectively. A Mamba lightweight decoder is added after each hidden layer. This is a residual upsampling module consisting of two normalization layers and a ReLU activation function. Features are extracted through a combination of depthwise and pointwise convolutions. Residual connections are also used to directly add input features to the convolution output, fusing features from different levels. This process not only restores the spatial resolution of the feature maps but also fuses features from different levels, improving the model's expressiveness and segmentation accuracy.

[0109] The second part is the global context module, which effectively integrates global context features into image features by simplifying the computation of non-local blocks. This module operates through three stages: global attention pooling, bottleneck transformation, and feature fusion. The parameters are set as follows: the simplified non-local block convolution kernel size is 1×1, and the bottleneck ratio is 16.

[0110] The formula of the global context module is as follows:

[0111]

[0112] Among them, α i represents the attention weight of the i-th position, x i represents the feature of the i-th position in the input feature map, W 1×1 Indicates a convolution operation with a convolution kernel size of 1×1, x m represents the mth feature;

[0113]

[0114] Among them, f() represents the bottleneck transformation operation, Represents global context features;

[0115]

[0116] Among them, y i Represents the feature of the i-th position in the output feature map, Represents element-by-element addition.

[0117] The third part is the channel-wise spatial attention mechanism. This module improves segmentation accuracy by combining channel-wise and spatial-wise attention. Channel-wise attention performs global average pooling and global max pooling on the feature map output by the final decoder layer to generate two feature vectors. This is then used to generate a channel-wise attention map via a shared fully-connected layer. Spatial attention, on the other hand, performs channel-wise average pooling and max pooling on the feature map output by the final decoder layer. The two resulting two-dimensional feature maps are then concatenated and passed through a 7×7 convolutional layer to generate a spatial-wise attention map. Both attention maps are normalized using a sigmoid activation function.

[0118] (3) Generalizer: In order to enhance the generalization ability of the model, the network uses a clue erasure mechanism to erase some high-confidence predictions during the training process, and randomly sets the pixels with confidence higher than the threshold to 0 through the loss function. On this basis, the present invention continues to introduce a frequency domain learning module, which consists of a high-frequency image representation module and a high-frequency feature representation module. The high-frequency image representation module uses Fourier transform to convert the input image to the frequency domain, applies Gaussian filtering to extract the high-frequency components in the image, and then uses inverse Fourier transform to convert the high-frequency information back to the image space, thereby ensuring that the model pays more attention to important details in the image. The high-frequency feature representation module performs the same operations on the spatial dimension and channel dimension of the feature map as the former. By extracting the high-frequency information of the feature map, it reduces the dependence on the training source and enhances the generalization ability of the model.

[0119] The formula of the frequency domain learning module is as follows:

[0120] x h =IF(B h (F(x))) (8)

[0121] Among them, F(x) represents the extraction of high-frequency components, B h is a high-pass filter, IF is the inverse Fourier transform, x represents the input feature, x h Represents the high-frequency component of the output;

[0122]

[0123] in, Indicates performing inverse Fourier transform in the spatial dimension and extracting high-frequency components, FFT W,H Indicates Fourier transform in spatial dimension, X i Represents the input feature at the i-th position;

[0124]

[0125] in, Indicates that the inverse Fourier transform is performed on the channel dimension and the high-frequency components are extracted. FFT C Indicates Fourier transform in the channel dimension, X i Represents the input feature at the i-th position.

[0126] S3: The convolutional neural network model for fundus image segmentation is trained using preprocessed fundus images until convergence. During training, the fundus image is first input into the network. During downsampling, it undergoes convolution operations for feature extraction. A multi-scale feature fusion mechanism and a dual-domain banded attention mechanism are used to improve feature extraction. During upsampling, the model gradually recovers the high-resolution image using Mamba's lightweight decoder. Global feature fusion and a spatial channel attention mechanism are used to further improve performance. Furthermore, a frequency-domain learning module is implemented to further enhance the model's generalization.

[0127] S4: Input the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model to obtain the fundus image retinal blood vessel segmentation result, as follows:

[0128] Input the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model;

[0129] Among them, the training network sets the training data Batchsize to 4, sets the network learning rate to 0.0005, uses the Adam optimizer to optimize the network parameters, uses the Dice loss function and the regularization loss function as the loss function, and saves the parameter model after 5000 iterations of training; the target domain test set is input into the model to obtain the retinal vessel segmentation results of the fundus image.

[0130] The above descriptions are only some embodiments of the present invention and do not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A blood vessel segmentation method based on an improved U-shaped network, characterized in that: The steps include: S1: Obtain a fundus image dataset, perform data enhancement on the segmented fundus images to obtain preprocessed fundus images, and divide the preprocessed fundus images into a training set and a test set; S2: Constructing a convolutional neural network model for fundus image segmentation to accurately segment retinal blood vessels in fundus images. The convolutional neural network model is based on a U-Net architecture; the encoder of the convolutional neural network model adopts a dual-domain banded attention mechanism. The dual-domain banded attention mechanism consists of three main parts: 1) global average pooling to extract global features; 2) local average pooling to extract local features; 3) finally, global features are fused with local features to extract global and local frequency domain features. The dual-domain banded attention module combines the global banded attention and local banded attention mechanisms. The formula of the dual-domain banded attention module is as follows: in, represents the output feature map, represents the global banded attention mechanism, and Represents the global banded attention mechanism with convolution kernel sizes of 7 and 11; Among them, Split means feature splitting in the channel dimension. Respectively represent the two parts of features after splitting; in, and Respectively represent the local band attention mechanism with convolution kernel size of 7 and 11; [ , ] represents feature concatenation in the channel dimension, represents the output features; The decoder module of the fundus image segmentation convolutional neural network model introduces the Mamba lightweight decoder, the global feature fusion mechanism, and the spatial channel attention mechanism; The Mamba lightweight decoder is a residual upsampling module that includes normalization, activation, and depth-wise separable convolution, passing the input directly to the output via residual connections; At the end of the decoder, a global feature fusion mechanism and a spatial channel attention mechanism are used; the global feature fusion mechanism extracts global context features and performs convolution operations; the spatial channel attention mechanism adjusts important information in the feature map by combining channel attention and spatial attention; S3: Use the preprocessed fundus images to train the fundus image segmentation convolutional neural network model until the network model converges; S4: Input the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model to obtain the fundus image retinal blood vessel segmentation result.

2. The blood vessel segmentation method based on the improved U-shaped network according to claim 1, characterized in that: S1 specifically includes the following steps: S1.1: Obtain fundus images from three public color fundus image databases: DRIVE, STARE, and CHASE_DB1; S1.2: Use horizontal random rotation and vertical random rotation to perform data augmentation on the original dataset.

3. The blood vessel segmentation method based on the improved U-shaped network according to claim 1, characterized in that: A multi-scale feature fusion module is introduced into the fundus image segmentation convolutional neural network model described in S2. Through three different convolution operations, namely 1×1 convolution, 3×3 convolution, and 3×3 dilated convolution, the multi-scale features in the input feature map are extracted, and the extracted features are fused. Then, batch normalization is used to standardize the fused features.

4. The blood vessel segmentation method based on the improved U-shaped network according to claim 3, characterized in that: After the third convolution layer, after feature fusion, the dual-domain banded attention mechanism is continued to be used to enhance the representation ability of the feature map.

5. The blood vessel segmentation method based on the improved U-shaped network according to claim 4, characterized in that: The encoder in the fundus image segmentation convolutional neural network model consists of the following three parts: Part 1: Input layer and hidden layer. The convolution structure of each layer of the input layer and hidden layer is exactly the same. In this part, the feature map is first downsampled by the pooling layer, and then the feature is extracted by the convolution layer. The two are connected in cascade. Batch normalization is performed after each convolutional layer and connected with the LeakyRelu activation function, and then further connected with the Dropout layer to set part of the input to zero; The parameters of the convolution layer and pooling layer are set as follows: the convolution kernel size is 3×3, the stride is 1, and the number of convolution kernels is 32, 64, 96, 128, and 256 respectively; the pooling layer uses the maximum pooling operation, the convolution kernel size is 2×2, and the stride is 2; The second part is a feature fusion module that fuses input features through standard convolution and dilated convolution. The feature fusion module consists of three convolutional layers, where the input feature maps are summed after passing through the three convolutional layers and then connected to a batch normalization layer. The specific parameters are set as follows: the convolution kernel sizes are 1, 3, and 3 respectively, the dilation rate of the dilated convolution is 2, and the padding is 0, 1, and 2 respectively. The feature fusion module formula is as follows: Among them, X is input and Y is output; Part III: Dual-domain Banded Attention Module.

6. The blood vessel segmentation method based on the improved U-shaped network according to claim 5, characterized in that: The decoder in the fundus image segmentation convolutional neural network model consists of the following three parts: Part 1: Double upsampling module, where the input of the hidden layer is the output of the last layer of the encoder after feature fusion. The double upsampling module upsamples the feature map of the previous layer to the same spatial size as the feature map of the current layer through bilinear interpolation, then concatenates them in the channel dimension, and further implements feature fusion through convolution operation. The parameters are set as follows: convolution kernel size is 3×3, stride is 1, and the number of convolution kernels is 128, 96, 64, and 32 respectively. A Mamba lightweight decoder is added after each hidden layer. The Mamba lightweight decoder is a residual upsampling module, which includes two normalization layers and a ReLU activation function. Features are then extracted through a combination of depthwise convolution and pointwise convolution. Residual connections add input features directly to the convolution output, fusing features from different levels. Part II: The global context module effectively integrates global context features into image features by simplifying the computation of non-local blocks. The global context module undergoes three-stage operations: global attention pooling, bottleneck transformation, and feature fusion. The parameters are set as follows: the simplified non-local block convolution kernel size is 1×1 and the bottleneck ratio is 16. The formula of the global context module is as follows: in, represents the attention weight of the i-th position, represents the feature of the i-th position in the input feature map, Represents a convolution operation with a convolution kernel size of 1×1, represents the mth feature map; in, ( ) represents the bottleneck transformation operation, Represents global context features; in, Represents the feature of the i-th position in the output feature map, It means element-by-element addition; Part III: Channel-Spatial Channel Attention Mechanism, which improves segmentation accuracy by combining channel attention and spatial attention; The channel attention performs global average pooling and global maximum pooling operations on the feature map output by the last layer of the decoder to obtain two feature vectors, and generates a channel attention map through a shared fully connected layer; The spatial attention is to perform average pooling and maximum pooling on the feature map output by the last layer of the decoder in the channel direction, splice the two generated two-dimensional feature maps, and finally pass them through a 7×7 convolution layer to generate a spatial attention map; finally, the two attention maps are normalized using the sigmoid activation function.

7. The blood vessel segmentation method based on the improved U-shaped network according to claim 5, characterized in that: The fundus image segmentation convolutional neural network model introduces a frequency domain learning module on the basis of erasing high confidence predictions.

8. The blood vessel segmentation method based on the improved U-shaped network according to claim 7, characterized in that: The fundus image segmentation convolutional neural network model also includes a generalizer for enhancing the generalization ability of the model; The network uses a clue erasure mechanism to randomly set pixels with confidence levels above a threshold to 0 through a loss function, while also introducing a frequency domain learning module. The introduced frequency domain learning module is composed of a high-frequency image representation module and a high-frequency feature representation module; The high-frequency image representation module converts the input image into the frequency domain using Fourier transform, applies Gaussian filtering to extract the high-frequency components in the image, and then uses inverse Fourier transform to convert the high-frequency information back to the image space; The high-frequency feature representation module is used to perform the same operations on the spatial dimension and channel dimension of the feature map as the former, by extracting the high-frequency information of the feature map; The formula of the frequency domain learning module is as follows: in, Indicates the extraction of high-frequency components, is a high-pass filter, is the inverse Fourier transform, represents the input features, represents the output features; in, Indicates performing inverse Fourier transform in the spatial dimension and extracting high-frequency components. Indicates Fourier transform of input features in spatial dimension, Represents input features; in, Indicates performing inverse Fourier transform on the channel dimension and extracting high-frequency components. Represents Fourier transform of input features in the channel dimension.

9. The blood vessel segmentation method based on the improved U-shaped network according to claim 1, characterized in that: The S4 steps are as follows: Input the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model; The training network sets the training data batch size to 4, the network learning rate to 0.0005, and the Adam optimizer is used for network parameter optimization. The loss function uses the Dice loss function and the regularization loss function. After 5000 iterations of training, the parameter model is saved. The target domain test set is input into the model to obtain the retinal vessel segmentation results of the fundus image.

Citation Information

Patent Citations

  • Eye fundus image blood vessel segmentation method based on improved U-Net model

    CN116740080A

  • Eye fundus blood vessel image segmentation method based on visual attention fusion network

    CN117523202A