Automatic Seizure Onset Detection in Long Term Pediatric EEG Signals

Epilepsy is one of the most common neurological disorders and occurs with an incidence of 68.8/100,000 person per years [1]. Despite proper medical treatment, on average one third of patient continues to have seizure [2]. These patients suffer from epilepsy that does not respond to antiepileptic drugs and is called as refractory epilepsy. The only known and generally adapted treatment is surgery, but surgery of brain requires identification of very precise focus. However, focus identification is done by employing various tracers when patient is experiencing seizure. Earlier detection of seizure onset will aid tracers for finding accurate location of epileptogenic focus. Sometimes proper diagnosis may need EEG recording of some weeks which becomes very tedious, unreliable and expensive job. Further visual inspection may lead to expert’s disagreement over same EEG due to its subjective nature and various morphologies [3]. Hence a reliable computer based expert system is needed to assist clinicians for promoting therapies and rapidly treating such patients.


Introduction
Epilepsy is one of the most common neurological disorders and occurs with an incidence of 68.8/100,000 person per years [1]. Despite proper medical treatment, on average one third of patient continues to have seizure [2]. These patients suffer from epilepsy that does not respond to antiepileptic drugs and is called as refractory epilepsy. The only known and generally adapted treatment is surgery, but surgery of brain requires identification of very precise focus. However, focus identification is done by employing various tracers when patient is experiencing seizure. Earlier detection of seizure onset will aid tracers for finding accurate location of epileptogenic focus. Sometimes proper diagnosis may need EEG recording of some weeks which becomes very tedious, unreliable and expensive job. Further visual inspection may lead to expert's disagreement over same EEG due to its subjective nature and various morphologies [3]. Hence a reliable computer based expert system is needed to assist clinicians for promoting therapies and rapidly treating such patients.
This article describes, how considering background activity for seizure onset detection is superior to currently available algorithms. We also explore the potential of such algorithms for seizure management using a closed loop around detection scheme, thereby arresting the spread of seizure and reducing complications.

Background
In the last few decades' various algorithms have been proposed for detection of presence or absence of seizure on ongoing EEG record [4][5][6][7][8][9][10][11][12][13][14][15]. All seizure detection algorithms involve two steps. First is to find quantitative values called features from the EEG data. Second is called classification that may require a simple threshold criteria or complex classier model derived from modern machine learning techniques. Since, EEG seizure pattern possess heterogenic nature, therefore detection algorithms are generally made patient specific and in addition, tradeoff is required between maximizing sensitivity and minimizing latency and false detection rates. First remarkable work in field of automated seizure detection was reported by Gotman et al. [4]. They implemented spike and sharp wave recognition technique to detect epileptic activity. Afterwards, several detection algorithms were developed based on the same technique by extracting features like relative amplitude, sharpness, and duration of EEG waves.
But these methods are very sensitive to various artefacts. Hence, preprocessing is required for artifacts rejection. Libenson [16] points that EEG instruments do not exceed 30-40 Hz and signals obtained from cortically implanted electrodes exceed 50 Hz due to electrical noise and other artefacts such as muscle movement. Thus, Wang et al. [5] use a frequency range between 8 and 32 Hz and Subhasi [6], discarded frequencies above 30 Hz by using high pass-filter, whereas Yuan et al. [7] split signals into three frequency bands using band-pass filters for theta ( : 4 ≤ ≤ 8 Hz), alpha ( : 8 ≤ ≤ 12 Hz), and beta ( : 12 ≤ ≤ 25 Hz) to ensure that only specific physiological data is considered. Further, Greene et al. [8] filter out frequencies above 34 Hz and stated that 2-20 Hz frequency range provides the best discrimination between seizure and non-seizure events. In 2009, Shoeb [9] proposed a patient specific onset detection system which was tested on the Children's Hospital Boston-Massachusetts Institute of Technology (CHB-MIT) database and shows detection accuracy and sensitivity of 96%, with a false-positive rate of 0.08 per hour and mean detection delay of 4.6 seconds. In a similar study Kharbouch et al. [10] designed a method for seizure detection. For evaluation of algorithm, data of 10 patients was utilized to extract both temporal and spectral features. The method was able to detect 97% of 67 test seizures with a median detection latency of 5 seconds and a median false detection rate of 0.6 per 24 hour. Khan et al. [14] in 2012 proposed a first remarkable seizure detection algorithm by considering background activity. The algorithm was tested on 5 patients with 65 seizures, results show that 83.6% was achieved for sensitivity, 100% for specificity, with an overall accuracy of 91.8%. In this work concept of exploiting background information is extended for detecting seizure more accurately.
When two functions are alike minimum divergence is obtained.
In both of the above features, two pdfs are required which are obtained by considering two epochs. Leading epoch is called as main epoch while the preceding epoch is known as background epoch. When both of the epochs are in normal EEG region, they have more or less identical pdfs and thus minimum relative entropy and Cauchy-Swartz divergence is obtained. However, as the window slides and main epoch enters seizure EEG zone, pdf experiences a change and consequently relative entropy and Cauchy-Swartz divergence as in Figures 3 and 4.
Also, a background window of 25 seconds is selected from nonseizure data to find the change between features calculated on main epoch with respect to the background activity of EEG. This change is calculated to highlight the seizure activity from background activity and also to reduce the effect of nonseizure rhythmic activities. Gap of 40 second is intentionally provided between main epoch and background window to make sure that the onset does not become a part of background activity and that the detection of seizures can be done at the earliest for the seizures having a gradual onset [13]. This 25 second window is divided in to 25 subsections of 1 second each. Each Section is then decomposed by DWT to obtain D3, D4, D5 coefficients in similar fashion as obtained on main epoch. On these coefficients of each section some other features are calculated and then average is taken to obtain mean feature value according to background rhythm of EEG. Same features are obtained on main epoch considering it as a single section of 1 second. Features from main and background epoch are then utilized to obtain a change in their value as the window slides. When both main and background window will be in nonseizure (normal) EEG region, the change obtained will be less as both epochs lie in same rhythmic activity region. However, as the main epoch enters in seizure region, characteristic of main epoch deviates consequently a change will be noticed. Median absolute deviation, normalized coefficient of variation (NCOV) and fractal dimension are calculated as features in this work.

Median Absolute Deviation:
Median Absolute Deviation is a simple way to quantify variation and thus, it can be defined as the measure of dispersion of statistical data available. Mathematically, for any discrete data set [X1, X2, X3, X4, X5, ……….. ] Therefore, change in median absolute deviation can be calculated from both main epoch and background window as suffering from intractable seizures and is freely available online [17]. This database has EEG recording of 916 hours of continuous scalp EEG recordings collected from 24 subjects. There are in total 664 EEG files, among these 129 files consist one or more seizures. In total, these recordings have 198 seizures. These signals were recorded at 256 samples per second with 16-bit resolution, using 23 channels in most of the cases and 24 or 26 channels in few cases.

Wavelet decomposition
Wavelets are recent approaches developed in 1990s for signal processing. Concepts of wavelet can be used to extract useful sub-frequency signals with retained time series information by decomposing EEG signals into progressively finer details by means of multi-resolution analysis using complementary low pass (LPF) and high pass (HPF) filters (explained further in Ref. [13]). These filters are referred to as analysis filters. HPF is mother wavelet while LPF is its mirror version. In this work, fourth order daubechies wavelets (db4) is used as mother wavelet. The coefficients Ak and Dk are produced by convolving the digital signal with each filter, and then decimating the output. The Ak coefficients are produced by LPF and are known as approximate coefficients whereas Dk coefficients are produced by HPF and are known as detailed coefficients. This decomposition into sub-band frequencies provides flexibility in extracting features. Figure  1 illustrates an 'n' level wavelet decomposition filter bank [12].

Feature extraction
The most important step in classifying problem is feature extraction. Initially, all files with seizures are collected and seizure onset and offsets are marked with the annotations available in database. A non-overlapping window of 256 data samples i.e., one second data was selected on seizure section. A similar window is also considered from non-seizure section preceding by 40 seconds. Both of these windows were allowed to slide by one second throughout the seizure section, forming N epochs, where N is the seizure time span. Using DWT both of the epochs were decomposed into 5 levels and detailed coefficients D5, D4 and D3 encompassing frequencies of 4-8 Hz, 8-16 Hz, and 16-32 Hz respectively were retained for extracting features. Two features i.e., relative entropy and Cauchy Swartz Divergence (explained later) are calculated as it slid N epochs forming N by 6 feature vector ( Figure 2).

Relative entropy:
For two discrete probability distributions having a probability function of Pk and Qk respectively. Relative entropy between the two can be defined as [14]:

Cauchy-Swartz divergence:
It is a kind of symmetric measure which is measured in terms of distance between two probability distribution functions, say P and Q. It is given by:  Fractal Dimension: It is a measure of complexity of signal and thus, can characterize difference between seizure and normal EEG patterns. In literature there are many algorithms available for estimating it [12]. In this work it is calculated using Katz algorithm.
The F d of a time series X (n), n=1, 2, 3 …N can be obtained as - Where 'L' is the sum of distances between successive points, <L> is the average distance between successive points and d is the diameter estimated as the distance between the first point of the sequence and the point of the sequence that provides the farthest distance. Mathematically, Where 'n' is the number of sections in which background window is splintered.
Where NVAR is normalized coefficient of variation [14,18] and can be defined mathematically as, Like the relative entropy and Cauchy-Swartz divergence, these three features were also calculated for same N seizure epoch by moving window forming N by 9 feature vector. It is now concatenated horizontally with the previous N by 6 vector, resulting in N by 15 feature vector. Most of the EEG in this database is of 23 channels. These features are calculated on each channel so as to give a feature vector of (23 × N) by 15. To reduce the curse of dimensionality, feature reduction is performed by taking mean of feature values obtained for each sub-bands i.e., D3, D4 and D5. Hence for each epoch we have feature vector of (23 × 1) by 5 ( Figure 8).
As described earlier, heterogeneity restricts the algorithm to patient specific. Features are calculated and then given to train a SVM classifier model with hyperplane kernel. Now, test EEG from other files of same patient is chosen and features are calculated. These features are then given to model for categorizing the epoch as normal or epileptic. Performance of the algorithm is evaluated using standard statistical parameters like sensitivity, false detection rate and latency.
Sensitivity: It may be defined as the percentage of seizures detected which were actually marked as seizures by experts.
False Detection Rate: It is the number of false detected epochs divided by time of measurement.
Latency: Latency is the lag between detected onset and expertlabeled onset.
To reduce artifacts' affect, a compromise with latency is done by declaring onset only if 18 channels or more report it is a seizure. Results obtained for 10 patients are summarized in Table 1.

Performance Evaluation
To evaluate the performance of algorithm, EEG record of 459.8 hours having 55 seizures is utilized for training and testing purpose. Classifier model outputs was compared with the expert annotations in the way as sensitivity, false detection rate and latency is described and results are summarized in Table 1. All of the seizures present in EEG record file were detected successfully. Mean latency was found to be 3.14 seconds with a median false detection rate of 2.159/hr. Maximum latency was shown by the patient 2 followed by patient 10, because of the high amplitude background characteristics similar to seizure activity as clear from Figure 9. Maximum false detection is present in patient 4 possibly because of artifacts present in records.

Conclusion
In this work, relative entropy and Cauchy-Swartz divergence are calculated on wavelet decomposed sub-bands by considering two epochs. Leading epoch is main epoch while the preceding epoch is background epoch. Further median absolute deviation, normalized coefficient of variation and fractal dimension are evaluated on main epoch as well as on background window. Difference between the two is taken and is used for training expert system. This methodology was able to detect all seizures present in 10 patient data of 445 hours with a mean latency of 3.14 second and median false detection rate of 2.16 per hour. In future this algorithm can be used to design a system which can raise an alarm for medical attendant or to automate the seizure arresting drugs for better seizure diagnosis and management ( Figure 10).