The SWEC-ETHZ iEEG Database and Algorithms

Overview

Motivated by Open Science, this page contains FREE datasets, source codes, and papers based on human intracranial electroencephalography (iEEG) recorded and analysed during pre-surgical evaluations of patients with pharmacoresistant epilepsies at the Sleep-Wake-Epilepsy-Center (SWEC) of the University Department of Neurology at the Inselspital Bern and the Integrated Systems Laboratory of the ETH Zurich. The source codes, datasets, and results on these sites are free of charge only for research and education purposes. Please read this page carefully before using any of the resources. We suggest to refer to the resources as the SWEC-ETHZ iEEG Database and Algorithms, and to cite the related paper in the following sections. If you have any questions or face any issues, please contact us at ieeg@iis.ee.ethz.ch.
alt text


Long-term Dataset and Algorithms

Dataset

In this study we included 116 seizures in 2656 hours of anonymized and continuous intracranial electroencephalography (iEEG) of 18 patients with pharmaco-resistant epilepsies who were evaluated for epilepsy surgery at the Sleep-Wake-Epilepsy-Center (SWEC) of the University Department of Neurology at the Inselspital Bern. All the patients gave written informed consent that their iEEG data might be used for research and teaching purposes. The decision on the necessity for iEEG recordings, the electrode implantation scheme, and the decision about surgical therapy was made entirely on clinical grounds. These decisions were taken prior to and completely independently from the compilation of this dataset.

iEEG Acquisition

The iEEG signals were recorded intracranially by strip, grid, and depth electrodes. After 16-bit analog-to-digital conversion, the iEEG signals were median-referenced and digitally band-pass filtered between 0.5 and 120 Hz using a fourth-order Butterworth filter prior to analysis and written onto disk at a rate of 512 or 1024 Hz. Forward and backward filtering was applied to minimize phase distortions. All the iEEG recordings were visually inspected by an EEG board-certified and experienced epileptologist (K.S.) for identification of seizure onsets and endings and exclusion of channels continuously corrupted by artifacts.

Data Format

The dataset is provided in 18 folders, named with the ID of the 18 patients (e.g., ID1). The continuous recoding of each patient is segmented to a set of .mat files, each of which contains exactly one hour of recording (e.g., ID01_1h.mat, ID01_2h.mat,…,ID01_294h.mat). Every file is less than 1 GB. In each .mat file, the recording is stored in a variable called EEG as a TxM array where T is the number of iEEG electrodes and M is the number of sampling points for one hour. The folder also contains an additional file (e.g., ID01_info.mat) defining the sampling frequency, beginning and end of the seizures (beginning and end of the seizures are computed in seconds).

Algorithm

The main idea of our algorithm is to combine local binary patterns (LBP) with hyperdimensional (HD) computing followed by a patient-specific postprocessing. We called it Laelaps.

Main features of our algorithm:

We provide the Python implementation of our algorithm. We used the Pytorch library with Python 2.7.12 to parallelize the code on a single Nvidia GeForce GTX 1080. For the baseline SVM, CNN, and LSTM algorithms we used the Scikilt-learn and Keras libraries.

Running a test : We run a sequence of scripts to obtain the results reported in our DATE 2019 paper.
Using Laelaps:

  1. iEEG_HD_analysis_prediction.py file trains the HD classifier and performs the test on the non-trained part of the recording. You should set the GPU index (0 if the workstation has only one) and the patient ID in this file. Execution of this .py file generates a result file Total_period_randomiM in which different metrics are saved for all the duration of the recording. The intermediate result is also saved in the Laelaps folder (e.g., Laelaps/intermediate_results/Pat01/Total_period_randomiM)

  2. smoothing.py file applies an average pooling to the results with kernel size=10x1 and stride=1. The intermediate result is saved in the Laelaps folder (e.g., Laelaps/intermediate_results/Pat01/Pred_rel_mean)

  3. postprocess.py file applies the tc and the tr thresholds described in the paper to obtain the final classification. This script reports on the terminal the mean latency, the total number of errors and the sensitivity for the target patient.

Using baselines (LBP+SVM, STFT+CNN, LSTM):

  1. SeizureDetectionSVM.py file trains the classifier and performs the test on all the seizures and on 20 hours randomly chosen from recording of all the patient. Execution of this .py file generates a result file where the predictions are saved.

  2. PostprocessingSVM.py file applies an average pooling to the results with kernel size=10x1 and stride=1 and the tc thresholds described in the paper to obtain the final classification. This script plots the final classification for each window of the ictal/interictal segments.

Links

Source Codes

Dataset

For easy downloading, we provide a list of the URLs to all files here. You can then download all of them using:

Related Paper

A. Burrello, L. Cavigelli, K. Schindler, L. Benini, A. Rahimi, ‘‘Laelaps: An Energy-Efficient Seizure Detection Algorithm from Long-term Human iEEG Recordings without False Alarms’’ in proceedings of the ACM/IEEE Design, Automation, and Test in Europe Conference (DATE), Florence, Italy, March 25-29, 2019. Received Best Paper Nomination. [OpenAccess]


Short-term Dataset and Algorithms

Dataset

In this study, we included a total of 100 anonymized intracranially recorded electroencephalographic (iEEG) datasets of 16 patients with pharmaco-resistant epilepsy who were evaluated for epilepsy surgery at the Sleep-Wake-Epilepsy-Center (SWEC) of the University Department of Neurology at the Inselspital Bern. All the patients gave written informed consent that their iEEG data might be used for research purposes. The decision on the necessity for iEEG recordings, the electrode implantation scheme, and the decision about surgical therapy was made entirely on clinical grounds. These decisions were taken prior to and independently from the compilation of this dataset.

iEEG Acquisition

The iEEG signals were recorded intracranially by strip, grid, and depth electrodes. After 16-bit analog-to-digital conversion, the data were digitally band-pass filtered between 0.5 and 150 Hz using a fourth-order Butterworth filter prior to analysis and written onto disk at a rate of 512 Hz. Forward and backward filtering was applied to minimize phase distortions. All the iEEG recordings were visually inspected by an EEG board-certified experienced epileptologist (K.S.) for identification of seizure onsets and endings and exclusion of channels continuously corrupted by artifacts. Each recording consists of 3 minutes of preictal segments (i.e., immediately before the seizure onset), the ictal segment (ranging from 10 s to 1002 s), and 3 minutes of postictal time (i.e., immediately after seizure ending).

Data Format

The dataset is provided in 19 zipped folders (each file is less than 1 GB), named with the ID of the 16 patients (e.g., ID1.zip). Each unzipped folder contains a number of .mat files as recorded seizures (e.g., Sz1.mat, Sz2.mat, …) for the target patient. In each .mat file, the recording is stored in a variable called EEG as a TxM array where T is the number of sampling points and M is the number of iEEG electrodes. Seizure always starts at 3 minutes from the beginning of recording (i.e., the sampling point of 512*3*60=92160), and ends 3 minutes before the end of recording (i.e., sampling point of T-92160).

Algorithm

The main idea of our algorithm is to combine local binary patterns (LBP) with hyperdimensional (HD) computing. We called it LBP+HD.

Main features of our algorithm:

We provided the Python implementation of our algorithm. We used Pytorch library with Python 2.7.12 to parallelize the code on a single Nvidia GeForce GTX 1080. For the baseline SVM and MLP algorithms we used the Scikilt-learn library.

Running a test : We run a sequence of two scripts to obtain the results reported in our BioCAS 2018 paper. Using LBP+HD algorithm as an example:

  1. iEEGClassifierLBP+HD.py file trains the HD classifier and performs the test on the non-trained recordings. You should set the GPU index (0 if the workstation has only one) and the patient ID in this file. Execution of this .py file generates different files for each combination of train-test seizure. For example, for a patient with 2 seizures, it produces 4 files as Train1Test1, Train1Test2, Train2Test1, Train2Test2.

  2. HD_Postprocessing.py file applies the threshold to obtain the final classification. The value of the threshold and the patient ID should be set. The patient ID has to be equal for both scripts. This script reports on the terminal the mean latency, the specificity and the sensitivity for the target patient.

Links

Source Codes

Dataset

Related Paper

Alessio Burrello, Kaspar Schindler, Luca Benini, Abbas Rahimi, “One-shot Learning for iEEG Seizure Detection Using End-to-end Binary Operations: Local Binary Patterns with Hyperdimensional Computing,” in proceedings of the IEEE Biomedical Circuits and Systems Conference (BioCAS), Cleveland, OH, October 17-19, 2018. Received Best Paper Award. [OpenAccess]


Legal Agreement

The source codes, datasets, and results on these sites are free of charge for research and education purposes only. Any commercial or military use is prohibited. All resources are provided without any expressed or implied warranty. In no event the authors of the article or any of their host institutions are liable for any damages arising from the use of the software, data or results.