# Online EEG Seizure Detection and Localization
## 4 Discussion  
Detecting seizures is a challenging problem, and a real-time seizure detection algorithm is even more challenging. Previous studies have shown a promising performance for detecting seizures, as shown in Table 6. However, those algorithms require a large amount of training on the data from previous seizures (patient-specific methods) or training on EEG signals of different seizure and non-seizure periods (seizure-specific methods). For instance, [PERSON] [20] and [PERSON] and [PERSON] [37] obtained a better sensitivity value (96% and 98%, respectively) than the TPR reported in this study (mean TPR = 72%, median TPR = 83%). However, their approaches were trained and tested on a specific patient. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Study** & **Methods, Classifier1** & **Available** & **\#Patients, Dataset2** & **\#Seizures** & **TPR\%** & **FPH (hour1)** & **PS/NPS3** \\ \hline [PERSON] et al. [21] & WD, SVM & — & 36,139 & 82.5 & 0.16 & PS \\ \hline [PERSON] [20] & SVM & CHB-MIT & 23,163 & 96 & 0.08 & PS \\ (2009) & WD & — & 1463 & 90.5 & 0.51 & PS \\ \hline [PERSON] [38] & WD, LDA & CHB-MIT & 526 & 83.6 & — & PS \\ (2012) & & TFDE, NNL & CHB-MIT & 22,131 & 81 & 0.15 & PS \\ \hline [PERSON] [37] & IPSO, ANN & CHB-MIT & 23,161 & 98 & 0.125 & PS \\ (2013) & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Performance of previous studies. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Mean** & **Median** \\ \hline TPR & 0.72 & 0.83 \\ FPH & 2.82 & 2.96 \\ Detection latency & 9.002 & 8 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Overall temporal performance. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Type/Region** & **Total** & **Localized** & **Sensitivity** \\ \hline Generalized & 88 & 64 & 0.73 \\ Focal & 87 & 41 & 0.47 \\ Right hemisphere & 50 & 39 & 0.78 \\ Right hemisphere lobes & 50 & 39 & 0.78 \\ Left hemisphere & 23 & 6 & 0.26 \\ Left hemisphere lobes & 23 & 10 & 0.43 \\ Central regions & 10 & 8 & 0.80 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Localization performance on the Karuniya dataset. Although non-patient-specific approaches are more amenable to generalization compared to patient-specific methods, they require a huge amount of the EEG data for training their classifiers. [PERSON] and [PERSON] [48] used a training set which contained 652 h EEG data including 126 clinical seizures from 28 patients, and the [PERSON] [50] training set consisted of 367 h of EEG signals, which contained 58 clinical seizures from 14 patients. Despite the size of the training dataset for these two studies, the non-trained proposed method has generally outperformed them. The overall performance of the proposed method was negatively affected by three patients--14, 15, and 16. Excluding these outliers enhances the overall TPR (mean TPR = 81.5%, median TPR = 85.7%). The main reason for the poor performance of the algorithm on these patients was an excessive level of artifacts. The EEG signals from patients 14 and 15 contained significant artifacts in the recordings and would require an enhanced preprocessing method to be able to differentiate the activities. The seizures for patient 16 lasted an average of only 8.4 s, which was less than the length of the epoch of the proposed system. Only one seizure lasted more than 10 s (14 s). It is hoped that by decreasing the epoch size, these types of short seizures attacks will be detectable. Compared to previous studies using computationally expensive classifiers, such as neural networks and PSO, the proposed algorithm is time-efficient and cost-effective. Table 7 contains the average times required to compute the main functions in milliseconds. The computation times were calculated for an implementation in MATLAB R2017b with Intel Core i7-6700 CPU @ 4.00 GHz with 32 GB RAM. The FFT, PBI, and threshold adaptation functions are computed for every 10 second epoch. The most computationally expensive part of the proposed algorithm is the generation of the CN.