Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2020 Oct 9.
Published in final edited form as: Annu Int Conf IEEE Eng Med Biol Soc. 2020 Jul;2020:3703–3706. doi: 10.1109/EMBC44109.2020.9175644

Deep Learning for Interictal Epileptiform Spike Detection from scalp EEG frequency sub bands

Thangavel Prasanth 1,*, John Thomas 2, R Yuvaraj 2, Jing Jing 3, Sydney S Cash 3, Rima Chaudhari 4, Tan Yee Leng 5, Rahul Rathakrishnan 6, Srivastava Rohit 7, Vinay Saini 7, Brandon M Westover 3, Justin Dauwels 2,*
PMCID: PMC7545315  NIHMSID: NIHMS1627055  PMID: 33018805

Abstract

Epilepsy diagnosis through visual examination of interictal epileptiform discharges (IEDs) in scalp electroencephalogram (EEG) signals is a challenging problem. Deep learning methods can be an automated way to perform this task. In this work, we present a new approach based on convolutional neural network (CNN) to detect IEDs from EEGs automatically. The input to CNN is a combination of raw EEG and frequency sub-bands, namely delta, theta, alpha and, beta arranged as a vector for one-dimensional (1D) CNN or matrix for two-dimensional (2D) CNN. The proposed method is evaluated on 554 scalp EEGs. The database consists of 18,164 IEDs marked by two neurologists. Five-fold cross-validation was performed to assess the IED detectors. The resulting 1D CNN based IED detector with multiple sub-bands achieved a false positive rate per minute of 0.23 and a precision of 0.79 at 90% sensitivity. Further, the proposed system is evaluated on datasets from three other clinics, and the features extracted from CNN outputs could significantly discriminate (p-values < 0.05) the EEGs with and without IEDs. We have proposed an optimized method with better performance than the literature that could aid clinicians to diagnose epilepsy expeditiously, and thereby devise proper treatment.

I. Introduction

Scalp electroencephalogram (EEG) signals are an effective, non-invasive technique commonly utilized for monitoring the brain activity and determining brain disorders. Epilepsy is a common neurological disorder that affect approximately 70 million people in the world [1]. Interictal epileptic discharges (IEDs) that show up in the EEG of epileptic patients are the most reliable biomarkers and are widely adopted in clinical evaluations. Traditionally, the IEDs are visually examined in the EEG recordings by the neurological experts. This makes the process of IED detection tedious, time consuming, subjective and potentially may lead to incorrect diagnosis [2]. These limitations motivated to develop a reliable automated IED detection system, which could assist the neurologist. In the past few decades, a wide range of IED detection methods, namely template matching, parametric methods, mimetic analysis, power spectral analysis, wavelet analysis, etc. was proposed in the literature [2]. At the core of these methods lies effective feature extraction for IEDs. However, feature engineering is an intricate process, and the majority of the features are not globally adopted. In recent years, deep learning techniques such as convolutional neural networks (CNN) have been shown to perform superior to traditional machine learning models and hand-crafted features, especially when trained on large databases [310]. Studies have reported that IED detection using EEG sub-bands could help to improve the IED detection performance [5, 10] since the sub-bands provide additional information about neuronal activities underlying the problem, which are not so obvious in the full-spectrum signal. We aim to investigate how to leverage EEG sub-bands for automated IED detection by CNNs. The proposed EEG sub-bands based IED detection achieved a false positive rate per minute (FP rate/min) of 0.23 and a precision of 0.79 at 90% sensitivity.

II. Methods

A. Scalp EEG recordings and pre-processing

In this study, we analyze 93 epileptic (84 patients) and 461 non-epileptic 30-min EEG recordings from the Massachusetts General Hospital (MGH), Boston, USA. The 19-channel data was according to the 10–20 international electrode system. The dataset has annotations for individual IEDs as well as EEG-level annotations. The EEG data was down-sampled to 128 Hz and filtered to eliminate power-line interference (notch filter of 50/60 Hz), and baseline fluctuations (high pass filter of 1 Hz). We also performed an artifact rejection based on noise statistics, as applied in [3]. After filtering, the common average referential montage is applied to enhance the quality of the signal. Generally, EEG signals can be decomposed to different sub-bands, which can provide helpful information for IED detection [10]. This makes the sub-band decomposition a compelling tool for analyzing EEG signals. Thus, we applied a bandpass filter to extract different sub-bands: Delta (1 to 4 Hz), Theta (4 to 8 Hz), Alpha (8 to 13 Hz), and Beta (13 to 30 Hz). In addition, we tested the proposed system on three other scalp EEG datasets from National University Hospital (NUH), National Neuroscience Institute (NNI), Singapore, and Fortis Mulund, India. The NUH data consists of 82 epileptic and 96 non-epileptic EEGs. The NNI data contains 25 epileptic and 24 non-epileptic EEGs. The Fortis dataset consisted of 28 epileptic and 19 non-epileptic EEGs.

B. Data Preparation

The MGH epileptic EEGs contain a total of 18,164 IED events annotated by two neurologists, independently. In IEDs, we prominently focus on spikes and spike-wave complexes. The IED events are marked for each time instant with the channel information on which the most significant IED pattern exists. There are multiple transients annotated at the same time-instant; we have 14,170-time events marked as epileptiform events. Each IED is extracted as a 64-sample waveform (500-milliseconds). We divided the MGH dataset into five folds, randomly, by following the data split criteria applied in [3]. The details regarding different folds are presented in Table I. The background waveforms (non-IEDs) are likewise extracted as 64-sample waveforms with an overlay of 75% from the non-epileptic EEGs.

TABLE I.

MGH 5-Fold Cross Validation Data Distribution.

Description Total Fold number
1 2 3 4 5
Epileptic EEG 93 19 19 18 19 18
Non-epileptic EEG 461 92 92 92 92 93
Annotated IEDs 18164 4077 3571 3207 4021 3288
IED time-events 14170 2920 2757 2831 2781 2881
Backgrounds (×106) 131 25.6 28.0 27.9 26.1 23.5
Challenging backgrounds (×103) 722 58.1 153 159 174 176

C. CNN based IED detector

We consider a CNN for IED detection since it has been proved to perform superior to traditional classifiers [3, 6, 7, 9,10]. The classifier is trained to detect whether a single-channel EEG segment is an IED or background. To handle the heavily imbalanced datasets, we follow a strategy that extracts majority class samples that are closer to the class decision boundary, and hence are challenging to classify. specifically, such samples correspond to background EEG segments that resemble IEDs, and training CNNs with such challenging examples leads to better classification performance. We train the CNN classifiers on the set of extracted IEDs and challenging backgrounds. We balanced the training batches to avert overfitting. We perform five-fold cross-validation to evaluate the CNNs. For each fold combination, the training and evaluation set contains four-folds of IED events and challenging backgrounds, while the testing performance was evaluated based on identifying IED time instants and backgrounds in other one-fold, i.e., we obtain 19 outputs (different EEG channels) for a single time-instant which we combine to produce a single output for this time-instant. We apply the maximum of the 19-channel outputs as the combining criterion to detect the IED time events. The hyperparameter settings evaluated are the number of convolutional layers, fully connected layers, number of convolution filters, hidden layer neurons, and number of batch iterations. Xavier technique is used to initialize the weights, and a rectified linear unit is used as an activation function. Depending on the input data, different CNN types are investigated: 1D CNN applied to EEG segments filtered in various frequency bands, late fusion of multiple 1D CNNs applied to different frequency bands, 1D CNN with multiple EEG sub-bands arranged as a vector, and two-dimensional (2D) CNN with multiple EEG sub-bands arranged as a matrix. Experimenting with various CNN architectures and input signals is crucial since the CNN designed for 1D input signals might not be optimal for 2D input signals.

1). ID CNN

For raw EEG signals, one-dimensional (1D) CNN is applied for IED detection. The input to the 1D CNN is of dimension (1×64). Similar to the 1D CNN IED detector designed for raw EEG signals, separate 1D CNN classifiers are designed for the delta, theta, alpha, and beta EEG sub- bands.

2). Late Fusion of multiple 1D CNNs

In this approach, a separate 1D CNN is trained for each sub-band. When a test signal is fed into each of the 1D CNN, it outputs values between 0 and 1. By means of weighted scoring, the outputs from different CNNs are combined as:

Output=i=1nwiCNNi, (1)
wi=1/eij=1n1/ej, (2)

where ei refers to the FP rate/min of sub-band i and wi corresponds to the weightage given to output for CNNi.

3). 1D CNN with multiple EEG sub-bands

In this method, instead of training multiple 1D CNNs and fusing their output in a later stage, a 1D CNN is trained from multiple frequency bands, by stacking the filtered signals one besides the other horizontally, thereby making the input a long vector. For example, if five sub-bands are selected as input features, then the input to the 1D CNN will have dimension of (1×320).

4). 2D CNN with multiple EEG sub-bands

Similar to 1D CNN with multiple features, this 2D CNN is trained with multiple frequency bands. However, the major difference is that instead of stacking different filtered signals horizontally, they are appended vertically leading to a two-dimensional matrix. For instance, if five sub-bands are applied as input features, then the input to the 2D CNN will have dimension of (5×64).

III. Results and Discussions

The waveform-level classification results for different input feature combinations, and CNN architecture are presented in Table II and Fig. 1. The performance of the IED detectors is evaluated based on mean precision and FP rate/min for fixed sensitivity value at 90%. Area-related measures such as the area under the curve (AUC) and area under the precision-recall curve (AUPRC) could be misleading due to the heavy class imbalance, as the IED to background ratio is around 1:1000 [3]. For 1D CNN, the results indicate that CNN trained on delta and beta frequency bands perform poorly. The CNN for the alpha band yielded reasonable results, followed by CNN for theta band, as these two bands carry the majority of information. However, the CNN trained on raw EEG signal surpassed the CNNs trained on EEG sub-bands separately and multiple 1D CNNs with late fusion. The 1D CNN and 2D CNN with multiple frequency bands (raw EEG, delta, theta, alpha, beta) achieve an FP rate/min of 0.23 and 0.27, respectively, at 90% sensitivity. This illustrates that using multiple EEG sub-bands aids in reducing false positives in IED detection. Fig. 2 shows the architecture of the 1D CNN with multiple sub-bands and sample output of IED and background segments across different layers. For the IED segment, the neurons at the flattened output layer have high activity in the raw EEG band followed by theta, alpha, and beta, respectively. several neurons are fired after the first fully connected layer, thereby successfully contributing to the detection of the IED segment. On the other hand, for the non-IED segment, all the neurons in the flattened layer have low activity, and correspondingly very few neurons fired after fully connected layer. However, a challenging background or an artifact that resembles an IED could easily generate high activity on neurons in the raw EEG band portion of the flattened layer. On the contrary, neurons in the delta band have high activity, whereas theta and alpha bands have minimal activity aiding in the detection of challenging background. S. Clarke et al. [8] reported an FP rate/min of 1 at 95% sensitivity. However, their CNN based system is designed exclusively for idiopathic generalized epilepsy and 21 channel configurations. Johansen et al. [7] have presented a similar study by feeding raw time-series signals into CNN. The system is reported to have attained an AUC of 0.947 on a small pool of 5 patients. The studies by [5] [10] adopt an alternate strategy based on fixed frequency subdividing and have achieved an AUC of 0.959 and 0.942, respectively. In [4], Jing et al. has achieved an AUC of 0.98 by applying a 2D CNN and in [9], Lourenço achieved an AUC of 0.96 with VGG CNN. Our system performs superior to these studies in terms of AUC. The different studies for IED detection reported in the literature considered various datasets and assessment metrics, thus making comparison challenging. In our previous studies, Thomas et al. achieved a mean AUC of 0.935 and a precision of 0.55 at 80% sensitivity by applying a 1D CNN with raw EEG [6]. Similarly, Thomas et al. achieved a mean FP rate/min of 0.92 at 90% sensitivity on an optimized CNN in [3]. While the present investigation is related to recent methodologies in terms of CNN architecture [3][6][7], it benefits from a new multi-feature space, which was not considered in previous studies. Our proposed system has achieved a mean AUC of 0.99 and a precision of 0.91 at a sensitivity threshold of 80%. Finally, the proposed 1D CNN with multiple sub-bands that is trained and validated on MGH fold 1, 2, 3, 4 is evaluated on the EEG level across multiple datasets. The fraction of CNN outputs that are greater than a threshold value of 0.5 is extracted as a feature from the EEG recordings of each subject. In Fig. 3, we show the box plot containing the extracted features for each dataset. A two-sample t-test was performed on every single dataset to check the feature’s ability to discriminate between EEGs with and without IEDs. The p-values for MGH (fold 5), NUH, NNI, and Fortis are 1.27e-5, 3.16e-4, 8.26e-3, and 4.69e-2 respectively. The corresponding p-values for features extracted from 1D CNN with raw EEG signals are 4.71e-4, 1.29e-4, 1.68e-1, and 2.16e-2. For the CNN with raw EEG, one of the p-values is above 0.05, which is not the case for the proposed method. The p-values show that the feature extracted from the CNN outputs with multiple sub-bands could effectively discriminate the EEGs, which might be helpful in clinical settings.

TABLE II.

The mean results of waveform-level classification for different CNN type and input features.

CNN type CNN Input Features AUC AUPRC For sensitivity = 90%
raw EEG delta theta alpha beta Precision FP rate/min
1D CNN raw EEG - - - - 0.988 0.881 0.72 0.36
1D CNN - delta - - - 0.579 0.031 0.00 376
1D CNN - - theta - - 0.685 0.312 0.02 338
1D CNN - - - alpha - 0.947 0.582 0.03 85
1D CNN - - - - beta 0.824 0.407 0.01 283
Multiple 1D CNNs with late fusion 0.846 × raw EEG 0.002 × delta 0.040 × theta 0.108 × alpha 0.003 × beta 0.981 0.898 0.71 0.36
1D CNN with multiple sub-bands raw EEG delta theta alpha beta 0.988 0.902 0.79 0.23
2D CNN with multiple sub-bands raw EEG delta theta alpha beta 0.996 0.910 0.77 0.27

Figure 1.

Figure 1.

Sensitivity-False Positive rate per minute curve for different CNNs and input features.

Figure 2.

Figure 2.

The proposed architecture of 1D CNN with multiple sub-bands (left), sample output of IED segment (middle) and background segment (right).

Figure 3.

Figure 3.

Box plot of feature extracted from different datasets. 1D CNN with raw EEG (top) and 1D CNN with multiple sub-bands (bottom).

IV. Conclusions

In this paper, we presented an automated IED detection framework using EEG frequency sub-bands and CNN. The proposed approach yielded an FP rate/min of 0.23 at 90% sensitivity. Further, the system is evaluated on NUH, NNI, and Fortis datasets, and the results show that the CNN output based feature could significantly discriminate (p-values < 0.05) the EEGs with and without IEDs. Automation of this process may help neurologists to speed up the diagnosis and treatments of epileptic patients. Moreover, we are presently analyzing different feature extraction techniques to augment the CNN with more features and build an EEG classification system based on datasets collected from multiple centers.

References

  • [1].Thijs RD, Surges R, O’Brien TJ and Sander JW, “Epilepsy in adults,” The Lancet, 2019. [DOI] [PubMed] [Google Scholar]
  • [2].Halford JJ, “Computerized epileptiform transient detection in the scalp electroencephalogram: Obstacles to progress and the example of computerized ECG interpretation,” Clinical Neurophysiology, vol. 120, pp. 1909–1915, 2009. [DOI] [PubMed] [Google Scholar]
  • [3].Thomas J, Jin J, Thangavel P, Bagheri E, Yuvaraj R, Dauwels J, Rathakrishnan R, Halford JJ, Cash SS and Westover B, “Automated Detection of Interictal Epileptiform Discharges from Scalp Electroencephalograms by Convolutional Neural Networks,” International Journal of Neural Systems, 2020. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [4].Jing J, Sun H, Kim JA, Herlopian A, Karakis I, Ng M, Halford JJ, Maus D, Chan F, Dolatshahi M and Muniz C, 2020. Development of expert-level automated detection of epileptiform discharges during electroencephalogram interpretation. JAMA neurology, 77(1), pp.103–108. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [5].Van Viet D, Long TQ, Trung NL, Thuan ND and others, “Deep Learning for Epileptic Spike Detection,” VNU Journal of Science: Computer Science and Communication Engineering, vol. 33, 2018. [Google Scholar]
  • [6].Thomas J, Comoretto L, Jin J, Dauwels J, Cash SS and Westover MB, “EEG CLassification Via Convolutional Neural Network-Based Interictal Epileptiform Event Detection,” in 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 2018. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [7].Johansen AR, Jin J, Maszczyk T, Dauwels J, Cash SS and Westover MB, “Epileptiform spike detection via convolutional neural networks,” in 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2016. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [8].Clarke S, Karoly P, Nurse E, Seneviratne U, Taylor J, Knight-Sadler R, Kerr R, Moore B, Hennessy P, Mendis D and others, “Computer-assisted EEG diagnostic review for idiopathic generalized epilepsy,” bioRxiv, p. 682112, 2019. [DOI] [PubMed] [Google Scholar]
  • [9].Lourenço C, Tjepkema-Cloostermans MC, Teixeira LF and Putten MJAM, “Deep Learning for Interictal Epileptiform Discharge Detection from Scalp EEG Recordings,” in Mediterranean Conference on Medical and Biological Engineering and Computing, 2019. [Google Scholar]
  • [10].Fukumori K, Nguyen HTT, Yoshida N and Tanaka T, “Fully Data-driven Convolutional Filters with Deep Learning Models for Epileptic Spike Detection,” in ICASSP 2019–2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019. [Google Scholar]

RESOURCES