Giter VIP home page Giter VIP logo

eeg_riemannian's Introduction

Spatio-Temporal EEG Representation Learning on Riemannian Manifold and Euclidean Space (TF v1.14.0)

Spatio-Temporal EEG Representation Learning on Riemannian Manifold and Euclidean Space

Install

pip install eeg-riemannian==1.10.0

This repository contains the source code of our paper, using following datasets:

  • Emotion Recoginition:

    • SEED: 15 subjects participated experiments with videos as emotion stimuli (positive/negative/neutral) and EEG was recorded with 62 channels at sampling rate of 1000Hz.

    • SEED-VIG: Vigilance estimation using EEG data in a simulated driving task. 23 subjects participated experiments and 17 EEG channels were recorded at sampling rate of 1000Hz.

  • Motor Imagery:

    • BCI-IV 2a: 9 subjects were involved in motor-imagery experiment (left hand, right hand, feet and tongue). 22 EEG recordings were collected at sampling rate of 250Hz.

    • BCI-IV 2b: 9 subjects were involved in motor-imagery experiment (left hand and right hand). 3 EEG channels were recorded at sampling rate of 250Hz.

Prerequisites

Please follow the steps below in order to be able to train our models:

1 - Install Requirements

pip3 install -r ./requirements.txt

2 - Download dataset, load data, preprocess data through filter bank, then perform feature extraction.

3 - Save the preprocessed data and EEG into separate folders (e.g., '/train/EEG/' and '/train/Extracted Features'). Move data and corresponding labels to the address shown in functions 'load_dataset_signal_addr' and 'load_dataset_feature_addr' from utils.

4 - Perform a hyper-parameters search for each information stream.

(1) For spatial information stream, run python3 ./main_spatial_val.py --dataset datasetname to search for the rank of EEG covariance matrices. For example, run the following command

python3 ./main_spatial_val.py --dataset BCI_IV_2a --cpu-seed 0 --gpu-seed 12345 --lr 0.001 --batch-size 32 --epochs 200 --early-stopping 20 --riemannian_dist

for the BCI_IV_2a dataset using Riemannian projection.

(2) For temporal information stream, run python3 ./main_temporal_val.py --dataset datasetname to obtain the result for different LSTM settings. For example, run the following command

python3 ./main_temporal_val.py --dataset SEED --cpu-seed 0 --gpu-seed 12345 --lr 0.001 --batch-size 8 --epochs 200 --early-stopping 20 -- BiLSTM --layer-num 2

for the SEED dataset using two bidirectional LSTM layers.

Validation results will be automatically saved in the address in functions 'save_spatial_val_result' and 'save_temporal_val_result' from utils. The parameters are saved and updated in dataset_params.

5 - Run the experiments for test data. For example, run the following command

python3 ./main.py --dataset BCI_IV_2b --cpu-seed 0 --gpu-seed 12345 --lr 0.001 --batch-size 32 --epochs 200 --early-stopping 100 --riemannian_dist 

for the BCI-IV 2b dataset.

Document Description

  • \code\library: Riemannian embedding estimation, feature preprocessing and extraction files

  • \code\model: Models for spatial, temporal and spatio-temporal streams of our architecture.

If you find this material useful, please cite the following article:

Citation

@article{zhang2020rfnet, 
  title={Spatio-Temporal EEG Representation Learning on Riemannian Manifold and Euclidean Space},
  author={Zhang, Guangyi and Etemad, Ali},
  journal={arXiv preprint arXiv:2008.08633},
  year={2020}
}

Contact

Should you have any questions, please feel free to contact me at [email protected].

eeg_riemannian's People

Contributors

guangyizhangbci avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.