Link Search Menu Expand Document

EEGNet Usage

View source on GitHub

Table of contents

  1. EEGNet Usage
    1. About EEGNet
    2. Preparation for EEGNet’s input
      1. Downloading a particular dataset
      2. Preprocessing based on time domain EEG over the considered dataset
      3. Build, fit, and evaluate EEGNet

About EEGNet

Original authors have uploaded their code here https://github.com/vlawhern/arl-eegmodels

If you use the EEGNet model in your research, please cite the following paper:

@article{Lawhern2018,
  author={Vernon J Lawhern and Amelia J Solon and Nicholas R Waytowich and Stephen M Gordon and Chou P Hung and Brent J Lance},
  title={EEGNet: a compact convolutional neural network for EEG-based brain–computer interfaces},
  journal={Journal of Neural Engineering},
  volume={15},
  number={5},
  pages={056013},
  url={http://stacks.iop.org/1741-2552/15/i=5/a=056013},
  year={2018}
}

Preparation for EEGNet’s input

An example of EEGNet’s input on the BCIC IV 2a dataset (All settings are set up as optimal settings in the original paper).

Downloading a particular dataset

View source on GitHub

python download_datasets.py --dataset 'BCIC2a'

Preprocessing based on time domain EEG over the considered dataset

View source on GitHub

python prep_time_domain.py --dataset 'BCIC2a'

Build, fit, and evaluate EEGNet

View source on GitHub

# Subject-dependent MI classification
python run_EEGNet.py --model_name 'EEGNet' --dataset 'BCIC2a' --train_type 'subject_dependent' --data_type 'time_domain' --num_class 2  --num_chs 20 --GPU 0

# Subject-independent MI classification
python run_EEGNet.py --model_name 'EEGNet' --dataset 'BCIC2a' --train_type 'subject_independent' --data_type 'time_domain' --num_class 2  --num_chs 20 --GPU 0

Arguments:

ArgumentsDescriptionDefault 
model_namestr prefix to save model‘EEGNet’ 
datasetstr prefix to pick up a particular dataset and save model‘BCIC2a’ 
train_typestr prefix to pick up a particular traning manner and save model‘subject_dependent’ 
data_typestr prefix to select data type of input‘time_domain’ 
num_classint number of classes2 
num_chsint number of classes20 
log_dirstr path to save model‘logs’ 
subjectsint or list of int or None list of range test subject, if None, use all subjectsNone 
GPUstr select GPU ID0-