Epileptic Seizure Prediction Using CSP and LDA for Scalp EEG Signals

This paper presents a patient-specific epileptic seizure predication method relying on the common spatial pattern- (CSP-) based feature extraction of scalp electroencephalogram (sEEG) signals. Multichannel EEG signals are traced and segmented into overlapping segments for both preictal and interictal intervals. The features extracted using CSP are used for training a linear discriminant analysis classifier, which is then employed in the testing phase. A leave-one-out cross-validation strategy is adopted in the experiments. The experimental results for seizure prediction obtained from the records of 24 patients from the CHB-MIT database reveal that the proposed predictor can achieve an average sensitivity of 0.89, an average false prediction rate of 0.39, and an average prediction time of 68.71 minutes using a 120-minute prediction horizon.


Introduction
Epilepsy is a brain disorder characterized by excessive, infrequent, and synchronous discharge of a large number of neurons [1] and affects 1% of the world's population [2]. Epileptic seizure can be managed in two-thirds of the patients using prescription drugs, while another 8% can be cured using resected surgery. Seizures of about 25% of patients with epilepsy cannot be managed sufficiently by any available therapy [2,3]. Therefore, the early anticipation of seizures could be very valuable for those patients, caregivers, or family members to save patients and others from possible hazards [4,5]. An effective seizure prediction approach would improve the quality of patients' daily lives. Electroencephalogram (EEG) is the most often used brain disorders' diagnostic tool, specifically for epilepsy [6]. It is measuring the voltage fluctuations resulting from ionic current within the neurons of the brain through electrodes [7]. There are two types of EEGs: intracranial EEG (iEEG) and scalp EEG (sEEG). In iEEG, electrodes are placed directly on the exposed surface of the brain to record the electrical signals. However, in sEEG, the electrical signals are collected with electrodes placed on the scalp area according to certain placement specifications, such as the International 10-20 System. Seizure prediction is based on the hypothesis that there exists a transition state (preictal) between the interictal (normal state) and the ictal state (seizure). There are numbers of clinical evidences that support this hypothesis. These evidences include increases in cerebral blood flow [8,9], cerebral oxygenation [10], cortical excitability [11], highly significant blood-oxygen-level-dependent signal on fMRI studies [12], and variations in heart rate [13,14]. Accordingly, researchers have invested a great deal of effort over the last decades on attempting to predict epileptic seizures based on iEEG and sEEG signals, where the latter are more convenient to apply clinically. Around forty years ago, Viglione and his colleagues presented the first attempt for seizure prediction [15,16]. After that, many researchers published their attempts to predict epileptic seizures suing different methods.
Common spatial pattern (CSP) is a feature extraction algorithm used in different applications, such as electromyography (EMG) signal separation [60], EEG signal analysis for motor imagery purposes [61,62], and, more recently, seizure detection [63][64][65]. The objective of this paper is to develop a patient-specific CSP-based seizure prediction algorithm for sEEG signals. The extracted feature using the CSP will be fed to a linear classifier to classify the epoch as either a preictal or interictal segment. Note that the data segment preceding the seizure onset is called the preictal interval and ranges from a few seconds to several hours long [38,47,54]. The performance of the proposed predictor is compared with the random and Poisson predictors and with existing sEEGbased prediction methods [17,18,28,41,45,47,48,54,55]. The results show that the proposed prediction method could be of potential value for early warnings for epileptic patients and/or their caregivers.
The remainder of the paper is organized as follows. The CSP mathematical formulation is discussed in Section 2. The data collection and seizure prediction approach are presented in Section 3. Section 4 presents the prediction performance metrics. The experimental results and comparisons with other existing seizure prediction algorithms are provided in Section 5. Finally, Section 6 offers concluding remarks.

Common Spatial Pattern (CSP)
CSP is a statistical method that was introduced to the field of EEG analysis by Koles et al. [66,67] and is used to extract spatial filters for discriminating between two classes of EEG signals. In this work, the CSP method is used to distinguish between two classes, preictal and interictal EEG activities, by constructing a projection matrix, , that minimizes the variance for preictal activity and maximizes it for the other class. The following steps describe the mathematical formulation of the CSP approach [66,67]: (1) Calculate the normalized covariance matrix for each data segment ∈ where is the number of channels, is the number of samples, and is the transpose operation.
(2) Perform an averaging process on the covariance matrices of each class ( = 1,2) to find two discriminated covariance matrices, 1 (preictal state) and 2 (interictal state), and then find the composed covariance matrix : (3) Decompose the composed matrix using singular value decomposition (SVD) to find the Eigenvalue matrix and normalized Eigenvector matrix : (3) (4) Form a new matrix : to obtain the following two matrices: 1 and 2 share common eigenvectors. Hence, the sum of the corresponding Eigenvalues of the two matrices is always 1.
(5) Apply the SVD to the matrices 1 and 2 as follows: Note that Λ 1 + Λ 2 = , where is the identity matrix, , and Λ represent the matrix of eigenvectors and the diagonal matrix of Eigenvalues, respectively. The Eigenvalues are then sorted in descending order; thus, the CSP projection matrix is formulated as = ∈ × .

Clinical Data.
In this work, long-term continuous multichannel sEEG recordings of 24 patients from a publicly available dataset (Children's Hospital Boston [CHB-MIT] database [68]), which consists of sEEG recordings from pediatric subjects with intractable seizures, were used. Subjects were monitored for up to several days following withdrawal of antiseizure medication in order to characterize their seizures and assess their candidacy for surgical intervention. This data contains 987.85 hours, with 170 seizures. Each seizure onset is marked by an experienced electroencephalographer and corresponds to the onset of a rhythmic activity that is associated with a clinical seizure [11,22,[26][27][28][29][30][31][32]. The data is multichannel in nature, with 23 or 18 channels for each patient obtained by sampling at a rate of 256 Hz. The International 10-20 System of EEG electrode positions and nomenclature was used for these recordings. A summary of this dataset is presented in Table 1. The data is segmented into one-hourlong records. Records that do not contain seizure activity are referred to as nonseizure records, and those that contain one or more seizures are referred to as seizure records.

Seizure Prediction Approach.
The block diagram of the proposed seizure prediction methodology is depicted in Figure 1. It is comprised of two main stages: feature extraction and classification. In the feature extraction stage, the multichannel signal is segmented and the CSP is used to extract the training and testing features. In the classification stage, a trained classifier is used to classify the incoming segment as a preictal or interictal segment.
Computational Intelligence and Neuroscience 3  Figure 1: CSP-based patient-specific seizure predictor.

CSP-Based Features Extraction Stage.
First, the multichannel signal was segmented into overlapping epochs of length = 3 seconds (this value for was selected based on several trials). A sliding window was used for signal framing with an overlap of − 1 seconds between two successive segments. In this work, we extracted preictal training features from data intervals of 3, 5, and 10 minutes. Similar intervals have been considered in [38,51,52]. Based on literature, it has been reported that there are electrophysiological changes, which might develop minutes to hours before the actual seizure onset [38,47,54]. Therefore, the preictal training data could be selected from any of the following options: (i) Preictal-0: the preictal training interval ends right at the beginning of seizure onset.
Therefore, we used a sliding window of length 3 seconds to extract preictal features from four different preictal training intervals (3, 5, and 10 minutes), each of which could be located at three different distances with respect to seizure onset. Nonseizure hours were used for interictal training data. The CSP algorithm was applied to each segment of size 23 × 768 (number of channels × number of samples) by computing X W, where W is a projection matrix of size 23 × 23. Following the approach of [69], the log of variance of each row of the resulting matrix was taken as a feature.

Classification Stage.
In the classification stage, a linear discriminant analysis (LDA) classifier [70] was trained with preictal and interictal feature vectors. We used random undersampling strategy to balance the number of preictal and interictal segments in the training set [71,72]. In the testing phase, the trained classifier was tasked to classify any incoming epoch as a preictal or interictal state. The classifier results were binary "1" for the preictal state and zero otherwise. A seventh-order median filter was used to smooth the results. The prediction alarm was raised if ∑ = , where is consecutive "1 s" with a moving window of 1 second, is a patient-dependent threshold, and = 1 ⋅ ⋅ ⋅ 24. The value of is obtained from the training dataset. The alarm is positive if it is within the prediction horizon; otherwise, it is a false alarm. In this study, three different prediction horizons were used: 60, 90, and 120 minutes, which are within the ranges used by other authors [18,43,47,55]. We adopt a postictal interval of 10 minutes as in [43,54]. Moreover, the alarms in the 10 minutes before or after a missing hour (when the patient's data is not continuous) are not considered.

Performance Evaluation
The proposed predictor performance is evaluated by estimating the sensitivity, specificity, false prediction rate (FPR), and prediction time. In our development, the FPR is computed such that a patient has to wait until the end of prediction horizon to determine if a warning is false. The prediction time is defined as the time from the positive alarm to seizure onset. The sensitivity is the percentage of predicted seizures. A seizure is considered to have been predicted if there is at least one alarm before it within the prediction horizon. For estimating the specificity, we adopted the method of Wang et al. [43,73], which considers the effect of the prediction horizon on prediction performance. The authors estimated the specificity (spec) by quantifying the portion of time during the normal interval that was not considered to be false waiting time (see (7) below). A normal interval starts from the end of the posthorizon of a seizure and ends at the beginning of the prediction horizon of the next seizure. The false waiting time is the time from a false alarm to the end of its horizon or the end of the current normal interval. A positive or false alarm occurring within another alarm horizon of the same type is considered to be one.
where fwt is the length of the false waiting time and is the length of the normal interval. Figure 2 presents an example of estimating the sensitivity and specificity of six continuous hours using a prediction horizon of 60 minutes. The seizure has at least one alarm within the prediction horizon, so the sensitivity is 100%. The f wt = 2 hours and = 4 hours yield a specificity of 50%.
We evaluate the performance of the proposed predictor with two random predictors: periodic predictor which raises an alarm at a fixed time period and Poisson predictor which gives an alarm according to an exponential distributed random time period with fixed mean . The two parameters and were determined to be the average length of interictal intervals for each patient, as presented in Table 1.

Experimental Results and Comparison
This section shows the results of the proposed seizure predictor's and compares the predictor's results with those of other sEEG-based algorithms. The proposed predictor was tested on the sEEG recordings of 24 epilepsy patients from the CHB-MIT database with a total of 987.85 hours containing 170 seizures (Table 1) and using three prediction horizons (60, 90, and 120 minutes). We adopted a leave-one-out strategy for evaluating the performance of the proposed approach in terms of each patient's data. There were rounds for each patient with recordings. In each round, the data were divided into two sets: training segments obtained from − 1 recordings and testing segments obtained from the remaining one recordings. That is, we performed runs where in each run a new recording is used for testing and the remaining − 1 recordings are used for training. The − 1 dataset used for training is divided into 5 folds in the implementation of the leave-one-out cross-validation procedure. The best model parameters obtained from training are then applied to the initially excluded recording for testing. So, all the parameters estimated from the − 1 recordings during training remained unchanged during the evaluation on the remaining one recording. Then, the average of the results was computed.   An example of predictor outcomes is shown in Figure 3, which represents the results of Patient 1 (hours 1-15) with a 60-minute prediction horizon (sliding one second) for preictal-0 and preictal intervals of 5 minutes. The seizure and postseizure are shown as the red area. The green area is the prediction horizon. The yellow area covers the unconsidered 6 Computational Intelligence and Neuroscience interval. The alarms are the magenta lines. The false alarms create false waiting times that are shown as light-blue areas. For selecting the proper preictal interval length, we investigated four different sizes, 3, 5, and 10 minutes, with all prediction horizons. These intervals are segmented into 3 seconds with an overlap of 2 seconds in the training phase. Table 5 presents the overall average results of the different preictal sizes of the 24 patients with the three horizons. It shows that the best results in all three horizons were achieved when the preictal length was 3 minutes with an average sensitivity of 0.89, average prediction time of 68.71 minutes, and average FPR of 0.39. The FAR with a 10-minute preictal length was the highest while the FAR with a 5-minute preictal length was the lowest.
As stated previously, the preictal interval ranges from a few seconds to several hours preceding the seizure onset. In this work, we studied a selection of preictal intervals immediately preceding (preictal-0), 60 minutes before (preictal-60), and 120 minutes before (preictal-120) onset with an interval of 3 minutes. Table 6 shows that selecting the preictal intervals exactly before the onset (preictal-0) was the most suitable. Preictal-0/-60/-120 achieved average sensitivity of 0.81, 0.87, and 0.89, respectively, with the prediction horizon of 120 minutes. This is intuitively unsurprising, as going back from the seizure onset is most likely to have a smaller seizure activity signature.

Comparison with Existing sEEG-Based Method.
A comparison of our method with previously published sEEGbased seizure prediction methods shows the effectiveness of the proposed method. However, the comparison must be interpreted correctly, as it is based on different datasets and prediction horizons. Table 7 shows a comparison of some of the previously published works with the proposed method. Zandi et al. [17] presented zero-crossing intervalsbased seizure prediction algorithm that was tested on sEEG recordings of three patients provided by the EEG Department of Vancouver General Hospital (VGH) with a total of 15.5 hours, including 14 seizures and a prediction horizon of 30 minutes. Using three channels, their method yielded an average sensitivity of 85.71%, average false prediction rate of 0.12/h, and average prediction time of 20.8 minutes. However, when they used five channels, they obtained an average sensitivity of 71.43%, average false prediction rate of 0.06/h, and average prediction time of 18.9 minutes. In [18], Zandi et al. used the sEEG recordings of 20 patients with a total of 561.3 hours, including 86 seizures from two Table 4: CSP-based patient-specific predictor performance (preictal-0 with a length of 3 minutes and 120-minute horizon

Conclusion
In this paper, we have presented a patient-specific seizure predictor based on CSP and a linear classifier using three prediction horizons: 60, 90, and 120 minutes. The CSP was used as a feature extractor to find the best discriminative features and reduce the amount of data used for each segment of dimensions 23 × 768 (number of channels × number of samples) to a feature vector of size 23 × 1 containing the log of variances computed from the rows of the resulting matrix after projection. This data reduction process enabled a linear classifier capable of labeling an incoming segment as either the preictal or interictal state to be built. Three alternatives for the proper selection of the preictal interval location were investigated: preictal-0, preictal-60, and preictal-120. Furthermore, three preictal interval lengths (3, 5, and 10 minutes) were studied. Using sEEG recordings from 24 epileptic patients, the best prediction performance was achieved using preictal-0 with a 3-minute preictal size and the prediction horizon of 120 minutes, in which the average sensitivity was 0.89, average specificity was 0.37, average FPR was 0.39, and average prediction time was 68.71 minutes.

Conflicts of Interest
The authors declare that there are no conflicts of interest.