A vascular feature-guided optic disc and optic cup segmentation method
Through the dual-branch feature extraction and cross-transformer fusion module guided by blood vessel features, the problem of performance degradation when the boundary between the optic disc and the optic cup is unclear is solved, the accuracy of the segmentation of the optic disc and the optic cup is improved, and the blood vessel information is used to enhance the remote sensing Relationship modeling capabilities.
Patent Information
- Application Number
- CN202210624721.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-06-02
AI Technical Summary
When the boundary between the optic disc and the optic cup is not clear in the existing technology, the performance of the optic disc and optic cup segmentation method degrades, and the CNN-based method lacks the ability to model remote relationships, making it difficult to effectively utilize the clinician's prior knowledge.
Using a method based on blood vessel feature guidance, the fundus image features are extracted through a dual-branch feature extractor, combined with the cross-transformer fusion module to calculate the long-distance dependence between blood vessel information and optic disc and optic cup features, and establish the relationship between doctors' prior knowledge and optic disc, optic cup, etc. The relationship between visual cup features, thereby improving segmentation performance.
It effectively improves the segmentation accuracy when the boundary between the optic disc and the optic cup is unclear, fully utilizes blood vessel information as medical prior knowledge, enhances the modeling ability of long-range relationships, and improves the accuracy of optic disc and optic cup segmentation.
Smart Images

Figure CN115018855B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an optic disc and optic cup segmentation method based on blood vessel feature guidance, and belongs to the technical field of image segmentation. Background Art
[0002] Glaucoma is one of the eye diseases that cause blindness, and the optic disc and optic cup are two important features for diagnosing glaucomatous lesions. Because the visual impairment of glaucoma patients is irreversible, glaucoma has received great attention among ophthalmic diseases. When glaucoma patients notice that their vision has decreased, the patient's optic nerve has already irreversibly died. If early glaucoma patients are detected in glaucoma screening, the deterioration of vision can be effectively controlled through reasonable treatment. Therefore, large-scale glaucoma screening is crucial to prevent vision loss caused by glaucoma. However, early diagnosis of glaucoma usually requires experienced ophthalmologists, and the existing number of professional doctors cannot meet the huge demand for glaucoma screening. Therefore, efficient optic disc and optic cup feature detection technology has become an urgent need in current glaucoma screening.
[0003] The segmentation methods of optic disc and optic cup can be divided into traditional methods based on handcrafted features and deep learning methods based on convolutional neural networks (CNNs). Traditional methods mainly include edge detection methods, threshold methods, color difference methods, and superpixel methods. These methods mainly perform image segmentation based on handcrafted features and are easily affected by image quality and noise damage. Compared with traditional methods, convolutional neural networks can automatically extract features from images. Many CNN-based variants have been proposed to segment optic disc and optic cup. Although CNN-based methods have better performance than handcrafted feature-based methods. However, CNN-based optic disc and optic cup segmentation methods tend to focus on local edge features of images and lack the ability to model long-range relationships.
[0004] Because the fundus image is obtained by projecting the 3D retina onto the 2D image, the 3D depth information is lost, resulting in unclear boundaries of the optic disc and optic cup in the 2D fundus image. When CNN encounters a fundus image without obvious boundaries of the optic disc and optic cup, the performance of the CNN-based method will be greatly reduced. Clinicians usually need to determine the boundaries of the optic disc and optic cup based on medical knowledge (i.e., vascular kink points). Vascular kink not only has a decisive influence on the adjacent optic disc and optic cup boundaries, but also has a constraining effect on the distant optic disc and optic cup boundaries. In addition, due to the local characteristics of the convolution operator, CNN-based methods usually have limitations in modeling explicit long-range relationships between the boundaries of the optic disc and optic cup and the clinician's prior knowledge. Therefore, it is necessary to effectively model the long-range dependency between the clinician's prior knowledge and the boundaries of the optic disc and optic cup to improve the performance of optic disc and optic cup segmentation. Summary of the invention
[0005] In view of the defects in the prior art, the present invention provides a method for segmenting the optic disc and the optic cup in a fundus image, which is used to solve the problem of performance degradation in the prior art when the boundary between the optic disc and the optic cup is not clear.
[0006] The technical solution of the present invention is:
[0007] A method for segmenting optic disc and optic cup based on vascular feature guidance is disclosed. The method encodes the doctor's prior knowledge based on blood vessels into implicit features, and then encodes the fundus image features into implicit features, further calculates the similarity of the two implicit features, and then establishes the relationship between the optic disc and optic cup features in the fundus image and the doctor's prior knowledge, so as to overcome the problem of performance degradation of the optic disc and optic cup segmentation method when the boundary features of the optic disc and optic cup are not clear. The method specifically includes the following steps:
[0008] S1, preprocess the fundus image, and then use a dual-branch feature extractor to extract the features of the preprocessed fundus image. The feature extractor in the dual-branch feature extractor includes a first feature extractor and a second feature extractor. The first feature extractor is a general feature extractor for extracting features from the color fundus image. The feature of the fundus image extracted by the first feature extractor is called the first feature, which is the decoupled feature F G The second feature extractor is a blood vessel guidance feature extractor, which is used to extract features from the perspective of fundus blood vessels. The features of the fundus image extracted by the second feature extractor are called second features. The second feature is the decoupling feature F V ;
[0009] S2, the decoupled feature F obtained in step S1 G and decoupling feature F V Serialize and decouple feature F G Generate feature sequence Decoupling feature F G Generate feature sequence Then the feature sequence and the characteristic sequence Z V Perform similarity calculation and use multi-layer fully connected layers to fuse the similarity calculation results to obtain fused features;
[0010] S3, using a decoder to decode the fused features obtained in step S2 to obtain three decoded features;
[0011] S4, performing feature aggregation on the fusion features obtained in step S2 and the decoding features obtained in step S3 to obtain aggregated features, and the aggregated features are used for the final segmentation of the optic disc and the optic cup.
[0012] In the step S1, the method for preprocessing the fundus image is: H×W×CCropping is performed based on the center of the optic disc. The cropping size includes the complete optic disc area. The length and width of the cropped fundus image salient area ROI are both N times the diameter of the optic disc. The value range of N is [1, 4], where H is the height of the original image, W is the width of the original image, and C is the number of channels of the original image.
[0013] The first feature extractor in step S1 is a nonlinear function feature extractor En with learnable parameters. G , the first feature extractor En G is a fully connected neural network, a convolutional neural network (CNN), or a transformer module based on the attention mechanism. The first feature extractor En G Extract the preliminary features F of the optic disc and optic cup from the fundus image G ; The first feature extractor En G Using the ResNet34 network as the backbone, the global average pooling layer and the final fully connected layer of ResNet34 are deleted, and only the four stages of the ResNet34 backbone network are retained, where each stage consists of multiple residual blocks, each residual block consists of two 3×3 convolutional layers and a residual connection, and each convolutional layer is followed by a batch normalization (BN) layer and a ReLU activation function;
[0014] The second feature extractor in step S1 includes a blood vessel extractor En V1 and vascular feature encoder En V2 The second feature extractor extracts features by: the fundus image is firstly passed through the blood vessel extractor En V1 Extract vascular information, and then vascular feature encoder En V2 The extracted vascular information is implicitly encoded, and the vascular extractor En V1 and vascular feature encoder En V2 is a series relationship, blood vessel extractor En V1 Can extract all blood vessels in the fundus image, blood vessel feature encoder En V2 The extracted vascular information is further encoded to extract implicit features F V ;Blood Vessel ExtractorEn V1 It is a U-Net network, the main structure is a U-type network, the blood vessel extractor En V1 First, the vascular structure is extracted, and then the vascular structure is sent to the vascular feature encoder En V2 Encode in; Vascular feature encoder En V2ResNet34 is used as the backbone of the vascular feature encoder. The global average pooling layer and the final fully connected layer of ResNet34 are deleted, and only the four stages of the ResNet34 backbone network are retained. Each stage consists of multiple residual blocks, each residual block consists of two 3×3 convolutional layers and a residual connection, and each convolutional layer is followed by a batch normalization (BN) layer and a ReLU activation function.
[0015] In step S2, the decoupling feature F G and decoupling feature F V The serialization method is:
[0016] The decoupled feature F G Split into chunked sequences The decoupled feature F V Split into chunked sequences Then, select the sequence for the block Perform a linear transformation and The result of the transformation is assigned position information; the sequence is selected for the block Perform a linear transformation and The result of the transformation is assigned position information;
[0017] Among them, the decoupled feature F G Split into chunked sequences The method is:
[0018] Decouple features Reshape into a two-dimensional block sequence of size P×P As shown below:
[0019]
[0020] Among them, the decoupled feature F V Split into chunked sequences The method is:
[0021] Decouple features Reshape into a two-dimensional block sequence of size P×P As shown below:
[0022]
[0023] Wherein, the (H 4 , W 4 ) and C 4 Respectively represent the resolution size and number of channels of the feature, is the number of blocks;
[0024] Furthermore, in the decoupling feature F G and decoupling feature FV In the block serialization, the and The method for performing linear transformation is: using a linear projection matrix with learnable parameters Will Mapping to D-dimensional space; using a linear projection matrix with learnable parameters Will Project to D-dimensional space; D represents the dimension of the projection space, and the value range of D is between [768, 2048];
[0025] Furthermore, in the decoupling feature F G and decoupling feature F V Separately serialize in blocks, for the and The method of assigning position information to the results of linear transformation is:
[0026] The Linear transformation of chunked sequences and learnable positional embeddings In the addition, the spatial position information of the sequence is retained to generate a feature sequence As shown in the following formula;
[0027]
[0028] The Linear transformation of chunked sequences and learnable positional embeddings In the addition, the spatial position information of the sequence is retained to generate the feature sequence Z V , as shown below;
[0029]
[0030] In step S2, the method for performing feature fusion is:
[0031] A cross-transformer fusion module is used for feature fusion. The cross-transformer fusion module includes L cross-transformer layers. The cross-transformer layer includes a cross-attention layer, a regularization layer, and a fully connected layer including three layers. The input of the cross-transformer layer is the input of the cross-attention layer. The cross-attention layer performs correlation calculation on the input to obtain the correlation calculation result, and then sends the correlation calculation result to the regularization layer and the fully connected layer for feature fusion. The input of the first cross-transformer layer is the feature sequence from S2. and Z V , the output of the first cross-transformer layer is the feature sequence Similarly, the input of the i-th cross-transformer layer is the feature sequence and Z V , the output of the i-th cross-transformer layer is
[0032] The cross-attention layer in the cross-transformer layer performs correlation calculation on the input to obtain the correlation calculation result, which is specifically:
[0033] The cross-attention layer includes h groups of cross-attention calculations. Each group calculation includes two steps. The first step of the group calculation is to perform a linear transformation on the input sequence to obtain the result of the linear transformation. The second step of the group calculation is to calculate the similarity of the result of the linear transformation. In the first step, the input feature sequence is the feature sequence Z V and From the i-th cross-transformer, it is passed to the cross-attention layer; for convenience, in the cross-attention Z G ;
[0034] The first step of the group calculation in the cross-attention calculation is to perform a linear transformation on the sequence. For the sake of generality, the cross-attention calculation of the i-th group is taken as an example. Figure 3 As shown, the linear transformation of the sequence is as follows: the characteristic sequence Z in S2 VUse the linear transformation matrix W i Q Linear projection to The characteristic sequence Z in S2 G First, use the linear transformation matrix W i K Linear projection to At the same time, the characteristic sequence Z G Using a linear transformation matrix Linear mapping to V i G ; and V i G , the specific calculation formula is as follows:
[0035]
[0036]
[0037]
[0038] Among them, d k =d v =d model / h.
[0039] The second step of the grouping calculation is to use linear transformation to calculate the similarity, as follows: First, use Scaled Dot-Product attention to calculate Z G and Z V The single correlation matrix is then normalized by SoftMax to generate the final calculation result Z i . Z i The calculation of is shown in the following formula:
[0040]
[0041] The multi-group cross-attention includes h groups of correlation matrices. The output of the multi-group cross-attention is to convert the h groups Z i Merge and then use the linear transformation matrix W O Apply a linear transformation to the combined result to generate Z.
[0042] Z=MCA(Z V , Z G )=Concat=(Z 1 , ..., Z i , ..., Z h )W O ,
[0043]
[0044] in
[0045] In the cross-transformer fusion module, the correlation calculation results are sent to the regularization layer (LN) and the fully connected layer (MLP) for feature fusion, specifically:
[0046] The similarity calculation result Z is sent to an MLP with two fully connected layers to adjust the feature representation. Z is the input of the MLP, W 1 and W 2 These are all parameters of the fully connected layer MLP. The calculation method of MLP can be described by the following formula:
[0047] MLP(Z)=ReLU(ZW 1 +b 1 )W 2 +b 2 .
[0048] Finally, the complete cross-transformer layer described in S2 can be fully described by the following formula:
[0049]
[0050]
[0051] Among them, Z V represents the output of the patch embedding layer from the vessel space, represents the output of the l-1th cross-transformer layer;
[0052] Furthermore, the output of the last cross-transformer layer, i.e., the output of the Lth cross-transformer layer, is the feature sequence The feature sequence Perform reshape operation, that is, reshape into 2D image features to obtain the final fusion features.
[0053] In step S3, the decoding method is:
[0054] First, the fusion features finally outputted in S2 are sequentially passed through the three serially connected decoding sub-blocks of the decoder. The decoding sub-blocks will generate corresponding decoding features, which are recorded as the first decoding feature, the second decoding feature and the third decoding feature in order;
[0055] The decoding sub-block includes a 1×1 convolution layer, two 3×3 convolution layers and an upsampling layer based on linear interpolation; the 1×1 convolution layer is used to adjust the number of spatial channels, the 3×3 convolution layer is used to adjust the spatial features of the image, and the upsampling layer is used to increase the size of the decoding features by 2 times in height and 2 times in width.
[0056] In the step S4, the polymerization method is:
[0057] First, the three decoding features generated in S3 are passed through the attention module to generate the output features of the attention module. Then the output features of the attention module are added to the features output in S2 for the final optic disc and optic cup segmentation, specifically:
[0058] The attention module passed by the first decoding feature in S3 is recorded as the first attention module, the attention module passed by the second decoding feature is recorded as the second attention module, and the attention module passed by the third decoding feature is recorded as the third attention module;
[0059] The first, second and third attention modules have the same composition structure. The input feature of attention is denoted as F. The attention module first uses 1×1 convolution to adjust the channel dimension of the input feature F, and generates an input feature with a new number of channels represented as F′. Then, the feature F′ uses global maximum pooling and global average pooling to compress the spatial information of the feature F′. The global maximum pooling generates the feature The global average pooling generates features The feature F Max and F Avg The number of channels of is the same as the number of channels of the feature F′.
[0060] Furthermore, the feature F Avg and F Max After passing through the same two consecutive fully connected layers, new features are generated respectively. The feature F Avg The new features generated and the F Max The generated new features are added element by element, and the result of the addition is used to generate attention weights through the sigmoid function. Finally, the input feature F and the attention weights are multiplied channel by channel to obtain the final attention feature.
[0061] The method for adding the output features of the attention module in the aggregation method of step S4 to the final output features in S2 for the final segmentation of the optic disc and the optic cup is:
[0062] First, the output feature of the first attention module passes through the upsampling layer and then through the 1×1 convolution layer to adjust the channel size, and is further added pixel by pixel with the output of the second attention module to generate the first added feature; the first added feature also passes through the upsampling layer, and then through the new 1×1 convolution layer to adjust the channel size, and is further added pixel by pixel with the output of the third attention module to generate the second added feature;
[0063] Then, the final feature generated by the cross-transformer fusion module in S2 also passes through the upsampling layer, and then adjusts the channel size through a new 1×1 convolution layer, and is further added with the second added feature to generate the third added feature.
[0064] Finally, the third added feature is passed through a 1×1 convolution layer and a SoftMax layer to generate the final segmentation result.
[0065] Beneficial Effects
[0066] Compared with the related art, the method of the present invention has the following advantages:
[0067] (1) The method fully considers the medical prior knowledge of vascular information and integrates the doctor's prior knowledge into the optic disc and optic cup segmentation task based on deep learning, effectively improving the accuracy of feature segmentation when the boundaries of the optic disc and optic cup in fundus images are unclear.
[0068] (2) Two feature extraction branches were established, and the features extracted by the two branches were calculated using a cross-transformer-based fusion module to obtain fused features based on the two branches. The extracted fused features can establish a long-distance dependency relationship between the optic disc / optic cup and vascular information, which is beneficial to improving the accuracy of optic disc and optic cup segmentation.
[0069] (3) When predicting the final optic disc and optic cup, a method of weighted fusion of the features of the convolutional layer and the features based on the cross-transformer feature fusion module was designed. The properties of the local operators of the convolutional layer and the properties of the transformer operator in modeling long-distance features were fully utilized in the extraction of optic disc and optic cup features. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 It is a schematic diagram of the process in the method and embodiments of the present invention;
[0071] Figure 2A schematic diagram of the structure of a method for segmenting an optic disc and an optic cup based on blood vessel feature guidance provided by an embodiment of the present invention;
[0072] Figure 3 Schematic diagram of the structure of a feature fusion module based on a cross-transformer in an embodiment of the present invention;
[0073] Figure 4 Schematic diagram of the structure of the attention block in an embodiment of the present invention. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] A vascular feature-guided optic disc and optic cup segmentation method is proposed. This method encodes the doctor's prior knowledge based on blood vessels into implicit features, and then encodes the fundus image features into implicit features. The similarity of the two implicit features is further calculated to establish the relationship between the optic disc and optic cup features in the fundus image and the doctor's prior knowledge, so as to overcome the problem of performance degradation of the optic disc and optic cup segmentation method when the boundary features of the optic disc and optic cup are not clear. Figure 1 As shown, the specific steps include:
[0076] S1, preprocess the fundus image, and then use a dual-branch feature extractor to extract the features of the preprocessed fundus image. The feature extractor in the dual-branch feature extractor is divided into a first feature extractor and a second feature extractor. The first feature extractor is a general feature extractor used to extract features from the color fundus image. The feature of the fundus image extracted by the first feature extractor is called the first feature, which is the decoupled feature F G The second feature extractor is a blood vessel guidance feature extractor, which is used to extract features from the perspective of fundus blood vessels. The features of the fundus image extracted by the second feature extractor are called second features. The second feature is the decoupling feature F V ;
[0077] S2, the decoupled feature F obtained in step S1 G and decoupling feature F V Serialize, and then use the cross-transformer fusion module to fuse features. The cross-transformer fusion module first decouples the feature F G and F VPerform block serialization and decouple feature F G Generate feature sequence Decoupling feature F V Generate feature sequence Z V , and then use multiple groups of cross-attention to the two sequences and Z V Perform similarity calculation and use multi-layer fully connected layers to fuse the similarity calculation results to obtain fused features;
[0078] S3, using a decoder to decode the fused features obtained in step S2 to obtain decoded features;
[0079] S4, using a feature aggregation module to perform feature aggregation on the fusion features obtained in step S2 and the decoding features obtained in step S3 to obtain aggregated features, and the aggregated features are used for the final segmentation of the optic disc and the optic cup.
[0080] In the step S2, Figure 2 As shown in the figure, the feature fusion method using the cross-transformer fusion module is as follows:
[0081] like Figure 3 As shown, the cross-transformer fusion module includes L cross-transformer layers; the cross-transformer layer includes a cross-attention layer, a regularization layer, and a fully connected layer including three layers; the input of the cross-transformer layer is the input of the cross-attention layer; the cross-attention layer performs correlation calculation on the input to obtain the correlation calculation result, and then sends the correlation calculation result to the regularization layer and the fully connected layer for feature fusion; the input of the first cross-transformer layer is the feature sequence from S2 and Z V , the output of the first cross-transformer layer is the feature sequence Similarly, the input of the i-th cross-transformer layer is the feature sequence and Z V , the output of the i-th cross-transformer layer is
[0082] In step S3, the decoding method is:
[0083] First, the 2D image features finally outputted in S2 are sequentially passed through the three serially connected decoding sub-blocks of the decoder, and the decoding sub-blocks will generate corresponding decoding features, which are recorded as the first decoding feature, the second decoding feature and the third decoding feature in order;
[0084] The decoding sub-block includes a 1×1 convolution layer, two 3×3 convolution layers and an upsampling layer based on linear interpolation; the 1×1 convolution layer is used to adjust the number of spatial channels, the 3×3 convolution layer is used to adjust the spatial features of the image, and the upsampling layer is used to increase the size of the decoding features by 2 times in height and 2 times in width.
[0085] In the step S4, the polymerization method is:
[0086] First, the three decoding features generated in S3 are passed through the attention module to generate the output features of the attention module. Then the output features of the attention module are added to the features output in S2 for the final optic disc and optic cup segmentation, specifically:
[0087] The attention module passed by the first decoding feature in S3 is recorded as the first attention module, the attention module passed by the second decoding feature is recorded as the second attention module, and the attention module passed by the third decoding feature is recorded as the third attention module;
[0088] Among them, the first, second and third attention modules have the same composition structure, such as Figure 4 As shown in the figure, the input feature of attention is recorded as F. The attention module first uses 1×1 convolution to adjust the channel dimension of the input feature F, and generates an input feature with a new number of channels represented as F′. Then, the feature F′ uses global maximum pooling and global average pooling to compress the spatial information of the feature F′. The global maximum pooling generates the feature The global average pooling generates features The feature F Max and F Avg The number of channels of is the same as the number of channels of the feature F′.
[0089] Furthermore, the feature F Avg and F Max After passing through the same two consecutive fully connected layers, new features are generated respectively. The feature F Avg The new features generated and the F MaxThe generated new features are added element by element, and the result of the addition is used to generate attention weights through the sigmoid function. Finally, the input feature F and the attention weights are multiplied channel by channel to obtain the final attention feature.
[0090] The output features of the attention module in the aggregation method of step S4 are added to the final output features in S2 for the final optic disc and optic cup segmentation, specifically:
[0091] First, the output feature of the first attention module passes through the upsampling layer and then through the 1×1 convolution layer to adjust the channel size, and is further added pixel by pixel with the output of the second attention module to generate the first added feature; the first added feature also passes through the upsampling layer, and then through the new 1×1 convolution layer to adjust the channel size, and is further added pixel by pixel with the output of the third attention module to generate the second added feature;
[0092] Then, the final feature generated by the cross-transformer fusion module in S2 also passes through the upsampling layer, and then adjusts the channel size through a new 1×1 convolution layer, and is further added with the second added feature to generate the third added feature.
[0093] Finally, the third added feature is passed through a 1×1 convolution layer and a SoftMax layer to generate the final segmentation result.
[0094] Example
[0095] The embodiment of the present invention designs a method for segmenting the optic disc and optic cup based on vascular feature guidance. The method takes into account the medical anatomical knowledge of clinical glaucoma experts, establishes a correlation between the vascular information in the fundus image and the features of the optic disc and optic cup, and finally obtains the optic disc and optic cup feature segmentation guided by the doctor's prior knowledge.
[0096] Figure 1 It is a schematic diagram of the process in the method and embodiments of the present invention, such as Figure 1 As shown, it contains the following 4 steps:
[0097] S1 uses two different sets of feature extractors to extract features from fundus images in parallel;
[0098] S2 calculates the correlation between the features output by the two sets of feature extractors and then fuses the two sets of features;
[0099] S3 uses a decoder to decouple the fused features generated in S2;
[0100] The S4 feature weighted fusion module aggregates the fused features in S2 and the decoupled features in S3 for the final segmentation of the optic disc and optic cup.
[0101] Figure 2 A flow chart of a method for segmenting the optic disc and optic cup based on blood vessel feature guidance provided by an embodiment of the present invention, the detailed steps are as follows:
[0102] Step 1 uses two different sets of feature extractors to extract features from the fundus image in parallel. Specifically, the dual-branch feature extraction module includes two parallel sub-feature extractors, which are the general feature extractor (first branch feature extractor) and the vascular feature guidance feature extractor (second branch feature extractor). The sub-feature extractors of the two branches extract features from the fundus image in parallel. The general feature extractor extracts features from the color fundus image; the vascular feature guidance feature extractor only extracts features from the perspective of fundus blood vessels.
[0103] Step 1.1. Transform the fundus image I∈R 512×512×3 Before being sent to the dual-branch feature extractor, the fundus image is preprocessed; specifically, the fundus image is cropped according to the center of the optic disc, and the cropped size includes the complete optic disc area. Preferably, the length and width of the cropped fundus image ROI area are both twice the diameter of the optic disc.
[0104] The general feature extractor in step 1.2 is a nonlinear function feature extractor En with learnable parameters. G , ExtractorEn G You can choose a fully connected neural network, a convolutional neural network (CNN), or a transformer module based on an attention calculation module, a feature extractor En G Extract the preliminary features F of the optic disc and optic cup from the fundus image G .
[0105] Preferably, the general feature extractor En G The ResNet34 network is used as its backbone. The global average pooling layer and the final fully connected layer of ResNet34 are deleted, and only the four stages of the ResNet34 backbone network are retained. Each stage consists of multiple residual blocks. Each residual block consists of 2 3×3 convolutional layers and a residual connection. Each convolutional layer is followed by a batch normalization (BN) layer and a ReLU activation function.
[0106] Step 1.3 The vascular feature guide feature extractor includes a vascular extractor En V1 and vascular feature encoder En V2 First, the fundus image is extracted by the blood vessel extractor En V1 Extract vascular information, and then vascular feature encoder En V2 Implicit feature encoding of vascular information.V1 and vascular feature encoder En V2 It is a series relationship; blood vessel extractor En V1 Can extract all blood vessels in the fundus image, blood vessel feature encoder En V2 The extracted blood vessels are further encoded to extract implicit features F V .
[0107] Preferably, the blood vessel extractor En V1 The U-Net network can be used, and its main structure is a U-shaped network. V1 First, the vascular structure is extracted, and then the vascular structure is sent to the vascular feature encoder En V2 Encoding is performed in .
[0108] Preferably, the blood vessel feature encoder En V2 ResNet34 can be used as the backbone of the vascular feature encoder. The global average pooling layer and the final fully connected layer of ResNet34 are deleted, and only the four stages of the ResNet34 backbone network are retained. Each stage consists of multiple residual blocks. Each residual block consists of two 3×3 convolutional layers and a residual connection. Each convolutional layer is followed by a batch normalization (BN) layer and a ReLU activation function.
[0109] The dual-branch feature extractor generates two sets of decoupled features for fundus image extraction, namely, first branch decoupled features and second branch decoupled features; the first branch decoupled features come from the first branch feature extractor; the second branch decoupled features come from the second branch feature extractor. G Represents the features of the first branch decoupling in the two-branch extractor and F V represents the decoupling feature of the second branch in the dual-branch extractor, such as Figure 2 As shown. G Mainly comes from the general local features in the fundus image, F V It mainly comes from the clinician's prior information features in the fundus image.
[0110] Step 2: The two sets of decoupled features F output in step 1 G and F V After the correlation calculation, the two sets of features are fused to generate fused features. Specifically, the cross-transformer-based feature fusion module mainly includes a block embedding layer, a position encoding layer and a cross-transformer-based layer. First, the decoupled feature F of the two-dimensional image feature in step 1 is embedded in the block embedding layer. G and F V Split into chunked sequences and Then, each block sequence is assigned specific position information through the position encoding layer. Finally, the cross-transformer layer fuses the block sequences from the two decoupled spaces.
[0111] Step 2.1 separates the decoupled features from step 1 into blocks and encodes the block positions. and Reshape into two 2D blocks of size 1×1 and This is shown in the following equation.
[0112]
[0113]
[0114] Among them, (H 4 , W 4 ) and C4 represent the resolution size and number of channels of the features respectively. is the number of blocks. Then and Mapped to a D-dimensional space with a learnable linear projection (i.e. Where D represents the dimension of the latent space, D = 768. We further embed the learnable position (i.e., E pos ∈R N×D ) is added to the block sequence to preserve the spatial position information of the sequence, as shown in Eq.
[0115]
[0116]
[0117] in, and Z V They represent the feature sequences from the general feature guidance branch (the first feature branch) and the vascular feature guidance branch (the second feature branch), respectively.
[0118] Step 2.2: The feature sequence generated in step 2.1 and Z V The feature sequences are sent to the cross-transformer layer to calculate the correlation between the two sets of feature sequences and establish the feature dependency between the two sets of feature sequences. Figure 3 As shown in Figure 1, the cross-transformer layer consists of multi-head cross attention (MCA), layer norm (LN), and multi-layer perceptron (MLP) blocks.
[0119] First, the correlation matrix between the two sets of feature block sequences is calculated in the cross-attention sublayer, and then the output of the cross-attention is normalized and the final result is obtained through a multi-layer perceptron. In the multi-head cross-attention sublayer, h groups of parallel cross-attention heads are connected together. The h groups of cross-attention are implemented by different h learnable linear projection mappings to query Q, key value K and value V.
[0120] Specifically, given two different sequences Z G and Z V (feature sequences from both branches), we compute the i-th cross-attention input query Q, key K and value V. V Using W i Q Linear projection to like Figure 3 As shown; Z G use and W i V Linear projection to and V i G The query, key, and value are constructed from the following equation:
[0121]
[0122]
[0123]
[0124] Where h = 8, d k =d v =d model / h=64. We then use Scaled Dot-Product attention to compute the correlation matrix, which is used for the weighted combination of the values V. The Cross Attention (CA) formula is described as follows:
[0125]
[0126] In addition, all attention heads are calculated and concatenated using the following formula:
[0127] MCA(Z V , Z G )Concat=(head 1 , ..., head h )W O ,
[0128]
[0129] in
[0130] Furthermore, the output of MCA is further fed into an MLP with two fully connected layers to adjust the feature representation. Given the input of MLP x, the MLP can be described as follows:
[0131] MLP(x) = ReLU(xW 1 +b 1 )W 2 +b 2 .
[0132] The cross-transformer layer can be fully described in the following formula.
[0133]
[0134]
[0135] Among them, Z V represents the output of the patch embedding layer from the vessel space, Represents the output of the l-1th cross-transformer layer.
[0136] Step 3 uses the decoder to fusion features generated in step 2 Decoding; specifically, the decoupling module contains three groups of 1×1 convolutional layers, 3×3 convolutional layers, and upsampling layers based on linear interpolation. The three sampling layers gradually restore the 2D spatial resolution, forming multi-level features, which are then added to the features of the same scale generated by the dual-branch feature extractor in step 1, and finally generate three multi-level decoupled features.
[0137] Step 4: The feature weighted fusion module combines the fused features in step 2 The decoded features in step 3 are aggregated for the final segmentation of the optic disc and the optic cup. Specifically, the weighted fusion module integrates the multi-scale features in the decoder and the feature representation based on the cross-transformer to improve the segmentation performance. Figure 2 As shown in Figure 2, the three decoupled outputs of the decoder are passed through the attention module to pay more attention to the useful information. In the attention block, the attention between feature channels is redistributed, and feature channels with high significance will receive larger attention weights.
[0138] Furthermore, if Figure 4 As shown in Figure 1, the attention block uses 1×1 convolution to adjust the channel dimension of the input feature F. The input feature with the new dimension is represented as F′, and then global maximum pooling and global average pooling are used to compress the spatial information of the input feature F′. Generate two 1×1×C 5Channel Descriptor F Avg and F Max . F Avg and F Max Represent the average pooling and maximum pooling features respectively. The number of channels of the two pooling descriptors is the same as that of the feature F′. Avg and F Max Share two consecutive fully connected layers. The hidden layer size of the fully connected layer is set to C / r to reduce the number of parameters of the fully connected layer, where r represents the reduction rate, r = 2. Finally, F Avg and F Max The output feature vectors are added element by element, and the result of the addition is used to generate attention weights through the sigmoid function. After that, the input features and attention weights are calculated by element multiplication.
Claims
1. A method for segmenting optic disc and optic cup based on vascular feature guidance, characterized in that The steps of the method include: S1, preprocess the fundus image, and then use the dual-branch feature extractor to extract the decoupled features F of the preprocessed fundus image G and decoupling feature F V ; The feature extractor in the dual-branch feature extractor includes a first feature extractor and a second feature extractor. The first feature extractor is a general feature extractor used to extract features from the color fundus image. The feature of the fundus image extracted by the first feature extractor is called the first feature. The first feature is the decoupled feature F G The second feature extractor is a blood vessel guidance feature extractor, which is used to extract features from the perspective of fundus blood vessels. The features of the fundus image extracted by the second feature extractor are called second features. The second feature is the decoupling feature F V ; The first feature extractor is a nonlinear function feature extractor En with learnable parameters G , the first feature extractor En G It is a fully connected neural network, convolutional neural network or transformer module based on attention mechanism. The first feature extractor En G Extract the preliminary features F of the optic disc and optic cup from the fundus image G ; The first feature extractor En G Using the ResNet34 network as the backbone, the global average pooling layer and the final fully connected layer of ResNet34 are deleted, and only the four stages of the ResNet34 backbone network are retained, where each stage consists of multiple residual blocks, each residual block consists of two 3×3 convolutional layers and a residual connection, and each convolutional layer is followed by a batch normalization (BN) layer and a ReLU activation function; The second feature extractor includes a blood vessel extractor En V1 and vascular feature encoder En V2 The second feature extractor extracts features by: the fundus image is firstly passed through the blood vessel extractor En V1 Extract vascular information, and then vascular feature encoder En V2 The extracted vascular information is implicitly encoded, and the vascular extractor En V1 and vascular feature encoder En V2 It is a series relationship, the blood vessel extractor En V1 Can extract all blood vessels in the fundus image, blood vessel feature encoder En V2 The extracted vascular information is further encoded to extract implicit features F V ;Blood Vessel ExtractorEn V1 It is a U-Net network, the main structure is a U-type network, the blood vessel extractor En V1 First, the vascular structure is extracted, and then the vascular structure is sent to the vascular feature encoder En V2 Encode in; Vascular feature encoder En V2 ResNet34 is used as the backbone of the vascular feature encoder. The global average pooling layer and the final fully connected layer of ResNet34 are deleted, and only the four stages of the ResNet34 backbone network are retained. Each stage consists of multiple residual blocks, each residual block consists of two 3×3 convolutional layers and a residual connection, and each convolutional layer is followed by a batch normalization layer and a ReLU activation function. S2, the decoupled feature F obtained in step S1 G and decoupling feature F V Serialize, decouple feature F when serializing G Generate feature sequence Decoupling feature F V Generate feature sequence Z V , then the feature sequence and the characteristic sequence Z V Perform similarity calculation and use multi-layer fully connected layers to fuse the similarity calculation results to obtain fused features; S3, using a decoder to decode the fused features obtained in step S2 to obtain three decoded features; S4, performing feature aggregation on the fusion features obtained in step S2 and the three decoding features obtained in step S3 to obtain aggregated features, and the aggregated features are used for the final segmentation of the optic disc and the optic cup.
2. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 1, characterized in that: In the step S1, the method for preprocessing the fundus image is: H×W×C Cropping is performed based on the center of the optic disc. The cropping size includes the complete optic disc area. The length and width of the cropped fundus image salient area ROI are both N times the diameter of the optic disc. The value range of N is [1, 4], where H is the height of the original image, W is the width of the original image, and C is the number of channels of the original image.
3. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 1, characterized in that: In step S2, the decoupling feature F G and decoupling feature F V The serialization method is: The decoupled feature F G Split into chunked sequences The decoupled feature F V Split into chunked sequences Then, select the sequence for the block Perform a linear transformation and The result of the transformation is assigned position information; Select sequence for blocks Perform a linear transformation and The result of the transformation is assigned position information; Among them, the decoupled feature F G Split into chunked sequences The method is: Decouple features Reshape into a two-dimensional block sequence of size P×P As shown below: Among them, the decoupled feature F V Split into chunked sequences The method is: Decouple features Reshape into a two-dimensional block sequence of size P×P As shown below: Among them, (H4, W4) and C4 represent the resolution size and number of channels of the feature respectively. is the number of chunks.
4. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 3, characterized in that: In step S2, the decoupling feature F G and decoupling feature F V In the block serialization, the and The method for performing linear transformation is: using a linear projection matrix with learnable parameters Will Mapping to D-dimensional space; using a linear projection matrix with learnable parameters Will Projection into D-dimensional space; Where D represents the dimension of the projection space, and the value range of D is between [768, 2048]; In the decoupling feature F G and decoupling feature F V Separately serialize in blocks, for the and The method of assigning position information to the results of linear transformation is: The Linear transformation of chunked sequences and learnable positional embeddings In the addition, the spatial position information of the sequence is retained to generate a feature sequence As shown in the following formula; The Linear transformation of chunked sequences and learnable positional embeddings In the addition, the spatial position information of the sequence is retained to generate the feature sequence Z V , as shown below; 5. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 3 or 4, characterized in that: In step S2, the method for performing feature fusion is: A cross-transformer fusion module is used for feature fusion. The cross-transformer fusion module includes L cross-transformer layers. The cross-transformer layer includes a cross-attention layer, a regularization layer, and a fully connected layer including three layers. The input of the cross-transformer layer is the input of the cross-attention layer. The cross-attention layer performs correlation calculation on the input to obtain the correlation calculation result, and then sends the correlation calculation result to the regularization layer and the fully connected layer for feature fusion. The input of the first cross-transformer layer is the feature sequence from S2. and Z V , the output of the first cross-transformer layer is the feature sequence The input to the i-th cross-transformer layer is the feature sequence and Z V , the output of the i-th cross-transformer layer is The cross-attention layer in the cross-transformer layer performs correlation calculation on the input to obtain the correlation calculation result, which is specifically: The cross-attention layer includes h groups of cross-attention calculations. Each group calculation includes two steps. The first step of the group calculation is to perform a linear transformation on the input sequence to obtain the result of the linear transformation. The second step of the group calculation is to calculate the similarity of the result of the linear transformation. In the first step, the input feature sequence is the feature sequence Z V and From the i-th cross-transformer, it is passed to the cross-attention layer; for convenience, in the cross-attention Z G ; The first step of the grouping calculation in the cross-attention calculation is to perform a linear transformation on the sequence. The linear transformation of the sequence is as follows: V Use the linear transformation matrix W i Q Linear projection to The characteristic sequence Z in S2 G First, use the linear transformation matrix Linear projection to At the same time, the characteristic sequence Z G Using a linear transformation matrix Linear mapping to V i G ; and V i G , the specific calculation formula is as follows: Among them, d k =d v =d model / h.
6. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 5, characterized in that: The second step of the grouping calculation is to calculate the similarity using linear transformation, as follows: First, use Scaled Dot-Product attention to calculate Z G and Z V The single correlation matrix is then normalized by SoftMax to generate the final calculation result Z i ; Z i The calculation of is shown in the following formula: The multiple groups of cross-attention include h groups of correlation matrices, multiple groups of cross - The output of attention is to group the h into Z i Merge and then use the linear transformation matrix W O Perform a linear transformation on the merged result to generate Z; Z=MCA(Z V ,WITH G )=Concat=(Z1,...,Z i ,...,WITH h )IN O , in, In the cross-transformer fusion module, the correlation calculation results are sent to the regularization layer and the fully connected layer for feature fusion, specifically: The similarity calculation result Z is sent to an MLP with two fully connected layers to adjust the feature representation; Z is the input of the MLP, and W1 and W2 are the parameters of the fully connected layer MLP. The calculation method of the MLP is as follows: MLP(Z)=ReLU(ZW1+b1)W2+b2. Finally, the cross-transformer layer described in S2 is fully described by the following formula: Among them, Z V represents the output of the patch embedding layer from the vessel space, represents the output of the l-1th cross-transformer layer; The output of the last cross-transformer layer, i.e. the output of the Lth cross-transformer layer, is the feature sequence The feature sequence Perform reshape operation, that is, reshape into 2D image features to obtain the final fusion features.
7. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 1, characterized in that: In step S3, the decoding method is: First, the fusion features finally outputted in S2 are sequentially passed through the three serially connected decoding sub-blocks of the decoder. The decoding sub-blocks will generate corresponding decoding features, which are recorded as the first decoding feature, the second decoding feature and the third decoding feature in order; The decoding sub-block includes a 1×1 convolution layer, two 3×3 convolution layers and an upsampling layer based on linear interpolation; the 1×1 convolution layer is used to adjust the number of spatial channels, the 3×3 convolution layer is used to adjust the spatial features of the image, and the upsampling layer is used to increase the size of the decoding features by 2 times in height and 2 times in width.
8. The optic disc and optic cup segmentation method based on blood vessel feature guidance according to claim 1, characterized in that: In the step S4, the polymerization method is: First, the three decoding features generated in S3 are passed through the attention module to generate the output features of the attention module. Then the output features of the attention module are added to the features output in S2 for the final optic disc and optic cup segmentation, specifically: The attention module passed by the first decoding feature in S3 is recorded as the first attention module, the attention module passed by the second decoding feature is recorded as the second attention module, and the attention module passed by the third decoding feature is recorded as the third attention module; The first, second and third attention modules have the same structure. The input feature of attention is denoted as F. The attention module first uses 1×1 convolution to adjust the channel dimension of the input feature F, and generates an input feature with a new number of channels, denoted as F. ′ , then, the feature F ′ Use global maximum pooling and global average pooling to compress the feature F respectively ′ The global maximum pooling generates features The global average pooling generates features The feature F Max and F Avg The number of channels and the feature F ′ The number of channels is the same; The feature F Avg and F Max After passing through the same two consecutive fully connected layers, new features are generated respectively. The feature F Avg The new features generated and the F Max The generated new features are added element by element, and the result of the addition is used to generate attention weights through the sigmoid function. Finally, the input feature F and the attention weights are multiplied according to the channel to obtain the final attention feature; The method for adding the output features of the attention module in the aggregation method of step S4 to the final output features in S2 for the final segmentation of the optic disc and the optic cup is: First, the output feature of the first attention module passes through the upsampling layer and then through the 1×1 convolution layer to adjust the channel size, and is further added pixel by pixel with the output of the second attention module to generate the first added feature; the first added feature also passes through the upsampling layer, and then through the new 1×1 convolution layer to adjust the channel size, and is further added pixel by pixel with the output of the third attention module to generate the second added feature; Then, the final feature generated by the cross-transformer fusion module in S2 also passes through the upsampling layer, and then adjusts the channel size through a new 1×1 convolution layer, and is further added to the second added feature to generate the third added feature; Finally, the third added feature is passed through a 1×1 convolution layer and a SoftMax layer to generate the final segmentation result.
Citation Information
Patent Citations
Color fundus image optic cup segmentation method based on multi-feature fusion
CN106651888A
Retina eyeground image segmentation method based on depth full convolutional neural network
CN108520522A
