# 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](https://arxiv.org/abs/2008.08633)
This repository contains the source code of our paper, using following datasets:
- Emotion Recoginition:
- [SEED](https://bcmi.sjtu.edu.cn/~seed/seed.html): 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](https://bcmi.sjtu.edu.cn/~seed/seed-vig.html): 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](https://www.bbci.de/competition/iv/#dataset1): 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](https://www.bbci.de/competition/iv/#dataset1): 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, then [load data](./code/load_data.py), proprocessing data through [filter bank](./code/library/signal_filtering.py), and perfom [feature extraction](./code/library/feature_extraction.py).
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](./code/utils.py).
4 - Perform hyper-parameters search for each individual stream.
(1) For spatial information stream, run `python3 ./main_spatial_val.py --dataset datasetname` to search 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 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 SEED dataset using two bidirectional LSTM layers.
Validation results will be automatically saved in the adddress in functions 'save_spatial_val_result' and 'save_temporal_val_result' from [utils](./code/utils.py). The paramaters are saved and updated in [dataset_params](./code/dataset_params.yaml).
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 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}
}
```
<img src="/doc/architecture.jpg" width="1100" height="350">
## Contact
Should you have any questions, please feel free to contact me at [guangyi.zhang@queensu.ca](mailto:guangyi.zhang@queensu.ca).
<!-- <img src="/doc/architecture.pdf" width="400" height="200">
-->
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
上交的seed数据集,研究较少,下面是收集的一些工程文件,可以学习一下。前面是算法,后面是准确率。 1.4D-CNN,94% 2、新算法,93% 3.rgnn,67% 4.CNN+SVM,73% 5.DANN(数据,代码) 6.EEG_Classification_-master 7.rgnn,67.7%8.CNN-SVM,73%
资源推荐
资源详情
资源评论
收起资源包目录
seed数据集相关代码整理 (200个子文件)
events.out.tfevents.1604399967.lab-2542.18576.0 33.97MB
events.out.tfevents.1604399967.lab-2542.18576.0 33.97MB
example_training_matrix.csv 55.99MB
example_training_matrix.csv 55.99MB
chloe-concentrating-1.csv 758KB
chloe-concentrating-1.csv 758KB
jordan-concentrating-2.csv 749KB
jordan-concentrating-2.csv 749KB
jordan-concentrating-1.csv 748KB
jordan-concentrating-1.csv 748KB
jordan-neutral-1.csv 746KB
jordan-neutral-1.csv 746KB
juozas-neutral-1.csv 746KB
juozas-neutral-1.csv 746KB
chloe-relaxed-2.csv 745KB
chloe-relaxed-2.csv 745KB
juozas-neutral-2.csv 745KB
juozas-neutral-2.csv 745KB
jodie-neutral-2.csv 744KB
jodie-neutral-2.csv 744KB
jodie-neutral-1.csv 741KB
jodie-neutral-1.csv 741KB
jodie-relaxed-1.csv 740KB
jodie-relaxed-1.csv 740KB
chloe-neutral-2.csv 740KB
chloe-neutral-2.csv 740KB
chloe-neutral-1.csv 739KB
chloe-neutral-1.csv 739KB
Juozas-relaxed-2.csv 738KB
Juozas-relaxed-2.csv 738KB
jordan-relaxed-2.csv 736KB
jordan-relaxed-2.csv 736KB
chloe-relaxed-1.csv 736KB
chloe-relaxed-1.csv 736KB
Juozas-relaxed-1.csv 736KB
Juozas-relaxed-1.csv 736KB
jordan-relaxed-1.csv 734KB
jordan-relaxed-1.csv 734KB
chloe-concentrating-2.csv 669KB
chloe-concentrating-2.csv 669KB
jodie-concentrating-2.csv 570KB
jodie-concentrating-2.csv 570KB
jodie-concentrating-1.csv 569KB
jodie-concentrating-1.csv 569KB
Juozas-concentrating-1.csv 567KB
Juozas-concentrating-1.csv 567KB
jodie-relaxed-2.csv 513KB
jodie-relaxed-2.csv 513KB
jordan-neutral-2.csv 114KB
jordan-neutral-2.csv 114KB
juozas-concentrating-2.csv 44KB
juozas-concentrating-2.csv 44KB
CNN 结果记录.docx 96KB
CNN 结果记录.docx 96KB
.DS_Store 6KB
.gitignore 696B
.gitignore 696B
.gitignore 20B
SEED-Emotion-Recognition.iml 611B
SEED-Emotion-Recognition.iml 611B
experiments.ipynb 86KB
experiments.ipynb 86KB
rgnn.ipynb 21KB
rgnn.ipynb 21KB
DANN_LSTM-checkpoint.ipynb 20KB
preprocess.ipynb 17KB
preprocess.ipynb 17KB
DANN_LSTM.ipynb 3KB
architecture.jpg 879KB
architecture.jpg 879KB
manifold.jpg 284KB
LICENSE 1KB
LSTM_pytorch 7KB
LSTMModel 872B
feature_extract.m 584B
signal_divide.m 373B
Untitled.m 228B
df_label.mat 28KB
df_label.mat 28KB
label.mat 188B
LSTM_DANN.md 9KB
README.md 703B
README.md 107B
README.md 51B
README.md 51B
README.md 4KB
2008.08633.pdf 3.29MB
EEG-based emotion recognition using 4D convolutional recurrent.pdf 2.19MB
Example_Random_Forest_Classifier.pkl 2.59MB
Example_Random_Forest_Classifier.pkl 2.59MB
EEG_feature_extraction.py 51KB
EEG_feature_extraction.py 51KB
EMD.py 32KB
EMD_matlab.py 22KB
main.py 16KB
main.py 16KB
train.py 16KB
train_reverse.py 15KB
EMD2d.py 14KB
all_train.py 13KB
共 200 条
- 1
- 2
大大U
- 粉丝: 706
- 资源: 135
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页