Keywords

1 Introduction

Epilepsy is one of the major neurological brain disorders which commonly occur due to one or more chronic conditions. Epilepsy is characterized by recurrent and uncontrollable electrical seizures due to sudden alteration in the electrical activity of the brain in the cortex [1]. EEG is a valuable tool to monitor the nonlinear electrical function of the brain activity. Epileptic seizures are commonly detected and tested by observation of EEG signal [2]. Currently, in the most cases, diagnosis of epileptic seizures is done manually through the observation of EEG signals which includes spikes, sharp waves, and spike-and-wave complexes not only during a seizure but also a short time before and between seizures [3]. An area of great interest is the development of efficient and reliable techniques for automatic diagnosis of early onset of seizures or even predicting before physical manifestations begin [4]. The DWT has been used effectively for detecting the epileptic seizer [5]. In many recent works, the automatic detection and decision-making system using neural network and support vector machines classifier has been proposed to recognize the epileptic seizures [6,7,8,9,10,11,12]. A recent review presented that in multi-paradigm approach by integrating wavelet transform and neural networks is the most effective method for automated EEG-based diagnosis of epilepsy [13].

This paper presents an automatic technique to detect the epileptic seizure in EEG signals using discrete wavelet transform with multi-resolution analysis. Specifically, five frequency sub-bands decomposition is obtained by applying DWT on EEG signal. Furthermore, the wavelet energy distribution at each sub-band levels is the most significant parameter to identify epileptic seizures is extracted as feature to make a feature set. The feature set is used as input to the NN classifier to classify three types of epileptic seizures.

2 Methodology

The workflow of the proposed method is shown in Fig. 1. The EEG signals are nonstationary time series signals that provides only the information in the time or the frequency domain. The wavelet transforms which provides an efficient alternative method that circumvents the disadvantages of the Fourier transform as far as the analysis of nonstationary signals is concerned.

Fig. 1
figure 1

Block diagram of the proposed epileptic classification framework

2.1 Materials

In this work, the DWT method is employed for decomposition of signal into five different EEG components (δ, θ, α, β, and γ). Specifically, the fourth-order Daubechies (db4) wavelet is selected due to its good local approximated performance for nonstationary signals [2]. Five frequency sub-bands (Delta (0–4 Hz), Theta (4–8 Hz), Alpha (8–16 Hz), Beta (16–32 Hz), and gamma (32–64 Hz) of clinical interest are obtained using the wavelet decomposition and at different levels. The wavelet energy distribution at each resolution levels are extracted as a features because of its good localizing properties, followed by a well-known ANN classifier is used to identify the epileptic seizures from EEG signals. A detailed flowchart of our proposed classification framework is shown in Fig. 1. The EEG signals used in this paper are obtained from public database at the University Hospital Bonn, Germany. The dataset recording is done with 128-channel amplifier system. After 12-bit analog-to-digital conversion, the data containing 100 single channel segments having sample points N = 4096 samples were written continuously onto data acquisition system at a sampling rate of 173.61 Hz. However, that time series have 0.5–85 Hz spectral bandwidth of the acquisition system. The EEG database consists of three subsets (Z, S, and F), the corresponding Nyquist frequency bandwidth is 86.8 Hz for 23.6-s duration. Z is obtained from five healthy volunteers through surface electrodes for open eye conditions while datasets S, F is acquired from epileptic patients. The datasets F are acquired during seizure-free intervals, while the dataset S only contains the seizure activity [11].

2.1.1 Discrete Wavelet Transform (DWT)

The WT is a spectral estimation technique in which any general function can be expressed as an infinite series of wavelets. The basic idea underlying wavelet analysis consists of expressing a signal as a linear combination of a particular set of functions (wavelet transform, WT), obtained by shifting and dilating one single function called a mother wavelet. The decomposition of the signal leads to a set of coefficients called wavelet coefficients [3]. The key feature of wavelets is the time–frequency localization. It means that most of the energy of the wavelet is restricted to a finite time interval. It means that most of the energy of the wavelet is restricted to a finite time interval as shown in Fig. 2.

Fig. 2
figure 2

Approximation and detailed coefficients of db 4 on an EEG signal

Multi-resolution decomposition of time-domain signal gives approximation (A1) and detail information (D1) of signal at different scales which is simply obtained by correlating the original signal with wavelet function of different sizes. At the first level of decomposition, given a time-domain signal \( x\left( n \right) \) of length n passes through half band high-pass (h(n)) and half band low-pass filter (g(n)) in which signal is convolved with impulse response of filter. The convolution operation in mathematical term is as follows:

$$ x\left( n \right)*h\left( n \right) = \sum\limits_{k = \infty }^{ - \infty } {x\left( k \right) \cdot h\left( {n - k} \right)} $$
(1)

In wavelet Transform subsampling by 2, reduces half number samples which double scale of signal. The output after subsampling by 2 gives approximation (A1) and detail information (D1). Similarly, after splitting the approximation coefficients A1 into two parts using the same scheme, produces A2 and D2 and so on. So that decomposition of signals into several frequency sub-bands requires a selection of an appropriate number of decomposition levels and wavelet function.

The DWT employs two sets of functions called scaling functions and wavelet functions, which are related to low-pass and high-pass filters, respectively. The decomposition of the signal into the different frequency bands is merely obtained by consecutive high-pass and low-pass filtering of the time-domain signal. All wavelet transforms can be specified in terms of a low-pass filter g, which satisfies the standard quadrature mirror filter condition

$$ G\left( Z \right)G\left( {Z^{ - 1} } \right) + G\left( { - Z} \right)G\left( {Z^{ - 1} } \right) = 1 $$
(2)

where G(z) denotes the z-transform of the filter g. Its complementary high-pass filter can be defined as

$$ H\left( Z \right) = ZG\left( { - Z^{ - 1} } \right) $$
(3)
$$ G_{i + 1} \left( Z \right) = G\left( {Z^{{I^{2} }} } \right)G_{i} \left( Z \right) $$
(4)
$$ H_{i + 1} = H(Z^{{i^{2} }} )G_{i} \left( Z \right),\quad i = 0, \ldots ,I - 1 $$
(5)

with the initial condition G0(z) = 1. A two-scale relation in time domain is

$$ g_{i + 1} \left( k \right) = \left[ g \right]_{{ \uparrow 2^{i} }} \,g_{i } \left( k \right) $$
(6)
$$ h_{i + 1} \left( k \right) = \left[ h \right]_{{ \uparrow 2^{i} }} g_{i} \left( k \right) $$
(7)

where the subscript \( \left[ . \right]_{ \uparrow m} \) indicates the up-sampling by a factor of m and k is the equally sampled discrete time. The normalized wavelet and scale basis functions can be defined as \( \varphi_{i,l} \left( k \right), \)

$$ \varphi_{i,l} \left( k \right) = 2^{i/2} g_{i} \left( {k - 2^{i} l} \right) $$
(8)
$$ \Psi _{i,l} \left( k \right) = 2^{i/2} \,h_{i} \left( {k - 2^{i} l} \right) $$
(9)

where the factor 2i/2 is an inner product normalization, i and l are the scale parameter and the translation parameter, respectively. The DWT decomposition can be described as

$$ a_{i} \left( l \right) = x\left( k \right)^{*} \,\varphi_{i,l} \left( k \right) $$
(10)
$$ d_{i} \left( l \right) = x\left( k \right)^{*} \,\Psi _{i,l} \left( k \right) $$
(11)

where \( a_{i} \left( l \right) \) and \( d_{i} \left( l \right) \) are the approximation coefficients and the detail coefficients at resolution i, respectively.

2.2 Wavelet Energy Distribution

The distorted signal is partitioned at different resolution levels and its energy is obtained using Parseval’s theorem, and is mathematically represented as

$$ \begin{array}{*{20}l} {ED_{i} = \sum\limits_{j = 1}^{N} {\left| {D_{ij} } \right|^{2} } } \hfill & {i = 1, \ldots, l} \hfill \\ \end{array} $$
(12)
$$ \begin{array}{*{20}l} {EA_{i} = \sum\limits_{j = 1}^{N} {\left| {A_{ij} } \right|^{2} } } \hfill & {i = 1, \ldots ,l} \hfill \\ \end{array} $$
(13)

where i = 1, …, l is the wavelet decomposition level from level 1 to N. N is the number of the coefficients of detail or approximate at each decomposition label. \( ED_{i} \) is the energy of the detail at decomposition level i and \( EA_{i} \) is the energy of the approximate at decomposition level l. Using wavelet decomposition with MRA, the 3 sets of the EEG signals are classified (20 EEG signals of the healthy patient, 20 EEG signals of the epilepsy patient in steady state, and 20 EEG signals of the epilepsy patient during the seizure) based on energy distribution in each resolution level. Energy distribution diagrams of EEG signals for different each set of EEG are shown in Fig. 3.

Fig. 3
figure 3

Energy distribution diagram (%) a z set-20 EEG signals of healthy patient, b f set-20 EEG signals of epilepsy patient c s set-20 EEG signals of epilepsy patient with seizure

2.3 Neural Network (NN) Classifier

NNs are widely used in the biomedical signal processing field for complex pattern recognition and classification. Recent applications of NN in the signal processing and classification for biomedical problems can be found in several studies. The ANN is biologically inspired method for computing and classification of signal. This is an adaptive, nonlinear system that learns to perform mapping function on an input/output data in training phase. After the training phase, the ANN parameters are fixed and the system is deployed to solve the problem at the testing phase. The ANN is built with a systematic step-by-step procedure to optimize a performance criterion or to follow some implicit internal constraint, which is commonly referred to as the learning rule [14]. ANNs consists of input node attributes, one or more hidden layers, and one or more output nodes representing the output class. The data fed to input nodes as feature vector of variables and this information is passed to first hidden layer associated weights. The output of each hidden node are calculated as follows:

$$ v_{k} = \mathop \sum \limits_{i = 1}^{n} w_{ki} x_{ki} $$
(14)

and

$$ y_{k} = \mathop \sum \limits_{i = 1}^{n} \emptyset (v_{k} + v_{ko} ) $$
(15)

where \( x_{1} \ldots x_{n} \) are input features, \( w_{k1} \ldots w_{kn} \) are the connected unit of k, weighted, \( v_{k} \) is the net input, \( y_{k} \) is the output class, and \( \emptyset \) is the activation function of the neurons is sigmoid which is defined by

$$ f_{x} = \frac{1}{{1 + e^{ - x} }} $$
(16)

We used Levenberg–Marquardt backpropagation algorithm for feature classification. The energy distribution of each wavelet coefficients are extracted and used as training and testing data. The size of data set was 5 × 60. The input vector is applied as input to the three-layer ANN structure having five hidden neurons with TANGENT SIGMOID as activation function of neuron.

3 Results and Discussions

The levels are chosen such that those parts of the signal that correlates well with the frequencies of EEG signal that retained in the wavelet coefficients. The smoothing feature of Daubechies 4 (db4) is suitable for detecting changes of the EEG signals, so we have chosen db4 as wavelet function with five levels of decomposition. We considered energy activity component D3, D4, and D5 which are dominant of signals and other components are discarded. Frequency bands corresponding to five decomposition levels for wavelet db4 with sampling frequency of 173.6 Hz of EEG signal are decomposed into details D1–D5 and one final approximation A5, as shown in Fig. 2.

It has been observed that energy distribution of gamma wave in healthy patients is about 6%, whereas in epilepsy, EEG signal energy distribution is much lower approximately 3%. Similarly, beta and alpha wave energy is quite similar with approximately 20%. In comparison with healthy patient data, the energy distribution of alpha and beta is much lower in seizure data. In the theta wave frequency, energy activity slightly lower with value around 10%. While in case of seizures, the energy distribution of theta and delta signal is much larger. Energy distribution of EEG signals during epileptic syndrome is significantly different from the first two cases as shown in Fig. 3. The feed-forward neural network was trained using the backpropagation algorithm. In the predicted classification, 20 signals of each case are considered. For example, for the testing data set of all EEG signal, it is found that out of total 60 signals 19 have been classified as healthy, 18 as seizure free, and 20 as epileptic syndrome during seizure. Since the majority of the predicted classification is in the Epileptic seizure. Table 1 presented are classification results of WNN algorithm where 20 data sets were used to train the ANN model and 5 data sets were used for testing process. The system can correctly classify 47 of the 60 different EEG signals in the testing set, is presented in Table 1. The proposed process achieved an accuracy of 95.0% in classifying epileptic seizure, which is better than few published articles such as Atoufi et al. [15] where the average accuracy was 60% and Ong et al. [16] where accuracy was 94.06%.

Table 1 Confusion table of classification results on the testing data set

4 Conclusion

In this paper, we proposed an automatic method for detecting epileptic seizure using nonstationary EEG signal with wavelet decomposition and classified with NN classifier. The energy distribution of various EEG signal components is very important for detection and classification of epilepsy. It has been observed that use of energy distribution from EEG recordings obtained from subjects with epileptic seizure and normal subject’s component using DWT enables classification, by a backpropagation algorithm in ANN, with a high degree of accuracy about 95%. Furthermore, it can reduce memory space, shorten preprocessing needs, and increase computation speed for the classification of an EEG signal. Hence, the proposed method could effectively be used for detection of seizure that could assist the physicians in diagnosis process.