EfficientNetB3 Architecture for Diabetic Retinopathy Assessment using Fundus Images

Classification of the stages of diabetic retinopathy (DR) is considered a key step in the assessment and management of diabetic retinopathy. Due to the damage caused by high blood sugar to the retinal blood vessels, differ-ent microscopic structures can be occupied in the retinal area, such as micro-aneurysms, hard exudate and neovasculari-zation. The convolutional neural network (CNN) based on deep learning has become a promising method for the analy-sis of biomedical images. In this work, representative images of diabetic retinopathy (DR) are divided into five catego-ries according to the professional knowledge of ophthalmologists. This article focuses on the use of convolutional neu-ral networks to classify background images of DR according to disease severity and on the application of pooling, Softmax Activation to achieve greater accuracy. The aptos2019-blindness-detection database makes it possible to verify the performance of the proposed algorithm.


Diabetes
Diabetes is a complete metabolic disorder that can lead to various vascular complications in the body. In addition, when the disease coexists with other general illnesses (hypertension, obesity, high cholesterol, etc.), the risk of eye complications will also increase. Diabetes damages the small blood vessels in the retina, which is the back layer of the eye. This is called diabetic retinopathy. The retina converts the light and images that enter the eye into neural signals sent to the brain [1].Diabetic retinopathy Diabetic retinopathy is a common complication of diabetes that affects retinal function as shown in fig-ure1. This pathology occurs when the blood vessels in the retina degenerate. These damaged blood vessels can dilate, causing fluid (plasma, lipid, and / or blood) to leak or even become blocked, leaving part of the retina without blood flow. All of these phenomena that occur due to diabetes can cause progressive damage to the structure of the eyeball, leading to severe vision loss or even blindness [2].

Phases of diabetic retinopathy
The existence and degree of the anomaly determine the severity of the disease. Identifying such manifestations as micro aneurysms, bleeding, new blood vessel formation, and venous beads is the primary diagnostic process. Micro aneurysms are blood clots 100 to 120 µm in size, usually round in shape. Blood escaping from a ruptured blood vessel is called a hemorrhage. The abnormal growth of tiny blood vessels is called neovascularization. Venous beading refers to the expansion of the center of the vein adjacent to the occluded arteriole. Patients with diabetic retinopathy are divided into patients with diabetic no proliferative retinopathy (NPDR) and diabetic proliferative retinopathy (PDR). In addition, depending on the severity of the disease, NPDR patients can be divided into mild, moderate NPDR patients. and severe. The stages of severity of diabetic retinopathy are described in figure 2. Pictures of the various stages of diabetic retinopathy [3]. The parts of this article are classified as follows: Part 2 provides a review of the research literature. Section 3 specifies the materials and methods proposed. Section 4 reviews the results and discussion of the proposed system and the performance evaluation. Finally, section 5 specifies the full conclusion of the document.  [25] 2 Related works [!h] The computer-assisted detection system can accurately detect the level of diabetic retinopathy, which makes it very popular among researchers. Over the past decade, many studies have focused on the de-velopment of computerassisted systems capable of automatically detecting diabetic retinopathy using traditional machine learning algorithms. Quellec et al. [4] used the traditional KNN algorithm and two categories of optimal filters to achieve an AUC of 0.927. In addition, Sinthanayothin et al. [5] have pro-posed an automated system that uses the KNN algorithm to detect the morphological features of diabet-ic retinopathy, and its sensitivity and specificity are 80.21% and 70.66%, respectively. In addition, in the article [6], neural networks are used to classify diabetic retinopathy into three categories. They divided mild, moderate, and severe diabetic retinopathy into accuracy rates of 82.6%, 82.6%, and 88.3%, respec-tively. Larson et al. [7] The automatic diagnosis of diabetic retinopathy is shown on the background photo of the visibility threshold. They achieved 90.1% detection accuracy for real cases and 81.3% accu-racy for false cases. Agurto et al. [8] used a multiscale decomposition based on amplitude modulation and frequency modulation to distinguish images of diabetic retinopathy from images of normal retina. In [9], the author reports that the area under ROC is 0.98 for the texture characteristics and an accuracy of 99.17% for the two-class classification using the wavelet transform with SVM. Jelinek et al. [10] have proposed an automated detection of diabetic retinopathy by combining the work of Spencer and the Cree system. de Spencer [11] and the Cree system [10], which achieved a specificity of 90%. and a sensi-tivity of 85% Abràmo et al. [12] for the automatic detection of diabetic retinopathy they created an Eye-Check algorithm. They detected anomaly lesions with an AUC of 0.839. Dupas et al. [13] have devel-oped a computer-assisted detection system with KNN classification. Acharya et al. [14] uses the SVM classifier based on bispectrum invariant characteristics to classify the five categories. Achieve sensitivity, specificity and precision of 82%, 86% and 85.9% respectively. They also studied four characteristics and obtained a classification accuracy of 85%, a specificity of 86% and a sensitivity of 82%. Roy Chow-dhury and others. [15] proposed a two-step classification method. First, it eliminates false alarms. Then use GMM, KNN, and SVM for classification tasks. They achieved a sensitivity of 100%, an AUC of 0.904 and a specificity of 53.16%. Deep learning algorithms have become popular in recent years. Kaggle [16] has initiated several competitions focused on automatic scoring for the detection of diabetic retinopathy. Pratt et al.
[17] introduced a CNN-based method that has surpassed even human experts in classifying advanced diabetic retinopathy. Kori et al. [18] Use a set of connected ResNet and Densely networks to detect diabetic retinopathy and advanced stages of macular enema Torrey et al. [19] to detect lesions on retinal fundus images, they developed a more interpretable CNN model. In a similar study [20], an unbalanced weight map methodology is used by Yang et al. [21] in order to emphasize the detection of lesions with an AUC of 0.95. In [22] the VGG-16 and Inception-4 networks were used for efficient classification of diabetic retinopathy.

Environment
The scripts are written in Python 3 on the Jupyter notebook on colab. No configuration is required and computing resources, including the GPU, are accessible free of charge.

Dataset
The dataset (aptos2019-blindness-detection) contains 3662 high resolution color images labeled as train-ing set and 1928 color images that are not labeled as training set. In each group, the images are divided into 5 groups according to the severity of the existing DR. Label 0 represents the control group. Labels 1 to 4 represent mild, moderate, severe and proliferative DR, respectively. The following is a visual sum-mary of the diagnostic distribution as shown Figure  3. The group size is obviously unbalanced, with more than 1,800 images representing the control group (label = 0), and less than 300 images in the most severe category (label = 4). While this imbalance is expected in real world data, it poses a problem for many machine learning models. In addition to the unbalanced category, the image sizes in the dataset are also different as shown in Figure 4.

Method proposed
The objective of this research is to classify the fundus images with great precision in the different stages of diabetic retinopathy. classification of patients in the different stages of diabetic retinopathy in a rapid manner is necessary. Thanks to this research and to the application of an EfficientnetB3 architecture, we try to increase the accuracy of the classification in the study of images of diabetic retinopathy.

Resize Image
When defining the architecture of the model, which will be explained in detail in a later section, one of the requirements is to define a fixed input form. When performing this task, it is important to keep in mind that there is a balance between speed of computation and loss of information. For clarification, when the size of an image is reduced, information (pixels) is removed. Less information means faster training times; however, it can also mean reduced overall accuracy. an image size of 300 x 300 has been select-ed.

Dataset augmentation
The common problem in machine learning is unbalanced group size. During the training of our models, the goal is to improve the precision during the following iterations (eras). Since the model learns by find-ing patterns to distinguish groups from one another, under-represented groups will be seen less often and therefore will not be learned as well as their over-represented counterparts. To mitigate the consequences of over / under-representation, data augmentation is used. By adjusting specific parameters, applying random changes to the original training images. These random changes are applied to each epoch, which means that the model will train on "different" images at each iteration.

Convolutional neural network
Convolutional neural network is a deep-learning neural network. It is a type of acyclic (feed-forward) artificial neural network, in which the communication pattern between neurons is inspired by the visual cortex of animals between neurons is in-spired by the visual cortex of animals. Neurons in this region of the brain are arranged so that they correspond to overlapping regions when tiling the visual field1. Their operation is inspired by biological processes2, they consist of a multilayer stack of perceptrons, the pur-pose of which is to preprocess3 small amounts of information [23]. there are different CNN architectures like Lenet, Alexnet, Googlenet, ConvNet, ResNet, etc. In this research, we used the EfficienNet Architec-ture which is introduced by Google AI.

Proposed EfficienNet architecture
The EfficientNetB3 Convolutional Network is a network architecture where provides a new scaling method that uniformly scales all dimensions of network depth, width and resolution as shown in figure 5. This architecture applies the grid search strategy to find the relationship between the different basic net-work scaling dimensions under a fixed resource constraint. The could find the appropriate scaling coeffi-cients for each of the dimensions to be scaled by applying this strategy. Using these coefficients, the basic network was scaled to the desired size [24]. By comparing EfficientNets with other existing CNNs on ImageNet. Typically, by reducing the parameter size and FLOPS by an order of magnitude, the Effi-cientNet model can achieve greater accuracy and efficiency than existing CNNs. For example, in high precision systems, our EfficientNet-B7 achieves a peak accuracy of 84.4% in the top 1 / 97.1% in ImageNet top 5, at the same time 8.4 times smaller than previous Gpipe, 6.1 times faster CPU inference speed. Compared to The widely used ResNet-50, EfficientNet-B4 uses similar FLOPS, and 7 improves top 1 accuracy from 76.3% of ResNet-50 to 82.6% (+ 6.3%) as shown in figure 6. Table 1and Figure  7 illustrate the network architecture of our proposed method that can detect diabetic retinopathy by severi-ty classification. The resolution of the network input layer is 300 x 300 pixels. We extend the architecture of EfficientNet by adding GlobalAveragePooling2D, Flatten and Dropout by 0.5 to reduce overfitting and Soft-Max layer with five classes. The architecture is optimized for 3662 sample images in 40 epochs, the learning rate is 0.00005 and the Adam optimizer is used for faster network optimization. Table 2 pro-vides a summary of our training hyper parameter settings

EXPERIMENTAL RESULTS
In this article, we have proposed a classified model by implementing the deep learning approach; exact-ly, we built a model based on the EfficientNetB3 architecture and an aptos2019-blindness-detection dataset to train and test it. In figure7. below, the screenshot shows part of the experimental results obtained and fig. show the details of the accuracy obtained and the loss error. The accuracy of the pro-posed model is 98.26%.    mean of the preci-sion, recall and f1 score by the diabetic retinopathy classification system is presented in Table3. The Receiver Operating Characteristic (ROC) curve is a graph showing the performance of the classifica-tion model under all classification thresholds. The curve plots the rate of true positives versus the rate of false positives. the figure 11 illustrates the detailed results of the ROC graph of the classification model

Confusion Matrix
The confusion matrix describes the performance of the classification model on the validation set by comparing the actual label with the predicted label. The matrix confusion of our model is evaluated as a one-label classification method for five categories, as shown in Table 3. Each element of the confusion matrix shows the comparison of each image between the actual label and the label. predicted. Configure verification. Our model shows the best DR-free results by making correct predictions on 180 images out of 180 images. Although the correct prediction images for mild DR, moderate DR, severe DR, and proliferative DR are 35, 97, 17, and 27 images out of 37, 100, 19, and 29, respectively. Table 4 illustrates the detailed results of the confusion matrix.

Conclusion
By early detection and treatment of diabetic retinopathy, severe vision loss in diabetic patients can be prevented. Deep learning is one of the most advanced technologies for solving classification problems and provides better accuracy. The efficient convolutional neural network architecture used to detect and classify fundus images will help ophthalmologists further eradicate vision loss caused by diabetic reti-nopathy. In this article, we propose an EfficientNetB3 model for the early detection of the five severities of diabetic retinopathy. We have made several modifications to the EfficientNetB3 pre-trained network and used pre-processing to improve network performance. Our network was trained on APTOS 2019 dataset, which outperformed other state-of-the-art networks in early-stage detection. The accuracy of the proposed model is 98.26