A method for optic disc detection in fundus images based on UNet network

By adding a bridge module and a hybrid loss function that integrates a multi-attention mechanism in the BASNet network, the error detection problem of fundus image visual disk detection under high bright noise interference is solved, the detection accuracy and adaptability are improved, and the computing burden is reduced.

CN116664546BActive Publication Date: 2025-08-15HANGZHOU DIANZI UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310751136.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2025-08-15
Estimated Expiration
2043-06-25

AI Technical Summary

Technical Problem

The existing fundus image disc detection method is prone to target error detection under high bright noise interference, the detection accuracy is easily affected by the characteristics of the image itself, and the calculation burden is heavy.

Method used

The fundus image disc detection method based on UNet network is adopted. By adding a bridge module with a multi-attention mechanism to the prediction module of BASNet, the foreground information, background information and original information of the image are combined, and the model is trained and evaluated using a mixed loss function.

Benefits of technology

It improves the accuracy and adaptability of detection, reduces the computational burden, and enhances the detection accuracy of the model under different image conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664546B_ABST
    Figure CN116664546B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for detecting optic discs in fundus images based on a UNet network, comprising the following steps: Step 1: Collecting a publicly available fundus image dataset and performing data preprocessing, performing data amplification, random cutting, and normalization processing on the image; Step 2: Using the BASNet prediction module as the network backbone structure, adding a multi-attention bridging module between the encoder and decoder of the first to fifth layers of the BASNet to improve the accuracy of fundus image optic disc detection; Step 3: Model training and evaluation. The present invention proposes a multi-attention bridging module that is added between the encoder and decoder of the first to fifth layers of the BASNet prediction module, integrating the foreground information, background information, and original information of the image, thereby improving detection accuracy. At the same time, the present invention places a test set on the trained network parameters for testing, thereby verifying that the model proposed by the present invention has good performance, can adapt to different images, and has high detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for detecting an optic disc in a fundus image based on a UNet network, and belongs to the technical field of medical image detection. Background Art

[0002] Fundus structure lesions will cause diseases such as glaucoma, leading to decreased or even loss of vision. Therefore, early detection of fundus structure lesions clinically is of great significance for preventing fundus diseases.

[0003] Medical image analysis technology has become a widely adopted technique in medical research, clinical testing, and diagnosis. Medical image detection methods based on UNet networks have been widely applied and have achieved many encouraging results on both simple and complex medical images. However, current detection methods still have some drawbacks, such as the tendency to misdetect objects in the presence of bright noise and the susceptibility of detection accuracy to the inherent characteristics of the image.

[0004] Patent document CN115587967A (application number: CN202211093428.6) discloses a method for detecting optic discs in fundus images based on the HA-UNet network. This method uses a six-layer HA module to connect the corresponding encoders and decoders in the network. However, the present invention differs from this patent in that it proposes a more streamlined module for the connection between the encoder and decoder, which reduces the computational burden of the network while maintaining detection accuracy. Summary of the Invention

[0005] In order to overcome the shortcomings of existing research, the present invention provides a method for detecting optic disc in fundus images based on a UNet network.

[0006] The specific steps of a method for detecting optic disc in fundus images based on UNet network are as follows:

[0007] Step 1: Collect a public fundus image dataset and perform data preprocessing, including data amplification, random cropping to 224×224 size, and normalization.

[0008] Step 2: Build the network: This paper uses the prediction module of BASNet as the network backbone. BASNet is a saliency detection network with the basic encoder-decoder structure of UNet, with a total of six layers of encoder-decoder structure. This paper adds a multi-attention bridging module between the encoder and decoder of the first to fifth layers of BASNet to improve the accuracy of optic disc detection in fundus images.

[0009] Step 2.1: Encoder structure: The encoder module consists of six residual stages. The first four stages use ResNet-34 layer1, layer2, layer3, and layer4, which are composed of 3, 4, 6, and 3 basic residual blocks respectively. The last two stages are composed of 3 basic residual blocks each. The basic residual block consists of a convolution with 64 convolution kernels, a size of 3×3, a stride of 1, and a padding of 1, as well as a normalization layer and a ReLu activation layer.

[0010] Step 2.2: Decoder structure: The decoder part is similar to the encoder and consists of six stages, each of which consists of a convolutional layer, normalization processing and activation function;

[0011] Step 2.3: Bridging module integrating multiple attention mechanisms: A bridging module integrating multiple attention mechanisms is added between the encoder and decoder layers 1 to 5 of the backbone structure. This bridging module consists of spatial attention mechanism, channel attention mechanism, and reverse attention mechanism to integrate the foreground information, background information, and original information of the image.

[0012] A bridge module integrating multiple attention mechanisms is introduced, which consists of a channel attention module CA, a spatial attention module SA, and a reverse attention module RA. The input of the bridge module is the output I of the corresponding encoder. The input first passes through the CA module and then performs channel-level multiplication with I to obtain I. ca , I ca Then pass through SA and RA modules and then connect to I ca Perform element-wise multiplication to get I ra , I ra After a 3×3 convolution and element-wise addition with I, the output result I is obtained. ma , I ma It will be concatenated with the upsampling result of the previous decoder of the corresponding decoder and then input into the corresponding decoder;

[0013] Step 3: Model training and evaluation: Input the training set into the constructed network for training. When the model loss function no longer decreases, save the model parameters, put the test set on the trained model for testing and evaluation.

[0014] Step 3.1: Introduce a hybrid loss function, combining the BCE loss function, SSIM loss function, and IoU loss function as the final loss function of the model;

[0015] Hybrid loss function: In order to more accurately judge the training situation, this paper adopts a hybrid loss function, which defines the training loss as the sum of the six-layer encoder-decoder outputs:

[0016]

[0017] Among them, n=6, is the output of the six encoder-decoder layers, a k represents the output loss weight of the kth encoder-decoder layer, l k Represents the actual loss of the kth encoder-decoder layer output. For each encoder-decoder layer output loss result l k The present invention adopts a hybrid loss function:

[0018]

[0019] in, They represent the BCE loss, SSIM loss, and IOU loss of the k-th decoder output, respectively, and are defined as:

[0020] l bce (x,y)=-[xlog(y)+(1-x)log(1-y)]

[0021]

[0022]

[0023] Among them, x is the true label of the pixel, y is the target prediction value, and u x and u y is the average value of x and y, σ xy is the covariance of x and y, c1, c2, c3 are constants to avoid systematic errors with denominators of 0;

[0024] Step 3.2: Model evaluation: In order to more accurately evaluate the performance of the network of the present invention, the following evaluation indicators are used to measure the performance of the network, including: average similarity (Dice) coefficient, Jaccard coefficient, recall coefficient, and sensitivity coefficient. The numerical range of the above indicators is [0, 1], and the closer to 1, the better the model performance. The definitions of the four indicators are as follows:

[0025]

[0026]

[0027]

[0028]

[0029] in:

[0030] True positive TP: the number of pixels correctly detected as the optic disc area;

[0031] True negative TN: the number of pixels correctly detected as background areas;

[0032] False positive: the number of pixels that are predicted to be in the background area as the optic disc area;

[0033] False negatives: The number of pixels where the optic disc area is predicted to be the background area.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] This paper proposes a bridge module that incorporates a multi-attention mechanism and is added between the encoder and decoder layers 1 to 5 of the BASNet prediction module. This module integrates the image's foreground, background, and original information, improving detection accuracy. Furthermore, the paper applies a test set to the trained network parameters for testing, verifying that the proposed model performs well, is adaptable to diverse images, and achieves high detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0037] Figure 1 This is the overall structure diagram of the fundus image optic disc detection method based on the UNet network of the present invention;

[0038] Figure 2 It is a structural diagram of the residual module of the present invention;

[0039] Figure 3 This is a structural diagram of the bridge module of the present invention that integrates multiple attention mechanisms;

[0040] Figure 4 It is a structural diagram of the channel attention module of the present invention;

[0041] Figure 5 is a structural diagram of the spatial attention module of the present invention;

[0042] Figure 6 is a structural diagram of the reverse attention module of the present invention;

[0043] Figure 7 It is a schematic diagram of the effect after the optic disc area is identified and detected in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 making creative efforts are within the scope of protection of the present invention.

[0045] The specific steps of a method for detecting optic disc in fundus images based on UNet network are as follows:

[0046] Step 1: Collect a public fundus image dataset and perform data preprocessing. The images are amplified, randomly cut into 224×224 size, and normalized.

[0047] Step 2: Build the network: The present invention uses the prediction module of BASNet as the network backbone structure. BASNet is a saliency detection network with the basic encoder-decoder structure of UNet, with a total of six layers of encoder-decoder structure. The present invention adds a bridging module that integrates multiple attentions between the encoders and decoders of the first to fifth layers of BASNet to improve the accuracy of fundus image optic disc detection. The network structure is shown in the attached figure. Figure 1 As shown;

[0048] Step 2.1: Encoder structure: The encoder module consists of six residual stages. The first four stages use ResNet-34 layer1, layer2, layer3, and layer4, which are composed of 3, 4, 6, and 3 basic residual blocks respectively. The last two stages are composed of 3 basic residual blocks. The basic residual block consists of a convolution with 64 convolution kernels, a size of 3×3, a stride of 1, and a padding of 1, as well as a normalization layer and a ReLu activation layer. The basic residual block is shown in the attached figure. Figure 2 As shown;

[0049] Step 2.2: Decoder structure: The decoder part is similar to the encoder and consists of six stages. Each stage consists of a convolutional layer, normalization, and activation function. The input of each stage decoder is the concatenated feature map of the upsampled output of the previous stage and the output of the corresponding stage encoder after passing through the bridge module.

[0050] Step 2.3: Bridge module for fusing multiple attention mechanisms: A bridge module for fusing multiple attention mechanisms is added between the encoder and decoder of the first to fifth layers of the backbone structure. The bridge module consists of a channel attention module CA, a spatial attention module SA, and a reverse attention module RA, thereby fusing the foreground information, background information, and original information of the image. The bridge module for fusing multiple attention mechanisms is shown in the attached figure. Figure 3 As shown, the CA, SA, and RA modules are as shown in the attached Figure 4 、5 , as shown in 6;

[0051] The input of the bridge module is the output I of the corresponding encoder. The input first passes through the CA module and then performs channel-level multiplication with I to obtain I ca , I ca Then pass through SA and RA modules and then connect to I ca Perform element-wise multiplication to get I ra , I ra After a 3×3 convolution and element-wise addition with I, the output result I is obtained. ma , I ma It will be concatenated with the upsampling result of the previous decoder of the corresponding decoder and then input into the corresponding decoder;

[0052] Step 3: Model training and evaluation: Input the training set into the constructed network for training. When the model loss function no longer decreases, save the model parameters, put the test set on the trained model for testing and evaluation.

[0053] Step 3.1: Hybrid loss function: To more accurately judge the training status, this paper adopts a hybrid loss function, defining the training loss as the sum of the six-layer encoder-decoder outputs:

[0054]

[0055] Among them, n=6, is the output of the six encoder-decoder layers, a k represents the output loss weight of the kth encoder-decoder layer, l k Represents the actual loss of the kth encoder-decoder layer output. For each encoder-decoder layer output loss result l k The present invention adopts a hybrid loss function:

[0056]

[0057] in, They represent the BCE loss, SSIM loss, and IOU loss of the k-th decoder output, respectively, and are defined as:

[0058] l bce (x,y)=-[xlog(y)+(1-x)log(1-y)]

[0059]

[0060]

[0061] Among them, x is the true label of the pixel, y is the target prediction value, and u x and uy is the average value of x and y, σ xy is the covariance of x and y, c1, c2, c3 are constants to avoid systematic errors with denominators of 0;

[0062] Step 3.2: Model evaluation: In order to more accurately evaluate the performance of the network of the present invention, the following evaluation indicators are used to measure the performance of the network, including: average similarity (Dice) coefficient, Jaccard coefficient, recall coefficient, and sensitivity coefficient. The numerical range of the above indicators is [0, 1], and the closer to 1, the better the model performance. The definitions of the four indicators are as follows:

[0063]

[0064]

[0065]

[0066]

[0067] in:

[0068] True positive TP: the number of pixels correctly detected as the optic disc area;

[0069] True negative TN: the number of pixels correctly detected as background areas;

[0070] False positive: the number of pixels that are predicted to be in the background area as the optic disc area;

[0071] False negatives: The number of pixels where the optic disc area is predicted to be the background area.

[0072] For example, the training set uses the public datasets MESSIDOR and DRIONS-DB. The MESSIDOR dataset contains 1,200 color fundus images, including 1,000 training images and 200 test images; the DRIONS-DB dataset contains 110 images, including 60 training images and 50 test images.

[0073] Due to the limited number of training sets in the dataset, to ensure the effectiveness of model training and testing and to prevent overfitting, we first performed data augmentation on the training set of the dataset. The 1,000 training set images from MESSIDIOR were mirrored and then rotated 90°, 180°, and 270°, increasing the number of images from 1,000 to 5,000. The 60 training set images from DRIONS-DB were mirrored and then rotated 90°, 180°, and 270°, increasing the number of images from 60 to 480.

[0074] Input the training set images into the constructed network and observe the hybrid loss function. When the loss function value no longer decreases, stop model training and obtain the trained model parameters.

[0075] The test set images are input into the trained model and the detection results of the training set are evaluated. The evaluation results are shown in Table 1.

[0076] Table 1 Evaluation results of MESSIDOR and DRIONS-DB test sets

[0077]

[0078]

[0079] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. It is apparent to those skilled in the art that various changes, modifications, substitutions, and variations to these embodiments may be made without departing from the principles and spirit of the present invention, and these changes and modifications still fall within the scope of protection of the present invention.

Claims

1. A method for detecting optic discs in fundus images based on a UNet network, characterized by: The following steps are involved: Step 1: Collect public fundus image datasets and perform data preprocessing, including data amplification, random cutting, and normalization of the images; Step 2: Using the prediction module of BASNet as the network backbone, a multi-attention bridging module is added between the encoder and decoder of the first to fifth layers of BASNet to improve the accuracy of optic disc detection in fundus images; Step 3: Model training and evaluation: Input the training set into the constructed network for training. When the model loss function no longer decreases, save the model parameters, put the test set on the trained model for testing and evaluation.

2. The method for detecting optic discs in fundus images based on a UNet network according to claim 1, wherein: The second step specifically includes: Step 2.1: Encoder structure: The encoder module consists of six residual stages. The first four stages use ResNet-34 layer1, layer2, layer3, and layer4, which are composed of 3, 4, 6, and 3 basic residual blocks respectively. The last two stages are composed of 3 basic residual blocks each. The basic residual block consists of a convolution with 64 convolution kernels, a size of 3×3, a stride of 1, and a padding of 1, as well as a normalization layer and a ReLu activation layer. Step 2.2: Decoder structure: The decoder part consists of six stages, each of which consists of a convolutional layer, normalization processing and activation function; Step 2.3: Bridge module integrating multiple attention mechanisms: A bridge module integrating multiple attention mechanisms is added between the encoder and decoder of the first to fifth layers of the backbone structure. The bridge module is composed of spatial attention mechanism, channel attention mechanism, and reverse attention mechanism, thereby integrating the foreground information, background information and original information of the image. The input of the bridge module is the output I of the corresponding encoder. The input first passes through the CA module and then performs channel-level multiplication with I to obtain I ca , I ca Then pass through SA and RA modules and then connect to I ca Perform element-wise multiplication to get I ra , I ra After a 3×3 convolution and element-wise addition with I, the output result I is obtained. ma , I ma It will be concatenated with the upsampling result of the previous decoder of the corresponding decoder and then input into the corresponding decoder.

3. The method for detecting optic discs in fundus images based on a UNet network according to claim 1, wherein: The step three specifically includes: Step 3.1: Hybrid loss function: Using a hybrid loss function, the training loss is defined as the sum of the six-layer encoder-decoder outputs: Among them, n=6, is the output of the six encoder-decoder layers, a k represents the output loss weight of the kth encoder-decoder layer, l k Represents the actual loss of the kth encoder-decoder layer output, and the loss result l for each encoder-decoder layer output k The calculation of , using the mixed loss function: in, They represent the BCE loss, SSIM loss, and IOU loss of the k-th decoder output, respectively, and are defined as: l bce (x,y)=-[xlog(y)+(1-x)log(1-y)] Among them, x is the true label of the pixel, y is the target prediction value, and u x and u y is the average value of x and y, σ xy is the covariance of x and y, c1 and c2 are constants to avoid systematic errors with denominators of 0; Step 3.2: Model evaluation: The following evaluation indicators are used to measure the performance of the network, including: average similarity coefficient, Jaccard coefficient, recall coefficient, and sensitivity coefficient. The numerical range of the above indicators is [0, 1], and the closer to 1, the better the model performance. The definitions of the four indicators are as follows: in: True positive TP: the number of pixels correctly detected as the optic disc area; True negative TN: the number of pixels correctly detected as background areas; False positive FP: the number of pixels in the background area predicted as the optic disc area; False negative FN: The number of pixels where the optic disc area is predicted to be the background area.

Citation Information

Patent Citations

  • A method for optic disc detection in fundus images based on HA-UNet network

    CN115587967B

  • Fundus blood vessel segmentation method based on space and channel double attention mechanism

    CN112767416A

  • Eye fundus image optic disk detection method based on HA-UNet network

    CN115587967A