## Materials and Methods
### Convolution Neural Network  
A simple neural network with a set of input, multiple hidden layers, and an output layer was used. Each hidden layer is similar to a neuron with a set of inputs and weighted outputs, which produces output with the help of an activation function [25, 26, 27, 28, 29]. Convolution neural network (CNN) learns such features on the patterns from the input training images when those patterns occur repeatedly in the input data. In diabetic retinopathy, those features are distortions in blood vessels, with macula occurring in the retina. When these features occur repeatedly and CNN sufficiently learns to classify them, they form a model. Then, this model is tested with a new dataset for accuracy.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**DR Category/No. of Images**} & \multicolumn{2}{c}{**Training**} & \multicolumn{2}{c}{**Testing**} \\ \cline{2-5}  & **Left Eye** & **Right Eye** & **Left Eye** & **Right Eye** \\ \hline Normal (No DR) & 12,871 & 12,939 & 19,717 & 19,816 \\ Mild DR & 1212 & 1231 & 1905 & 1875 \\ Moderate DR & 2702 & 2590 & 3957 & 3904 \\ Severe DR & 425 & 448 & 613 & 601 \\ Proliferate DR & 353 & 355 & 596 & 610 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The number of images in each diabetic retinopathy (DR) category for training and testing.  
Figure 1: Sample images from the five different image classes showing various DR stages: No DR, Mild DR, Moderate DR, Severe DR, and Proliferate DR. As the disease progresses, blood vessels expand, slowly distorting vision over time.  
A filter or convolution kernel is a matrix that is convolved with the input image to detect specific features. Consider an example where the input image is \(4\times 4\). A \(3\times 3\) filter is applied to the image, resulting in an output. This process is repeated by moving the filter by one column, generating a second output. The initial choice of the filter size is random and is optimized based on the accuracy. The learning rate determines the step size at each iteration. It is important to have an optimum learning rate because a too-small learning rate will slow down the convergence, and a too-high learning rate may make a learning jump over minima. To determine an optimum learning rate, the system is trained with different learning rates, typically starting from 0.001, and a rate that results in the highest accuracy is chosen. Activation functions are mathematical equations that determine the output of a neural network [29; 30; 31]. Without activation functions, the output of the neural network is linear. An epoch is when one scans the complete dataset in one pass through the neural network in either a forward or backward direction. The number of epochs impacts the performance of a system. If a dataset is very large and the number of epochs is chosen incorrectly, the time to train the system increases. Thus, it is important to choose an optimum epoch value. A hidden layer is an intermediate layer between the input and output layers, where a set of weighted inputs produces an output through an activation function [32].  
The CNN architecture consists of convolution and pooling layers. The convolution layer is a core layer of a neural network and performs convolution operation (point-wise or depth-wise). The pooling layer is used to reduce the spatial size of convolved features. There are two types of pooling layers: max pooling and average pooling. A fully connected layer, following the pooling layer, holds composite and aggregated information and is used to predict the output as either healthy or unhealthy.