Skip to content

iamsoroush/DeepEEG

Repository files navigation

DeepEEG

Deep feature learning using a specially designed CNN for processing raw EEG data in order to predict MDD patient's response to SSRI treatment.

In this project, we have proposed two new Convolution blocks which aim to reduce parameters of conventional Temporal Convolution blocks which makes it plausible to train deep CNN models to classify multi-variate time-series data constrained with limited amount of training data, which is the case in classifying resting state EEG signals. These blocks named as WFB (Windowed Filter-Bank) and DFB (Dilated Filter-Bank) are designed to force the model learn spatio-temporal features that capture the frequency components of various frequency bands. DFB mimics the wavelet transform but as a learnable spatio-temporal filter-bank, in the other side the WFB mimics the FFT in extracting various frequency components from a window, but it is a learnable transforma and the earned features are spatio-temporal rather than temporal. We show that the DFB blocks are superior in terms of improving accuracy, f1-score and decreasing the number of parameters.

Comparing the architecture design choices proves the superiority of wavelet-like Conv1D blocks (results on Repponder vs. Non-Responder task):

Model # Trainable Params F1-Score (std)
BaselineDeepEEG 70,668 0.25 (0.32)
DilatedDeepEEG (DFB) 8,804 0.66 (0.17)
LightDilatedDeepEEG (DFB) 4,408 0.63 (0.16)
WindowedDeepEEG (WFB) 41,228 0.63 (0.17)

Here's a simple schema which shows the overall model's architecture:

alt text

And here's an intuitive presentation of how DFB and WFB work:

alt text

How to use

To reproduce the results, do the following:

  1. Create a copy from prepare_data in your google drive.
  2. Run all cells within Copy of prepare_data.ipynb one-by-one.
  3. Create a copy from a cv_....ipynb file in your google drive.
  4. Run cells one-by-one, and you got the results!

Results

We have compared our model on Repponder vs. Non-Responder task with some other models that we have found which are end-to-end learnable:

Model # Trainable Params F1-Score (std)
E-ST-CNN 153,093 0.4 (0.09)
Conv2DModel 3,550,069 0.03 (0.11)
EEGNet 2,305 0.6 (0.2)
DeepEEG (ours)(DFB + TemporalAttention) 8,804 0.67 (0.15)

About

EEG classification using deep learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages