TOWARDS AUTOMATIC EPILEPTIC SEIZURE DETECTION IN EEGS BASED ON NEURAL NETWORKS AND LARGEST LYAPUNOV EXPONENT

: Over the past few decades, application of neural networks and chaos theory to electroencephalogram (EEG) analysis has grown rapidly due to the complex and nonlinear nature of EEG data. We report a novel method for epileptic seizure detection that is depending on the maximal short-term Lyapunov exponent (STLmax). The proposed approach is based on the automatic segmentation of the EEG into time segments that correspond to epileptic and non-epileptic activity. The STL-max is then computed from both categories of EEG signal and used for classification of epileptic and non-epileptic EEG segments throughout the recording. Neural network techniques are proposed both for segmentation of EEG signals and computation of STLmax. The data set from hospital have been used for experiments performing. It consists of 21 records during 8 seconds of eight adult patients. Furthermore the publicly available data were used for experiments. The main advantages of presented neural technique is its ability to detect rapidly the small EEG time segments as the epileptic or non-epileptic activity, training without desired data set about epileptic and non-epileptic activity in EEG signals. The proposed approach permits to detect exactly the epileptic and non-epileptic EEG segments of different duration and shape in order to identify a pathological activity in a remission state as well as detect a paroxysmal activity in a preictal period. Copyright © Research Institute for Intelligent Computer Systems, 2015. All rights reserved.


INTRODUCTION
Nowadays Artificial Intelligence has become broadly applied in medicine as evidenced by over 500 academic publications concerning artificial neural networks in medical applications [1]. In accordance with published literature, artificial neural networks are potentially powerful tools for automating diagnostics to support clinical decision making. Here, we propose a novel automated algorithm for seizure detection in patients with epilepsy.
The scalp EEG is the most widely-used diagnostic tool in epilepsy, a common neurological disorder that affects approximately 1% of the world's population [2]. Seizure detection, as well as detection of epileptiforminterictal activity, is an essential part of day-to-day management of patients with epilepsy. Notably, although most EEG data are now digital, and numerous protocols for automated seizure detection are available [2-16], the EEG is still largely analyzed by visual inspection. Here, we present a novel method for automated detection of seizure and epileptic interictal discharge based on the maximal short-term Lyapunov exponent (STLmax), a measure of dynamic system instability which has been extensively used in EEG analysis [3,17] Previous studies show nonstationarity and chaotic nature of EEG data, and thus justify a measure of entropy such the STLmax [3, 8-10]. There exists clear difference in dynamical properties of the EEG signals in non-epileptic and epileptic state. Epileptic seizures are characterized by synchronized neuronal firing which reduces EEG complexity. It is known that the STLmaxis reduced during epileptic activity, and for this reason the STLmax calculation has been proposed as a component of seizure detection protocols [ [18]. In order to estimate the STLmax for EEG data, a modified Wolf algorithm [17] are used in [3]. However, the existing approaches have the following drawbacks: unreliable for small data-set size and computationally intensive. Therefore the many authors use for computing of STLmax long EEG segments with time length of 10,24 s [19][20][21]. One limitation of previous study is that these don't permit to detect exactly the small EEG segments with epileptic and non-epileptic activity.
Seizure detection by machine learning protocols is often accomplished in two stages: (1) feature selection and (2) event classification [5,[11][12][13][14][15][16]. However, present approaches to feature selection have a disadvantage in their inability to select time segments with epileptic activity in EEG and the requirement for neural network training on desired data set, which necessitates some amount of nonautomated EEG analysis in order to identify representative epileptic and non-epileptic EEG segments to be used as templates for the automated algorithm [2,4-2-7,11-16].
The basic idea of this paper is to detect exactly the EEG segments of different duration with epileptic and non-epileptic activity. It permits to identify pathological activity in remission state and to detect paroxysmal activity in preictal period. We propose neural networks technique both for time segmentation of EEG signals and computation of the STLmax. As mentioned, the epileptic seizure is characterized an STLmax decrease, and we propose to exploit the change of the STLmax over time as a criterion of epileptic seizure in EEG segments. The proposed diagnostic system generates twodimensional map which can visualize the zones (segments) of epileptic and non-epileptic activity in EEG signals, as it can be seen below.
Neural networks techniques permit to reduce the diagnostic time and the number of misdiagnosis, as well as to assist the doctor in making decision. The clinical data from the 5th City Hospital (Minsk, Belarus) have been collected for testing of the proposed approach. Furthermore the publicly available data were used for experiments [23]. The efficiency of epileptic seizure detection is illustrated by the experimental results.
The paper is organized as follows. The dataset used in this work and proposed methodology is given in Section 2. In Section 3 the experimental results are described. Finally, discussions are given in the last section.

DATABASE
In this research we have used two dataset for proposed approach testing. The first one described in [22] and publicly available from [23]. The second one have been taken from 5th City Hospital in Minsk (Belarus). Let's consider these databases.
The complete dataset [22] includes five subsets (denotes A, B, C, D and E), each containing 100 single-channels EEG signals of 23,6s duration with sample frequency of 173,6 Hz. Set A and B have been taken from surface EEG recordings of five healthy volunteers with eyes open (set A) and closed (set B), using international 10-20 electrode placement scheme. Set C and D consist of inter-ictal recordings from five epileptic patients. Electrodes were placed on epileptic zone for set C and on the hippocampal formation of the opposite hemisphere of the brain for set D. Thus sets C and D contains activity of epileptic patients measured during seizure free intervals. Set E includes seizure activity, selected from all recording sites exhibiting ictal activity.
The next database was collected from the 5th City Clinical Hospital (Minsk, Belarus) for eight adult patients with epileptic activity. During long time was performed patients examination, using 16channel registration of EEG. The EEG signals have been registered with the sampling rate of 250 samples per second. The duration of one registration was approximately 30 min. 50 registrations were realized for each patients. As a result of processing these EEG data, the EEG database was created, which represents the set of 21 registrations of 16-channelEEG, selected from eight adult epileptic patients during 8 seconds for each registration. It may be noted, that each signal in EEG was presented as time series of 2000 points. Thus the EEG database contains 21x16=336 EEG time series. The total number of epileptic events in these EEG signals is 32. The epileptic events were selected due the long time examination of patients. We should note that practically impossible to indicate the seizure event in these EEG signals even for high quality the neurologist experts. Our goal is to detect in EEG signals the segments with epileptic and non epileptic activity.

THE SYSTEM DESCRIPTION
In this section the neural network diagnostic system for epileptic seizure detection using EEG data is described. As a diagnostic criterion the value of the STLmax is used, which is decreased during seizures. The STLmax characterizes sensitivity to initial conditions [17,18]. It is statistical measure of divergence between two orbits starting from slightly different initial conditions. The neural network diagnostic system is shown in Fig. 1. It consists of different modules, which are combined in diagnostic system. One can see from Fig. 1 the system inputs are multi-channel EEG patient data of patient. These data can be interpreted as an observation of chaotic dynamical system generating electrophysiological waves. EEG data recorded from scalp electrodes contain different artifacts and consist of various signals combination. Therefore in the first stage the independent component analysis (ICA) is used for artifacts removal and extraction of the independent sources from their mixtures [24]. ICA separates the independent sources from their mixtures by measuring non-Gaussian. As a result we can get independent and clean EEG data without artifacts and noises.

ICA Segmentation
The Largest Lyapunov's exponent computing In the second stage every EEG signal is divided into quasi-stationary segments, using adaptive segmentation algorithm. The segment is called quasi-stationary when its behavior does not change under a time shift. The multilayer neural network (MLP) is used for adaptive segmentation of EEG signal. The minimal initial length of EEG segment is 70 points and is changed during adaptive segmentation. The computation of the STLmax for every extracted segment is performed on the third stage. As a result the sequence of the STLmax for every EEG signal is obtained: where p is the number of selected segments. As a result the sequences of segments with different values of the STLmax are obtained. If the different segments have the same value of the STLmax they are combined into a one segment.
Finally the epileptic seizure identification is performed in accordance with the following test: normal activity epileptic activity As a result we obtain the segments in EEG signals with epileptic and non-epileptic activity.

SEGMENTATION
As it is mentioned in previous section the segmentation is partitioning of EEG signal into quasi-stationary zones (segments), where behavior do not change under a time shift. We propose adaptive segmentation algorithm for decomposition EEG signal into elementary intervals. The forecasting neural network, namely multilayer perceptron (MLP) is used for adaptive segmentation. At the beginning we should perform phase-space reconstruction of one-dimensional EEG signal. Phase-space of chaotic process can be reconstructed from only one time series of observation using embedding parameters. Phase-space reconstruction is a mapping, where every point x(t) of the time series associates with point ), τ -time delay and Dembedding dimension.
Takens [25] shows, that using only onedimensional observation we can construct in pseudophase space an attractor , which preserves basic topological and dynamical properties of the attractor of the initial dynamical system. For this purpose we must take an embedding dimension as denotes the integer part of the attractor fractal dimension d, τ is appropriate time delay. In this case we can reconstruct an attractor in phase space D R and the orbits don't have selfintersections in it. The reconstructed attractor also preserves the property, so that we can unambiguously calculate the latter for any (D -1) phase coordinate. The embedding theorem states that only from a single measure of dynamical system is possible to reconstruct a state space, that equivalent to the unknown original.
Taking this into account we can conclude, that we must construct the neural network, which has k ≥ D -1 input units.
After that the EEG signal is divided into the initial short quasi-stationary segments. The quality of segmentation depends on initial length of segments. It is known that the period of time within which spectral properties of the EEG signal can be considered as constant even if length of segment longer than 4 s [26]. Therefore we have chosen initial length of a segment equal 70 points, that makes approximately 0,3 s. 70 points is an enough length of segment for correct neural network training in the task of different epileptic events including short single spikes detection. When N < 70 then the number of false positives errors is increased, because is not enough points to train the neural network for qualitative forecasting. When N>70, the probability to detect a single short epileptic event is decreased. Such a length of initial segments has been confirmed by experimentally way and behavior of EEG inside of each segment is constant.
Then, the multilayer perceptron is trained for first segment by means of the sliding window method: Here τ is time delay that is computed as the first minimum of the mutual information method [27], k is the size of sliding window. It should be noted, that k ≥ D -1, where D is embedding dimension. The embedding dimension is calculated using the false nearest-neighbors method [27]. Our experiments show that embedding dimension is changed from 7 till 9. The multilayer perceptron consist of 7 units input layer, 5 units hidden layer and 1 output unit (Fig. 2). After training of MLP the border of first segment is specified by means of forecasting accuracy. Thus the forecasting accuracy is criterion of border detection. Then is chosen the next 70 points in EEG signal, beginning from the border of the first segment and the second MLP is trained using the points of this segment. The border of the second segment is specified using prediction accuracy. Hence the algorithm of the dividing initial EEG signal into elementary intervals by the neural network approach is as follows: 1) EEG signal is divided preliminary into the short segments of the length of N points (N=70). The start point of the sliding window is t = 1.
3) Multilayer perceptron is trained by means of sliding window approach.
4) The perceptron begin to predict the points of segment. As a result the following points are obtained: {x'(t+N), x'(t+N+1), x'(t+N+2), …}. The data prediction is ended when expression (4) is fulfilled.
where i = t+N, t+N+1,…, xmax=0,1 is a appropriate error of the forecasting. 5) If i = t + N (expression (4) is fulfilled) then i is a point of the segment border and the next training data set are formed beginning from t= i. Otherwise the segment border moves on the number of the predicted points, i.e. t = i -N.
6) The procedure is continued, when t < m -N, where m is common length of time series.
After fulfillment of this algorithm we can get the set of different segments and multilayer perceptrons tuned on corresponding segments.

LARGEST LYAPUNOV EXPONENT
Let's examine the neural network approach for calculating of largest Lyapunov exponent. As it is mentioned above the Lyapunov exponent is statistical measure of divergence between two orbits starting from slightly different initial conditions [27][28][29]. Let d0 be initial divergence between two trajectories and dn be divergence between such orbits after n steps. Then largest Lyapunov exponent is defined by The conventional approach to computation of the STLmax can be used on experimental data only when the sequence of data is very long [17,18]. So, in accordance with [18] the data-set size should be N>10D. However, it is very problematic to reach for real data. Therefore the traditional approach has been limited in their applicability to many real world chaotic data. One way to avoid this problem is to use neural networks for computing STLmax [27,29]. It is based on forecasting neural network techniques for measure of exponential divergence and permits to work well with small data set. Let us consider a forecasting neural network, which permits to trace the trajectory of any point in a reconstructed phase space. This network after its construction with the appropriate embedding parameter (embedding dimension D and time delay τ) allow us to perform a more exact prediction of a time series and to reconstruct an attractor from an arbitrary initial point. As a result forecasting neural network can preserve a system dynamics. It means that for every point in the attractor we can take the nearest point, which is far from it at some distance, and then trace its trajectory.
Thus the key idea of proposed method [29,30] is to compute by help of neural network divergence between two orbits on n step ahead, using iterative approach. In this case the neural network for computing of the STLmax will consist of k ≥ D -1 input units, where D is embedding dimension, p hidden units and one output unit (Fig. 2).
First of all we must train such a neural network according to sliding window method (3).
In that case procedure of calculating of the STLmax using small data set can be described in accordance with the following algorithm [29]: 1) Train neural network using sliding window technique.
In Fig. 3 the procedure of the STLmax computation is presented in case of t=1. By using this technique the STLmax for Henon and Lorenz time series are 0.43 (desired value is 0,418) and 0.98 (desired value is 0,906) respectively. Only the X-series has been used in both cases. The size of data set was 70 and 100 points respectively. As can be seen, this result is very close to real values with error 2,87% and 8,16% respectively. The results are better in comparison with [18], where error is 16,7% for 1000 points of Lorenz time series and 1,9% for 100 points of Henon time series. This method is highly advantageous as computational complexity, accuracy, and small data set are concerned.
As already said the neural networks are applied in order to compute the STLmax for EEG segments. It should be noted that we use for calculation of the STLmax the multilayer neural networks, received at the segmentation stage. As a result the sequences of segments with different values of the STLmax are obtained. If the different segments have the same value of the STLmax exponent they are combined into a one segment. Finally the epileptic seizure identification is performed for each segment. The proposed approach permits to detect exactly the epileptic and non-epileptic EEG segments of different duration and shape, in order to identify pathological activity in remission state and to detect paroxysmal activity in preictal period.

EXPERIMENTAL RESULTS
In our research we used sets (A-E) of the EEG signals [22,23]. There are 100 EEG segments in each set. Each EEG segment contains 4096 consecutive amplitude points; its duration is 23.6 seconds with sampling 173.61 Hz. We made experiments on the EEG signals that are characterized pathological (epileptic) and normal activities. Sets A and B consist signals recorded from healthy patients with eyes open (A) and eyes closed (B), respectively. Set C and set D includes EEG fragments during seizure-free intervals that were recorded from within the epileptogenic zone (C), and from the hippocampal formation of the opposite hemisphere of the brain (D). Set E contained activity during epileptic seizure.
All sets were used in experiment. Signals were classified on two classes: first class consisted signals with epileptic activity detected with using our system, second class included signals with only nonepileptic activity.
In the Table 1 the experimental results are presented. It is significant, that there are no false detections of epileptic activity in sets A and B (see example in the Fig. 4 a). In surgical treatment it is necessary to find the epileptic zone (the source of epileptic seizures). It is interesting, that 6% epileptic activity detections in the set C were only single detections (only one segment with epileptic activity in each signal is detected). Example of the single detection presented in the Fig. 4 b). When sets C and E were analyzed system had multiple detections in the signals in most cases (Fig. 4 c). Fig. 4 b) and Fig. 4 c) clearly show that the system can not only detect the presence of epileptic activity, but also to allocate the segments in which it is contained. The fragment from set C has one segment with epileptic activity (gray color). c) Four segments with epileptic activity (gray color) are detected in the fragment from set E.
The next experiment is made with use EEG data given by the 5th City Clinical Hospital (Minsk, Belarus). The data represent set of 21 registrations of 16-channel EEG. EEG data was recorded from eight adult patients during 8 seconds for each registration. In the result of EEG data digitalization with frequency 250 Hz each signal in EEG was presented as time series of 2000 points. Total number of EEG signals is 336. In comparison with previous database these data contain different artifacts. As it was mentioned early for removing artifacts from EEG records we use independent component analysis (ICA), which can detect independent source signals from linear mixtures. The EEG signals of one registration are divided into six sets as it is shown in the Fig. 5. All records of one registration are divided into six sets.
The number of sets is selected by experimentally way according to the number of signals in the set for the correct filter, and to location of the electrodes. Then each set of EEG signal is processed by ICA module. As a result we have obtained six clean without artifacts EEG signals. After that the segmentation of each obtained EEG signals is performed. As a result we detected 1775 segments from EEG signals of all registration (6x21=126). The results of epilepsy detection for one registration are presented in a two-dimensional map, as it is shown in the Fig. 6, Fig. 7 and Fig. 8. In the Fig. 6 the system detects one segment in the temporal part of the right hemisphere of the brain (the detection in the figures marked in a gray color that overlaps on a fragment of EEG and selects it). The next result (Fig. 7) shows us that system detects one outbreak of the epileptic activity in the all area in the right hemisphere of the brain. In the Fig. 8 we can see, that our system detects two outbreaks in the all areas of the brain. It may be noted that practically impossible to indicate the seizure event in these EEG signals by visual inspection even for high quality the neurologist experts.
The results of classification all selected segment in the EEG data by the designed system are summarized in the Table 2. We can see that our system correctly detects 29 segments with epileptic activity from total number of 32 segments. The test performance of the presented approach can be defined by the computation of sensitivity, specificity and total classification accuracy.
The values of these statistical parameters calculated on the base of Tables 1 (sets A, B and E ) and 2 are presented in Table 3. The results show that the presented in the paper methodology of EEG analysis are very specifically (99.7%), it means that there are small counts of false epileptic activity detection. It is important because a misdiagnosis can have serious consequences. The value of the sensitivity means that the system in 90.6% cases has right epileptic activity detection in real EEG data. The total accuracy of the segments classification in two classes (non-epileptic activity and epileptic activity) is equal 99.6%.

CONCLUSION
In this paper the novel method for epileptic seizure detection using EEG waveforms have been addressed. The proposed approach is based on selection of the different time segments in EEG signals with epileptic and non-epileptic activity. The value of the STLmax is used for classification of epileptic and non-epileptic segments in EEG data.
The neural network techniques are proposed both for segmentation of EEG signals and computation of STLmax. The proposed approach uses the same neural networks both for time segment selection and for STLmax computation in each segment using small data sets and faster in comparison conventional approach. This allows both for reducing the computationally complexity and for limit the observation time.
The data set from hospital have been used for experiments performing. The main advantages of presented neural technique is the ability to select in EEG small time segments with epileptic and normal activity, training without desired data set about epileptic and non-epileptic activity, the ability to assist the doctor in making decision and to visualize the zones (segments) of epileptic and non-epileptic activity in EEG signals using two-dimensional map [31,32]. Thus the proposed method has: -high accuracy of segments classification for epileptic and non-epileptic activity; -automatic detection of epileptic activity in the EEG; -classification without prior training on the special desired data set; -the ability to detect seizure activity of different shapes and duration; -resistance to noise in the signals of the EEG. It permits to detect exactly the EEG segments of different duration with epileptic and non-epileptic activity, to identify pathological activity in remission state and to detect paroxysmal activity in preictal period.

ACKNOWLEDGEMENTS
We appreciate The 5th City Clinical Hospital (Minsk, Belarus) for the experimental data supply very much.