## 3 (DRSM-CNNFIS) Framework
### DRSM-CNNFIS Implementation  
Multiple rounds of convolution and pooling layers were used to provide single-vector output that was used by experts to extract rules associated with each class of diabetic retinopathy (normal, mild, moderate, severe, and proliferative diabetic retinopathy). In the training of CNN with Stochastic, the gradient descent with momentum (SGDM) learning rate was set to 0.1, and an early stop mechanism was used. Tuning for the linear membership function used for the FIS was based on the labeled data. The implementation used Keras and the number of epochs was set to 400. The key inputs for the fuzzy inference were features that could be measured by experts, such as:  
* Microaneurysms, which are red patterns that increase the mean value of the output numeric vector;
* Intraretinal hemorrhages, which are outlined patterns starting as dot shape that then defuse into a flame shape and increase the maximum value of the output vector;
* Exudates, which have a yellow or white thick texture and affect the range of the standard deviation of the output vector;
* Macular edema, which occurs when blood leaks into scattered parts of the retina, affecting the minimum value of the extracted features vector.  
Four trapezoidal membership functions were used for the output features: the vector mean, standard deviation, max, min, and feature map max. Table 5 presents the description for the linguistics terms used in the membership function for all variables.  
Figure 4: Fuzzy rule-based inference system of the DRSM-CNNFIS framework.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Diabetic Retinopathy Stage Measurement Inference System** & **Linguistic Value** & **Numerical Range** \\ \hline Input 1: output vector average—microaneurysms & Low, average, high & 0–100 \\ Input 2: output vector maximum—intratretinal & Low, average, high & 0–100 \\ hemorrhage & & \\ Input 3: output vector standard & & \\ deviation—exudates & Low, average, high & 0–100 \\ Input 4: output vector minimum—macular edema & Low, average, high & 0–100 \\ Output: diabetic retinopathy (DR) stage & Normal DR (NDR), mild DR (MDR), moderate & 0–100 \\  & (MoDR), severe DR (SDR), proliferative DR (FDR) & \\ \hline \hline \end{tabular}
\end{table}
Table 5: Input and output linguistic variables and their ranges.  
To accomplish the stage identification task, medical experts provided rules based on the output feature vector and the associated labels. The medical experts' decisions were based mainly on features, such as microaneurysms, hemorrhages, exudates, and macular edema [35]. Some of the rules used in the fuzzy system are shown in Figure 5.  
The aggregation method used for the rules evaluation is Mamdani inference [9]. Figure 6 shows the membership function for all the linguistic values for the fuzzy output variable: diabetic retinopathy (DR) stage, starting with normal DR (NDR), followed by mild DR (MDR), moderate (MoDR), and severe DR (SDR), and ending with proliferative DR (PDR).  
After evaluating the rules, the output showed as stage percentage. In this phase, human adjustment of the membership function interval was calculated several times to improve the classification accuracy.