Automatic Detection of Paroxysms in EEG Signals using Morphological Descriptors and Artificial Neural Networks

The first recordings of brain activity in the form of electrical signals, through the use of a galvanometer and insertion of two electrodes on the scalp of an individual, were conducted in 1875 by British scientist Richard Caton. Since then, the electroencephalogram (EEG) has been used to denote the neural electrical activity of the brain (Sanei & Chambers, 2007). The EEG signal acquisition can be performed by introducing electrodes inside the brain tissue (depth EEG), the placement of electrodes directly into the exposed surface of the cerebral cortex (electrocorticogram ECoG) or the positioning of electrodes in a noninvasive, on the surface of the scalp (scalp EEG sEEG). The human scalp EEG, in relation to its physical characteristics, occupies a frequency band of 0Hz to 100 Hz and an amplitude range of 2μV to 200μV, however, in general, the signal is concentrated between 0,5Hz and 60Hz with an average amplitude of 50μV (Coimbra, 1994). These frequency and amplitude value of the EEG signal are influenced by a series of characteristics, such as: location in the cerebral cortex from where recording was acquired, age of the subject, physical (sleep, wake, coma, etc.) and behavioral (depression, excitement, euphoria, stress, etc.) state of the subject. Furthermore, the signal can also be distorted by artifacts interference from many sources, for example, extra cerebral electrical potentials from the patient, the electrodes, the signal acquisition system and external electromagnetic interferences. This means that the recordings may have variability among patients under identical circumstances and in the same patient over time. The presence of this variability contributes to the great difficulty presented in attempts to mathematically model the electrographic patterns commonly present in the EEG signal. Nevertheless these patterns have a relative regularity in frequency, morphology and amplitude – whichever they are – i.e. the frequency spectrum of the EEG is usually divided into frequency bands that may be related to different physical states and behavior (Sanei & Chambers, 2007): • alpha band – 8 to 13 Hz – common rhythm in normal patients and more easily observable while the subject is awake, relaxed and with its eyes closed; • beta band – 13 to 22 Hz – common rhythm in normal adult patients during wakefulness. Dominant in the pre-central region of the brain but also occurs in other brain regions. Subdivided into: beta I, 13 to 17 Hz present during intense


Introduction
The first recordings of brain activity in the form of electrical signals, through the use of a galvanometer and insertion of two electrodes on the scalp of an individual, were conducted in 1875 by British scientist Richard Caton. Since then, the electroencephalogram (EEG) has been used to denote the neural electrical activity of the brain (Sanei & Chambers, 2007). The EEG signal acquisition can be performed by introducing electrodes inside the brain tissue (depth EEG), the placement of electrodes directly into the exposed surface of the cerebral cortex (electrocorticogram -ECoG) or the positioning of electrodes in a noninvasive, on the surface of the scalp (scalp EEG -sEEG). The human scalp EEG, in relation to its physical characteristics, occupies a frequency band of 0Hz to 100 Hz and an amplitude range of 2μV to 200μV, however, in general, the signal is concentrated between 0,5Hz and 60Hz with an average amplitude of 50μV (Coimbra, 1994). These frequency and amplitude value of the EEG signal are influenced by a series of characteristics, such as: location in the cerebral cortex from where recording was acquired, age of the subject, physical (sleep, wake, coma, etc.) and behavioral (depression, excitement, euphoria, stress, etc.) state of the subject. Furthermore, the signal can also be distorted by artifacts interference from many sources, for example, extra cerebral electrical potentials from the patient, the electrodes, the signal acquisition system and external electromagnetic interferences. This means that the recordings may have variability among patients under identical circumstances and in the same patient over time. The presence of this variability contributes to the great difficulty presented in attempts to mathematically model the electrographic patterns commonly present in the EEG signal. Nevertheless these patterns have a relative regularity in frequency, morphology and amplitude -whichever they arei.e. the frequency spectrum of the EEG is usually divided into frequency bands that may be related to different physical states and behavior (Sanei & Chambers, 2007): • alpha band -8 to 13 Hz -common rhythm in normal patients and more easily observable while the subject is awake, relaxed and with its eyes closed; • beta band -13 to 22 Hz -common rhythm in normal adult patients during wakefulness. Dominant in the pre-central region of the brain but also occurs in other brain regions. Subdivided into: beta I, 13 to 17 Hz -present during intense 388 activation of central nervous system (CNS) -and beta II, 18 to 22 Hz -decreases during intense activation of the CNS; • theta band -4 to 8 Hz -rhythm frequent in children, in central and temporal region of the brain. Typical of early stages of sleep. Some transient components of this rhythm have been found in normal adult patients; • delta band -0,5 to 4 Hz -common rhythm in children, especially infants, in a state of deep sleep. The presence of this wave in adults under a state of alert may indicate abnormalities. (Sanei & Chambers, 2007) Fig. 1. Examples of common electrographic patterns present in the EEG signal The EEG recording has applicability on, among others: monitoring alertness, coma and brain death; locating damaged areas after head injury, stroke and tumor; testing afferent pathways; monitoring anesthesia depth; researching physiology and sleep disorders; researching epilepsy and localizing the seizure focus (Sanei & Chambers, 2007). Epilepsy is a disorder of the brain characterized by an enduring predisposition to generate epileptic seizures and by the neurobiological, cognitive, psychological and social consequences of this condition. The definition of epilepsy requires the occurrence of at least one epileptic seizure, which is a transient occurrence of signs and/or symptoms due to abnormal excessive or synchronous neuronal activity in the brain (Fisher et al., 2005).
Neurologists can make a diagnosis of epilepsy simply through anamneses however EEG signal analysis is a commonly used and important tool to: clinical diagnosis, support in www.intechopen.com Automatic Detection of Paroxysms in EEG Signals using Morphological Descriptors and Artificial Neural Networks 389 defining the type of epilepsy syndrome, provide information for planning drug therapy and also help in deciding the feasibility of surgical intervention. The occurrence of certain electrographic events, called epileptiform events, in EEG signal is a strong indicator of this pathology presence. An expert in reading these records (EEGer) spends a considerable amount of time reviewing each record, especially when they are acquired for long term monitoring (more than 24 hours) and with many channels -between 24 and 128 leads (Pillay & Sperling, 2006). In attempt to facilitate the analysis of EEG recordings by neurologists (or other experts) many studies have proposed automated systems for this analysis. Unfortunately few of them are actually being used worldwide mainly because the available systems for automatic detection of epileptiform events have a relative high number of false identifications (false positives), resulting in little or no effective time save for the process (Wilson & Emerson, 2002). This means that the low specificity of the systems still discourages EEGers to delegate the task of thorough analysis of the thousands of EEG screens (each with up to 128 continuous signals) in the search for events whose maximum length is 200ms and the amplitude values are in the range of microvolts (μV).

Automatic detection of paroxysms
The Biomedical Engineering Institute (IEB-UFSC) of the Federal University of Santa Catarina (UFSC) has as one of their areas of expertise and interest the acquisition, analysis and processing of bioelectrical signals, with emphasis in electroencephalogram (EEG), electrocardiogram (ECG), electromyogram (EMG) and electrooculogram (EOG) signals. Currently within this area there are two research lines, both using neural networks, for automatic detection of epileptiform events: one applies methodologies based on Wavelet Transform and the other one uses a parameterization 1 of the EEG signal.

Approaches based on wavelet transform
The Wavelet Transform is a tool that allows you to make a more comprehensive analysis of the signal due to the fact that it is possible to obtain information in both time and frequency domains simultaneously. This Transform is a powerful tool for the analysis of nonstationary signals (Wilson et al., 2004) making it ideal for EEG signal analysis. Its basic principle of operation is extract approximation and detail coefficients of the signal at each decomposition carried out, i.e., get high and low frequencies features of the signal for each level of decomposition. Wavelet Transform can be used for the parameterization, filtering and/or feature extraction of the EEG signals and also be very involved in the construction of hybrid intelligent systems for the automatic detection of epileptiform events, providing relatively good results when applied as a preprocessor for Artificial Neural Networks (Kalayci & Özdamar, 1995;Hoffmann et al., 1996;Oweiss & Anderson, 2001;Quiroga et al . 2001;Adeli et al., 2003;Khan & Gotman, 2003;Argoud et al., 2006, Pang et al., 2003, Liu et al., 2006Argoud et al., 2006;Mohamed et al., 2006;Subasi, 2007;Indiradevi et al., 2008;Abibullaev et al., 2009th, 2009bOcak, 2009;Scolaro & Azevedo, 2010).

Methodology
This section will present the recordings and methodologies used for both the development of the descriptors' ensemble and the experiments used as an evaluation tool for the proposed set.

EEG recordings
All of the EEG signals used in this study belong to a database with nine records acquired from seven adult patients with confirmed diagnosis of epilepsy. They have a sampling frequency of 100Hz and were acquired through 24 (1 record) and 32 channels (8 records For the acquisition process the signals went through analog filtering to isolate the range of 0,5 to 40Hz. We also observed the need to perform additional filtering to remove the baseline wandering effect (DC frequency -0Hz) and eliminate noise caused by power line interference (60Hz), and it was necessary to perform interpolation of the signal to a sampling frequency of 200Hz. (Malmivuo & Plonsey, 1995) Fig. 2. EEG signal differences presented when a bipolar (A) and unipolar or referential (B) montage is used. In the bipolar montage the signal is a result of potential difference between pairs of electrodes while for the unipolar montage the signal is obtained by the difference in potential between an electrode and a reference point (equal for the whole montage)

Morphological descriptors
The literature on the automatic detection of epileptiform events contains a considerable amount of morphological descriptors used in different methodologies and/or developed systems. For our experiments we selected the descriptors most reported in literature: the maximum amplitude of the event, event duration, the length variation coefficient, crest factor and entropy. The maximum amplitude and duration of the event are self-explanatory. The length variation coefficient -used to measure the regularity of the signal -is the ratio of standard deviation and the mean value of the signal. The crest factor is the difference between the maximum and minimum amplitudes, divided by the standard deviation (Webber et al., 1994). The entropy, reported in several studies -e.g. Quiroga (1998), Esteller (2000), Srinivasan et al. (2007) and Naghsh-Nilchi & Aghashahi (2010) -provides a value for the complexity of the signal under analysis. These descriptors are widely used, however they may not guarantee the complete differentiation between the events presented by the recordings and also because of this the existing systems for automatic detection have only a moderate performance. Thus, through a detailed analysis of the EEG signals that are being used, new descriptors based on the physical and/or morphological signal can be developed in attempt to improve the performance of the automatic detection process. The main focus for the development of new descriptors was to find characteristics in the EEG signals that further highlighted the epileptiform events from other types of events. The latter are called non-epileptiform events (Fig. 3.) and for our database they are represented by: a. normal background EEG activity; b. alpha waves; c. blinks; d. artifacts originated from EMG (muscle activity), external electromagnetic interference, among others. Looking at the obtained records we realized that due to the use of a bipolar montage (Fig.2) the epileptiform events can appear in four different ways (Fig. 4.). In other words, because of the type of montage the spikes and sharp waves may appear with both electronegative and electropositives amplitude peaks, however to be considered a paroxysm they still have to be followed by a slow wave. The basic morphological characteristics of an epileptic event are related to their amplitude and duration. The spikes have duration of 20 to 70ms, while a sharp wave has duration of 70 to 200ms. Since both events can be a paroxysm and making a distinction between them makes little sense from a clinical point of view, we can consider that the duration www.intechopen.com Automatic Detection of Paroxysms in EEG Signals using Morphological Descriptors and Artificial Neural Networks 393 epileptiform events varies from 20 to 200ms. The amplitudes values of both spikes and sharp waves are also varied but when considering them epileptiform events the amplitude (module value) usually lies between 20μV and 200μV (Niedermeyer, 2005). Examples of morphological descriptors related to the amplitude and duration of a typical epileptiform event are (Fig. 5.): • maximum amplitude (Amax); • minimum amplitude (Bmin); • difference between the points of occurrence of extreme amplitude (Tdif); • difference between the maximum and minimum amplitudes (DifAB).

minimum (event)
Tim e ( 10 -2 s ) minimum (epoch) Fig. 6. EEG signal presenting maximum amplitude corresponding to an epileptiform event and minimum amplitude corresponding to another (different) event Also regarding the amplitudes within the epoch under review (in this case 1 second of the signal) the points of maximum and minimum amplitude may not belong to the same event (Fig. 6.). Analyzing this fact, we could see that to be a paroxysm (event we want to correctly identify) the event should have a time difference between maximum and minimum amplitudes in the range of 35 to 100ms (half duration the slowest event). For this, as illustrated in Fig 7, we determined a 300ms segment centered at the event appearing in the epoch under review and within this segment we calculated the following descriptors: maximum amplitude (Amax_pts); minimum amplitude (Bmin_pts); distance between extreme amplitudes (DifAB_pts) and time difference (Tdif_pts) between the maximum and minimum amplitudes. Another feature that can be observed is that an epileptiform event, particularly the spike, has more acute peaks when compared to the obtuse peaks of alpha waves or blinks (Fif. 3b and Fig. 3c). This fact allows another opportunity to discriminate between events since the  (Bmin_pts), distance between extreme amplitudes (Tdif_pts) and time difference between amplitudes (DifAB_pts), all within the 300ms segment centered on the event under analysis process of automatic detection can confused them, which is a detrimental factor to the system performance. Based on these observations we analyzed the vertex angle of the peaks through the extreme amplitudes and zero crossing points adjacent to the beginning and the end of the event. The calculated angles (Fig. 8.), taking an epileptiform event as example, refer to the angle influenced by the peak's initial inclination and the angle that suffers influence of beginning slope of the slow wave. Based on the calculation of these angles (θp and θn) we determined other descriptors: • base of the peaks directly adjacent to the beginning and the end of the event (dpos and dneg, depending in order of appearance of the peaks); • angle of the analyzed event apex (θ); • tangents of the angles of peak apex (tgp and tgn); • tilt of the slopes directly adjacent to the beginning and the end of the event (trp and trn); • event basis (dbase).

Automatic Detection of Paroxysms in EEG Signals using Morphological Descriptors and Artificial Neural Networks 395
The morphology of a paroxysm can also often be confused with the morphology of artifacts (from various sources) present in the EEG signal. However, as can be seen in Fig. 9. the typical waveforms of these noises usually have a relative high frequency. This means that the high amplitudes appear with minimum time differences between them, which are the opposite of paroxysms that usually have more widely spaced peaks because they are always followed by a slow wave. The descriptors proposed to make the distinction between noise and epileptiform events can be based on relations of time and amplitude differences in the epoch when dividing it in two regions (initial and final) adjacent to the event. Experiments were performed and from them we projected the following descriptors: • amplitude and time difference between maximum amplitudes of the event (Amax), initial (Amax_i) and final regions (Amax_f): DifA_i, tA_i, DifA_f and tA_f; • amplitude and time difference between minimum amplitudes of the event (Bmin), initial (Bmin_i) and final regions (Bmin_f): DifB_i, tB_i, DifB_f, tB_f. Further analysis of the morphology and other characteristics of events that occur in the EEG recordings can be performed. In this research it is proposed only the addition of descriptors based on the classical statistical indices of average, standard deviation and variance. These descriptors, were calculated for both the epoch under analysis (one second) and the 300ms segment. Thus, considering the descriptors selected from the literature and those we developed after a review of the recordings, we obtained a final set of 45 morphological descriptors (Table 1).

Morphological descriptors evaluation
In the previous item (3.2) 45 morphological descriptors were presented. Some of them were chosen among those universally used and others were defined in our previous work. After the creation of the descriptors' set it is necessary to analyze this ensemble in order to verify the significance of each element of the group in the differentiation of events. For this research we chose to use correlation analysis and application of Hotelling's T² test (Härdle & Simar, 2007) for individual assessment and Artificial Neural Networks (Eberhart & Dobbins, 1990;Zurada, 1992;Haykin, 1994 ) to verify the complete set performance. The correlation analysis was made evaluating the correlation matrices of descriptors for pairs of events. We examined the correlation between morphological descriptors calculated from epochs containing paroxysm and epochs with non-epileptiform (blinks, artifacts, alpha waves and background EEG activity). The criterion for possible exclusion of any element (descriptor) of the designed set was the existence of high correlation values (above 50%) for all pairs of events considered. The Hotelling's T² test consisted in calculating the difference between the values of each descriptor in epochs with epileptiform transients and epochs with non-epileptiform events. The assessment of this test was made comparing the results of these differences with a predetermined T² critical value (a threshold). Based on this test a descriptor is considered relevant when its T² result is greater than the pre-determined critical value. Some descriptors such as the tangents of the positive (θp) and negative (θn) angles, length variation coefficient (coef) and crest factor (CF) had T² test result relatively close to the critical value and thus these elements could have been removed from the set. However as the correlation value achieved by these same descriptors was not high and their exclusion did not affect significantly the sensitivity and specificity of the neural networks implemented in this study. We chose to not exclude them from the final set. www.intechopen.com

Automatic Detection of Paroxysms in EEG Signals using Morphological Descriptors and Artificial Neural Networks 397
For the verification that the descriptors can indeed provide sufficient information so a classifier can make the discrimination between events the set was arranged at the input of several Artificial Neural Networks.
The networks used are all Feedforward Multilayer Perceptron with Backpropagation algorithm and supervised learning. The basic architecture of each network was of an input layer with 45 neurons and output layer with only one neuron. The number of neurons in the hidden layer and the application of input stimuli normalization 3 were varied in each of the networks so we could find the best configuration and analyze the effect of this normalization. Some other features of neural networks implemented are: • activation function of output and hidden layers: hyperbolic tangent; • number of neurons in the hidden layer (N): 7 to 11 neurons; • batch update of the synaptic weights (after every training epoch); • learning rate and momentum were respectively: 0,01 and 0,9. Finally, the training and test of networks were made with two different compositions of files (

Results
Several networks with the same basic architecture and features showed in the previous section were trained and tested using both types of file composition (Table 2.). The normalization of input stimuli was tested in all implemented networks. The set of descriptors (computed for each file) were attributed directly to the networks' input and the stopping criteria for training, used in our experiments, was the minimum error (1%) and the maximum number of iterations allowed (100.000 epochs).
The best results obtained after the simulations with all these networks are presented in  According to results presented in Table 3 the use of files with signals classified by the occurrence of paroxysms showed success rate (the correct identification of test signals) of 79% whereas with the files of the composition II this rate was around 90%. The best network implementations for each type of files showed sensitivity of 90% and 85% and specificity of 87% and 96%. The effect of normalizing the network's input stimuli that we observed during the simulations was a reduction in the specificity values due to the number of false positives generated (for example, for the network with nine hidden neurons the false positives increased from one to six).

Conclusions
The use and determination of morphological descriptors seems to be simple because it is a direct data collection with relatively basic calculations such as, for example, calculating the dimensions of amplitude and duration of the event. However, this process requires a priori knowledge of information about the system or entity which characteristics will be cataloged. In other words, for the case of automatic detection of epileptiform events in EEG recordings is necessary to carry out preliminary studies about the morphology of the signals to be analyzed. Another significant aspect when using morphological descriptors is the assessment of the selected descriptors as input of the classifier used. It is important to perform an evaluation to demonstrate the contribution of each descriptor for the capability of the ensemble in making the distinction between events of interest. In this study we used correlation analysis and Hotelling's T² test to identify which descriptors could be excluded from the created set in order to provide a performance improvement of the automatic detection process. The methods applied for this assessment did not result in significantly high improvements in the automatic detection, but this does not invalidate its use because the classifier (neural network) used on the experiments showed promising results.

www.intechopen.com
Automatic Detection of Paroxysms in EEG Signals using Morphological Descriptors and Artificial Neural Networks 399 Thus, it becomes necessary to study other advanced and robust analysis tools that can within a tolerance (error) threshold, provide more consistent results. Therefore we are using multivariate analysis (Principal Component Analysis, Independent Component Analysis) alone or in combination with other statistical techniques for assessing the relevance of the descriptors in attempt to optimize the size of the set needed to perform automatic detection through neural networks (or other classifier) without causing significant performance loss for the system in which the descriptors are inserted.