Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

It is estimated that around 1 % of the world population suffers from epilepsy. This disease is the result of sudden changes in the dynamics of the brain, producing abnormal synchronization in its networks, which is called a “seizure” [16]. In some cases, this disease cannot be controlled, producing serious physical and social disturbances in the affected patients. Seizures occur unexpectedly, lasting from few seconds to few minutes and showing symptoms as loss of consciousness, convolutions, lip smacking, blank staring or jerking movements of arms or legs [8]. Due to the negative effects of their occurrence, the medical community is looking for ways to predict seizures in real-time, so that patients can be warned of incoming episodes. However, still this is an open problem, but many research efforts are being dedicated to this. Among several strategies, the monitoring of the electroencephalographic activity (EEG) of the brain is considered one of the most promising options for building epilepsy predictors. However, this is very difficult problem, because the brain is a very complex system, and an EEG time series may be generated by dynamics among neurons nearby or far away from the electrodes where it was acquired, which makes difficult to model the dynamics involved.

The electrical activity of the brain was first mentioned in 1875, when Galvani and Volta performed their famous experiments [7, 23]. The first EEG was recorded from the surface of a human skull by Borger in 1929 [5] and 1935 is considered the year of birth of today’s clinical electroencephalography. Since then, EEGs are part of the required medical tools for diagnosis and monitoring of patients. Figure 1 shows a portion of a EEG of a healthy patient.

Fig. 1
figure 1

An example of a EEG of a healthy patient (taken form set Z of the database created by the University of Bonn)

Experts have identified several morphological characteristics in an EEG, related to the type of patients and brain stages when the EEG is recorded. The EEG of a healthy, relaxed patient with closed eyes presents a predominant physiological rhythm, known as the “alpha rhythm”, with frequencies ranging from 8 to 13 Hz; if patient’s eyes are open, broader frequencies are presented. Seizure-free intervals, acquired within the epileptogenic zone of a brain, that is, the zone where the abnormality occurs, present rhythmic and high amplitude patterns, known as “interictal epileptiform activities”; these activities are fewer and less pronounced when intervals are sensed in places distant from the epileptogenic zones. Contrary to the expected, an EEG taken during an epileptic event (ictal activity) is almost periodic and presents high amplitudes [16].

Several stages may be identified in an EEG related to epilepsy: the ictal stage, which corresponds to the occurrence a seizure, the interictal stage, which occurs in between epileptic events, the pre-ictal state, occurring few minutes prior to a seizure and the postictal stage [26]. The term “healthy stage” is used here to identify the behavior of a EEG obtained from relaxed, healthy patients with closed eyes.

With the possibility of using fast and accurate information technologies ubiquitously, the promise of trustily devices able to monitor and predict health conditions in real time is growing, and a fact in many cases. Based on this, a huge amount of research has been published, with the hope of finding better uses of signal processing techniques to support clinical diagnosis. Related to the use of EEG for diagnosis, the health community has agreed on some nomenclature related to time–frequency analysis. Table 1 lists the identifications given by most authors to frequency sub-bands found in an EEG spectra, and its relation to specific conditions of the subjects being analyzed. These sub-bands have been used to characterize different brain conditions as Alzheimer disease or epilepsy and as a tool for building brain computer interfaces [7]. In this respect, some researchers have reported that delta and alpha sub-bands are suitable for the identification of epileptic episodes [28, 31]. Signal processing has also been widely involved in the use of time–frequency transformations as an aid for feature extraction in classification and prediction in medical applications and as pre-processing techniques for biomedical signals [34]. In particular, wavelet analysis has been widely used for classification and prediction of epilepsy (see for example [1, 10, 15, 19, 29].

Table 1 Frequency sub-bands identified in EEG (adapted from)

In this chapter we review some important concepts and research work related with the automatic identification of epilepsy using EEG, and we analyze the use of filtering, wavelet analysis and artificial neural networks to tackle the main problems associated to this identification: noise reduction, definition of a suitable feature vector and design of a classifier. The behavior of several classifiers is presented, which were built using combinations of: Infinite Impulse Response (IIR) filters, Finite Impulse Response (FIR) filters, discrete wavelet transforms (DWT), Maximal Overlap Discrete Wavelet Transform (MODWT) and Feed-Forward Artificial Neural Networks (FF-ANN). The chapter is organized as follows: Sect. 2 presents some of the recent work related to this research; Sect. 3 comments on the basic concept used for identification of epilepsy; the main steps for identifying epilepsy using EEG are detailed in Sect. 4; Sect. 5 shows the results obtained with an experiment using the just mentioned characteristics. Section 6 presents some conclusions and future work.

2 Related Works

The amount of published work related to the automatic identification of epilepsy in EEGs is amazing. For this reason, a complete state-of the art review is out of the scope of this chapter. Therefore, in this section, we limit our analysis to works similar to ours. We present only recent works that have tested using a free-available EEG database, originally presented in [2] from the University of Bonn and available at [33]. This collection contains unfiltered EEGs of five subjects, including different channels per patient, recorded with a sampling rate of 173 Hz. The database is divided in 5 sets, identified as (A, B, C, D, E) or (Z, O, N, F, and S). Each set contains 100 single-channel segments of EEG with the characteristics described in Table 2, lasting 23.6 s each. Even though larger databases exist (see [16] for a review), this database has the advantages of being free, highly popular and very easy to use. For this reason, we decided to use this database to test our algorithms, referred herein as the “Bonn database.” In addition, we focus our review in works based on the use of wavelet analysis for feature extraction and feed-forward neural networks (FF-NN) for identification of 2 classes (healthy and ictal stage) and 3 classes (healthy, ictal and inter-ictal stages). Table 3 summaries this review. A detailed review of other works can be found in [32].

Table 2 A brief description of the EEG data collection provided by the Univerisity of Bonn [33]. For a detailed description see [2]
Table 3 Comparison of published works in epilepsy identification. Two or three classes are identified using data provided by [2, 33]

3 Filtering and Wavelet Analysis

This section describes some basic concepts related to filtering and wavelet analysis, which are used in this paper. It is important to point that that these paragraphs include just basic definitions and brief descriptions of techniques; it does not pretend to be a detailed review of them. The interested reader is encouraged to review [1, 27].

In this context, filtering refers to a process that removes unwanted frequencies in a signal. This is required for some tasks in order to eliminate noise, even though it may create some distortion in the features represented in the frequency-time domain of the signal. In spite of that, filtering in epilepsy identification is highly recommended; according to Mirzaei, EEG frequencies above 60 Hz can be neglected [25]. There are different types of filters: linear and non-linear, time-invariant or time-variant, digital or analog, etc.

Digital filters are divided as infinite impulse response (IIR) filters and finite-impulse response filters (FIR). A FIR filter is one whose response to any finite length input is of finite duration, because it settles to zero in finite time. On the other hand, an IIR filter has internal feedback and may continue to respond indefinitely, usually decaying. The classical IIR filters approximate the ideal “brick wall” filter. Examples of IIR filters are: Butterworth, Chebyshev type I and II, Elliptic and Bessel; of special interest are Chebyshev type II and Elliptic. The Chebyshev type II filter minimizes the absolute difference between the ideal and actual frequency response over the entire stop band. Elliptic filters are equiripple in both the pass and stop band and they generally meet filter requirements with the lowest order of any supported filter type. FIR filters have useful properties, for example, they require no feedback and they are inherently stable. The main disadvantage of FIR filters is that they require more computational power that IIR filters, especially when low frequency cutoffs are needed [24].

To design a filter means to select their coefficients in a way that the system covers specific characteristics. Most of the time these filter specifications refer to the frequency response of the filter. There are different methods to find the coefficients suitable from frequency specifications, for example: window design, frequency sampling method, weighted least squares design and equiripple [6]. In the experiments presented in this chapter, the methods “weighted least squares design” and “Equiripple” were applied, as recommended by [4]. Figure 2 shows a filtered EEG and its frequency spectrum of an ictal stage. The filtering was obtained using a Least Squares FIR filter.

Fig. 2
figure 2

A filtered EEG of an ictal stage (a), its corresponding frequency spectra (b). Signal was filtered using a least-square FIR filter. Data taken from [33]

Wavelet analysis is a very popular signal processing technique, widely applied in non-periodic and noisy signals [1]. It consists on calculating a correlation among a signal and a basis function, known as the wavelet function; this similarity is calculated for different time steps and frequencies. A wavelet function φ(.) is a small wave, which means that it oscillates in short periods of time and holds the following conditions:

  1. 1.

    Its energy is finite, that is:

    $$ E = \int\limits_{ - \infty }^{\infty } {\left| {\varphi (t)} \right|^{2} dt\;<\;\infty } $$
    (1)
  2. 2.

    Its admissibility constant \( C_{\varphi } \) is finite, that is:

    $$ C_{\varphi } = \int\limits_{0}^{\infty } {\frac{{\left| {\varPhi (u)} \right|^{2} }}{u}} du\;<\;\infty $$
    (2)

    where:

    $$ \varPhi (u) = \int\limits_{ - \infty }^{\infty } {\varphi (t)e^{ - i2\pi u} dt} $$
    (3)

    is the Fourier transform of φ(.).

    Any function f(t) can be expressed as a linear decomposition:

    $$ f(t) = \sum\limits_{\ell } {a_{\ell } \varphi_{\ell } (t)} $$
    (4)

    where a are real-valued expansion coefficients and φ (t) are a set of real functions, known as the expansion set. Using wavelets as an expansion set, a series expansion of a signal is defined as:

    $$ f(t) = \sum\limits_{k} {\sum\limits_{j} {a_{j,k} \varphi_{j,k} (t)} } $$
    (5)

    a j,k are known as the Discrete Wavelet Transform (DWT) of f(t).

In addition to DWT, there are several wavelet transforms, which may be applied using different types of wavelets. Two transforms frequently used are the Discrete Wavelet Transforms (DWT) and Maximal Overlap Discrete Wavelet Transform (MODWT). DWT can be estimated using a bank of low-pass and high-pas filters. Filters are combined with down-sampling operations, to create coefficients that represent different frequencies in different resolution levels. Two types of coefficients are obtained: approximation coefficients and detailed coefficients. The output of each filter contains a signal with half the frequencies of the input signal, but double the points, requiring then to be down-sampled. Figure 3 shows a tree representing the decomposition of an EEG using a DWT algorithm. Notice that the EEG sub-bands, described in Table 1, are obtained in different levels of the decomposition (marked as yellow blocks in the figure). Figure 4 shows the delta sub-band of an EEG signal obtained by a MODWT with Daubechies degree 2 and its corresponding spectra. Figure 5 shows the same for Alpha sub-band.

Fig. 3
figure 3

Wavelet analysis of an EEG using a DWT. The yellow blocks correspond to identifiers of sub-bands found in a EEG (see Table 1). LP Low-pass filter, HP High-pass filter, C# Approximation coefficient number #, D# Detailed coefficient number#

Fig. 4
figure 4

Delta sub-band of an EEG signal obtained by a MODWT with Daubechies degree 2 (a) and its corresponding frequency spectrum (b)

Fig. 5
figure 5

Alpha sub-band of an EEG signal obtained by a MODWT with Daubechies degree 2 (a) and its corresponding frequency spectrum (b)

The selection of the right wavelet to be used in a specific problem is related with the characteristics found in the signal being analyzed. In this paper, we used Haar, second order Daubechies (Db2) and fourth order Daubechies (Db4) wavelets. For a complete review of wavelet analysis, see [1].

4 Identifying Epilepsy

Off-line identification of epilepsy stages using EEGs is composed of 3 main steps, which are described next:

  1. 1.

    Preprocessing of the input signal. In this step the EEG stream is divided in segments and each segment is clean of unwanted frequencies that may represent noise or other artifacts. Section 3 describes some methods for filtering. In this chapter we compare the performance obtained for classifiers using different types of filters: Chebyshev II, Elliptic, Equiripple and Least Squares. For de results showed in this paper, we used segments lasting 23.6 s, 1 s, and 0.7375 segments each.

  2. 2.

    Feature extraction. The design of this part of a classifier is one of the most important challenges in this and other identification problems. Using signal processing, statistics, or other math techniques, each filtered EEG segment (sample) has to be represented with appropriate values that will allow the recognizer to separate the different classes. In Table 3, we list some examples of feature extraction methods, used for some works related to epilepsy identification, but there are many more. Here we present the results obtained using DWT and MODWT as feature extractors. First, each segment of one second is decomposed using DWT or MODWT, obtaining sub-bands alpha and delta (among others). Next, the mean, absolute mean and variance of the amplitude of each sub-band are calculated. This results in a feature vector of six positions characterizing each segment.

  3. 3.

    Recognition. The feature vectors obtained in previous step are input to a system that will decide the class with highest probability of being the sample’s class. There are many classifiers that have been tried for epilepsy identifications, being those based on soft computing the most popular.

In special, artificial neural networks have showed to be good modelers with excellent generalization abilities, when compared with other strategies. Here we present results using a feed forward neural network (FF-ANN). The activation function used in all neurons was a sigmoid. The network used here has 6 input neurons (one for each feature) and two output neurons, each representing a class: ictal stage or healthy stage.

The best combination of filter method, features and recognizer parameters need to be found in order to get the best possible performance in a particular application. To find this, it is advised to execute several experiments, testing each model with some validation criteria. Several of these methods have been proposed in the literature, being k-fold validation one of the most popular, due to its ability to provide a good statistical estimation of the performance of the classifier [20]. The selection of a value for k depends upon the number of samples available for training and testing the system. We used a 3-fold validation to test all the combinations reported here.

With respect to the way of evaluating the performance of epilepsy identifiers, it is a common practice to use 3 metrics: accuracy, sensitivity and specificity. When two classes are involved (healthy and ictal stages), these metrics are defined as [26]:

$$ Accuracy = \frac{number\;of\;correct\;classified\;segments}{total\;of\;segments} $$
(6)
$$ Sensitivity = \frac{number\,of\,correct\,classified\;ictal\;segments}{total\;of\;ictal\;segments} $$
(7)
$$ Specificity = \frac{number\;of\;correct\;classified\;healthy\;segments}{total\;of\;healthy\;segments} $$
(8)

Accuracy gives the proportion of correctly identified samples. Sensitivity, also known as the recall rate, measures a proportion of sick cases correctly identified as such. Specificity gives the proportion of healthy cases correctly identified as such [13].

In the next section, we present the results of an experiment that we executed for identification of ictal and healthy stages in EEG, which were originally reported in [18].

5 An Experiment for Ictal Identification

Our research group is working with the design of new models for identification and prediction of epilepsy [17]. In our way to do so, we have experimented with some models currently proved to obtain good results in this task. Here, as an example of this process, we detail the results obtained for a FF-NN when trained with filtered segments of EEG [18]. As described in Sect. 4, we tested different combinations of filters, wavelet transforms and number of hidden nodes, to obtain the most suitable architecture for the data provided by sets Z and S from the Bonn database. We tested two cases, the first using segments of 23.6 s and the second using segments of one second or of 0.7375 s. For the second case, segments of one second were used when a DWT transform were applied and segments of 0.7375 were used when MODWT was applied. Table 4 presents the parameters used for setting the FF-NN classifier. As we stated before, three-fold validation was applied to obtain all performance measures.

Table 4 Parameters for the FF-NN, applied for both experimental cases

Performances obtained in the first case are summarized in Table 5, and the performances obtained for second case are summarized in Table 6. Measures are calculated according to Eqs. (6), (7) and (8). These values are the average obtained by a 3-fold validation procedure. The best results in each case are bolded. Notice that the best results are obtained using segments of one second (second case) cleaned using a Chebyshev II filter, features are obtained using a DWT with a Haar wavelet. In this case an accuracy of 99.26 ± 0.26 is obtained, with a sensitivity of 98.93 % and a specificity of 99.59 %. This results are better than most of the results shown in Table 3, except for the work of [32].

Table 5 Performance of models using segments of 23.6 s
Table 6 Performance of the models using segments of 1 or 0.7375 s

6 Conclusions and Ongoing Work

In this paper, we present basic ideas related to the identification of different stages identified in a EEG, related to epilepsy. Given the importance of this brain disorder, it is mandatory to find better ways to identify and predict seizures in real time. However, this is still an open problem, given the complexity inherent to the brain and the amount of information provided by EEGs. Some recent works using filtering, FF-NN and wavelet decomposition were analyzed. We also presented the design of a identifier of ictal and healthy stages, based on filters, wavelet analysis and FF-NN, which obtained an average of 99.26 ± 0.26 % of accuracy.

Here we present just the first steps of an ongoing research, and still the most important ideas are being explored. A critical issue to be considered is that this problem is highly related to temporal classification. Some temporal classification problems may be solved using static classification strategies (as the one presented here), provided that the information about time is represented in some way in a feature vector. However, it is difficult to identify accurately the time lag required to build the feature vector, which in this case corresponds to the right size of the segment to be characterized. It has been showed that recurrent neural networks are a better option than FF-NN for time-dependent problems where chaos is present [12]. Particularly, some studies have outlined the advantage of recurrent models over feed-forward models for EEG classification [13]. Indeed, there is a strong evidence of the chaotic behavior of EEG during seizures [2] and that recurrent neural networks have presented good results modeling chaotic systems [12]. Therefore, the next step to be explored in our research is the use of recurrent neural networks for temporal identification. Encourage for the results obtained here, we will explore wavelet-recurrent neural networks, as the ones presented in [30] and [9], modeled with Haar wavelets as activation functions.

A search for better features extractor methods has to be performed. A method that has reported with good results in this context is Empirical Mode Decomposition (see for example [22] ) will be also analyzed. EMD, introduced by Huang in 1971 [34], has become very popular in biomedicine in the last few years [35]. This is a spontaneous multi-resolution method that represents nonlinear and non-stationary data as a sum of oscillatory modes inherent in the data, called Intrinsic Mode Functions (IMFs) [21].