# Parallel Implementation on FPGA of Support Vector Machines Using Stochastic Gradient Descent
## 5 Comparison with the State of the Art  
Although it was not possible to synthesize the design for a dataset with more than 4 features to compare with the state of the art, the results from the current datasets were extrapolated using a linear regression. The extrapolation was performed using data from the XOR dataset on both fixed and single precision floating point, as well as from Iris dataset using single precision floating point. The regressor has as input the number of kernels and as output the execution time. In order to compare to a model with 758 inputs, for example, the input of our regressor was 758, then the output was compared with the execution time of the model being referenced. Despite the fact that is not necessarily the case to have one kernel for each input, this draws a lower bound on our results. Further studies can show that the actual performance is different from the results presented in this work. As presented on Figure 12 the linear regression of the xor dataset using floating-point precision had a \(R^{2}\) score of 0.988, with sample time, \(t_{s}\), computed as  
\[t_{s}=20.566\times K+52.364.\]  
Figure 11: Quadratic error during training using the Iris dataset, floating point implementation. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Number of Kernels** & **Software** & **Floating Point Hardware** & **Speedup** \\ \hline
2 & 0.641 ms & 90.982 ns & 7045 \\
4 & 0.628 ms & 110.152 ns & 5701 \\
8 & 0.619 ms & 132.055 ns & 4687 \\
16 & 0.620 ms & 176.004 ns & 3641 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Execution time, \(ts\), of the Iris dataset—floating point. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Number of Kernels** & **Software** & **Floating Point Hardware** \\ \hline
2 & 1.560 Ksps (Kips) & 10.99 Msps (Mips) \\
4 & 1.592 Ksps (Kips) & 9.07 Msps (Mips) \\
8 & 1.615 Ksps (Kips) & 7.57 Msps (Mips) \\
16 & 1.612 Ksps (Kips) & 5.68 Msps (Mips) \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Throughput, \(th\), of the Iris dataset—floating point. FPGAs are also being used to accelerate algorithms in association with cluster of computers as shown in [8]. The work presents an implementation in hardware of a linear SVM accelerator in FPGA, being used to analyse a dataset of cancer imagens, with 65,536 features per image. The author's proposal divides the workload between 8 computers, each having a associated FPGA to compute the SVM. The design presented on the FPGA is serial as it can only compute at most 64 features of an image per iteration, that way requiring 1024 iterations to analyse the complete set of features. Every image is considered a sample and requires 8 ms (125 sps) to execute. The proposal presented in this paper would need 1.35 ms (741 sps) using the results from the XOR float-point, 63.3 us (15,797 sps) considering XOR fixed-point and 0.385 ms (2857 sps) with the extrapolation from the Iris float-point implementation. Resulting in speedups of 5.925\(\times\), 126.382\(\times\) and 20.779\(\times\) respectively. The work of [9] analyzes the impact of stochastic quantization on SGD convergence and speedup on reconfigurable hardware using FPGA. The authors studied the impact on the task of classifying images of handwritten digits using the Gisette dataset containing 5000 features per image. The model used to analyse the digits was described as a dense linear model, the design with best throughput presented requires 1.56 ms to compute a sample (641 sps) and uses fixed-point precision. The input data was quantized to 1 bit numbers and 128 features are analysed at a time, requiring about 39 iterations to compute a sample. When compared with the proposal presented in this paper would need 103 us to compute a sample, yielding 9708 sps and presenting a speedup of 15.145\(\times\) if the XOR float-point implementation is considered, a speedup of 319.672\(\times\) with execution time of 4.88 us (20,4918 sps) for XOR fixed-point and 29.5 us (33,898 sps) and speedup 52.881\(\times\) with the results from the Iris float-point implementation.