# Classification of Diabetic Retinopathy Based on Efficient Computational Modeling
## 4 Experimental Section  
### Dataset and Preprocessing  
In this paper, model validation is performed on APTOS2019, a publicly available dataset officially provided by Kaggle (San Francisco, CA, USA). The APTOS2019 dataset was obtained by the [PERSON] team while performing disease screening in medically deprived villages in India, relying on trained doctors to review images and provide diagnoses. The database contains 3662 images with lesions categorized into five categories, where 0 indicates a healthy retina and categories 1-4 indicate mild, moderate, severe, and proliferative retinopathy, respectively. A ratio of 8:2 was used to divide the training set and test set during the training process of this paper. Table 1 shows the distribution of sample size for each type of lesion in the APTOS2019 dataset. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Form** & **Lesion Level** & **APTOS2019 (Width)** \\ \hline
0 & Healthy Retina & 1805 (49.3\%) \\
1 & Mild lesions & 370 (10.1\%) \\
2 & Moderate lesions & 999 (27.3\%) \\
3 & Severe lesions & 193 (5.2\%) \\
4 & Proliferative lesions & 295 (8.1\%) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distribution of samples in each category of the dataset. As the samples in the DR dataset have differences in lighting conditions and shooting equipment during the sampling process, it leads to a big difference between the images in terms of size and color. There are also some images with problems such as underexposure, overexposure, and much noise. In order to train the network using samples with consistent color sizes, the images need to be preprocessed and enhanced. First of all, the black border of the fundus image must be removed because of its high pixel value, which affects the results of classification. Since the aspect ratio varies from image to image and the width of the black border at the periphery of the eyeball varies, the size of the entire image cannot be used. Therefore, the radius of the eyeball is used as a benchmark. Finally, for image enhancement, the method used in Kaggle's DR classification competition is used to improve the brightness and contrast difference of the image. The process is shown below. \[I_{gaussian}=G(x,y,\sigma)\otimes I(x,y) \tag{4}\]  
\[I_{enhance}=\alpha\cdot I(x,y)+\beta\cdot I_{gaussian}+\gamma \tag{5}\]  
In Formula (4), \(I(x,y)\) is the preprocessed fundus image, and \(G(x,y,\sigma)\) represents the Gaussian convolution of the standard deviation. Formula (5) is a weighted sum of the images before and after enhancement. \(\alpha\) represents the transparency or blending coefficient. When images are fused or colors are mixed, the \(\alpha\) value can control the degree of blending between the two images. When performing weighted summation of images, \(\alpha\) can be used to adjust the influence of the first image. \(\beta\) is used to represent the brightness adjustment factor, which is used to adjust the contrast or brightness of the image. \(\gamma\) represents the exponent of gamma correction, which is a nonlinear operation that aims to adjust the brightness of the image and improve the display effect of the image under different lighting conditions. In this paper, adjusting the \(\gamma\) value mainly affects the brightness and contrast of the image. \(\sigma\) usually represents the standard deviation in Gaussian filters, which mainly determines the degree of blurring of the filter. When using Gaussian filtering, \(\sigma\) controls the width of the Gaussian function, thereby affecting the filter's ability to retain image details. Smaller \(\sigma\) will result in less blur, while larger \(\sigma\) will make the image more blurred. For the images in the dataset with large differences, after multiple rounds of adjustment of different parameters, we found that the parameters of \(\alpha\), \(\beta\), \(\gamma\), and \(\sigma\) were 4, \(-\)4, 10, and 128, respectively, to achieve the best effect, solving the problems of underexposure, overexposure, and high noise. Figure 4 shows the preprocessing results.