Link Search Menu Expand Document

SpectralSpatialCNN Usage

View source on GitHub

Table of contents

  1. SpectralSpatialCNN Usage
    1. About SpectralSpatialCNN
    2. Preparation for SpectralSpatialCNN’s input
      1. Downloading a particular dataset
      2. Preprocessing based on Spectral Spatial mapping over the considered dataset
      3. Build, fit, and evaluate SpectralSpatialCNN

About SpectralSpatialCNN

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

@ARTICLE{8897723,
  author={Kwon, O-Yeon and Lee, Min-Ho and Guan, Cuntai and Lee, Seong-Whan},
  journal={IEEE Transactions on Neural Networks and Learning Systems}, 
  title={Subject-Independent Brain–Computer Interfaces Based on Deep Convolutional Neural Networks}, 
  year={2020},
  volume={31},
  number={10},
  pages={3839-3852},
  doi={10.1109/TNNLS.2019.2946869}}

Preparation for SpectralSpatialCNN’s input

An example of SpectralSpatialCNN’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 Spectral Spatial mapping over the considered dataset

View source on GitHub

python prep_spectral_spatial.py --dataset 'BCIC2a'

Build, fit, and evaluate SpectralSpatialCNN

View source on GitHub

# Subject-dependent MI classification
python run_SpectralSpatialCNN.py --model_name 'SpectralSpatialCNN' --dataset 'BCIC2a' --train_type 'subject_dependent' --data_type 'spectral_spatial' --num_class 2  --num_chs 20 --GPU 0

# Subject-independent MI classification
python run_SpectralSpatialCNN.py --model_name 'SpectralSpatialCNN' --dataset 'BCIC2a' --train_type 'subject_independent' --data_type 'spectral_spatial' --num_class 2  --num_chs 20 --GPU 0

Arguments:

ArgumentsDescriptionDefault 
model_namestr prefix to save model‘SpectralSpatialCNN’ 
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‘spectral_spatial’ 
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-