Classification of Epileptic Seizure Predictors in EEG Problem: Epileptic seizures are still not fully understood in medicine. This is because there is a wide range of potential causes of epilepsy which may or may not correlate to the severity, regularity, and frequency of a patient s seizures. Furthermore, the physiological pathway causing seizures may vary between patients, even if both patients epilepsy is attributed to the same apparent cause. Despite modern diagnostic techniques, 6/10 seizure events are still diagnosed as idiopathic and attributed to epilepsy [1]. The amount of physiological variability in seizures makes a cure difficult in some cases and impossible in others. However, nearly all seizures can be detected as aberrant behavior in electrical signals produced by the brain, which provides an avenue for treatment of chronic seizures. Chronic seizures are treated with a combination of medication and preparedness/action plans. The utility and practicality of a seizure action plan increases if the patient has some method of monitoring when the next seizure will occur. Recent clinical studies have shown that features of EEG waveforms present during seizure activity can be detected as pre-seizure activity minutes before the onset of symptoms [2]. A practical method to warn patients of future seizure events is required. Solution: Patient Needs are not being met by the current applications of machine learning in EEG processing. To date, seizure detection has been a higher priority than seizure prediction. To detect ongoing seizures, pattern classification of bio-signals and EEG data is used daily in emergency rooms to diagnose unresponsive patients [3]. Seizure prediction is the use of pattern classification to detect neuroelectric markers of an oncoming seizure before symptoms begin. In a survey of 191 epileptic patients, 90% stated that they believe practical seizure prediction would be important for treatment [4]. Those same patients expressed a desire for sensitivity or specificity [4]. These patient needs were translated into technical specifications for a pattern classification algorithm and resulting deterministic mathematical model. The following are criteria the final model is based on patient needs. Feature space dimensions <= 25 Computationally simple feature extraction Time group predictions Maximize true negative probability with highest possible true positive The feature space must remain small and computationally simple to extract due to the intention that the final patient-specific deterministic models get loaded onto a microprocessors and combined with wearable EEG technology. This combination of hardware and software will act as an everyday monitoring device providing a continuous, real-time assessment of oncoming seizure probability.
To improve patient utility, this study also attempted to locate feature markers in training data that indicated if seizure event is likely as well as when that seizure is most likely to begin. This will be achieved by adding an additional value to the feature space labeling which time group the processed sample was extracted from as shown in Table 1. Table 1: The label of each time group. Control samples labeled 0 are taken from time windows that are 1+ hours away from the next seizure as well as 1+ hours away from the previous seizure to ensure a clean control. Label Sample Window (time before next seizure) 0 1+ hours 1 5-4 minutes 2 4-3 minutes 3 3-2 minutes 4 2-1 minutes 5 1-0 minutes The relative classification probability criteria are also based on patient needs. As this is intended to be a patient-monitored device, it is important not to warn falsely warn of seizures at the risk of the patient losing confidence in the device. However, it is also important to consider the survey results calling for sensitivity over specificity. Patients would rather be warned of a higher percentage of oncoming seizures and suffer a few false alarms than not receive a warning at all. These two criteria are conflicting but can both be achieved with time dependent classification. False positives are minimized by requiring an overall high specificity in the deterministic model. This lowers the sensitivity for recognizing pre-seizure samples in each time group at any given instant. Low sensitivity is compensated for by the proposed real-time implementation through the accumulation of pre-seizure markers. The false negative probability between groups 1-5 is accepted as high and variable between patients. This is a physiological consequence of the assumption that even though there are markers that predict seizures, these markers will not exist at all locations in EEG data at all times. Training Data [5]: Collected from 22 patients with 23 electrode continuous EEG systems. Data is recorded at 256 Hz at 0.1 mv resolution. In total, 198 seizure events occurred during EEG collection. Each seizure is annotated with start and end time. Since epilepsy is patient-specific, each model was trained on data from only one patient.
Approach: The complexity of EEG signals and a lack of universal pre-seizure markers excludes a template matching method for pre-seizure wave characteristic classification. Instead, the EEG signal was preprocessed into data representing the mathematical features of the waveform. A pattern classification algorithm compares the preprocessed data from the five minutes leading up to a seizure against preprocessed data pulled from the same patient s normal EEG patterns (1+ hours away from the nearest seizure). This yielded lists of waveform features that commonly occur at known time ranges before the onset of seizure symptoms. Using the final results of the pattern classification algorithm run in each time range, a multilayer perceptron (MLP) network will be generated to simultaneously analyze all electrode inputs from a real-time EEG signal. The output of the MLP is a real-time probability assessment of when the patient will have their next seizure or an indication that there is no pre-seizure activity. S = Number of seizures in training data Fs = 256 Hz E = # of electrodes in EEG = 23 for most patients X = # of features = 16 Sampling: Each patient s EEG data was handled separately. First the data was divided into control data and seizure data based on provided annotations. The control data was sourced 1+ hours from any recorded seizure activity. Seizure data was collected in the 5 minutes leading up to each recorded seizure in the training data set. Each patients training data was composed of 30 minutes of control data the five minutes leading up to at least four seizures. Data = [(30 + (S * 5 )) * 60 * Fs, E] matrix Preprocessing: Each data set was run through a preprocessing function to convert the raw waveform data into labeled feature vectors for the pattern classification algorithm. The preprocessing function extracted frequency and amplitude metrics, and relative power spectrographic results. The final 16-dimensional feature space was defined to include: Relative power of the 8, 4-Hz-wide frequency windows from 0-32 Hz Relative high frequency power in the 32-80 Hz range Max/min peak signal values Max/min peak duration Max/min values of signal after digital high pass filtering with Fc =.5 Hz Average frequency
The input to the feature extraction was a time scrolling window of data set, collecting one second long samples every half second from each electrode individually. The time group labels described in Table 1 were also added in this step. Finally the rows of the data set were randomized to get an unordered training set. Data = [(30 + (S * 5 )) * 60 * 2 * E, X] matrix Single-Input Pattern Classification: The data set after preprocessing was analyzed with MATLAB s classification learner. The ideal pattern classification method for this study was arrived at experimentally. Support vector machines, nearest neighbor classifiers, and decision trees were tested. Due to the number of features and size of the data set, ensemble methods were the most effective. The two best approaches were a bootstrapped aggregate of decision trees (sometimes referred to as a decision forest) and a subspace KNN which analyzes the results of many KNN algorithms in different subsets of the feature space. Ensemble methods are not ideal for the future platform of a microcontroller. In this case, the computational simplicity involved in computing the output of a decision forest makes it possible. Additionally, the decision forest has a faster training time than the subspace KNN makes it the best pattern classification algorithm for this study.
Results: After the sampling and preprocessing steps defined above, the implemented learning algorithm successfully generated decision forests that met the criteria defined by patient needs as shown in Figure 1 and Figure 2. All test were run with 5-fold verification. Total number of tree was experimentally determined to yield the level of classification shown below is 30-60. Figure 1: Confusion of patient 03 in data set. Maximum values on the diagonal of the matrix shows successful pattern classification.
Figure 2: True positive and false negative of patient 03. High true positive in class 0 and relatively high true positives for groups 1-5 compared to false positives in groups 1-5 shows success.
The success of this study with respect to its goals are summarized in Table 2: Table 2: Success of each criteria is described in table two Criteria Small feature space Simple feature extraction Time group predictions Evidence Only 16 features and one label are used for this classification. Calculations do not require large amounts of memory or computations. When a preseizure marker is detected, there is a ~50% chance it is placed in the right time group. There is a 60-80% chance the marker is placed in adjacent time group. Maximum true negative probability True positive classification for group 0 is 99%. High true positive probability The true positive calculation of groups 1-5 is ~20% with relatively smaller false positive probabilities within groups 1-5 * As expected false negative probabilities are high. This is shown in the high rate of misclassification of each group 1-5 into group 0. Real-Time Implementation: The real-time implementation of the neural network based on this pattern classification model was not generated due to the scope of this course. The NN would need to operate recursively, storing an array of past processed samples. The output of the RNN would be based on a weighted combination of all past stored samples. The classification of more recent samples would have higher weights than the samples farther away in the time domain to calculate the probability and time of an approaching seizure. The RNN would also employ a heuristic threshold to set a minimum confidence required to warn a patient a seizure is approaching. The pattern classification modeling technique described in this report can be used in the future to implement such a neural network. Conclusion: This study achieved the goal of applying machine learning to epileptic EEG monitoring while focusing on patient priorities. The process of developing pattern classification models proposed in this study could be used to build a real time RNN operating on a microcontroller with a wearable EEG input. The high specificity for group 0 samples shows the system would almost never instantaneously come to the conclusion that a seizure is about to occur if there is not seizure activity in the next five minutes. Once this is applied to the threshold and aggregate analysis of the proposed RNN, the number of false warnings from this system would be nearly 0. Additionally, the pattern classification models have a high probability of classifying a pre-seizure marker to the correct time group or an adjacent group relative to other time groups 1-5. The proposed device and the software developed in this study have the potential to function as a real-time seizure warning system advising a patient when his or her next seizure symptoms will begin.
References [1] Steven, S. (2017). What Causes Epilepsy and Seizures? Epilepsy Foundation. [online] Epilepsy Foundation. Available at: https://www.epilepsy.com/learn/aboutepilepsy-basics/what-causes-epilepsy-and-seizures [Accessed 16 Dec. 2017]. [2] G. Minasyan, J. Chatten, M. Chatten and R. Harner, "Patient-Specific Early Seizure Detection From Scalp Electroencephalogram", Journal of Clinical Neurophysiology, vol. 27, no. 3, pp. 163-178, 2010. [3] Ramgopal, S., Thome-Souza, S., Jackson, M., Kadish, N., Sánchez Fernández, I., Klehm, J., Bosl, W., Reinsberger, C., Schachter, S. and Loddenkemper, T. (2017). Seizure detection, seizure prediction, and closed-loop warning systems in epilepsy. [online] Available at: https://www.sciencedirect.com/science/article/pii/s1525505014002297 [Accessed 16 Dec. 2017]. [4] Schulze-Bonhage, A., Sales, F., Wagner, K., Teotonio, R., Carius, A., Schelle, A. and Ihle, M. (2017). Views of patients with epilepsy on seizure prediction devices. [online] Available at: https://www.sciencedirect.com/science/article/pii/s152550501000377x [Accessed 16 Dec. 2017]. [5] Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh, Mark RG, Mietus JE, Moody GB, Peng C-K, Stanley HE. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation 101(23):e215-e220 [Circulation Electronic Pages; http://circ.ahajournals.org/cgi/content/full/101/23/e215]; 2000 (June 13).