Blood vessel segmentation method based on improved U-shaped network
By improving the U-shaped network method, combining data enhancement, multi-scale feature fusion and frequency domain learning modules, the problem of insufficient noise sensitivity and generalization in retinal vascular segmentation of fundus images is solved, and segmentation accuracy and robustness are improved.
Patent Information
- Application Number
- CN202411260165.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The existing fundus image retinal vascular segmentation method is not sensitive to noise, has insufficient robustness and generalization, and lacks adaptive learning ability, resulting in poor segmentation effect.
Using an improved U-shaped network method, the segmentation of the model is improved through data augmentation, multi-scale feature fusion, dual-domain band-shaped attention mechanism, Mamba lightweight decoder, global feature fusion, spatial channel attention mechanism and frequency domain learning module. Accuracy and generalization capability.
It improves the accuracy and generalization of retinal vascular segmentation, reduces the risk of overfitting, and enhances the model's robustness to noise and its ability to segment small blood vessels.
Smart Images

Figure CN119228813A_ABST
Abstract
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, etc. can cause retinal vascular lesions. Therefore, fundus examination can be used to analyze and determine the type and severity of the disease. The fundus images captured by the fundus camera have important clinical diagnostic value. Since manual analysis by doctors is inefficient and costly, it is of great use value to use computer-aided diagnosis technology to automatically segment retinal blood vessels in fundus images.
[0003] At present, the methods for retinal blood vessel segmentation in fundus images are mainly divided into traditional segmentation methods and deep learning methods. Traditional methods include edge detection methods such as Sobel and Canny, threshold segmentation methods, region growing methods, and morphological operations. However, traditional methods are sensitive to noise, have poor robustness and generalization, and have poor segmentation effects on small blood vessels and lesion areas. These shortcomings limit the application of traditional methods in actual clinical practice and promote the continuous development of deep learning technology. The most famous of these is the U-Net model, which has the advantage of its symmetrical encoder-decoder structure and jump connection, which can fuse multi-level features to achieve image segmentation. Inspired by the U-Net model, some variants of the U-Net model have emerged in the field of deep learning.
[0004] "SA-UNet: Spatial attention U-Net for retinal vessel segmentation" proposed a spatial attention U-Net model for retinal vessel segmentation. "A data-aware deep supervised method for retinal vessel segmentation" introduced a deep supervision module in the segmentation network, in which the supervision layer can increase the attention to fine blood vessels. The U-Net network and its variants have shown excellent performance on retinal fundus images, but lack the ability of adaptive learning and insufficient generalization. Affected by various noise factors in fundus images, the robustness is insufficient. In addition, due to the loss of information, there is still 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 in that it includes the following steps:
[0007] S1: Obtain a fundus image dataset, perform data enhancement on the segmented fundus image to obtain a preprocessed fundus image, and divide the preprocessed fundus image into a training set and a test set;
[0008] S2: Construct 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 color fundus image public 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 band 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, the global features are fused with the 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] Part 1: input layer and hidden layer, each convolution structure of the input layer and hidden layer is exactly the same; in this part, the feature map is first downsampled through the pooling layer, and then the feature is extracted through the convolution layer, and the two are connected by cascade;
[0019] Batch normalization is performed after each convolutional layer and connected with the LeakyRelu activation function, which is then further connected with the Dropout layer to set part of the input to zero;
[0020] The parameters of the convolution layer and pooling layer are set as follows: the convolution kernel size is 3×3, the step size is 1, and the number of convolution kernels is 32, 64, 96, 128, and 256 respectively; the pooling layer uses the maximum pooling operation, and its convolution kernel size is 2×2 and the step size is 2;
[0021] Part II: Feature fusion module, which fuses input features through standard convolution and dilated convolution; the feature fusion module includes three convolution layers, the input feature map is added after passing through the three convolution layers, and connected to the batch normalization layer; the specific parameters are set as follows: the sizes of the convolution kernels are 1, 3, and 3 respectively, and the dilation rate of the dilated convolution is 2, and the padding is 0, 1, and 2 respectively;
[0022] The feature fusion module formula is as follows:
[0023]
[0024] Among them, X is input and Y is output;
[0025] Part III: Dual-domain banded attention module, which combines global banded attention and local banded attention. In the encoder, the dual-domain banded attention mechanism is applied to the intermediate process. The convolution kernel sizes of the global banded attention module are 7 and 11 respectively, which are consistent with the local banded attention module. After that, the output feature maps processed by the global banded attention and local banded attention operations are concatenated to integrate attention information of different scales.
[0026] The formula of the dual-domain banded attention module is as follows:
[0027] X′=Conv 1×1 (GSA k=7 (X)+GSA k=11 (X)+GSA global (X)) (2)
[0028] Among them, GSA global represents the global banded attention mechanism in the whole range, 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 concatenation 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 convolutions, passing the input directly to the output via residual connections;
[0035] A global feature fusion mechanism and a spatial channel attention mechanism are used at the end of the decoder; 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, and then splices it in the channel dimension, and further realizes feature fusion through convolution operation; 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;
[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 deep convolution and point convolution. The residual connection directly adds the input features to the convolution output to fuse features at different levels.
[0039] Part II: A global context module, which effectively integrates global context features into image features by simplifying the calculation 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 ith position, x i represents the feature of the i-th position in the input feature map, W 1×1 represents 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, It 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 average pool and max pool the feature map output by the last layer of the decoder in the channel direction, concatenate the two generated two-dimensional feature maps, and finally generate a spatial attention map through a 7×7 convolution layer; 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 the 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. At the same time, the frequency domain learning module is introduced;
[0053] The introduced frequency domain learning module is composed of a high-frequency image representation module and a high-frequency feature representation module;
[0054] 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;
[0055] The high-frequency feature representation module is used to perform the same operation 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 that the inverse Fourier transform is performed in the spatial dimension and the high-frequency components are extracted. 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] Inputting the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model;
[0065] 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.
[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 the present invention adopts preprocessing methods such as data enhancement 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 make full use of multi-scale information, and combines 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.
[0070] Figure 1 It is a simplified flow chart of the blood vessel segmentation method based on the improved U-shaped network of the present invention;
[0071] Figure 2 It is a schematic diagram of the structure 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 further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0074] See 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 image to obtain a preprocessed fundus image, and divide the preprocessed fundus image into a training set and a test set, specifically including the following steps:
[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 enhancement is performed on the fundus color image to expand the data set. The specific image enhancement 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 blood vessels in fundus images. The constructed convolutional neural network model for fundus image segmentation includes a hybrid attention mechanism (i.e., the dual-domain band attention mechanism is implemented by the dual-domain band attention module), a feature fusion module, a codec module, and a frequency domain learning module;
[0086] Among them, the fundus image segmentation convolutional neural network model follows the U-Net architecture. In each layer of the encoder, the present invention introduces a multi-scale feature fusion module, which extracts multi-scale features in the input feature map through three different convolution operations (1×1 convolution, 3×3 convolution, 3×3 dilated convolution). By fusing these features, a richer and more comprehensive feature expression can be obtained. After that, 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 ability of the feature map.
[0087] The dual-domain banded attention mechanism consists of three main parts, namely, global average pooling to extract global features, local average pooling to extract local features, and finally feature fusion of global features and local features to extract global and local frequency domain features, so that important information in the image can be better captured. As for the improvement of the decoder, the Mamba lightweight decoder, global feature fusion mechanism and spatial channel attention mechanism are introduced in the decoder module of the original network.
[0088] The Mamba lightweight decoder is a residual upsampling module that includes normalization, activation, and depth-wise separable convolution. It passes the input directly to the output through a residual connection, helping the model capture more features while maintaining computational efficiency. A global feature fusion mechanism and a spatial channel attention mechanism are used at the end of the decoder.
[0089] The global feature fusion mechanism can effectively integrate different information of input features and improve the quality of feature representation through global context feature extraction and convolution operations. The spatial attention mechanism can adaptively adjust important information in the feature map to improve the performance of the model. Finally, high-frequency image representation and high-frequency feature representation modules (i.e., frequency domain learning modules) are introduced on the basis of erasing high-confidence predictions. On the one hand, the uncertainty of training data is increased; on the other hand, by extracting and utilizing high-frequency information, the model's dependence on specific training sources is reduced, thereby improving the generalization ability of the model.
[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: Input layer and hidden layer, input the fundus image after preprocessing in step S1. The convolution structure of each layer of the input layer and the hidden layer is exactly the same. In this part, the feature map is first downsampled through the pooling layer, and then the feature is extracted through the convolution layer, which are cascaded connections. Batch normalization is performed after each convolution layer, and it is connected with the LeakyRelu activation function, which can alleviate the problem of zero gradient in negative areas, and then further connected with the Dropout layer to set part of the input to zero to reduce overfitting. The parameters are set as follows: the convolution kernel size is 3×3, the step size is 1, and the number of convolution kernels is: 32, 64, 96, 128, 256. The pooling layer uses the maximum pooling operation, and its convolution kernel size is 2×2, and the step size is 2.
[0093] Part II: Feature Fusion Module. This module uses standard convolution and dilated convolution to fuse input features. Through these operations, feature information of different scales can be captured and finally combined to enhance feature representation capabilities. The feature fusion module includes three convolution layers. The input feature map is added after passing through three convolution layers and connected to a batch normalization layer. The specific parameters are set as follows: the sizes of the convolution kernels 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 banded attention module captures contextual information of different scales by using GSA and LSA with different band 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 band operations, effectively expanding the receptive field of the network. By simplifying the attention weight generation process and adopting lightweight convolution branches, this significantly reduces the computational complexity and improves the computational efficiency.
[0099] Specifically, the convolution kernel sizes of the global band attention module are 7 and 11 respectively, which are consistent with the local band attention module. Then, the output feature maps processed by the global band attention and local band attention operations are concatenated to integrate the attention information of different scales. The joint action of these modules enables the network to process feature maps in detail at different scales.
[0100] The formula of the dual-domain banded 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 concatenation 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] Part 1: Double upsampling module, the input of the hidden layer is the output of the last layer of the encoder after feature fusion. In this part, the feature map of the previous layer is upsampled to the same spatial size as the feature map of the current layer through bilinear interpolation, and then spliced in the channel dimension, and further through the convolution operation to achieve the purpose of 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. It is a residual upsampling module, which includes two normalization layers and a Relu activation function, and then extracts features through a combination of deep convolution and point convolution. There is also a residual connection to add the input features directly to the convolution output to fuse features at different levels. This process can not only restore the spatial resolution of the feature map, but also fuse features at different levels, improving the expression ability and segmentation accuracy of the model.
[0109] The second part is the global context module, which effectively integrates the global context features into the image features by simplifying the calculation of non-local blocks. This 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.
[0110] The formula of the global context module is as follows:
[0111]
[0112] Among them, α i represents the attention weight of the ith position, x i represents the feature of the i-th position in the input feature map, W 1×1 represents 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, It represents element-by-element addition.
[0117] Part 3: Channel spatial attention mechanism. This module improves segmentation accuracy by combining channel attention and spatial attention. 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. Spatial attention performs average pooling and maximum pooling on the feature map output by the last layer of the decoder in the channel direction, concatenates the two generated two-dimensional feature maps, and finally generates a spatial attention map through a 7×7 convolution layer. The two attention maps are normalized using the sigmoid activation function.
[0118] (3) Generalizer: In order to enhance the generalization ability of the model, the network uses a clue erasing 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 the 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 that the inverse Fourier transform is performed in the spatial dimension and the high-frequency components are extracted. 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: Use the preprocessed fundus images to train the fundus image segmentation convolutional neural network model until the network model converges. During the training process, the fundus image is first input into the network, and features are extracted through convolution operations during the downsampling process. The multi-scale feature fusion mechanism and dual-domain banded attention mechanism are used to improve the effect of feature extraction. During the upsampling process, the Mamba lightweight decoder is combined to gradually restore the high-resolution image, and the global feature fusion method and spatial channel attention mechanism are used to further improve the performance. In addition, the frequency domain learning module is used to further improve the generalization of the model.
[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] Inputting 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; inputs the target domain test set into the model to obtain the retinal vascular segmentation results of the fundus image.
[0130] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, 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 image to obtain a preprocessed fundus image, and divide the preprocessed fundus image into a training set and a test set; S2: Construct a convolutional neural network model for fundus image segmentation to accurately segment retinal blood vessels in fundus images; 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 color fundus image public 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: 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, the multi-scale features in the input feature map are extracted, the extracted features are fused, and 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 band attention mechanism is continued to be used to enhance the representation ability of the feature map; 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, the global features are fused with the local features to extract global and local frequency domain features.
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, each convolution structure of the input layer and hidden layer is exactly the same; in this part, the feature map is first downsampled through the pooling layer, and then the feature is extracted through the convolution layer, and the two are connected by cascade; Batch normalization is performed after each convolutional layer and connected with the LeakyRelu activation function, which is 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 step size is 1, and the number of convolution kernels is 32, 64, 96, 128, and 256 respectively; the pooling layer uses the maximum pooling operation, and its convolution kernel size is 2×2 and the step size is 2; Part II: Feature fusion module, which fuses input features through standard convolution and dilated convolution; the feature fusion module includes three convolution layers, the input feature map is added after passing through the three convolution layers, and connected to the batch normalization layer; the specific parameters are set as follows: the sizes of the convolution kernels are 1, 3, and 3 respectively, and 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, which combines global banded attention and local banded attention. In the encoder, the dual-domain banded attention mechanism is applied to the intermediate process. The convolution kernel sizes of the local banded attention module are 7 and 11 respectively, which are consistent with the local banded attention module. After that, the output feature maps processed by the global banded attention and local banded attention operations are concatenated to integrate attention information of different scales. The formula of the dual-domain banded attention module is as follows: X′=Conv 1×1 (GSA k=7 (X)+GSA k=11 (X)+GSA global (X)) (2) Among them, X′ represents the output feature map, GSA global Represents the global band attention mechanism, GSA k=7 (X) AND GSA k=11 (X) represents the global band attention mechanism with convolution kernel size of 7 and 11; X1, X2 = Split(X′) (3) Among them, Split means feature splitting in the channel dimension, X1 and X2 respectively represent the two parts of features after splitting; Among them, LSA represents the local band attention mechanism; [,] represents feature concatenation in the channel dimension, Represents the output features.
6. The blood vessel segmentation method based on the improved U-shaped network according to claim 5, characterized in that: 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; The Mamba lightweight decoder is a residual upsampling module that includes normalization, activation, and depthwise separable convolutions, passing the input directly to the output via residual connections; A global feature fusion mechanism and a spatial channel attention mechanism are used at the end of the decoder; 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.
7. The blood vessel segmentation method based on the improved U-shaped network according to claim 6, 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, and then splices it in the channel dimension, and further realizes feature fusion through convolution operation; 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. 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 deep convolution and point convolution. The residual connection directly adds the input features to the convolution output to fuse features at different levels. Part II: A global context module, which effectively integrates global context features into image features by simplifying the calculation 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: Among them, α i represents the attention weight of the ith position, x i Represents the feature of the i-th position in the input feature map, W1 ×1 represents a convolution operation with a convolution kernel size of 1×1, x m represents the mth feature map; Among them, f() represents the bottleneck transformation operation, Represents global context features; Among them, yi represents the feature of the i-th position in the output feature map, It means adding elements one by one; Part III: Channel-spatial 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 average pool and max pool the feature map output by the last layer of the decoder in the channel direction, concatenate the two generated two-dimensional feature maps, and finally generate a spatial attention map through a 7×7 convolution layer; finally, the two attention maps are normalized using the sigmoid activation function.
8. The blood vessel segmentation method based on the improved U-shaped network according to claim 6, 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.
9. The blood vessel segmentation method based on the improved U-shaped network according to claim 8, 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 the 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. At the same time, the frequency domain learning module is introduced; 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 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; The high-frequency feature representation module is used to perform the same operation 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: 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 output features; in, Indicates that the inverse Fourier transform is performed in the spatial dimension and the high-frequency components are extracted. FFT W,H Indicates the Fourier transform of the input features in the spatial dimension, X i Represents input features; in, Indicates that the inverse Fourier transform is performed on the channel dimension and the high-frequency components are extracted. FFT C Represents the Fourier transform of the input features in the channel dimension.
10. 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: Inputting the fundus image to be segmented into the trained fundus image segmentation convolutional neural network model; 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.
Citation Information
Patent Citations
Eye fundus image blood vessel segmentation method based on multi-scale channel fusion and space activation
CN116071411A
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
Medical image segmentation method based on u-shaped network
WO2022199143A1
Cited By
Method and system for positioning drill rod of trenchless drilling machine based on image segmentation
CN119693461A
Lightweight image restoration method and device based on multi-scale features, and medium
CN120374463A
Retina artery and vein blood vessel image segmentation method and device
CN121074956A
