Deep Learning pipeline for motor-imagery classification.

Overview

BCI-ToolBox

1. Introduction

BCI-ToolBox is deep learning pipeline for motor-imagery classification.
This repo contains five models: ShallowConvNet, DeepConvNet, EEGNet, FBCNet, BCI2021.
(BCI2021 is not an official name.)

2. Installation

Environment

  • Python == 3.7.10
  • PyTorch == 1.9.0
  • mne == 0.23.0
  • braindecode == 0.5.1
  • CUDA == 11.0

Create conda environment

conda install pytorch=1.9.0 cudatoolkit=11.1 -c pytorch -c nvidia
conda install numpy pandas matplotlib pyyaml ipywidgets
pip install torchinfo braindecode moabb mne

3. Directory structure

.
├── README.md
├── base
│   ├── constructor.py
│   └── layers.py
├── configs
│   ├── BCI2021
│   │   └── default.yaml
│   ├── DeepConvNet
│   │   └── default.yaml
│   ├── EEGNet
│   │   └── default.yaml
│   ├── FBCNet
│   │   └── default.yaml
│   ├── ShallowConvNet
│   │   └── default.yaml
│   └── demo
│       ├── arch.yaml
│       ├── bci2021.yaml
│       ├── test.yaml
│       ├── train.yaml
│       └── training_params.yaml
├── data_loader
│   ├── data_generator.py
│   ├── datasets
│   │   ├── __init__.py
│   │   ├── bnci2014.py
│   │   ├── cho2017.py
│   │   ├── folder_dataset.py
│   │   ├── openbmi.py
│   │   └── tmp_dataset.py
│   └── transforms.py
├── main.py
├── models
│   ├── BCI2021
│   │   ├── BCI2021.py
│   │   └── __init__.py
│   ├── DeepConvNet
│   │   ├── DeepConvNet.py
│   │   └── __init__.py
│   ├── EEGNet
│   │   ├── EEGNet.py
│   │   └── __init__.py
│   ├── FBCNet
│   │   ├── FBCNet.py
│   │   └── __init__.py
│   ├── ShallowConvNet
│   │   ├── ShallowConvNet.py
│   │   └── __init__.py
│   ├── __init__.py
│   └── model_builder.py
├── trainers
│   ├── __init__.py
│   ├── cls_trainer.py
│   └── trainer_maker.py
└── utils
    ├── calculator.py
    ├── painter.py
    └── utils.py

4. Dataset

5. Get Started

Create wandb_key.yaml file

  • Create wandb_key.yaml file in configs directory.
    # wandb_key.yaml
    key: WANDB API keys
  • WANDB API keys can be obtained from your W&B account settings.

train

Use W&B

python main.py --config_file=configs/demo/train.yaml

Not use W&B

python main.py --config_file=configs/demo/train.yaml --no_wandb

USE GPU

python main.py --config_file=configs/demo/train.yaml --device=0  # Use GPU 0
python main.py --config_file=configs/demo/train.yaml --device=1  # Use GPU 1
python main.py --config_file=configs/demo/train.yaml --device=2  # Use GPU 2
  • GPU numbers depend on your server.

USE Sweep

# W&B
sweep_file: configs/demo/training_params.yaml
project: Demo
tags: [train]
  • Add this block to config file for finding training parameters.
# W&B
sweep_file: configs/demo/arch.yaml
sweep_type: arch
project: Demo
tags: [train]
  • Add this block to config file for finding model architecture.

test

python main.py --config_file=configs/demo/test.yaml

5. References

Owner
DongHee
Data Engineering / MLOps / AutoML
DongHee
Code Release for ICCV 2021 (oral), "AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds"

AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds (ICCV 2021 oral) **Project Page | Arxiv ** Runsong Zhu¹, Yuan Liu², Zhen Dong¹, Te

40 Dec 30, 2022
audioLIME: Listenable Explanations Using Source Separation

audioLIME This repository contains the Python package audioLIME, a tool for creating listenable explanations for machine learning models in music info

Institute of Computational Perception 27 Dec 01, 2022
Facial detection, landmark tracking and expression transfer library for Windows, Linux and Mac

Welcome to the CSIRO Face Analysis SDK. Documentation for the SDK can be found in doc/documentation.html. All code in this SDK is provided according t

Luiz Carlos Vieira 7 Jul 16, 2020
Google Recaptcha solver.

byerecaptcha - Google Recaptcha solver. Model and some codes takes from embium's repository -Installation- pip install byerecaptcha -How to use- from

Vladislav Zenkevich 21 Dec 19, 2022
Backend code to use MCPI's python API to make infinite worlds with custom generation

inf-mcpi Backend code to use MCPI's python API to make infinite worlds with custom generation Does not save player-placed blocks! Generation is still

5 Oct 04, 2022
Learnable Motion Coherence for Correspondence Pruning

Learnable Motion Coherence for Correspondence Pruning Yuan Liu, Lingjie Liu, Cheng Lin, Zhen Dong, Wenping Wang Project Page Any questions or discussi

liuyuan 41 Nov 30, 2022
ReGAN: Sequence GAN using RE[INFORCE|LAX|BAR] based PG estimators

Sequence Generation with GANs trained by Gradient Estimation Requirements: PyTorch v0.3 Python 3.6 CUDA 9.1 (For GPU) Origin The idea is from paper Se

40 Nov 03, 2022
Codes for CIKM'21 paper 'Self-Supervised Graph Co-Training for Session-based Recommendation'.

COTREC Codes for CIKM'21 paper 'Self-Supervised Graph Co-Training for Session-based Recommendation'. Requirements: Python 3.7, Pytorch 1.6.0 Best Hype

Xin Xia 42 Dec 09, 2022
The fundamental package for scientific computing with Python.

NumPy is the fundamental package needed for scientific computing with Python. Website: https://www.numpy.org Documentation: https://numpy.org/doc Mail

NumPy 22.4k Jan 09, 2023
Official code for "Simpler is Better: Few-shot Semantic Segmentation with Classifier Weight Transformer. ICCV2021".

Simpler is Better: Few-shot Semantic Segmentation with Classifier Weight Transformer. ICCV2021. Introduction We proposed a novel model training paradi

Lucas 103 Dec 14, 2022
This project provides an unsupervised framework for mining and tagging quality phrases on text corpora with pretrained language models (KDD'21).

UCPhrase: Unsupervised Context-aware Quality Phrase Tagging To appear on KDD'21...[pdf] This project provides an unsupervised framework for mining and

Xiaotao Gu 146 Dec 22, 2022
Convert Python 3 code to CUDA code.

Py2CUDA Convert python code to CUDA. Usage To convert a python file say named py_file.py to CUDA, run python generate_cuda.py --file py_file.py --arch

Yuval Rosen 3 Jul 14, 2021
Weighing Counts: Sequential Crowd Counting by Reinforcement Learning

LibraNet This repository includes the official implementation of LibraNet for crowd counting, presented in our paper: Weighing Counts: Sequential Crow

Hao Lu 18 Nov 05, 2022
MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research

MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research

Facebook Research 338 Dec 29, 2022
Allows including an action inside another action (by preprocessing the Yaml file). This is how composite actions should have worked.

actions-includes Allows including an action inside another action (by preprocessing the Yaml file). Instead of using uses or run in your action step,

Tim Ansell 70 Nov 04, 2022
Codebase for testing whether hidden states of neural networks encode discrete structures.

structural-probes Codebase for testing whether hidden states of neural networks encode discrete structures. Based on the paper A Structural Probe for

John Hewitt 349 Dec 17, 2022
This is a repository with the code for the ACL 2019 paper

The Story of Heads This is the official repo for the following papers: (ACL 2019) Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy

231 Nov 15, 2022
PyTorch implementation of the wavelet analysis from Torrence & Compo

Continuous Wavelet Transforms in PyTorch This is a PyTorch implementation for the wavelet analysis outlined in Torrence and Compo (BAMS, 1998). The co

Tom Runia 262 Dec 21, 2022
The official repository for our paper "The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization".

Codebase for learning control flow in transformers The official repository for our paper "The Neural Data Router: Adaptive Control Flow in Transformer

Csordás Róbert 24 Oct 15, 2022
The official github repository for Towards Continual Knowledge Learning of Language Models

Towards Continual Knowledge Learning of Language Models This is the official github repository for Towards Continual Knowledge Learning of Language Mo

Joel Jang | 장요엘 65 Jan 07, 2023