Data and Code Sharing

Philosophy

The Bioelectronics Neurophysiology and Engineering Lab is committed to the practice of sharing data and code to create reproducible research in accordance with the Code is Science Manifesto.

Projects

Sleep-related Projects

Sleep Staging

Automated Unsupervised Classifier to use iEEG data and score it into AWAKE, N2, N3 sleep stages

A full description of how to use the classifier is in the help section of the Matlab m-file. Also available — features extracted from two patients' data in day-night recordings. These matrixes can be used as an input and to provide an example of how to use the classifier.

Objective

Automated behavioral state classification in intracranial EEG (iEEG) recordings may be beneficial for iEEG interpretation and quantifying sleep patterns to enable behavioral state dependent neuromodulation therapy in next-generation implantable brain stimulation devices. Here, we introduce a fully automated unsupervised framework to differentiate between awake (AW), sleep (N2) and slow wave sleep (N3), using iEEG only and validated with expert-scored polysomnography.

Approach

Data from eight patients undergoing evaluation for epilepsy surgery — age 40+/-11, including three female — with intracranial depth electrodes for iEEG monitoring were included. Spectral power features at 0.1-235 Hz, spanning several frequency bands from a single electrode were used to classify behavioral states of patients into AW, N2 and N3.

Results

Overall, classification accuracy of 94%, with 94% sensitivity and 93% specificity across eight subjects using multiple spectral power features from a single electrode was achieved. Classification performance of N3 sleep was significantly better at 95% with sensitivity 95% and specificity 93%, than that of the N2 sleep phase at 87% with sensitivity 78% and specificity 96%.

Significance

Automated, unsupervised and robust classification of behavioral states based on iEEG data is possible, and it is feasible to incorporate these algorithms into future implantable devices with limited computational power, memory and number of electrodes for brain monitoring and stimulation.

Continuous behavioral state tracking in ambulatory humans

Objective

Electrical deep brain stimulation (DBS) is an established treatment for patients with drug-resistant epilepsy. Sleep disorders are common in people with epilepsy, and DBS may actually further disturb regular sleep patterns and sleep quality. Novel implantable devices capable of DBS and streaming of continuous intracranial electroencephalography (iEEG) signals enable detailed assessments of therapy efficacy and tracking of sleep-related comorbidities. Here, we investigate the feasibility of automated sleep classification using continuous iEEG data recorded from Papez circuit in four patients with drug-resistant mesial temporal lobe epilepsy using an investigational implantable sensing and stimulation device with electrodes implanted in bilateral hippocampus (HPC) and anterior nucleus of thalamus (ANT).

Approach

The iEEG recorded from HPC is used to classify sleep during concurrent DBS targeting ANT. Simultaneous polysomnography (PSG) and sensing from HPC were used to train, validate and test an automated classifier for a range of ANT DBS frequencies: no stimulation, 2 Hz, 7 Hz, and high frequency (>100 Hz).

Results

We show that it is possible to build a patient-specific automated sleep staging classifier using power in band features extracted from one HPC iEEG sensing channel. The patient-specific classifiers performed well under all thalamic DBS frequencies with an average F1-score of 0.894, and provided viable classification into awake and major sleep categories, rapid eye movement (REM) and non-REM. We retrospectively analyzed classification performance with gold-standard PSG annotations, and then prospectively deployed the classifier on chronic continuous iEEG data spanning multiple months to characterize sleep patterns in ambulatory patients living in their home environments.

Significance

The ability to continuously track behavioral state and fully characterize sleep should prove useful for optimizing DBS for epilepsy and associated sleep, cognitive and mood comorbidities.

References

Open-source software

The open-source software produced by the Bioelectronics Neurophysiology and Engineering Lab (BNEL) can be found at the lab's GitHub page.

Artificial Intelligence

High-frequency oscillations

High-frequency oscillations (HFOs) are brief discrete events seen in EEG that are promising biomarkers of both epileptic neural tissue and cognitive processing.

References

Multiscale Electrophysiology Format

The Multiscale Electrophysiology Format (MEF) version 3.0 is an open-source file format for storing electrophysiology and other time-series data employing data compression and encryption.

SOURCE CODE LIBRARIES

Functions that handle MEF header operations, data compression and decompression, encryption, calculation of the CRC checksum, and byte order adjustments. Included in this distribution is sample code for decimating, filtering, converting European Data Format (EDF) format to MEF 3.0 and sample code to read MEF 3.0 files.

EXAMPLE DATA

This distribution contains four EEG time-series data channels in MEF 3.0 format. The files are anonymized and encrypted with technical (level 1) and subject (level 2) encryption. The level 1 password is password1, and the level 2 password is password2. The dataset is a two-hour segment of 256 Hz samples.

Seizure forecasting

Accurate seizure forecasting could transform epilepsy care, allowing patients to modify activities to avoid risk, or take additional AED to stop seizures before they develop. Our laboratory is engaged in efforts to develop and validate robust algorithms for seizure forecasting.

KAGGLE SEIZURE PREDICTION COMPETITION

Seizure detection and forecasting competitions were run on Kaggle.com using open access chronic ambulatory intracranial EEG (iEEG) from five canines with naturally occurring epilepsy and two humans undergoing prolonged wide-bandwidth iEEG monitoring. The competitions were sponsored by the National Institutes of Health, the American Epilepsy Society and the Epilepsy Foundation.

The seizure detection contest ran from May to August 2014. Ambulatory iEEG data clips one second in duration were provided from seizures and from interictal, seizure-free epochs. Data clips were extracted from chronic ambulatory recordings from four canines with naturally occurring epilepsy, and eight patients undergoing intracranial monitoring as part of their pre-surgical evaluation for epilepsy. Contestants provided two classifications for the clips: seizure vs. interictal, and early seizure vs. interictal or late seizure. Submissions were ranked based on the area under the receiver operating characteristic (ROC) curve.

The seizure forecasting contest ran from August to November 2014. Data was provided to participants as 10-minute interictal and preictal clips, with approximately half of the 60Gb data bundle labeled (interictal/preictal) for algorithm training and half unlabeled for evaluation. In total 654 participants submitted 17,856 classifications of the unlabeled test data. The contestants developed custom algorithms and uploaded their classifications (interictal/preictal) for the unknown testing data, and a randomly selected 40% of data segments were scored and results broadcasted on a public leaderboard. After the competition ended, the top-placing contestants were invited to run their algorithms on unlabeled held-out data from four of the canines, in order to assess the robustness and broader applicability of these algorithms.