Detection of Epileptic Seizures Using Wavelet Transform, Peak Extraction and PSR from EEG Signals

: In this study, techniques were proposed for the detection of epileptic seizures from electroencephalogram (EEG) signals using the wavelet transform (WT), peak extraction and phase–space reconstruction (PSR) based Euclidean distances. In the ﬁrst step, the wavelet coe ﬃ cients were extracted after eliminating the noise from the EEG signals using a WT, which is a widely used signal processing technique. In the second step, the peaks were extracted from the wavelet coe ﬃ cients. In the third step, the continuous peaks that were extracted were mapped to 3D coordinates using PSR. In the fourth step, the Euclidean distances between the mapped 3D coordinates and the origin were obtained. The features of the Euclidean distances obtained were extracted using statistical techniques. The ﬁnal features extracted were used as inputs to the neural network with weighted fuzzy membership (NEWFM). NEWFM contains the bounded sum of weighted fuzzy memberships (BSWFMs) that can reveal the di ﬀ erences in the graphic characteristics between normal EEG signals and epileptic-seizure EEG signals. The BSWFMs can easily be embedded in a portable device to detect epileptic seizures from EEG signals in real life.


Introduction
Epilepsy is a chronic disease in which seizures occur repeatedly for a prolonged period of time without the appearance of high fever or any other particular trigger [1]. When excessive epileptic-seizure discharges occur locally in one part of the brain, the condition is called partial epilepsy. When these seizure discharges occur in the entire brain, the condition is called generalized epilepsy [2]. Symptoms of epilepsy can be expressed in numerous ways [2,3]. When there is a simple subjective symptom or local convulsions without clouding of consciousness, the condition is called a simple partial seizure [2,4]. While seizures are classified as focus or generalized according to their onset, it is recognized that focal seizures can evolve to generalize [5]. The focal evolution of generalized seizures is recorded in several studies [6][7][8], but much less recognized. The phenomenon of focusing evolution was described as a general beginning of spike-and-wave or focal spike-and-wave activity [7] or poly-spike-and-wave activity with ictal progression with biased rhythmic seta [8]. It is important to recognize a subset of these primary generalized seizures-called generalized seizures by focal evolution seizures (GOFE)-because these patients are often misdiagnosed and treated with antiepileptic drugs (EDs) specific to focal seizures, and there is a risk of incomplete control and deterioration of seizures. When the seizures are accompanied by epileptic-seizure discharges in the brain and are repeated over a long period of time without any particular trigger, the condition is diagnosed as epilepsy [2][3][4].
The phase-space reconstruction (PSR) technique was used to analyze the visual aspect of EEG signals in order to detect epileptic seizures [9,10]. In addition, the electroencephalogram (EEG) signals brain and are repeated over a long period of time without any particular trigger, the condition is diagnosed as epilepsy [2][3][4].
The phase-space reconstruction (PSR) technique was used to analyze the visual aspect of EEG signals in order to detect epileptic seizures [9,10]. In addition, the electroencephalogram (EEG) signals were decomposed into frequency domain using a Fourier transform [11]. The WT decomposed the EEG signals into time-frequency domain [12]. Nonlinear techniques, such as the Lyapunov index and correlation dimension were used to simplify the EEG signals [13,14]. The coefficients generated by the wavelet transform were used as inputs to a classifier called a mixture of expert (ME) model or as inputs to an adaptive neuro-fuzzy inference system [15,16]. A model was developed in which entropy and feed-forward neural networks were mixed [17].
In this study, a method was proposed for detecting epileptic seizures from EEG signals using a neural network with weighted fuzzy membership (NEWFM) and signal processing technology [18][19][20]. This study comprises two parts. The first part encompasses the description of the process of extracting features after processing EEG signals, and the second part details the description of the process of detecting epileptic seizures using the extracted features as the input of NEWFM. During signal processing, wavelet coefficients were generated after removing the noise from the EEG signals using the WT, and peaks were extracted from the generated wavelet coefficients. The continuously extracted peaks were mapped to 3D coordinates using phase-space reconstruction. Finally, the Euclidean distances between the origin and mapped coordinates were obtained. From the obtained Euclidean distances, features that would be used as inputs to NEWFM were extracted using the statistical technique. The features extracted using the statistical technique were used as inputs to the NEWFM to detect epileptic seizures.
The remainder of the study is organized as follows. We describe experimental data in Section 2.1, wavelet transforms in Section 2.2, peak extraction in Section 2.3, phase-space reconstruction in Section 2.4 and Euclidean distance and feature extraction using statistical techniques in Section 2.5. Section 2.6 explains NEWFM as a classifier. Section 3 describes the classification performance as an experimental result. Finally, the conclusions are presented in Section 4.

Overview of Epileptic-Seizure Detection
As evident from the epilepsy-seizure detection model in Figure 1, the peaks in this study were mapped to the 3D coordinates through WT, peak extraction and PSR, which are preprocessing processes. The features were extracted according to the distances between their mapped 3D coordinates and the origin using frequency distribution and frequency variations, which are statistical techniques. The extracted features were used as inputs to the NEWFM to detect epileptic seizures.

Experimental Data
The EEG signals used by Subasi [15] were used to classify normal EEG signals and epilepticseizure EEG signals in this study. Furthermore, the experimental data used by them were divided into 5 experimental groups (A, B, C, D and E). Each experimental group contained 100 single-channel EEG signals. Experiments were conducted using the experimental groups A and E. Experimental group A contains normal EEG signals collected from healthy subjects, and experimental group E contains epileptic EEG signals collected from subjects exhibiting epilepsy symptoms. Table 1 describes the experimental groups used by Subasi [15].

Experimental Data
The EEG signals used by Subasi [15] were used to classify normal EEG signals and epileptic-seizure EEG signals in this study. Furthermore, the experimental data used by them were divided into 5 experimental groups (A, B, C, D and E). Each experimental group contained 100 single-channel EEG signals. Experiments were conducted using the experimental groups A and E. Experimental group A contains normal EEG signals collected from healthy subjects, and experimental group E contains epileptic EEG signals collected from subjects exhibiting epilepsy symptoms. Table 1 describes the experimental groups used by Subasi [15].

Wavelet Transforms
The wavelet transform (WT) is a transformation technique that represents the time and frequency components for signals, in which the frequency component changes over time [21,22]. In general, the Fourier transform indicates the frequency components under the assumption that the signals do not change over time. By contrast, wavelet transform is a transform technique used to represent time and frequency components for signals, in which the frequency components change over time in signal processing fields, such as EEG signals.
The main advantage of the WT is that we can use either short or long time intervals to observe the characteristics of the EEG signals. Smaller windows can be applied for EEG signals with fast variation, whereas larger windows can be applied for EEG signals with slow variation. In addition, the approximation and detailed coefficients can be simultaneously calculated. The number of decomposition levels is crucial in the analysis of EEG signals using the WT. Figure 2 depicts the filter bank used for implementing bisector discontinuous wavelet separation. g(n), which is called a detail, is a finite impulse filter (FIR) high-pass filter coefficient associated with wavelet coefficients and h(n), which is called an approximation, is an FIR low-pass filter coefficient related to scale function coefficients. The h(n) signals, of which the length was reduced to half after passing each filter, are repeatedly transformed at the next scale level. In this study, 512 consecutive points were constructed as one signal using EEG signals. Daubechies 4 wavelet transform was performed on the signals constructed to extract detail coefficients (D1, D2) and approximation coefficients (A1, A2), which are wavelet coefficients and were extracted up to scale level 2.

Class Training Set
Test Set

Wavelet Transforms
The wavelet transform (WT) is a transformation technique that represents the time and frequency components for signals, in which the frequency component changes over time [21,22]. In general, the Fourier transform indicates the frequency components under the assumption that the signals do not change over time. By contrast, wavelet transform is a transform technique used to represent time and frequency components for signals, in which the frequency components change over time in signal processing fields, such as EEG signals.
The main advantage of the WT is that we can use either short or long time intervals to observe the characteristics of the EEG signals. Smaller windows can be applied for EEG signals with fast variation, whereas larger windows can be applied for EEG signals with slow variation. In addition, the approximation and detailed coefficients can be simultaneously calculated. The number of decomposition levels is crucial in the analysis of EEG signals using the WT. Figure 2 depicts the filter bank used for implementing bisector discontinuous wavelet separation. g(n), which is called a detail, is a finite impulse filter (FIR) high-pass filter coefficient associated with wavelet coefficients and h(n), which is called an approximation, is an FIR low-pass filter coefficient related to scale function coefficients. The h(n) signals, of which the length was reduced to half after passing each filter, are repeatedly transformed at the next scale level. In this study, 512 consecutive points were constructed as one signal using EEG signals. Daubechies 4 wavelet transform was performed on the signals constructed to extract detail coefficients (D1, D2) and approximation coefficients (A1, A2), which are wavelet coefficients and were extracted up to scale level 2.

Peak Extraction
A peak refers to a point where there is a fall in signals that have previously been rising. Many peaks that exist in a wavelet coefficient are extracted by performing the wavelet transform, as depicted in Figure 3. However, as observed in Figure 3, there are peaks where signals fall after rising only once or twice. Such peaks are marked with a circle (O). By contrast, there are peaks where signals fall after rising at least thrice. These peaks are marked with a square (□). The technique to extract peaks proposed herein can extract only those peaks where signals fall after rising at least thrice consecutively. It neglects those peaks where signals fall after rising only once or twice.

Peak Extraction
A peak refers to a point where there is a fall in signals that have previously been rising. Many peaks that exist in a wavelet coefficient are extracted by performing the wavelet transform, as depicted in Figure 3. However, as observed in Figure 3, there are peaks where signals fall after rising only once or twice. Such peaks are marked with a circle (O). By contrast, there are peaks where signals fall after rising at least thrice. These peaks are marked with a square ( ). The technique to extract peaks proposed herein can extract only those peaks where signals fall after rising at least thrice consecutively. It neglects those peaks where signals fall after rising only once or twice.

Phase Space Reconstruction
The phase-space reconstruction technique is a technique for analyzing dynamic or random signals based on phase spaces [23]. When the consecutive peaks that were already extracted were assumed to be x(t), x(t + 1) and x(t + 2), x(t) was mapped on the x-axis of the phase space, x(t + 1) was mapped on the y-axis and x(t + 2) was mapped on the z-axis to create 3D coordinates. Figure 4 highlights the difference between the phase-space reconstruction for the peaks of the normal EEG signals and the phase-space reconstruction for the peaks of epileptic-seizure EEG signals. It is observed that the phase-space reconstruction for the peaks of normal EEG signals is concentrated in one place compared to the phase-space reconstruction for the peaks of epileptic-seizure EEG signals. Based on these results, when the peaks of normal EEG signals are applied to the phase-space reconstruction, the phase-space reconstruction exhibits regular shapes and occupies a small space; however, when the peaks of epileptic-seizure EEG signals are applied to the phase-space reconstruction, the phase-space reconstruction displays irregular shapes and occupies a large space.

Phase Space Reconstruction
The phase-space reconstruction technique is a technique for analyzing dynamic or random signals based on phase spaces [23]. When the consecutive peaks that were already extracted were assumed to be x(t), x(t + 1) and x(t + 2), x(t) was mapped on the x-axis of the phase space, x(t + 1) was mapped on the y-axis and x(t + 2) was mapped on the z-axis to create 3D coordinates. Figure 4 highlights the difference between the phase-space reconstruction for the peaks of the normal EEG signals and the phase-space reconstruction for the peaks of epileptic-seizure EEG signals. It is observed that the phase-space reconstruction for the peaks of normal EEG signals is concentrated in one place compared to the phase-space reconstruction for the peaks of epileptic-seizure EEG signals. Based on these results, when the peaks of normal EEG signals are applied to the phase-space reconstruction, the phase-space reconstruction exhibits regular shapes and occupies a small space; however, when the peaks of epileptic-seizure EEG signals are applied to the phase-space reconstruction, the phase-space reconstruction displays irregular shapes and occupies a large space.

Phase Space Reconstruction
The phase-space reconstruction technique is a technique for analyzing dynamic or random signals based on phase spaces [23]. When the consecutive peaks that were already extracted were assumed to be x(t), x(t + 1) and x(t + 2), x(t) was mapped on the x-axis of the phase space, x(t + 1) was mapped on the y-axis and x(t + 2) was mapped on the z-axis to create 3D coordinates. Figure 4 highlights the difference between the phase-space reconstruction for the peaks of the normal EEG signals and the phase-space reconstruction for the peaks of epileptic-seizure EEG signals. It is observed that the phase-space reconstruction for the peaks of normal EEG signals is concentrated in one place compared to the phase-space reconstruction for the peaks of epileptic-seizure EEG signals. Based on these results, when the peaks of normal EEG signals are applied to the phase-space reconstruction, the phase-space reconstruction exhibits regular shapes and occupies a small space; however, when the peaks of epileptic-seizure EEG signals are applied to the phase-space reconstruction, the phase-space reconstruction displays irregular shapes and occupies a large space.

Feature Extraction Using Euclidean Distances and Statistical Techniques
In this study, the Euclidean distances between the origin and the mapped 3D coordinates were obtained to extract the features that can be used as inputs of NEWFM, as shown in Figure 4. From the obtained Euclidean distances, 16 features (4 features each from wavelet coefficients D1, D2, A1 and A2) were extracted to be used as inputs in this study using the statistical techniques shown in Table 2.  Table 2 refer to the frequency distribution of EEG signals. In addition, the statistical technique (4) represents the frequency change for EEG signals.

Neural Networks with Weighted Fuzzy Membership (NEWFM)
NEWFM is a version of a fuzzy neural network that uses the bounded sum of weighted fuzzy memberships (BSWFMs) [18][19][20]. Figure 5 illustrates the structure of the NEWFM that comprises three layers, namely the input, hyperbox and the class layer. An hth input node can be used as I h = {A h = (a 1 , a 2 , a 3 , a 4 , . . . , a n ), class}, where class is the class node and A h is n features. A total of 16 features were used as the inputs, as represented in Figure 5.

No
Description of the Features

Neural Networks with Weighted Fuzzy Membership (NEWFM)
NEWFM is a version of a fuzzy neural network that uses the bounded sum of weighted fuzzy memberships (BSWFMs) [18][19][20]. Figure 5 illustrates the structure of the NEWFM that comprises three layers, namely the input, hyperbox and the class layer. An hth input node can be used as Ih = {Ah = (a1, a2, a3, a4, …, an), class}, where class is the class node and Ah is n features. A total of 16 features were used as the inputs, as represented in Figure 5.
The Adjust(Bl) operation adjusts the weights and the center of the membership in Figure 6. W1, W2 and W3 are moved up or down, v1 and v2 are moved up to ai and v3 stays in the same position. After finishing the Adjust(Bl) operation, each fuzzy set in the hyperbox node Bl in Figure 5 contains three weighted fuzzy memberships (WFMs). The WFM implies gray memberships, as depicted in Figure  7. The bounded sum of WFMs (BSWFM) in the ith fuzzy set, is defined as follows: The BSWFM is represented by the bold line in Figure 7. The two BSWFMs graphically illustrate the distinction between normal EEG signals and epileptic-seizure EEG signals for each feature.  The Adjust(B l ) operation adjusts the weights and the center of the membership in Figure 6. W 1 , W 2 and W 3 are moved up or down, v 1 and v 2 are moved up to a i and v 3 stays in the same position. After finishing the Adjust(B l ) operation, each fuzzy set in the hyperbox node B l in Figure 5 contains three weighted fuzzy memberships (WFMs). The WFM implies gray memberships, as depicted in Figure 7. The bounded sum of WFMs (BSWFM) in the ith fuzzy set, B i l (x) denoted as, µ i b (x) is defined as follows: The BSWFM is represented by the bold line in Figure 7. The two BSWFMs graphically illustrate the distinction between normal EEG signals and epileptic-seizure EEG signals for each feature.   Figure 8 presents an example of the BSWFM for the wavelet coefficient D1. The BSWFM highlights the differences between normal EEG signals and epileptic-seizure EEG signals as visible and interpretable rules. The differences between the 16 features can be analyzed via the graphic characteristics of these BSWFMs. The 16 BSWFMs can easily be embedded in the portable device to detect epileptic seizures from EEG signals in real life because they consist of x-y coordinates, as depicted in Figure 8.

Experimental Results
In this study, the performance of NEWFM is compared with that of a mixture of expert (ME) [15]. In Equation (2), true positive (TP) indicates cases where the epileptic seizure was identified accurately as an epileptic seizure, whereas TN indicates those cases where a normal is accurately identified as normal from the EEG signal. On the contrary, false positive (FP) means those cases where the normal was identified inaccurately and false negative (FN) implied those cases where an epileptic seizure was inaccurately identified from the EEG signal. Table 3 presents the confusion  matrix of the performance results and Table 4 details the accuracy, sensitivity and specificity, as defined in Equation (2).
The classification performance obtained from the 16 features is listed in Tables 3 and 4. In Table  4, the classification performance was compared with that of Subasi [15]. The classification   Figure 8 presents an example of the BSWFM for the wavelet coefficient D1. The BSWFM highlights the differences between normal EEG signals and epileptic-seizure EEG signals as visible and interpretable rules. The differences between the 16 features can be analyzed via the graphic characteristics of these BSWFMs. The 16 BSWFMs can easily be embedded in the portable device to detect epileptic seizures from EEG signals in real life because they consist of x-y coordinates, as depicted in Figure 8.

Experimental Results
In this study, the performance of NEWFM is compared with that of a mixture of expert (ME) [15]. In Equation (2), true positive (TP) indicates cases where the epileptic seizure was identified accurately as an epileptic seizure, whereas TN indicates those cases where a normal is accurately identified as normal from the EEG signal. On the contrary, false positive (FP) means those cases where the normal was identified inaccurately and false negative (FN) implied those cases where an epileptic seizure was inaccurately identified from the EEG signal. Table 3 presents the confusion  matrix of the performance results and Table 4 details the accuracy, sensitivity and specificity, as defined in Equation (2).
The classification performance obtained from the 16 features is listed in Tables 3 and 4. In Table  4, the classification performance was compared with that of Subasi [15]. The classification  Figure 8 presents an example of the BSWFM for the wavelet coefficient D1. The BSWFM highlights the differences between normal EEG signals and epileptic-seizure EEG signals as visible and interpretable rules. The differences between the 16 features can be analyzed via the graphic characteristics of these BSWFMs. The 16 BSWFMs can easily be embedded in the portable device to detect epileptic seizures from EEG signals in real life because they consist of x-y coordinates, as depicted in Figure 8.

Experimental Results
In this study, the performance of NEWFM is compared with that of a mixture of expert (ME) [15]. In Equation (2), true positive (TP) indicates cases where the epileptic seizure was identified accurately as an epileptic seizure, whereas TN indicates those cases where a normal is accurately identified as normal from the EEG signal. On the contrary, false positive (FP) means those cases where the normal was identified inaccurately and false negative (FN) implied those cases where an epileptic seizure was inaccurately identified from the EEG signal. Table 3 presents the confusion matrix of the performance  results and Table 4 details the accuracy, sensitivity and specificity, as defined in Equation (2).   Table 2.

Conclusions
In this study, combined methodologies are proposed for detecting epileptic seizures from EEG signals using wavelet transforms, peak extraction, PSR and Euclidean distances. In the preprocessing step, the wavelet coefficients were extracted after removing noise from the EEG signals. The peaks were extracted from the wavelet coefficients. The continuous peaks extracted were mapped to 3D coordinates using PSR. The Euclidean distances between the coordinates that were mapped to 3D coordinates and the origin were obtained. The features of the Euclidean distances obtained were extracted using statistical techniques. In this study, 16 features were used as inputs for the NEWFM and were extracted using the WT, peak extraction, PSR and Euclidean distances.
For the detection step, the NEWFM contains BSWFMs that can reveal the differences between the graphic characteristics of normal EEG signals and epileptic-seizure EEG signals. In this study, the NEWFM obtains 16 BSWFMs for the 16 features in order to elucidate the differences between normal EEG signals and epileptic-seizure EEG signals, as depicted in Figure 8. The classification performance of the NEWFM exhibited a higher performance than that of Subasi by 3% and 6% in terms of accuracy and specificity, respectively. The technique proposed in this study indicates that BSWFMs can be easily embedded in a portable device to detect epileptic seizures from EEG signals in real life.  Table 2  The classification performance obtained from the 16 features is listed in Tables 3 and 4. In Table 4, the classification performance was compared with that of Subasi [15]. The classification Symmetry 2020, 12, 1239 9 of 10 performance of the NEWFM was higher than that of Subasi by 3% and 6% in terms of accuracy and specificity, respectively. Sensitivity = TP TP + FN × 100% Specificity = TN TN + FP × 100% Accuracy = TP + TN TP + FN + TN + FP × 100% (2)

Conclusions
In this study, combined methodologies are proposed for detecting epileptic seizures from EEG signals using wavelet transforms, peak extraction, PSR and Euclidean distances. In the preprocessing step, the wavelet coefficients were extracted after removing noise from the EEG signals. The peaks were extracted from the wavelet coefficients. The continuous peaks extracted were mapped to 3D coordinates using PSR. The Euclidean distances between the coordinates that were mapped to 3D coordinates and the origin were obtained. The features of the Euclidean distances obtained were extracted using statistical techniques. In this study, 16 features were used as inputs for the NEWFM and were extracted using the WT, peak extraction, PSR and Euclidean distances.
For the detection step, the NEWFM contains BSWFMs that can reveal the differences between the graphic characteristics of normal EEG signals and epileptic-seizure EEG signals. In this study, the NEWFM obtains 16 BSWFMs for the 16 features in order to elucidate the differences between normal EEG signals and epileptic-seizure EEG signals, as depicted in Figure 8. The classification performance of the NEWFM exhibited a higher performance than that of Subasi by 3% and 6% in terms of accuracy and specificity, respectively. The technique proposed in this study indicates that BSWFMs can be easily embedded in a portable device to detect epileptic seizures from EEG signals in real life.