A method and device for segmenting hard exudates in diabetic retinopathy

Through the adjacent complementary correction and progressive iterative fusion module of the diabetic retinopathy hard exudate segmentation model, combined with the spatial perception module, the problem of inaccurate detection and boundary positioning of tiny hard exudate lesions in the existing technology is solved, and the segmentation is improved. Accuracy and ability to identify interfering structures.

CN117333470BActive Publication Date: 2024-08-30SUZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311365396.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-20
Publication Date
2024-08-30
Estimated Expiration
2043-10-20

AI Technical Summary

Technical Problem

Existing technology has difficulty in detecting small hard exudate lesions, accurately locating lesion boundaries, and distinguishing anatomical structures with interfering factors, resulting in low segmentation accuracy.

Method used

The diabetic retinopathy hard exudate segmentation model is used to fuse encoding and decoding features layer by layer through the adjacent complementary correction module and the progressive iterative fusion module. Combined with the spatial perception module, multi-scale features are extracted and fused from the bottom up to reduce the semantic gap. Enhance complementary features.

Benefits of technology

It improves the accuracy of hard exudate segmentation, effectively solves the problem of inaccurate positioning of small lesions and fuzzy boundaries, and enhances the ability to identify small lesions and interfering structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117333470B
    Figure CN117333470B
Patent Text Reader

Abstract

The present invention relates to a field of diabetes technology, and in particular to a method and device for segmenting hard exudates of diabetic retinopathy. The method for segmenting hard exudates of diabetic retinopathy uses three bottom-up adjacent complementary correction modules in the encoding path, and a bottom-up progressive iterative fusion module in the decoding path. The two output features of the decoding path are adaptively fused using a spatial perception module to output a hard exudate prediction probability map of diabetic retinopathy. The present invention improves segmentation accuracy and effectively solves the problem of inaccurate positioning of small lesions and fuzzy boundaries during hard exudate segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of diabetes, and in particular to a method and a device for segmenting hard exudates of diabetic retinopathy. Background Art

[0002] Diabetic retinopathy (DR), a complication of diabetes that manifests itself on the retina, is the leading cause of blindness among working-age people in developed countries. Because there are often no obvious symptoms in the early stages, the disease may go unnoticed by patients, who fail to perceive any noticeable changes in vision until the disease has progressed to the point where it is virtually untreatable or irreversible vision loss has occurred. However, early lesions of DR can be detected through fundus imaging. Ophthalmologists diagnose the severity of DR and prescribe treatment plans by examining fundus photographs for the key clinical signs of DR, namely hemorrhages, microaneurysms, soft exudates, and hard exudates.

[0003] Hard exudates (EX) are lipid and protein deposits from abnormally leaking capillaries on the retina. They are one of the earliest and most common clinical symptoms of DR in fundus images. Therefore, the detection of hard exudates is very important for the early diagnosis of diabetic retinopathy.

[0004] With the rapid development of deep learning, researchers have proposed the use of convolutional neural networks to automatically segment hard exudates to develop DR screening systems. For example, HED proposed an end-to-end system for pixel-level segmentation of DR lesions by incorporating HEDNet into a conditional generative adversarial network, which upsamples and splices the multi-scale side outputs on the decoding path as the final segmentation result. At present, researchers have proposed different multi-scale feature fusion modules, such as LWENet, which uses parallel feature extraction modules with different convolution kernel sizes to form a lightweight network for exudate segmentation to capture exudate lesions with different sizes; in order to fully fuse global and local information, Yan et al. proposed a fusion network that trains two network branches together and uses the downsampled global image and cropped local image blocks as inputs to their respective branches; in this framework, the feature map from the global branch is cropped and spliced ​​with the feature map from the local branch for feature fusion. This framework can not only perceive local details, but also make full use of the global contextual information of the fundus image; Sanhita et al. Basup proposed a new deep supervised multi-scale attention U-Net for DR lesion segmentation, inheriting the attention gate to the encoding and decoding features at the same level, thereby attenuating feature responses irrelevant to the task, and conducted a comparative study with four state-of-the-art models, establishing its superiority; SS-MAF considered the complementarity between segmentation and super-resolution tasks, proposed a new hard exudate segmentation method, assisted by auxiliary super-resolution tasks, and designed two independent network branches: the segmentation branch and the super-resolution branch; between the two branches is a fusion module, which effectively fuses the features of the two branches and extracts their mutual information to obtain more accurate segmentation results, bringing useful detail features for micro-lesion and boundary detection. In addition, researchers have also proposed some losses to optimize the network. For example, Guo et al. proposed a bin loss function to deal with the class imbalance problem in hard exudate segmentation. Considering that a large part of the background pixels in the fundus image are easy to classify, a top-k loss was designed to consider all hard exudate pixels. This method considers the top-k background pixels with larger losses to pay more attention to the difficult-to-classify background pixels and achieve good exudate segmentation results; Liu et al. proposed a dual-sampling modulated Dice loss for the training of a two-branch network: a large hard exudate-biased segmentation branch and a small hard exudate-biased segmentation branch. The two-branch network can accurately segment hard exudates of different sizes at the same time.

[0005] However, the large variations in the size, shape, and position of the exudate itself, as well as the presence of other exudate-like structures (such as drusen, optic discs, and optic nerve fibers), uneven illumination, low contrast, and color variations pose challenges to the deep learning-based exudate segmentation task. For example, LWENet, SS-MAF, Guo et al., and Liu et al. downsample the input high-resolution image significantly and then rescale the output as the final result. However, due to the large downsampling factor, a large amount of small lesion detail information is often lost, which makes it difficult for the network to learn discriminative small lesion features, making it difficult to achieve fine segmentation of small lesions. In the studies of Yan et al. and Sanhita Basup, the continuous downsampling operation of the encoding path and the lack of complementary information exchange between different features of the encoding path cause the boundary details of small lesions to be lost, and thus cannot be restored in the upsampling process of the decoding path, which is not conducive to the precise delineation of the boundary. HED directly upsamples multiple side outputs and fuses them at once without distinction, which will result in the final fused features containing useless background information and interference features.

[0006] Therefore, detecting tiny hard exudate lesions, accurately locating lesion boundaries, and distinguishing anatomical structures with interfering factors remain issues that researchers are currently working to solve. Summary of the invention

[0007] Therefore, the technical problem to be solved by the present invention is to overcome the problem in the prior art that it is impossible to detect tiny hard exudate lesions, accurately locate the lesion boundaries and distinguish anatomical structures with interference factors.

[0008] In order to solve the above technical problems, the present invention provides a diabetic retinopathy hard exudate segmentation method, which uses a diabetic retinopathy hard exudate segmentation model to extract hard exudates in fundus images for identification, and the steps include:

[0009] S1. Input the fundus image into the diabetic retinopathy hard exudate segmentation model for encoding, and obtain encoding features F1, F2, ..., F n , where n is the number of coded features;

[0010] S2, the three lowest level encoding features F n 、F n-1 、F n-2 Input the first adjacent complementary correction module to obtain the corrected intermediate feature F' n-1 ; Then the intermediate feature F' n-1 With the encoding feature F n-2 、F n-3 Input the second adjacent complementary correction module to obtain the corrected intermediate feature F' n-2; The coding features are progressively merged upward through the adjacent complementary correction modules in sequence, until the intermediate feature F'3 and the coding features F2 and F1 are input into the n-2th adjacent complementary correction module to obtain the corrected intermediate feature F'2;

[0011] S3, on the decoding path, the encoded features F are transformed from bottom to top n , intermediate feature F' n-1 ,F' n-2 ,…,F'2 and the encoded feature F1 are decoded to obtain the decoded features d1,d2,…,d n-1 ;

[0012] S4, decode the features d1, d2, ..., d n-1 Input a progressive iterative fusion module, wherein the progressive iterative fusion module progressively fuses three adjacent decoding features in a bottom-up layer-by-layer iterative manner to obtain an output fusion feature d";

[0013] S5. Decode the feature d n-1 The output fusion feature d" is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy.

[0014] In one embodiment of the present invention, the fundus image is divided into a plurality of patches and then input into a diabetic retinopathy hard exudate segmentation model, and the size of the patch is 512×512.

[0015] In one embodiment of the present invention, the process of fusing coding features of adjacent complementary correction modules includes:

[0016] The three input features of the adjacent complementary correction module are denoted as F i-1 、F i 、F i+1 , where the input feature F i-1 After downsampling, the spatial attention map Ms is obtained by inputting the spatial attention module, and the input feature F i+1 After inputting the channel attention module, the channel attention map Mc is obtained;

[0017] The spatial attention map Ms is related to the input feature F i After pixel-by-pixel multiplication, we get F i1 , the channel attention map Mc and the input feature F i After pixel-by-pixel multiplication, we get F i2 , F i1 With F i2 After pixel-by-pixel addition, the corrected intermediate feature F' is output i .

[0018] In one embodiment of the present invention, the input feature F i-1The process of obtaining the spatial attention map Ms after downsampling and inputting it into the spatial attention module includes:

[0019] Ms=SAM(down(F i-1 ))

[0020]

[0021] Among them, σ is the Sigmoid operation, To perform a convolution operation with a kernel size of 3×3 and a number of 1, For splicing along the channel direction.

[0022] In one embodiment of the present invention, the input feature F i+1 The process of obtaining the channel attention map Mc after inputting the channel attention module includes:

[0023]

[0024]

[0025] in, To perform a convolution operation with a convolution kernel size of 1×1 and a number of c, c is the input feature F i The number of channels; σ is the Sigmoid operation, It is a pixel-by-pixel addition operation, and MLP is a multi-layer perceptron.

[0026] In one embodiment of the present invention, the decoding features d1, d2, ..., d n-1 Input the progressive iterative fusion module, and gradually fuse the three adjacent decoding features from bottom to top to obtain the fusion feature d". The specific process includes:

[0027] The first scale attention module is used to fuse the decoded features d1, d2, and d3 to obtain the fused feature d″2. The second scale attention module is then used to fuse the decoded features d3, d4, and the fused feature d″2 to obtain the fused feature d″3. This process is repeated layer by layer from bottom to top until the n-3 scale attention module fuses the decoded feature d n-2 ,d n-1 and fusion feature d″ n-3 , get the fusion feature d″ n-2 , as the output fusion feature d" of the progressive iterative fusion module.

[0028] In one embodiment of the present invention, the process of fusing the decoded features of the scale attention module includes:

[0029] The three input features of the scale attention module are denoted as d i-1 ,d i ,d i+1First, bilinear interpolation and 1×1 convolution are used to make the input feature d i-1 ,d i ,d i+1 The shape is consistent with that of the input feature d i-1 ,d i ,d i+1 Input 1×1 convolution respectively for dimensionality reduction to obtain 3 compressed features;

[0030] The three compressed features are concatenated and input into a 1×1 convolution to aggregate multi-scale information to obtain fused features.

[0031] The fused features are softmaxed along the channel direction and then split along the channel to obtain three spatial attention feature maps M1, M2, and M3;

[0032] The spatial attention feature maps M1, M2, and M3 are respectively associated with their corresponding input features d i-1 ,d i ,d i+1 After multiplication, sum is calculated and finally input into 3×3 convolution to obtain the input feature d i-1 ,d i ,d i+1 The fused feature d″ i .

[0033] In one embodiment of the present invention, the decoding feature d n-1 The output fusion feature d" is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy. The specific process includes:

[0034] The decoding feature d n-1 The output fusion feature d' of the progressive iterative fusion module is used as the input feature to the spatial perception module, which is spliced ​​along the channel. The spliced ​​features are input into the 1×1 convolution for dimension reduction, and then into the 3×3 convolution for further feature fusion. Then, they are input into the softmax layer to assign attention weights, and the spatial attention maps M'1 and M'2 are obtained.

[0035] The spatial attention maps M'1 and M'2 are combined with their corresponding decoded features d n-1 Multiply it with the fusion feature d" and then sum it up, and finally input 1×1 convolution for feature aggregation, and output the decision feature map fuse;

[0036] The decision feature map fuse is transposed convolved to obtain an output feature map with two channels and the same size as the input fundus image. The output feature map is then input into the softmax layer to obtain the hard exudate prediction probability map of diabetic retinopathy.

[0037] In one embodiment of the present invention, when training the diabetic retinopathy hard exudate segmentation model, a deep supervision mechanism is introduced on each decoding feature of the decoding path, and the specific process is as follows:

[0038] Decode the features d1, d2, ..., d n-1 Use 1×1 convolution to adjust the number of channels to 2, and then use bilinear interpolation to upsample the feature map after channel adjustment to the resolution size of the real label to obtain the auxiliary output d'1, d'2, ..., d' of the decoding feature. n-1 ;

[0039] The loss function L of the diabetic retinopathy hard exudate segmentation model is total for:

[0040] L total =L CBCE (y,g)+L CBCE (d1,g)+L CBCE (d2,g)+…+L CBCE (d′ n-1 ,g)

[0041] Among them, L CBCE is the weighted cross entropy loss function, y represents the hard exudate prediction probability map output by the diabetic retinopathy hard exudate segmentation model, and g represents the true label map.

[0042] The present invention also provides a device for segmenting hard exudates of diabetic retinopathy, comprising:

[0043] The encoding module is used to input the fundus image into the diabetic retinopathy hard exudate segmentation model for encoding, and obtain encoding features F1, F2, ..., F of different sizes in turn. n , where n is the number of coded features;

[0044] Correction module, used to convert the three lowest level encoding features F n 、F n-1 、F n-2 Input the first adjacent complementary correction module to obtain the corrected intermediate feature F' n-1 ; Then the intermediate feature F' n-1 With the encoding feature F n-2 、F n-3 Input the second adjacent complementary correction module to obtain the corrected intermediate feature F' n-2 ; The coding features are progressively merged upward through the adjacent complementary correction modules in sequence, until the intermediate feature F'3 and the coding features F2 and F1 are input into the n-2th adjacent complementary correction module to obtain the corrected intermediate feature F'2;

[0045] The decoding module is used to convert the encoded features F from bottom to top in the decoding path. n , intermediate feature F' n-1 ,F' n-2 ,…,F'2 and the encoded feature F1 are decoded to obtain the decoded features d1,d2,…,d n-1 ;

[0046] The progressive fusion module is used to transform the decoded features d1, d2, …, d n-1 Input a progressive iterative fusion module, wherein the progressive iterative fusion module progressively fuses three adjacent decoding features in a bottom-up layer-by-layer iterative manner to obtain an output fusion feature d";

[0047] The result output module is used to decode the feature d n-1 The output fusion feature d" is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy.

[0048] The above technical solution of the present invention has the following advantages compared with the prior art:

[0049] The present invention discloses a method for segmenting hard exudates of diabetic retinopathy, which uses a bottom-up adjacent complementary correction module to promote the communication and correction between features of different scales on the coding path, and gradually captures the features of exudate lesions with different shapes and scales from a high semantic level to a low semantic level, so that the detailed information of the underlying features can be transmitted to the high-level features, that is, the information of small lesions and fuzzy boundaries can be transmitted to the high-level features, and the semantic discrimination information of the high-level features can guide the information relocation of the underlying features, so as to achieve the effect of vertical information complementarity and bridging the semantic gap, and to a certain extent promote the feature fusion of the subsequent coding and decoding path, thereby overcoming the problem of highly inconsistent shallow and deep features after fusion due to the large semantic gap.

[0050] The method for segmenting hard exudates of diabetic retinopathy described in the present invention uses a progressive iterative fusion module to gradually fuse the features of three adjacent decoding paths from bottom to top in an iterative manner, and applies fine-grained spatial attention to adaptively learn the different contributions of multi-scale features to the final output, thereby promoting the progressive fusion of different-scale features on the decoding path. In addition, the method for segmenting hard exudates of diabetic retinopathy uses a spatial perception module to adaptively select features that contribute more to the final output, and with the progressive iterative fusion module, it can guide the network to adaptively select features that have a key contribution to the final judgment from multi-scale features, and exclude interfering structures and redundant background information that have similar features to the exudate.

[0051] Therefore, the diabetic retinopathy hard exudate segmentation method described in the present invention improves the segmentation accuracy and effectively solves the problem of inaccurate positioning of small lesions and fuzzy boundaries during hard exudate segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein

[0053] Figure 1 is a flow chart of a diabetic retinopathy hard exudate segmentation method provided by the present invention;

[0054] Figure 2 This is a network structure diagram of the diabetic retinopathy hard exudate segmentation model provided by the present invention;

[0055] Figure 3 is a schematic structural diagram of an adjacent complementary correction module in an embodiment of the present invention;

[0056] Figure 4 is a structural diagram of a progressive iterative fusion module in an embodiment of the present invention;

[0057] Figure 5 is a schematic diagram of the structure of a space perception module in an embodiment of the present invention;

[0058] Figure 6 It is a visualized segmentation result diagram using the method of the present invention on the data sets DDR and IDRiD; wherein Figure a is an example test set image of the DDR data set, Figure b is the real GT annotation of the DDR data set, and Figure c is the binary output result of using the method of the present invention on the DDR data set; Figure d is an example test set image of the IDRiD data set, Figure e is the real GT annotation of the IDRiD data set, and Figure f is the binary output result of using the method of the present invention on the IDRiD data set. DETAILED DESCRIPTION

[0059] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0060] Embodiment 1

[0061] Reference Figure 1 As shown, the present invention provides a diabetic retinopathy hard exudate segmentation method, which uses a diabetic retinopathy hard exudate segmentation model to extract hard exudates in a fundus image for identification, and the steps include:

[0062] S1, dividing the fundus image into multiple patches and inputting them into the diabetic retinopathy hard exudate segmentation model for encoding, wherein the size of the patch is 512×512, and obtaining encoding features F1, F2, …, F n , where n is the number of coded features.

[0063] S2, reference Figure 2 As shown, the three lowest level encoding features F n 、F n-1 、F n-2 Input the first adjacent complementary correction module to obtain the corrected intermediate feature F' n-1 ; Then the intermediate feature F' n-1 With the encoding feature F n-2 、F n-3 Input the second adjacent complementary correction module to obtain the corrected intermediate feature F' n-2 ; The coding features are gradually merged upward through adjacent complementary correction modules in sequence until the intermediate feature F'3 and the coding features F2 and F1 are input into the n-2th adjacent complementary correction module to obtain the corrected intermediate feature F'2.

[0064] The process of fusing coding features by the adjacent complementary correction module includes:

[0065] The adjacent complementary correction module is applied in the encoding path, such as Figure 3 As shown, the three input features of the adjacent complementary correction module are denoted as F i-1 、F i 、F i+1 , namely, bottom-level, middle-level, and high-level features.

[0066] The encoding feature F i-1 After downsampling, the spatial attention map Ms is obtained by inputting it into the spatial attention module (SAM), and the encoding feature F i+1 After inputting the channel attention module (CAM), the channel attention map Mc is obtained. The specific formula is:

[0067]

[0068] Ms=SAM(down(F i-1 ))

[0069]

[0070]

[0071] Among them, σ is the Sigmoid operation, To perform a convolution operation with a kernel size of 3×3 and a number of 1, For splicing along the channel direction; To perform a convolution operation with a convolution kernel size of 1×1 and a number of c, this operation keeps the size of the feature map unchanged, c is the encoding feature F i The number of channels, It is a pixel-by-pixel addition operation, and MLP is a multi-layer perceptron.

[0072] The multilayer perceptron is implemented by two fully connected layers, wherein the number of output channels of the first fully connected layer is C / 4, followed by a ReLU function; the number of input channels of the second fully connected layer is C.

[0073] The implementation of the spatial attention module and the channel attention module is inspired by the CBAM network, but the difference between the present invention and the CBAM module is that in the CBAM module, the spatial attention module and the channel attention module are applied serially on the same feature map, while the spatial attention module and the channel attention module of the present invention are respectively applied on two different feature maps and implemented in parallel to make full use of the spatial detail information of the underlying feature map and the semantic discrimination information of the high-level features.

[0074] The spatial attention map Ms and the encoding feature F i After pixel-by-pixel multiplication, we get F i1 , the channel attention map Mc and the encoding feature F i After pixel-by-pixel multiplication, we get F i2 , F i1 With F i2 After pixel-by-pixel addition, the corrected intermediate feature F' is output i , the specific formula is:

[0075]

[0076]

[0077]

[0078] in, It is a pixel-by-pixel multiplication operation.

[0079] The underlying feature F i+1 Contains more detailed spatial information and is therefore included in the middle-level feature F i Ignored minor exudate details can be activated by multiplying the spatial attention map generated by the low-level features. i-1 Contains more global discriminant information. By multiplying the channel attention map generated by the high-level features, the weak activation area of ​​the exudate with less semantic information in the middle-level features can be enhanced, and the redundant background noise can also be suppressed to a certain extent. The final corrected intermediate feature F' iIt not only retains the underlying detail information, but also includes the semantic discrimination information from high-level features, so that the semantic information of the corrected intermediate features is no longer single, is more sensitive to the identification of tiny exudates, and is more robust to the interference of background information, ultimately achieving a complementary correction effect.

[0080] S3, on the decoding path, the encoded features F are transformed from bottom to top n , intermediate feature F' n-1 ,F' n-2 ,…,F'2 and the encoded feature F1 are decoded to obtain the decoded features d1,d2,…,d n-1 , the specific process is:

[0081] Encoding feature F n With the intermediate feature F' n-1 The decoding feature d1 is obtained by fusion, and the decoding feature d1 is combined with the intermediate feature F' n-2 The decoded feature d2 is obtained by fusion, and the decoded feature d2 is combined with the intermediate feature F' n-3 The fusion obtains the decoding feature d3, and the decoding is fused upwards in sequence until the decoding feature d n-2 Fusion with the encoding feature F1 to obtain the decoding feature d n-1 .

[0082] S4, decode the features d1, d2, ..., d n-1 The progressive iterative fusion module is input, and the progressive iterative fusion module progressively fuses three adjacent decoding features in a bottom-up iterative manner to obtain an output fusion feature d'. The specific process includes:

[0083] The first scale attention module is used to fuse the decoded features d1, d2, and d3 to obtain the fused feature d″2. The second scale attention module is then used to fuse the decoded features d3, d4, and the fused feature d″2 to obtain the fused feature d″3. This process is repeated layer by layer from bottom to top until the n-3 scale attention module fuses the decoded feature d n-2 ,d n-1 and fusion feature d″ n-3 , get the fusion feature d″ n-2 , as the output fusion feature d" of the progressive iterative fusion module.

[0084] The process of fusing decoded features in the scale attention module includes:

[0085] The three input features of the scale attention module are denoted as d i-1 ,d i ,d i+1 First, bilinear interpolation and 1×1 convolution are used to make the input feature d i-1 ,d i ,d i+1The shape is consistent with that of the input feature d i-1 ,d i ,d i+1 Input 1×1 convolution respectively for dimensionality reduction to obtain 3 compressed features;

[0086] The three compressed features are concatenated and input into a 1×1 convolution to aggregate multi-scale information to obtain fused features.

[0087] The fused features are softmaxed along the channel direction and then split along the channel to obtain three spatial attention feature maps M1, M2, and M3;

[0088] The spatial attention feature maps M1, M2, and M3 are respectively associated with their corresponding input features d i-1 ,d i ,d i+1 After multiplication, sum is calculated and finally input into 3×3 convolution to obtain the input feature d i-1 ,d i ,d i+1 The fused feature d″ i .

[0089] S5. Decode the feature d n-1 The output fusion feature d" is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy. The specific process includes:

[0090] The decoding feature d n-1 The output fusion feature d' of the progressive iterative fusion module is used as the input feature to the spatial perception module, which is spliced ​​along the channel. The spliced ​​features are input into the 1×1 convolution for dimension reduction, and then into the 3×3 convolution for further feature fusion. Then, they are input into the softmax layer to assign attention weights, and the spatial attention maps M'1 and M'2 are obtained.

[0091] The spatial attention maps M'1 and M'2 are combined with their corresponding decoded features d n-1 Multiply it with the fusion feature d" and then sum it up, and finally input 1×1 convolution for feature aggregation, and output the decision feature map fuse;

[0092] The decision feature map fuse is transposed convolved to obtain an output feature map with two channels and the same size as the input fundus image. The output feature map is then input into the softmax layer to obtain the hard exudate prediction probability map of diabetic retinopathy.

[0093] When training the diabetic retinopathy hard exudate segmentation model, a deep supervision mechanism is introduced on each decoding feature of the decoding path. The specific process is as follows:

[0094] Decode the features d1, d2, ..., d n-1 Use 1×1 convolution to adjust the number of channels to 2, and then use bilinear interpolation to upsample the feature map after channel adjustment to the resolution size of the real label to obtain the auxiliary output d'1, d'2, ..., d' of the decoding feature. n-1 ;

[0095] The loss function L of the diabetic retinopathy hard exudate segmentation model is total for:

[0096] L total =L CBCE (y,g)+L CBCE (d1,g)+L CBCE (d2,g)+…+L CBCE (d′ n-1 ,g)

[0097] Among them, L CBCE is the weighted cross entropy loss function, y represents the hard exudate prediction probability map output by the diabetic retinopathy hard exudate segmentation model, and g represents the true label map.

[0098] Embodiment 2

[0099] Reference Figure 2 As shown, the present invention provides a diabetic retinopathy hard exudate segmentation model based on the encoding and decoding structure of the Resnet34 feature extractor.

[0100] In order to solve the problem of significantly downsampled input images as input, the present invention adopts larger patches cropped based on the sliding window strategy as the input of the network. For all data sets, the patch size is uniformly set to 512×512, which not only retains detailed spatial information but also provides sufficient contextual information required to distinguish exudate lesions.

[0101] The diabetic retinopathy hard exudate segmentation model mainly consists of three parts: a bottom-up adjacent complementary correction module (ACCM), a bottom-up progressive iterative fusion module (LIFM), and a spatial awareness module (SAM) that fuses two decoding output branches. The implementation principles of the above three modules are introduced below.

[0102] The fundus image is input into the diabetic retinopathy hard exudate segmentation model for encoding, and the encoding features F1, F2, F3, F4, and F5 of different sizes are obtained in turn. The size of F1 is 256×256×64, the size of F2 is 128×128×64, the size of F3 is 64×64×128, the size of F4 is 32×32×256, and the size of F5 is 16×16×512.

[0103] The diabetic retinopathy hard exudate segmentation model of the present invention uses a total of three adjacent complementary correction modules in the coding path, and gradually merges from the bottom layer to the top, and finally obtains three corrected intermediate features: f'2, F'3, and F'4. Among them, the coding features F5, F4, and F3 are input into the first adjacent complementary correction module to obtain the corrected intermediate feature F'4 with a size of 32×32×256; the intermediate feature F'4 and the coding features F3 and F2 are input into the second adjacent complementary correction module to obtain the corrected intermediate feature F'3 with a size of 64×64×128; the intermediate feature F'3 and the coding features F2 and F1 are input into the third adjacent complementary correction module to obtain the corrected intermediate feature F'2 with a size of 128×128×64.

[0104] It should be noted that F1 and F5 correspond to the lowest-level features and the highest-level features extracted by the original feature extractor, respectively. These two features can be regarded as the semantic lower limit and semantic upper limit of the feature space, ensuring that the intermediate features are recalibrated within this range, thereby narrowing the semantic gap between adjacent features and ensuring that the semantic deviation between adjacent features is not too large.

[0105] On the decoding path, the encoding feature F5 is fused with the intermediate feature F'4 to obtain the decoding feature d1, the decoding feature d1 is fused with the intermediate feature F'3 to obtain the decoding feature d2, the decoding feature d2 is fused with the intermediate feature F'2 to obtain the decoding feature d3, and the decoding feature d3 is fused with the encoding feature F1 to obtain the decoding feature d4. The size of d1 is 32×32×256, the size of d2 is 64×64×128, the size of d3 is 128×128×64, and the size of d4 is 256×256×64.

[0106] Although features of the same resolution level on the encoding and decoding path in the backbone network will be fused, simply fusing features of the same scale on the encoding and decoding path while ignoring the communication between features of different scales on the decoding path will lead to the loss of exudate discrimination information of different scales learned on side output features of different scales. In order to comprehensively consider information of multiple scales, adaptively fuse side outputs with different scales, and then distinguish features with different contributions to the discrimination of exudates, the diabetic retinopathy hard exudate segmentation model provided by the present invention applies a progressive iterative fusion module on the decoding path for multi-scale feature fusion on the decoding path.

[0107] Reference Figure 4As shown, the progressive iterative fusion module progressively fuses three adjacent decoding features in a layer-by-layer iterative manner, which is consistent with the direction of the encoding path. It adopts a bottom-up fusion method to first fuse the three side outputs of the bottom layer, and then further fuse the fused result with the two side outputs of the top layer to obtain the output fusion feature d″3 of the progressive iterative fusion module.

[0108] In the embodiment of the present invention, the progressive iterative fusion module includes two scale attention modules (SAB). First, the first scale attention module is used to fuse the three decoding features d1, d2, and d3 at the bottom layer to obtain the fused feature d″2, and then the second scale attention module is used to fuse the two decoding features d3 and d4 at the top layer and the fused feature d″2 to obtain the fused feature d″3. The formula is:

[0109] d″2=SAB(d1,d2,d3)

[0110] d″3=SAB(d″2,d3,d4)

[0111] Structural reference of scale attention module Figure 4 As shown in the figure, the symbol represents splicing along the channel direction, ×2 and ×4 represent upsampling the feature map by two times and four times using bilinear interpolation, respectively. represents pixel-by-pixel multiplication, Indicates pixel-by-pixel addition.

[0112] The specific process of using the first scale attention module to fuse the decoded features d1, d2, and d3 to obtain the fused feature d″2 includes:

[0113] First, bilinear interpolation and 1×1 convolution are used to make the shapes of the decoded features d1, d2, and d3 consistent. In order to reduce the amount of calculation, the decoded features d1, d2, and d3 are respectively input into 1×1 convolution for dimensionality reduction, and three compressed features with 8 channels are obtained;

[0114] The three compressed features are concatenated, and the concatenated features are input into a 1×1 convolution to aggregate multi-scale information to obtain a fused feature with 3 channels.

[0115] The fused features are softmaxed along the channel direction and then split along the channel to obtain three spatial attention feature maps M1, M2, M3∈R H,W,1 , respectively represent the attention weights of three different scale features, where H is the height of the decoded feature d3, and W is the width of the decoded feature d3;

[0116] The spatial attention feature maps M1, M2, and M3 are multiplied by their corresponding decoding features d1, d2, and d3 respectively, and then summed up. Finally, a 3×3 convolution is performed to obtain a feature d″2 fused from the decoding features d1, d2, and d3.

[0117] The specific process of using the second scale attention module to fuse the two top-level decoding features d3 and d4 and the fused feature d″2 to obtain the fused feature d″3 includes:

[0118] First, bilinear interpolation and 1×1 convolution are used to make the shapes of fusion feature d″2 and decoding features d3 and d4 consistent. In order to reduce the amount of calculation, the fusion feature d″2 and decoding features d3 and d4 are respectively input into 1×1 convolution for dimensionality reduction to obtain 3 compressed features with 8 channels.

[0119] The three compressed features are concatenated, and the concatenated features are input into a 1×1 convolution to aggregate multi-scale information to obtain a fused feature with 3 channels.

[0120] The fused features are softmaxed along the channel direction and then split along the channel to obtain three spatial attention feature maps M4, M5, and M6, which represent the attention weights of features of three different scales respectively;

[0121] The spatial attention feature maps M4, M5, and M6 are respectively multiplied by their corresponding fusion feature d″2 and decoding features d3 and d4, and then summed. Finally, they are input into a 3×3 convolution to obtain a feature d″3 which is a fusion of the fusion feature d″2 and the decoding features d3 and d4.

[0122] The progressive iterative fusion module adopts a hierarchical iterative form between the decoding features of three adjacent scales, and progressively fuses multi-scale features from bottom to top, fully considering the hierarchical structure between different decoding features, and using the spatial attention mechanism to integrate the features between adjacent scales. Because the fine-grained spatial attention can adaptively learn the different contributions of multi-scale features to the final output, the module can finally fully fuse multiple side outputs on the decoding path. The module, assisted by the deep supervision mechanism, can give full play to its advantages in mining the discriminative features of exudates of different scales.

[0123] Finally, the output d4 of the last layer of the decoding path is used as the output feature fuse1 of the decoding path, and the fusion feature d″3 output by the progressive iterative fusion module is used as the output feature fuse2 of the decoding path, wherein the output feature fuse1 considers the feature fusion of the same level on the encoding and decoding path, and the output feature fuse2 considers the feature fusion of different scales on adjacent decoding paths. The output features fuse1 and fuse2 are used as the input of the spatial perception module to output the hard exudate prediction probability map of diabetic retinopathy.

[0124] The specific process of the spatial perception module outputting the predicted probability map of hard exudates of diabetic retinopathy includes:

[0125] Reference Figure 5 As shown in the figure, fuse1 and fuse2 are input into the spatial perception module, spliced ​​along the channel, and the spliced ​​features are input into the 1×1 convolution for dimensionality reduction, and then into the 3×3 convolution for further feature fusion, and then into the softmax layer to assign attention weights, and the spatial attention maps M'1 and M'2 corresponding to the learning of features of different scales are obtained; the convolution parameters will adaptively adjust the attention map parameters according to the contribution of the two input features to the final result, and then select the most reasonable and sufficient fusion method to achieve the effect of information complementarity;

[0126] Multiply the spatial attention maps M'1 and M'2 with their corresponding decoding features d4 and fusion features d" and then sum them up. Finally, input 1×1 convolution for feature aggregation and output the decision feature map fuse.

[0127] The decision feature map fuse is transposed convolved to obtain an output feature map with two channels and the same size as the input fundus image. The output feature map is then input into the softmax layer to obtain the hard exudate prediction probability map of diabetic retinopathy.

[0128] The spatial perception module uses fine-grained spatial attention to adaptively fuse feature maps that have different contributions to the final output result, and the combination of the progressive iterative fusion module and the spatial perception module can guide the network to adaptively select features that have key contributions to the final judgment from multi-scale features, and exclude interfering structures and redundant background information with similar characteristics to the exudate.

[0129] When training the diabetic retinopathy hard exudate segmentation model, the embodiment of the present invention introduces a deep supervision mechanism on each decoding feature of the decoding path.

[0130] Deep supervision is a technique used in deep learning training to improve the performance and training effect of the model. In traditional deep learning models, a loss function is usually used to evaluate the gap between the output of the model in the entire network and the true label. This training method may lead to the problem of gradient vanishing or gradient exploding during training, especially when the network is deep and complex.

[0131] The deep supervision mechanism alleviates this problem by adding additional loss functions in the middle layers of the network. Specifically, it introduces additional supervision signals between multiple layers of the network to enable more accurate gradient transfer on each layer, provide the network with more training guidance, and promote the network to learn more discriminative feature representations. Using the deep supervision mechanism, the model can obtain more feedback signals from the middle layers, allowing the gradient to propagate more easily in the network. This can speed up the training process and increase the convergence speed of the model, while also alleviating the problems of gradient vanishing and gradient exploding, making the network more stable and easier to optimize.

[0132] Since the diabetic retinopathy hard exudate segmentation model provided by the present invention inserts an additional module into the basic network, the training of the network becomes more complicated. In order to alleviate this situation, the embodiment of the present invention uses a deep supervision mechanism, that is, in addition to calculating the loss function of the final prediction result of the network and the true label, a deep supervision mechanism is introduced on each decoding feature layer of the decoding path. The specific process includes:

[0133] The decoding features d1, d2, d3, and d4 are respectively adjusted to 2 in number of channels using 1×1 convolution, where 2 is the number of classification categories. Secondly, bilinear interpolation is used to upsample the feature maps after channel adjustment to the resolution of the true label to obtain auxiliary outputs d'1, d'2, d'3, and d'4 of the bottom-up decoding features. The sizes of the auxiliary outputs d'1, d'2, d'3, and d'4 are all 512×512×2.

[0134] The auxiliary outputs d'1, d'2, d'3, d'4 and the output hard exudate prediction probability map are respectively subjected to loss function calculation with the true label as the total loss function of the diabetic retinopathy hard exudate segmentation model.

[0135] Since the distribution of background pixels and hard exudate pixels in the present invention is highly unbalanced, the model can easily ignore small hard exudates. Therefore, the loss function of the diabetic retinopathy hard exudate segmentation model provided by the present invention adopts a weighted cross entropy loss function (CBCE loss function). The calculation formula of the CBCE loss function is as follows:

[0136]

[0137] y represents the hard exudate prediction probability map output by the diabetic retinopathy hard exudate segmentation model, g represents the true label map, and the resolution of y and g are the same; C represents the number of classification categories, which is in the embodiment of the present invention; N represents the total number of pixels in an image; g kj represents the true label of the j-th pixel, 0 means it belongs to the background pixel, and 1 means it belongs to the exudate pixel; kjrepresents the probability that the jth pixel is predicted to be of category k; w k represents the loss weight of the kth category. In the embodiment of the present invention, w0=0.3, w1=0.7.

[0138] Therefore, the loss function L of the diabetic retinopathy hard exudate segmentation model is total for:

[0139] L total =L CBCE (y,g)+L CBCE (d′1,g)+L CBCE (d′2,g)+L CBCE (d′3,g)+L CBCE (d′4,g)

[0140] Embodiment 3

[0141] This embodiment uses the diabetic retinopathy hard exudate segmentation model to conduct extensive experiments on two publicly available retinal datasets with hard exudate annotations, DDR and IDRiD. Among them, DDR is the largest dataset for hard exudate segmentation. The fundus images in DDR are collected from 147 hospitals, covering 23 provinces in China, and the size ranges from 1088×1920 to 3456×5184. The large variation of image size and large inter-domain differences make classification and segmentation on DDR more challenging. The IDRiD dataset consists of 81 color fundus images and pixel-level annotations of retinal lesions. According to the official separation, 54 images are used for training and the remaining 27 images are used for testing. In the experiment, for the DDR and IDRiD datasets, the image size is controlled to 512×512 as input, and the corresponding output size of the diabetic retinopathy hard exudate segmentation model is also 512×512, and the ratio of the training set and the validation set is controlled at 4:1. The final evaluation indicators all use pixel-level evaluation indicators: the area under the precision-recall curve (AUPR).

[0142] First, the data is preprocessed and enhanced. The specific process includes:

[0143] The region of interest (ROI) of the cropped dataset is surrounded by a black border. In order to obtain the region of interest (ROI), this embodiment uses Otsu threshold segmentation (OSTU) and maximum connected components to obtain the optimal processing threshold and remove the outer border respectively;

[0144] Contrast-limited adaptive histogram equalization (CLAHE) is applied to enhance image contrast;

[0145] The sliding window strategy is used to obtain patch images for the dataset. The patch samples are divided into positive samples (lesions with exudate) and negative samples (lesions without exudate). In this embodiment, only positive samples are retained for training. The patch size is set to 512×512, and the sliding window step size is 128.

[0146] In order to ensure the robustness and generalization of the model, this embodiment uses five online data expansion strategies during the training process, including random flipping, rotation (90°, 180°, 270°), random cropping, shifting and rescaling.

[0147] Secondly, set up the experimental environment. The specific process includes:

[0148] The software environment used in this example is the Centos8 operating system and the PyTorch 1.1 framework. All experiments are performed on a single Nvidia GeForce RTX 3080Ti with 12GB of memory. The network input size is 512×512, and the batch size is set to 4. The resnet34 pre-trained model on the Imagenet dataset is used to initialize the feature extraction part of the network.

[0149] All experiments in this example were trained for 100 epochs using weighted cross entropy loss. The learning rate adjustment strategy used was the Poly learning rate decay strategy (power of 0.9), and the SGD optimizer was used for parameter optimization: initial learning rate (0.001), weight decay (0.0005), and momentum (0.9).

[0150] A large number of experimental results using the method of the present invention on two public datasets, DDR and IDRiD, show that the method proposed by the present invention is more effective than the most advanced method in the prior art. The quantitative results and qualitative analysis results of the experiments are given below.

[0151] 1. Quantitative results

[0152] In order to further measure the superiority of the present invention in exudate segmentation, this embodiment compares the present invention method with the advanced methods in the prior art on two benchmark datasets. Tables 1 and 2 list the quantitative results of the two datasets, respectively, and the evaluation index is the AUPR (area under the precision-recall curve) of exudate lesion segmentation.

[0153]

[0154]

[0155] Table 1. Comparative experimental results on DDR dataset

[0156] method years AUPR PATech(2nd) 2018 0.8850 L-seg 2019 0.7945 HEDNet 2019 0.8405 DSM 2021 0.7767 SSMAF 2022 0.8596 Guo 2023 0.8961 Method of the present invention 2023 0.9007

[0157] Table 2. Comparative experimental results on IDRiD dataset

[0158] It can be seen from the above comparative experiments that the method of the present invention has achieved the best performance compared with the existing advanced methods on both data sets.

[0159] Therefore, from the perspective of quantitative results, the method of the present invention achieves the highest accuracy in exudate lesion segmentation, and can therefore effectively solve the current problems of being unable to accurately locate tiny exudate lesions and fuzzy lesion boundaries.

[0160] (II) Qualitative segmentation results

[0161] Figure 6 Visualized segmentation result diagrams using the method of the present invention on two data sets are given respectively, wherein Figure a is an example test set image of the DDR data set, Figure b is the real GT annotation of the DDR data set, and Figure c is the binary output result of the method of the present invention on the DDR data set; Figure d is an example test set image of the IDRiD data set, Figure e is the real GT annotation of the IDRiD data set, and Figure f is the binary output result of the method of the present invention on the IDRiD data set.

[0162] It can be seen from the visualization results that the method of the present invention shows excellent performance in locating the boundaries of small lesions and fuzzy lesions.

[0163] Embodiment 4

[0164] This embodiment provides a device for segmenting hard exudates of diabetic retinopathy, comprising:

[0165] The encoding module is used to input the fundus image into the diabetic retinopathy hard exudate segmentation model for encoding, and obtain encoding features F1, F2, ..., F of different sizes in turn. n , where n is the number of coded features;

[0166] Correction module, used to convert the three lowest level encoding features F n 、F n-1 、F n-2 Input the first adjacent complementary correction module to obtain the corrected intermediate feature F' n-1 ; Then the intermediate feature F' n-1 With the encoding feature F n-2 、F n-3 Input the second adjacent complementary correction module to obtain the corrected intermediate feature F' n-2; The coding features are progressively merged upward through the adjacent complementary correction modules in sequence, until the intermediate feature F'3 and the coding features F2 and F1 are input into the n-2th adjacent complementary correction module to obtain the corrected intermediate feature F'2;

[0167] The decoding module is used to convert the encoded features F from bottom to top in the decoding path. n , intermediate feature F' n-1 ,F' n-2 ,…,F'2 and the encoded feature F1 are decoded to obtain the decoded features d1,d2,…,d n-1 ;

[0168] The progressive fusion module is used to transform the decoded features d1, d2, …, d n-1 Input a progressive iterative fusion module, wherein the progressive iterative fusion module progressively fuses three adjacent decoding features in a bottom-up layer-by-layer iterative manner to obtain an output fusion feature d";

[0169] The result output module is used to decode the feature d n-1 The output fusion feature d" is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy.

[0170] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0171] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0172] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0174] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A method for segmenting hard exudates of diabetic retinopathy, characterized in that: The hard exudate segmentation model for diabetic retinopathy is used to extract hard exudates in fundus images for identification, and the steps include: S1. Input the fundus image into the diabetic retinopathy hard exudate segmentation model for encoding, and obtain encoding features F1, F2, ..., F n , where n is the number of coded features; S2, the three lowest level encoding features F n 、F n-1 、F n-2 Input the first adjacent complementary correction module to obtain the corrected intermediate feature F′ n-1 ; Then the intermediate feature F′ n-1 With the encoding feature F n-2 、F n-3 Input the second adjacent complementary correction module to obtain the corrected intermediate feature F′ n-2 ; The coding features are progressively merged upward through the adjacent complementary correction modules in sequence, until the intermediate feature F′3 and the coding features F2 and F1 are input into the n-2th adjacent complementary correction module to obtain the corrected intermediate feature F′2; The process of fusing coding features in the adjacent complementary correction module includes: The three input features of the adjacent complementary correction module are denoted as F i-1 、F i 、F i+1 , where the input feature F i-1 After downsampling, the spatial attention map Ms is obtained by inputting the spatial attention module, and the input feature F i+1 After inputting the channel attention module, the channel attention map Mc is obtained; The spatial attention map Ms is related to the input feature F i After pixel-by-pixel multiplication, we get F i1 , the channel attention map Mc and the input feature F i After pixel-by-pixel multiplication, we get F i2 , F i1 With F i2 After pixel-by-pixel addition, the corrected intermediate feature F′ is output i ; S3, on the decoding path, the encoding feature F is converted from bottom to top n , intermediate feature F′ n-1 ,F′ n-2 ,…,F′2 and the encoded feature F1 are decoded to obtain the decoded features d1,d2,…,d n-1 ; S4, decode the features d1, d2, ..., d n-1 Input a progressive iterative fusion module, which progressively fuses three adjacent decoding features in a layer-by-layer iterative manner from bottom to top to obtain an output fusion feature d″. The process includes: The first scale attention module is used to fuse the decoded features d1, d2, and d3 to obtain the fused feature d″2. The second scale attention module is then used to fuse the decoded features d3, d4, and the fused feature d″2 to obtain the fused feature d″3. This process is repeated layer by layer from bottom to top until the n-3 scale attention module fuses the decoded feature d n-2 ,d n-1 and fusion feature d″ n-3 , get the fusion feature d″ n-2 , as the output fusion feature d″ of the progressive iterative fusion module; S5. Decode the feature d n-1 The output fusion feature d″ is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy, including: The decoding feature d n-1 The output fusion feature d″ of the progressive iterative fusion module is used as the input feature to the spatial perception module, which is spliced ​​along the channel. The spliced ​​features are input into the 1×1 convolution for dimension reduction, and then into the 3×3 convolution for further feature fusion, and then into the softmax layer to assign attention weights to obtain the spatial attention maps M′1 and M′2; The spatial attention maps M′1 and M′2 are combined with their corresponding decoding features d n-1 After multiplying with the fusion feature d″, the sum is calculated and finally input into a 1×1 convolution for feature aggregation, and the decision feature map fuse is output; The decision feature map fuse is transposed convolved to obtain an output feature map with two channels and the same size as the input fundus image. The output feature map is then input into the softmax layer to obtain the hard exudate prediction probability map of diabetic retinopathy.

2. A diabetic retinopathy hard exudate segmentation method according to claim 1, characterized in that: The fundus image is divided into a plurality of patches and then input into a diabetic retinopathy hard exudate segmentation model, wherein the size of the patch is 512×512.

3. The method for segmenting hard exudates of diabetic retinopathy according to claim 1, characterized in that: The input feature F i-1 The process of obtaining the spatial attention map Ms after downsampling and inputting it into the spatial attention module includes: Ms=SAM(down(F i-1 )) Among them, σ is the Sigmoid operation, To perform a convolution operation with a kernel size of 3×3 and a number of 1, For splicing along the channel direction.

4. The method for segmenting hard exudates of diabetic retinopathy according to claim 1, characterized in that: The input feature F i+1 The process of obtaining the channel attention map Mc after inputting the channel attention module includes: in, To perform a convolution operation with a convolution kernel size of 1×1 and a number of c, c is the input feature F i The number of channels; σ is the Sigmoid operation, It is a pixel-by-pixel addition operation, and MLP is a multi-layer perceptron.

5. The method for segmenting hard exudates of diabetic retinopathy according to claim 1, characterized in that: The process of fusing decoded features in the scale attention module includes: The three input features of the scale attention module are denoted as d i-1 ,d i ,d i+1 First, bilinear interpolation and 1×1 convolution are used to make the input feature d i-1 ,d i ,d i+1 The shape is consistent with that of the input feature d i-1 ,d i ,d i+1 Input 1×1 convolution respectively for dimensionality reduction to obtain 3 compressed features; The three compressed features are concatenated and input into a 1×1 convolution to aggregate multi-scale information to obtain fused features. The fused features are softmaxed along the channel direction and then split along the channel to obtain three spatial attention feature maps M1, M2, and M3; The spatial attention feature maps M1, M2, and M3 are respectively associated with their corresponding input features d i-1 ,d i ,d i+1 After multiplication, sum is calculated and finally input into 3×3 convolution to obtain the input feature d i-1 ,d i ,d i+1 The fused feature d″ i .

6. The method for segmenting hard exudates of diabetic retinopathy according to claim 1, characterized in that: When training the diabetic retinopathy hard exudate segmentation model, a deep supervision mechanism is introduced on each decoding feature of the decoding path. The specific process is as follows: Decode the features d1, d2, ..., d n-1 Use 1×1 convolution to adjust the number of channels to 2, and then use bilinear interpolation to upsample the feature map after channel adjustment to the resolution size of the real label to obtain the auxiliary output d′1, d′2, …, d′ of the decoding feature. n-1 ; The loss function L of the diabetic retinopathy hard exudate segmentation model is total for: L total =L CBCE (y,g)+L CBCE (d′1,g)+L CBCE (d′2,g)+…+L CBCE (d′ n-1 ,g) Among them, L CBCE is the weighted cross entropy loss function, y represents the hard exudate prediction probability map output by the diabetic retinopathy hard exudate segmentation model, and g represents the true label map.

7. A device for segmenting hard exudates of diabetic retinopathy, characterized in that: include: The encoding module is used to input the fundus image into the diabetic retinopathy hard exudate segmentation model for encoding, and obtain encoding features F1, F2, ..., F of different sizes in turn. n , where n is the number of coded features; Correction module, used to convert the three lowest level encoding features F n 、F n-1 、F n-2 Input the first adjacent complementary correction module to obtain the corrected intermediate feature F′ n-1 ; Then the intermediate feature F′ n-1 With the encoding feature F n-2 、F n-3 Input the second adjacent complementary correction module to obtain the corrected intermediate feature F′ n-2 ; The coding features are progressively merged upward through the adjacent complementary correction modules in sequence, until the intermediate feature F′3 and the coding features F2 and F1 are input into the n-2th adjacent complementary correction module to obtain the corrected intermediate feature F′2; The process of fusing coding features in the adjacent complementary correction module includes: The three input features of the adjacent complementary correction module are denoted as F i-1 、F i 、F i+1 , where the input feature F i-1 After downsampling, the spatial attention map Ms is obtained by inputting the spatial attention module, and the input feature F i+1 After inputting the channel attention module, the channel attention map Mc is obtained; The spatial attention map Ms is related to the input feature F i After pixel-by-pixel multiplication, we get F i1 , the channel attention map Mc and the input feature F i After pixel-by-pixel multiplication, we get F i2 , F i1 With F i2 After pixel-by-pixel addition, the corrected intermediate feature F′ is output i ; The decoding module is used to convert the encoded features F from bottom to top in the decoding path. n , intermediate feature F′ n-1 ,F′ n-2 ,…,F′2 and the encoded feature F1 are decoded to obtain the decoded features d1,d2,…,d n-1 ; The progressive fusion module is used to transform the decoded features d1, d2, …, d n-1 Input a progressive iterative fusion module, which progressively fuses three adjacent decoding features in a layer-by-layer iterative manner from bottom to top to obtain an output fusion feature d″. The process includes: The first scale attention module is used to fuse the decoded features d1, d2, and d3 to obtain the fused feature d″2. The second scale attention module is then used to fuse the decoded features d3, d4, and the fused feature d″2 to obtain the fused feature d″3. This process is repeated layer by layer from bottom to top until the n-3 scale attention module fuses the decoded feature d n-2 ,d n-1 and fusion feature d″ n-3 , get the fusion feature d″ n-2 , as the output fusion feature d″ of the progressive iterative fusion module; The result output module is used to decode the feature d n-1 The output fusion feature d″ is input into the spatial perception module together to output a hard exudate prediction probability map of diabetic retinopathy, including: The decoding feature d n-1 The output fusion feature d″ of the progressive iterative fusion module is used as the input feature to the spatial perception module, which is spliced ​​along the channel. The spliced ​​features are input into the 1×1 convolution for dimension reduction, and then into the 3×3 convolution for further feature fusion, and then into the softmax layer to assign attention weights to obtain the spatial attention maps M′1 and M′2; The spatial attention maps M′1 and M′2 are combined with their corresponding decoding features d n-1 After multiplying with the fusion feature d″, the sum is calculated and finally input into a 1×1 convolution for feature aggregation, and the decision feature map fuse is output; The decision feature map fuse is transposed convolved to obtain an output feature map with two channels and the same size as the input fundus image. The output feature map is then input into the softmax layer to obtain the hard exudate prediction probability map of diabetic retinopathy.

Citation Information

Patent Citations

  • Micro-hemorrhage focus segmentation method based on convolutional neural network

    CN112927243A

  • Feature fusion method for target detection based on key points

    CN113011443A