# Enhanced Epileptic Seizure Detection through Wavelet-Based Analysis of EEG Signal Processing
## 4 Results and Discussion
### Model Classification Performance  
The evaluation of the generated models involved analyzing sensitivity, specificity, and precision metrics. Sensitivity (recall) quantifies the model's capacity to accurately detect true positives \((\mathit{TP})\) in relation to all actual positives \((\mathit{TP}+\mathit{FN})\), where \(\mathit{FN}\) are the false negatives. It evaluates the model's proficiency in detecting positive cases accurately. The mathematical expression for recall is expressed as:  
\[\text{Sensitivity (recall)}=\frac{\mathit{TP}}{\mathit{TP}+\mathit{FN}}\times 100\%.\]  
Specificity quantifies the model's ability to accurately identify true negatives \((\mathit{TN})\) among all actual negatives \((\mathit{TN}+\mathit{FP})\), where \(\mathit{FP}\) represents the false positives, thereby assessing its capability to reduce false alarms in negative case identification. The specificity is given by:  
\[\text{Specificity}=\frac{\mathit{TN}}{\mathit{TN}+\mathit{FP}}\times 100\%.\]  
Precision (accuracy) denotes the proportion of correct predictions (both positive and negative) made by the model relative to all predictions made \((\mathit{TP}+\mathit{TN}+\mathit{FP}+\mathit{FN})\). Accuracy represents an overall measure of the model's precision. The equation to obtain accuracy is expressed as:  
\[\text{Precision (accuracy)}=\frac{\mathit{TP}+\mathit{TN}}{\mathit{TP}+ \mathit{TN}+\mathit{FP}+\mathit{FN}}\times 100\%.\]  
In Table 2, the results of calculating recall (Sen), specificity (Spec), and accuracy (Acc) are presented for the three classifier models across the alpha and beta frequency bands. The signal number is indicated in the EDF file that exhibited the best performance in classification. This primarily stems from the fact that certain seizures occur in specific channels and may not be detected throughout the entire cerebral cortex. Additionally, the number of seizures recorded in each EDF file by neurophysiologists is also reported. The model trained using data from the CHB-MIT dataset achieved an average accuracy of 90.3% for the alpha band and 89.7% for the beta band. The classification results are detailed in Table 2. A graphical comparison of the accuracy achieved by the CHB-MIT model for alpha and beta bands is depicted in Figure 7.  
The model achieved high accuracy rates for each frequency band separately, demonstrating the algorithm's capability to detect seizures in EEG signal representations with significantly dimension reduction and data volumes, even from a single channel. In relation to the classification models developed for the Helsinki Hospital database, the accuracy achieved by the unprocessed model was 73.35% in the alpha band and 70.13% in the beta band. Conversely, the average accuracy achieved by the preprocessed model was 92.82% in the alpha band and 90.55% in the beta band. These results underscore the importance of preprocessing in EEG signals. Tables 3 and 4 show the performance obtained for the models constructed with unfiltered and prefiltered databases, respectively. A visual comparison of the performance from the Helsinki hospital models for the alpha and beta bands is presented in Figure 8. It is observed that models constructed with prefiltered data exhibit significantly superior performance compared to those built with unfiltered data. Thus, it can be concluded that prefiltering notably improves the reliability of EEG signals. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**EDF File** & **Signal** & **Seizures** & **Sen \(\pi\)** & **Sen \(\beta\)** & **Spec \(\pi\)** & **Spec \(\pi\)** & **Spec \(\beta\)** & **Acc \(\alpha\)** & **Acc \(\beta\)** \\ \hline eeg1.edf & 7 & 44 & 93  
Regarding processing speed, analyzing a 3600-s signal in the alpha band took an average of 70 s, indicating a processing time of 0.019444 s per second of signal. For the beta band, analyzing a signal of the same length took an average of 250 s, resulting in a processing time of 0.69444 s per second of signal.