# Real-Time Localization of Epileptogenic Foci EEG Signals: An FPGA-Based Implementation
## 3 Hardware Implementation and Computational Method
### Computation of the RT-EPI Algorithm
#### 3.4.1 Algorithm Description
\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Authors** & **Classifier Type** & **Extracted Feature** & **Accuracy** \\ \hline [PERSON] et al. (2015) [17] & LS-SVM & EMD with IMFs & 87.0\% \\ [PERSON] et al. (2016) [18] & k-NN & EMD-DWT, log-energy entropy & 89.4\% \\ [PERSON] et al. (2017) [21] & SVM, k-NN & MFDFA & 92.2\% \\ [PERSON] et al. (2017) [22] & LS-SVM & DFT based filter bank & 89.7\% \\ [PERSON] et al. (2017) [16] & LS-SVM & TQWT1  & 95.0\% \\ [PERSON] et al. (2017) [13] & LS-SVM & Wavelet based entropies & 94.3\% \\ [PERSON] et al. (2017) [15] & LS-SVM & Fuzzy entropy of TQWT & 84.7\% \\ [PERSON] et al. (2018) [20] & LS-SVM & Rhythm separation from EWT & 90.0\% \\ [PERSON] et al. (2018) [23] & ELM & Clustering VMD & 96.0\% \\ [PERSON] et al. (2018) [24] & ANFIS & Extracted from CWT & 96.0\% \\ [PERSON] et al. (2019) [19] & RBF-NN & EMD and PSR & 97.0\% \\ [PERSON] et al. (2019) [25] & DNN & Fourier transform & 95.5\% \\ [PERSON] et al. (2019) [25] & DNN & Wavelet transform & 97.4\% \\ [PERSON] et al. (2019) [25] & DNN & Raw data & 98.6\% \\ [PERSON] et al. (2019) [25] & DNN & 6 IMFs from EMD & 98.9\% \\ [PERSON] et al. (2019) [47] & Stacked SVM & VMD, DWT, and others2 & 95.2\% \\ [PERSON] et al. (2019) [48] & SVM & LSDA from bispectrum & 96.2\% \\ _This work_ & _Neural Network_ & _5 low computational complexity_ & 95.5\% \\  & & _features extracted in real-time_ & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of focal and non-focal classification results with previous works. Note that the computational cost of the feature extraction process in previous works is greater than the computational cost of the feature set proposed in our work. The only work in the bibliography having a computational cost comparable to that of our work is [PERSON] et al. (2020), that obtained a 89.7% of classification accuracy deriving features from DFT-based rhythms of the EEG. In the same way, we have to compute the DFT too. Nevertheless, we obtain a better classification accuracy (5.8% more). Thus, despite its simplicity, a classification procedure that performs better than most of related works, or, in the worst case, got surpassed by a maximum of 1.5% of classification accuracy (not considering ([PERSON] and [PERSON], 2018)) was achieved. However, this work does not propose just an optimum feature set, but an optimum classification procedure, as a whole. Thus, the proposed feature set, Table 2, can be combined optimally with a neural network classifier model when five seconds of segment length are used (Section 4.1). Our analysis indicates that this, altogether, guarantees the best accuracy performance with a minimum computational cost. The proposed neural network is of perceptron type, with just one hidden layer of 25 hidden neurons, five input neurons (the dimensionality of the proposed feature set) and two output neurons in the output layer. On the other hand, the FPGA real-time implementation of the classification procedure, following Algorithms 1 and 2, has been done using a sequential architecture. The benefits of using this architecture are the minimization of the memory usage and the number of arithmetic hardware blocks. Anyway, to improve the throughput results this computation can be easily parallelized. The proposed hardware design allows the definition of floating point arithmetic units of single or double data type precision (following the IEEE 754 standard for floating-point arithmetic). As it was expected, both designs offer a great MAE accuracy. \"Double\" design achieves an accuracy similar to the Matlab environment implementation: 3.94\(\times\)10\({}^{-15}\), while the \"float\" design offers a great accuracy: 1.00 \(\times\)10\({}^{-6}\). MAE accuracy was measured using the Matlab implementation as a reference. The analysis demonstrates that the proposed hardware implementation does not uses many resources.