Retinal vessel segmentation method based on multi-scale consistency and attention mechanism

By constructing the MCAU-Net network model and combining attention refinement and context feature fusion modules, the problems of high time complexity and low segmentation accuracy in retinal vessel segmentation are solved, achieving effective segmentation of microvessels and capillaries and improving segmentation effect and efficiency.

CN115482388BActive Publication Date: 2026-11-27CHONGQING NORMAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211253630.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-13
Publication Date
2026-11-27
Estimated Expiration
2042-10-13

AI Technical Summary

Technical Problem

Existing retinal vessel segmentation methods are time-consuming on portable devices and suffer from problems such as vessel breakage and incomplete segmentation at the ends, making it difficult to effectively segment microvessels and capillaries.

Method used

A retinal vessel segmentation method based on multi-scale consistency and attention mechanism is adopted. By constructing the MCAU-Net network model and embedding attention refinement module and context feature fusion module, the ability to construct microvessels and capillaries is enhanced, background pixel weights are suppressed, and multi-scale consistency training method is adopted to improve the segmentation effect.

Benefits of technology

It improves the accuracy and efficiency of retinal vessel segmentation, reduces background noise interference, enhances the segmentation capability of microvessels and capillaries, and reduces time complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115482388B_ABST
    Figure CN115482388B_ABST
Patent Text Reader

Abstract

The application discloses a retinal blood vessel segmentation method based on multi-scale consistency and attention mechanism, and comprises the following steps: S1, constructing a retinal blood vessel segmentation network model based on multi-scale consistency and attention mechanism; S2, training the retinal blood vessel segmentation network model to obtain a trained network model; and S3, collecting a to-be-detected retinal blood vessel image, inputting the to-be-detected retinal blood vessel image into the trained network model, and outputting a segmentation result of the to-be-detected retinal blood vessel. The application can strengthen the construction capability of microvessels and capillaries, suppress the weight of irrelevant pixels such as background, and has low time complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of retinal vessels, and more specifically to a retinal vessel segmentation method based on multi-scale consistency and attention mechanisms. Background Technology

[0002] The lack of resources at the grassroots level greatly limits the implementation of large-scale fundus disease screening. Therefore, research on automated segmentation methods for retinal vessels is of great significance for the diagnosis and prevention of fundus diseases.

[0003] Currently, common methods for retinal vessel segmentation are divided into unsupervised and supervised methods. Unsupervised methods do not require manual labels and mainly focus on the information of the fundus retinal vessel image itself. Tavakoli et al. first used the Radon transform (RT) to enhance the overlapping vascular tree structure in the fundus retinal image, and then completed the subsequent refinement and reconstruction to achieve the segmentation effect. However, this method has too high a time complexity and is not convenient to deploy on portable devices. Supervised methods, on the other hand, use labels manually segmented by experts and leverage the advantage of neural networks to automatically extract features, thereby improving the classifier's ability to classify blood vessels and background pixels. Although existing supervised methods have gradually improved the segmentation accuracy, problems such as blood vessel breaks and missed segmentation of terminal blood vessels still exist.

[0004] Therefore, a retinal vessel segmentation method based on multi-scale consistency and attention mechanisms is needed to solve the above problems. Summary of the Invention

[0005] In view of this, the purpose of this invention is to overcome the defects in the prior art and provide a retinal vessel segmentation method based on multi-scale consistency and attention mechanism, which can enhance the ability to construct microvessels and capillaries, suppress the weights of irrelevant pixels such as background, and has low time complexity.

[0006] The retinal vessel segmentation method based on multi-scale consistency and attention mechanism of the present invention includes the following steps:

[0007] S1. Construct a retinal vessel segmentation network model based on multi-scale consistency and attention mechanisms;

[0008] S2. Train the retinal vessel segmentation network model to obtain a trained network model;

[0009] S3. Acquire images of the retinal vessels to be tested, input the images into the trained network model, and output the segmentation results of the retinal vessels to be tested.

[0010] Furthermore, a retinal vessel segmentation network model based on multi-scale consistency and attention mechanisms is constructed, specifically including:

[0011] S11. Construct an initial retinal vessel segmentation network model based on the U-Net network model;

[0012] S12. Construct an attention refinement module and embed the attention refinement module into the bottleneck feature layer of the initial retinal vessel segmentation network model;

[0013] S13. Construct a context feature fusion module and integrate the context feature fusion module into the initial retinal vessel segmentation network model; the context feature fusion module is used to fuse the features extracted by the encoder with the features restored by the decoder.

[0014] Furthermore, an attention refinement module is constructed using the following method:

[0015] S121. Perform channel average pooling operation P on feature F in the bottleneck feature. c The channel average weight feature X is obtained;

[0016] S122. Feed the channel average weight feature X into two branches, one of which is a horizontal pooling operation P. h Another branch is the vertical pooling operation P. w The P h X is used to capture the relationship between pixels in each row of F. h The P w Used to obtain the relationship between pixels in each column, resulting in X. w ;

[0017] S123. The horizontal feature X is obtained through matrix multiplication. h With vertical feature X w The two graphs are merged to generate a coarse attention map A. r ;

[0018] S124. Coarse Attention Graph A r Normalization is performed to scale the weights of all pixel positions to the range (0, 1), resulting in a refined attention map A.

[0019] S125. Redistribute the weights to the positions in feature F to obtain the final feature F. A .

[0020] Furthermore, the final feature F is determined according to the following formula. A :

[0021]

[0022] Where σ is the sigmoid operation; · is matrix multiplication. For Hadama accumulation, This is used to add the matrix elements.

[0023] Furthermore, a context feature fusion module is constructed using the following method:

[0024] Features F from the encoder e ∈R H×W×C and the features F of the upsampled previous layer decoder d ∈R H×W×C These serve as the two inputs to the context feature fusion module; where H, W, and C represent the length, width, and number of channels of the feature, respectively.

[0025] For feature F e and feature F d By fusing the features, we obtain the aggregated feature F. f ∈R H×W×2C .

[0026] Furthermore, the aggregation feature F is determined according to the following formula. f :

[0027]

[0028]

[0029] Among them, f mid ReLU represents the intermediate features of the initial fusion, and ReLU represents the activation function of the neuron. This involves adding matrix elements, where σ is the sigmoid operation. For Hadamard products, Θ represents the channel-based concatenation operation, W e and W d Both represent 1×1 convolution kernels, W fe and W fd Then they all represent combinations of continuous 1×1 and 3×3 convolution kernels.

[0030] Furthermore, the retinal vessel segmentation network model is trained to obtain a trained network model, specifically including:

[0031] S21. Full-size retinal vascular image I g As the first input, the cropped retinal vessel image I c As a second input;

[0032] S22. Make the first input and the second input pass through the same path in the retinal vessel segmentation network model, and use the set optimizer to train the retinal vessel segmentation network model to obtain a trained network model.

[0033] Furthermore, during the network model training process, a consistency loss L is added. conSupervise the two output branches of each layer's decoder to maintain consistency; where the two outputs are the complete outputs of the i-th layer. and cropping output

[0034] The

[0035] Where m represents the total number of layers in the decoder, and α is a hyperparameter; L mse Representing the mean squared error loss, the n represents the number of pixels.

[0036] Furthermore, the complete output of the retinal vessel segmentation network model is calculated. Segmentation loss L with ground truth label GT seg :L seg =β1L dice (x,y)+β2L bce (x,y);

[0037] Among them, L dice (x,y) represents the Dice loss function, L bce (x,y) represents the binary cross-entropy loss function, where β1 and β2 are weighting coefficients.

[0038] Furthermore, the consistency loss L con With segmentation loss L seg The sum is used as the overall loss of the retinal vessel segmentation network model.

[0039] The beneficial effects of this invention are as follows: The retinal vessel segmentation method disclosed herein, based on multi-scale consistency and attention mechanisms, refines redundant features in the bottleneck feature layer by embedding an attention-based refinement fusion module, suppressing the weights of irrelevant pixels such as background pixels. By combining a contextual feature fusion module with traditional skip connections, it supplements information gradually lost during feature extraction, enhancing the ability to construct microvessels and capillaries. A multi-scale consistency training method is designed using the network's multi-scale output, enhancing the network's sensitivity to features at different scales, strengthening its ability to capture both global and local features of the target, and improving the network's segmentation performance. Attached Figure Description

[0040] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0041] Figure 1 This is a diagram showing the overall structure of the retinal vessel segmentation network model of the present invention.

[0042] Figure 2 This is a diagram of the U-Net network structure of the present invention;

[0043] Figure 3 This is a schematic diagram illustrating the principle of the attention refinement module of the present invention;

[0044] Figure 4 This is a schematic diagram illustrating the principle of the context feature fusion module of the present invention. Detailed Implementation

[0045] The present invention will be further described below with reference to the accompanying drawings, as shown in the figures:

[0046] The retinal vessel segmentation method based on multi-scale consistency and attention mechanism of the present invention includes the following steps:

[0047] S1. Construct a retinal vessel segmentation network model based on multi-scale consistency and attention mechanism; the retinal vessel segmentation network model based on multi-scale consistency and attention mechanism is referred to as MCAU-Net (Multi-scale Consistency and Attention mechanism U-Net);

[0048] S2. Train the retinal vessel segmentation network model to obtain a trained network model;

[0049] S3. Acquire images of the retinal vessels to be tested, input the images into the trained network model, and output the segmentation results of the retinal vessels to be tested.

[0050] In this embodiment, step S1 involves constructing a retinal vessel segmentation network model based on multi-scale consistency and attention mechanisms, specifically including:

[0051] S11. Construct an initial retinal vessel segmentation network model based on the U-Net network model; wherein, the U-Net is a convolutional neural network model with a symmetrical encoder-decoder structure, as shown in the figure. Figure 2 As shown, the encoder extracts image features using a combination of convolutional layers, pooling layers, and activation functions, while the decoder reconstructs the image using deconvolution or bilinear interpolation. Features between the encoder and decoder are often referred to as bottleneck features. Skip connections send features generated by the encoder to the decoder at the same level. Lower-level features include more local information, while higher-level features include more global information. Through skip connections, the U-Net network integrates information from these two levels, resulting in better segmentation results.

[0052] S12. Construct an attention refinement module (ARM) and embed it into the bottleneck feature layer of the initial retinal vessel segmentation network model; by embedding the attention refinement module into the bottleneck feature part, the redundant retinal vessel features are refined, and the ability to extract fine vessels is improved.

[0053] S13. Construct a context fusion module (CFM) and integrate it into the initial retinal vessel segmentation network model. The CFM module is used to fuse the features extracted by the encoder with the features reconstructed by the decoder. In the decoder of the network model, the CFM module fuses the features extracted by the encoder with the features reconstructed by the decoder to fully utilize the low-level spatial information extracted by the encoder.

[0054] In this embodiment, retinal vascular images contain blood vessels of varying shapes and sizes. While segmentation networks can easily extract features of main blood vessels, they struggle to extract features of microvessels and capillaries. Even if some features are extracted in the superficial layers, they may be gradually lost or corrupted by noise in subsequent processes. Noise in the U-Net network propagates to the bottleneck feature layer through downsampling, causing artifacts that directly affect the final segmentation result. To address this issue, MCAU-Net embeds an attention refinement module into the bottleneck feature layer. This module encodes the weights of the entire image in both horizontal and vertical directions, enhancing the weights of blood vessel pixels while suppressing the weights of background pixels.

[0055] like Figure 3 As shown, the attention refinement module is constructed according to the following method:

[0056] S121. Perform channel average pooling operation P on feature F in the bottleneck feature. c We obtain the channel average weight feature X; where H, W, and C represent the length, width, and number of channels of the feature, respectively.

[0057] S122. Feed the channel average weight feature X into two branches, one of which is a horizontal pooling operation P. h Another branch is the vertical pooling operation P. w The P h X is used to capture the relationship between pixels in each row of F. h The P w Used to obtain the relationship between pixels in each column, resulting in X. w ;

[0058] S123. The horizontal feature X is obtained through matrix multiplication. hWith vertical feature X w The two graphs are merged to generate a coarse attention map A. r This allows the network to simultaneously acquire the spatial relationships within the entire image;

[0059] S124. Then apply the sigmoid function to the coarse attention map A. r A normalization operation is performed to scale the weights of all pixel positions to the range (0, 1), resulting in a refined attention map A; the attention map A contains attention weights related to high-level semantic pixels.

[0060] S125. After obtaining A, the weights are redistributed to the various positions in feature F to obtain the final feature F. A The allocation process involves performing a Hadamard product operation between the attention map A and the input feature F, and then adding it to feature F. Based on the obtained attention weights, the aim is to enhance blood vessel pixels and suppress background pixels, thereby enabling the network to better preserve the features of microvessels and capillaries.

[0061] The final feature F is determined according to the following formula. A :

[0062]

[0063] Where σ is the sigmoid operation; · is matrix multiplication. For Hadama accumulation, This is used to add the matrix elements.

[0064] In this embodiment, blood vessel pixels constitute only a small fraction of all pixels in the retinal image, while microvessels and capillaries account for an even smaller proportion. To fully utilize the extracted blood vessel features, U-Net's solution is to directly supplement the lost spatial information through skip connections. However, this method of directly stitching together different stages of the network is too simplistic and does not fully utilize the location information of retinal blood vessels, resulting in insufficient ability to construct microvessels and capillaries. To address this issue, this invention introduces a contextual feature fusion module after the skip connections, which can more effectively fuse features from the encoder and decoder to supplement the lost information.

[0065] like Figure 4 As shown, the context feature fusion module is constructed according to the following method:

[0066] Features F from the encoder e ∈R H×W×C and the features F of the upsampled previous layer decoder d ∈R H×W×C These serve as the two inputs to the context feature fusion module; where H, W, and C represent the length, width, and number of channels of the feature, respectively.

[0067] For feature F e and feature F d By fusing the features, we obtain the aggregated feature F. f ∈R H×W×2C .

[0068] The aggregation feature F is determined according to the following formula. f :

[0069]

[0070]

[0071] Among them, f mid ReLU represents the intermediate features of the initial fusion, and ReLU represents the activation function of the neuron. This involves adding matrix elements, where σ is the sigmoid operation. For Hadamard products, Θ represents the channel-based concatenation operation, W e and W d Both represent 1×1 convolution kernels, W fe and W fd Then they all represent combinations of continuous 1×1 and 3×3 convolution kernels.

[0072] That is, the two features F that need to be fused e With F d First, pass through W respectively e and W d Then, the two convolutional results are added together to obtain the preliminary fused feature f. squ ; Fusion feature f squ f is obtained through a linear activation function. mid It then splits into two branches, each undergoing two consecutive convolutional combinations W. fe and W fd Then compare the result with the original input feature F e and F d Perform a Hadamard product operation, and finally concatenate the features obtained from the two branches along the channel dimension to obtain the final aggregated feature F. f .

[0073] MCAU-Net uses CFM (Context Fusion Module) to replace the original skip connections between the encoder and decoder. However, CFM does not use a large number of convolution combinations. Instead, it uses a small number of convolutions and interoperability with the original features, thereby reducing computational overhead and network complexity. This achieves the goal of fusing the two input features as much as possible while also preserving the original information of the features appropriately.

[0074] In this embodiment, in image processing, it is difficult to discover image information at a certain scale, but this information can be extracted more easily at other scales. Multi-scale sampling allows for different granularities of image sampling, guiding the network to obtain different features at different scales, ultimately achieving the target task. In retinal vascular images, due to the blurring of vessel boundaries and reflections at the vessel center, feature information at different scales helps to better extract vascular information.

[0075] The MCAU-Net of this invention employs a consistency regularization training strategy. The key to consistency regularization training lies in constructing two distinct outputs. The original approach involves adding different noise to the outputs to achieve differentiation, artificially creating differences at the data level. However, in retinal image segmentation tasks, because the segmented objects occupy very few pixels, some regions may only contain one or two pixels, arbitrarily adding noise can cause artifacts in the segmentation results, leading to poor segmentation outcomes. Therefore, this invention uses a scale consistency training method to address this problem.

[0076] In step S2, the retinal vessel segmentation network model is trained to obtain a trained network model, specifically including:

[0077] S21. Full-size retinal vascular image I g As the first input, the cropped retinal vessel image I c As the second input; where the full-size image is a complete image, and the cropped image I c It is composed of complete image I g Four puzzle pieces of the same size can be cut and reassembled to form a complete image. g Using full-size and cropped images of retinal vessels as input ensures the integrity of large segmented regions while enabling the network to focus more accurately on the target segmented region, thus taking into account the continuity of blood vessels in the segmented region.

[0078] S22. The first and second inputs are made to pass through the same path in the retinal vessel segmentation network model. The retinal vessel segmentation network model is trained using a predefined optimizer to obtain a trained network model. Specifically, the Adam optimizer with default parameters is used for network model training, with an initial learning rate of 0.0005, a batch size of 1, and 100 training epochs.

[0079] In this embodiment, at the input end of the network model, MCAU-Net uses full-scale and cropped images at multiple scales; at the output end of the network model, MCAU-Net utilizes the characteristic that although the input of each layer decoder is different, the output is the same after the mosaic is stitched together, and adopts a consistent approach for training under multi-branch output.

[0080] During network model training, a consistency loss L is added. con Supervise the two output branches of each layer's decoder to maintain consistency; where the two outputs are the complete outputs of the i-th layer. and cropping output i=1,2,3...; such as Figure 1 As shown on the right, i takes the values ​​1, 2, 3, and 4.

[0081] Each layer's corresponding scale label is achieved by reducing the ground truth (GT) label to 1 / 2, 1 / 4, or 1 / 8 of its original size, to the same scale as the input image. The labels are represented using images.

[0082] The

[0083] Where m represents the total number of decoder layers, and in this embodiment, m is 4; α is a hyperparameter; L mse Representing the mean squared error loss, the n represents the number of pixels.

[0084] In this embodiment, as Figure 1 The right side shows the complete output of the retinal vessel segmentation network model. Segmentation loss L with ground truth label GT seg This is used to monitor the segmentation results of the network.

[0085] The L seg =β1L dice (x,y)+β2L bce (x,y);

[0086] Among them, L dice (x,y) represents the Dice loss function, L bce (x,y) represents the binary cross-entropy loss function, where β1 and β2 are weighting coefficients.

[0087] The x represents the prediction value of the segmentation network, y represents the true label, and n represents the number of pixels.

[0088] In this embodiment, the consistency loss L con With segmentation loss L seg The sum is used as the overall loss of the retinal vessel segmentation network model.

[0089] The retinal vessel segmentation method of this invention was applied to experiments, and the performance of MCAU-Net was verified using the publicly available datasets DRIVE and CHASE_DB1. The DRIVE dataset contains 40 color fundus images of the retina, each image being 584×565 pixels in size. In the experiments, the first 20 images were used for training, and the other 20 images were used for testing. The CHASE_DB1 dataset contains 28 color retinal images, each image being 999×960 pixels in size. In the experiments, the first 14 images were used for training, and the other 14 images were used for testing. To facilitate obtaining cropped images, the resolution of the original images in the two datasets was enlarged to 592×592 and 1024×1024, respectively.

[0090] Experiments show that MCAU-Net performs well on the DRIVE and CHASE_DB1 datasets.

[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A retinal vessel segmentation method based on multi-scale consistency and attention mechanisms, characterized in that: Includes the following steps: S1. Construct a retinal vessel segmentation network model based on multi-scale consistency and attention mechanisms; S2. Train the retinal vessel segmentation network model to obtain a trained network model, specifically including: S21. Full-size retinal vascular image I g As the first input, the cropped retinal vessel image I c As a second input; S22. Make the first input and the second input pass through the same path in the retinal vessel segmentation network model, and use the set optimizer to train the retinal vessel segmentation network model to obtain a trained network model. During network model training, consistency loss is added. Supervise the two output branches of each layer's decoder to maintain consistency; where the two outputs are the complete outputs of the i-th layer. and cropping output , ; The ; Where m represents the total number of layers in the decoder. For hyperparameters; L mse Representing the mean squared error loss, the , where n represents the number of pixels; S3. Acquire images of the retinal vessels to be tested, input the images into the trained network model, and output the segmentation results of the retinal vessels to be tested.

2. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 1, characterized in that: A retinal vessel segmentation network model based on multi-scale consistency and attention mechanisms is constructed, specifically including: S11. Construct an initial retinal vessel segmentation network model based on the U-Net network model; S12. Construct an attention refinement module and embed the attention refinement module into the bottleneck feature layer of the initial retinal vessel segmentation network model; S13. Construct a context feature fusion module and integrate the context feature fusion module into the initial retinal vessel segmentation network model; the context feature fusion module is used to fuse the features extracted by the encoder with the features restored by the decoder.

3. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 2, characterized in that: The attention refinement module is constructed using the following method: S121. Perform channel average pooling operation P on feature F in the bottleneck feature. c The channel average weight feature X is obtained; S122. Feed the channel average weight feature X into two branches, one of which is a horizontal pooling operation P. h Another branch is the vertical pooling operation P. w The P h X is used to capture the relationship between pixels in each row of F. h The P w Used to obtain the relationship between pixels in each column, resulting in X. w ; S123. The horizontal feature X is obtained through matrix multiplication. h With vertical feature X w The two graphs are merged to generate a coarse attention map A. r ; S124. Coarse Attention Map A r Normalization is performed to scale the weights of all pixel positions to the range (0, 1), resulting in a refined attention map A. S125. Redistribute the weights to the positions in feature F to obtain the final feature F. A .

4. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 3, characterized in that: The final feature F is determined according to the following formula. A : ; Where σ is the sigmoid operation; • is matrix multiplication. For Hadama accumulation, This adds the matrix elements together.

5. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 2, characterized in that: The context feature fusion module is constructed using the following method: Features from the encoder and features of the upsampled previous layer decoder These serve as the two inputs to the context feature fusion module; where H, W, and C represent the length, width, and number of channels of the feature, respectively. Features and features By fusing, aggregated features are obtained. .

6. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 5, characterized in that: Aggregation characteristics are determined according to the following formula. : ; ; Among them, f mid ReLU represents the intermediate features of the initial fusion, and ReLU represents the activation function of the neuron. This represents the addition of matrix elements, where σ is the sigmoid operation. For Hadama accumulation, W represents the operation of splicing by channel. e and W d Both represent 1×1 convolution kernels, W fe and W fd Then they all represent combinations of continuous 1×1 and 3×3 convolution kernels.

7. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 1, characterized in that: Calculate the complete output of the retinal vessel segmentation network model. Segmentation loss compared to ground truth (GT) : ; in, Represents the Dice loss function. This represents the binary cross-entropy loss function. and These are the weighting coefficients.

8. The retinal vessel segmentation method based on multi-scale consistency and attention mechanism according to claim 7, characterized in that: Consistency loss With segmentation loss The sum is used as the overall loss of the retinal vessel segmentation network model.

Citation Information

Patent Citations

  • Retinal vessel segmentation method and system based on retinal fundus image

    CN110689526A