# A Deep Learning Ensemble Method to Visual Acuity Measurement Using Fundus Images
## 4 Deep Learning-Based Ensemble Method for VA Measurement
### ML Models and Classification Performances
#### 4.2.2 ML Model for Step-2-1: SVM (RBF Kernel)  
SVM is an algorithm based on statistical learning theory. It was initially devised to solve binary classification and regression analysis problems and extended for multiple classifications later. In addition, since the nonlinear separation between classes has been possible to solve using the notion of kernel method [31], it is popularly being used for data mining, artificial intelligence, prediction, and medical diagnosis. In SVM, the learning data in a multidimensional space is expressed by:  
\[\{x_{i},y_{i}\},i=1,\ldots,n,y_{i}\in\{+1,-1\} \tag{1}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Optimizer** & **Learning Rate** & **Batch Size** & **Epoch** \\ \hline VGG19 CNN & [PERSON] & 0.00002 & 128 & 500 \\ \hline EfficientNet-B7 & [PERSON] & 0.00002 & 128 & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Learning parameters for VGG19 and EfficientNet-B7. Figure 6: VGG19-based CNN model for VA classification. Figure 7: Training results of VGG19-based CNN for Step-1. (**a**) Accuracy; (**b**) Loss; (**c**) Confusion matrix; (**d**) Classification report. where \(x_{i}\) is a set of data and \(y_{i}\) is a label of \(x_{i}\). For such learning data, several hyperplanes that separate the two classes can exist, but only one optimal hyperplane exists as shown in Figure 8a. Such an optimal hyperplane maximizes the distance between the data closest to the hyperplane separated among each class of data. A hyperplane is defined by:  
\[\omega^{T}\cdot x+b=0 \tag{2}\]  
If data are linearly separable as shown in Figure 8a, the hyperplane that separates the two classes can be defined by Equation (3):  
\[\forall i,y_{i}(\omega^{T}\cdot x_{i}+b)-1\geq 0 \tag{3}\]  
where \(\omega\) is a vector of weight. The training data for these two hyperplanes is called a support vector. In addition, since the margin between two hyperplanes must be maximized to obtain the hyperplanes of two classes, it becomes an optimization problem like the following objective of Equation (4) under Equation (3) as a constraint:  
\[\min\{\frac{1}{2}||\omega||^{2}\} \tag{4}\]  
In most cases, the data do not satisfy the above constraint because they are not linearly separable, as shown in Figure 8b. To solve this problem, the constraint is extended with a slack variable \(\xi\) representing the distance from the hyperplane to misplaced data, and the objective is extended with a penalty term \(c\). As a result, we obtain an optimization problem as follows:  
\[objective : \min\{\frac{1}{2}||\omega||^{2}+c\sum_{i=1}^{n}\xi_{i}\} \tag{5}\] \[s.t : y_{i}(\omega^{T}\cdot x_{i}+b)>1-\xi_{i} \tag{6}\]  
For nonlinear data, a hyperplane of data having a nonlinear boundary can be obtained by data space transformation using \(K(x_{i},x_{j})\) (Kernel function) for the features of data \(x_{i}\) and \(x_{j}\). The representative \(K(x_{j},x_{j})\) is defined by, respectively:  
* Polynomial (Inhomogeneous): \(K(\overrightarrow{x_{i}},\overrightarrow{x_{j}})=(\overrightarrow{x_{i}} \cdot\overrightarrow{x_{j}}+r)^{d}\);
* Radial basis function: \(K(\overrightarrow{x_{i}},\overrightarrow{x_{j}})=exp(\frac{||\overrightarrow {x_{i}}-\overrightarrow{x_{j}}||^{2}}{2\sigma^{2}})\);
* Sigmoid function: \(K(\overrightarrow{x_{i}},\overrightarrow{x_{j}})=\tanh(\kappa\overrightarrow {x_{i}}\cdot\overrightarrow{x_{j}}+c)\) for some (not every) \(\kappa>0\) and \(c<0\), where \(\kappa\) is a gradient and \(c\) is a bias term (intercept). Now, the SVM model using RBF kernel that we used for Step-2-1 is explained. First, we resize all the images from \(300\times 300\times 3\) to \(32\times 32\times 3\), as shown in Figure 9, which  
Figure 8: Hyperplanes in SVM. (**a**) Hard-margin; (**b**) soft-margin. shows the data shape and features that SVM-RBF-Kernel would use to reason the class of a fundus image.