## 3 Epileptic Seizure Detection
### Proposed Epileptic Seizure Detection Scheme Based on Random Neural Network  
The model proposed in this research involves the classification of EEG data utilizing RNN for epileptic seizure detection using two different datasets. A flow diagram of the proposed scheme is illustrated in Figure 2. The steps involved in the proposed methodology are outlined as follows:  
1. Data preparation;
2. Pre-processing;
3. Feature extraction;
4. Data normalization;
5. Classification using RNN. In the first step, the data are prepared for use as input in our experiments. The CHB-MIT data have been recorded with varying numbers of EEG channels in different cases; however, to standardize the data, we have selected 23 common EEG channels as shown in Table 2. Another channel has been added to the data and indicates the ictal and pre-ictal segments in the data. The data have been balanced to have an equal number of data samples in both classes. In the pre-processing stage, as illustrated in Figure 3, a band-pass filter of 0.5 Hz to 40 Hz is applied to the EEG data to remove the high-frequency artifacts from the signal [42]. The data have been divided into epochs of 3 s each with no overlap using MNE-Tools in Python [43]. Each epoch is decomposed using four levels of decomposition of DWT utilizing Daubechie's mother wavelet of the fourth order (DB4) at all 23 channels of the EEG signal. The DWT-based decomposition partitions all channels in each epoch into five frequency sub-bands: Delta Ac-4 (0.0-4.0 Hz), Theta Dc-4 (4.0-8.0 Hz), Alpha Dc-3 (8.0-15.0 Hz), Beta Dc-2 (15.0-30.0 Hz), and Gamma Dc-1 (30.0-60.0 Hz). As compared with our previous work [44], where we used raw data for feature extraction, in the current research, we utilized DWT for signal decomposition before the feature extraction phase. DWT-based decomposition of the EEG signals provides enhanced feature representation and results in a more discriminative feature set. \begin{table}
\begin{tabular}{c c} \hline \hline
**Channel Number** & **Electrode Name** \\ \hline
1 & FP1-F7 \\  
7 \\
19 & P8-O2 \\
20 & PZ-OZ \\
21 & T7-FT9 \\
22 & T7-P7 \\
23 & T8-P8 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: CHB-MIT EEG channels. Figure 2: Classification model for RNN-based epileptic seizure detection. In the feature extraction phase, four statistical features have been extracted from each frequency sub-band in each epoch. The statistical features obtained are standard deviation, mean, kurtosis, and skewness. These features have been used in the literature for training machine learning (ML) models for the diagnosis of various neurological disorders including Alzheimer's disease [45] and classification of epileptic seizures [46]. The result is a feature vector of size 23 (EEG channels) \(\times\) 5 (sub-bands) \(\times\) 4 (statistical features). Therefore, the corresponding feature vector (size 460 \(\times\) 1) for each EEG epoch is extracted and used as an input to train the RNN-based classification model. After feature extraction, the resulting data contain a total of 2730 epochs. Each epoch is labeled as either 1 or 0 for \"seizure\" and \"no seizure\" data, respectively. The method used for classification involves an RNN architecture, comprising an input layer, a hidden layer, and an output layer. The first layer is set at 460 neurons due to the size of the input vector generated at the feature extraction phase. The output layer has only one neuron as the model is performing binary classification between ictal and inter-ictal data. The hidden layer has been tuned to have 20 neurons using the trial and error method. The RNN-based model has been trained and tested multiple times using different sets of training and testing ratios and LR, as illustrated in Tables 3 and 4. The RNN-based epilepsy classification model has been trained and tested in five different scenarios. In scenario 1, RNN-based epilepsy classification has been performed using the CHB-MIT dataset.