knitr::read_chunk("chunks.R")



Introduction

The EEG signal exhibit abrupt changes in their statistical distribution and functional behavior. The procedure for estimating complexity coefficients was developed, in part, as a model free way of detecting changes in the underlying generating mechanism. We assume that such regime changes are reflected in changes in the complexity coefficients. With that in mind, we used change points in the complexity coefficients to segment the EEG signal. The goal was to compute features on more homogeneous segments rather than on arbitrary partitions.

EEG from several optogenetically modified epileptic mice were used to predict a seizure response to a laser stimulus. A single set of features including relative bandpower and several nonlinear features were used to predict the response. Several models were built using features calcuated on both uniform segmentation of the raw EEG and on segmetation based on change points in the complexity coefficients. Models using the complexity based partitions performed no better than the uniform partition schemes.

The EEG came from 4 intercranial EEG channels and 2 local field potential(LFP) sensors. The LFP data capture the electrical potential of a small group of neurons located in the thalamus. All models were based on single channel EEG channels. We compare the features predictive of a seizure outcome for each channel and the feature distribution associated with seizure and non-seizure responses. Gamma and beta levels in the LFP channels were the strongest predictor of a seizure responses.

There are several inherent flaws in the data that are discussed in more detail below. All seizures come from a single mouse and seizure responses were recorded in most cases following a previous seizure.

Classification models

The plot below illustrates a partition of spectral features based on change points in the complexity coefficient $B$. In total, 6 segmentation models were used: segmentation based on complexity coefficients $A$ and $B$ -- individually and combined -- and three models using uniform partitions.

 devtools::load_all()
  knitr::read_chunk("../code/eeg-segment-plot.R")
  <<eeg-segment-create>>

  <<eeg-segment-plot>>

There were 26 trials with 9 seizure responses. The underlying classifier is a random forest. The classification performance reported in the table below is the mean balanced accuracy based on 30 iterations of 5-fold cross-validation.

The mean balanced accuracy for each model and channel is reported below. All models performed better on channels 1 and 2: these are local field potential(LFP) channels which record the activity of a small set of neurons in the thalamus. The regular partition models of 8 and 15 partitions performed better across most channels.

  knitr::read_chunk("../code/eeg-tables.R")
  <<eeg-tables>>

Data

The EEG data was collected from mice with a genetic mutation that makes them prone to epilepsy. The mice are also genetically modified to allow for direct stimulation of neurons by a laser pulse.

Data was gathered from 13 distinct time periods during which a laser stimulus was applied between one to four times. There were 26 trials in total. The 4-minute segments preceding the stimulus was used to predict outcomes.

  devtools::load_all()
  knitr::read_chunk("../code/eeg-plot.R")
  <<eeg-plot>>

While we were able to prediction seizures on with a relatively high degree of accuracy -- over 80% for some channels, there are significant limitations to the data. First and foremost, all seizures came from an individual mouse. We can only make limited inferences about features related to seizure responses without additional data. Variations in the features could be specific to the biology or measurement devices particular to that mouse.

Seizures also occured mainly in the same series of trials. A plot below shows a shematic diagram of the trials. Each bar represents a single trial. Filled boxes indicate a trial period and green bars indicate an application of the stimulus. Most seizures occured in a trial following a previous seizure: these are indicated by blue boxes.

Again, features associated with seizures may simply be features that occur following a seizure, not preceeding it.

  knitr::read_chunk("../code/eeg-trial-plot.R")
  <<trialplot>>

The plot below shows the probability of seizure as estimated by a single model for each trial. Pink and blue indicate seizure responses. For most trials the model separates seizure and non-seizure trials fairly well. However, the initial seizure responses are much closer to the threshold than the later seizure trials.

  knitr::read_chunk("../code/eeg-cv-ch1-plot.R")
  <<cv-ch1-plot>>

Feature importance

Despite variations in classification performance, variable importance was similar across models. The variable importance for two models plotted in the figure below. Both models were build on data from channel 1. On the left is the model segmented on the combined complexity coefficients A and B. On the right is a model with 8 uniform partitions.

  knitr::read_chunk("../code/eeg-classify-roc-import.R")
  <<eeg-importance-plot>>

Although the underlying random forest classifier can be highly non-linear the pattern of variable importance is reflected in the differences of distributions of the raw features. The boxplots below show clear differences in the distributions of the relative gamma and theta for channel 1.

  knitr::read_chunk("../code/eeg-boxplot-ch1.R")
  <<eeg-boxplotpanel-ch1>>

Channel 1 represents an LFP or local field potential signal, captured from a smaller cluster of neurons in the thalamus. Channel 3 is an iEEG or external EEG sensor placed on the brain surface. For channel 3 the direction of the difference for relative gamma and theta are reversed. Where differences in the beta distribution for seizure an non-seizure trials are not significant for channel 1, for channel three the differences are clear. The difference in distributions is also reflected in the variable importance in the previous plot, as are differences in Hurst and spectral entropy features.

  <<eeg-boxplotpanel-ch3>>

Session information




nateaff/eeg-complex documentation built on May 14, 2019, 2:55 p.m.