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
FlingBot: The Unreasonable Effectiveness of Dynamic Manipulations for Cloth Unfolding

This repository contains code for training and evaluating FlingBot in both simulation and real-world settings on a dual-UR5 robot arm setup for Ubuntu 18.04

Columbia Artificial Intelligence and Robotics Lab 70 Dec 06, 2022
NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

5 Nov 03, 2022
Official repository for Fourier model that can generate periodic signals

Conditional Generation of Periodic Signals with Fourier-Based Decoder Jiyoung Lee, Wonjae Kim, Daehoon Gwak, Edward Choi This repository provides offi

8 May 25, 2022
EdiBERT is a generative model based on a bi-directional transformer, suited for image manipulation

EdiBERT, a generative model for image editing EdiBERT is a generative model based on a bi-directional transformer, suited for image manipulation. The

16 Dec 07, 2022
Supplementary materials for ISMIR 2021 LBD paper "Evaluation of Latent Space Disentanglement in the Presence of Interdependent Attributes"

Evaluation of Latent Space Disentanglement in the Presence of Interdependent Attributes Supplementary materials for ISMIR 2021 LBD submission: K. N. W

Karn Watcharasupat 2 Oct 25, 2021
A novel Engagement Detection with Multi-Task Training (ED-MTT) system

A novel Engagement Detection with Multi-Task Training (ED-MTT) system which minimizes MSE and triplet loss together to determine the engagement level of students in an e-learning environment.

Onur Çopur 12 Nov 11, 2022
A Repository of Community-Driven Natural Instructions

A Repository of Community-Driven Natural Instructions TLDR; this repository maintains a community effort to create a large collection of tasks and the

AI2 244 Jan 04, 2023
Code for Paper "Evidential Softmax for Sparse MultimodalDistributions in Deep Generative Models"

Evidential Softmax for Sparse Multimodal Distributions in Deep Generative Models Abstract Many applications of generative models rely on the marginali

Stanford Intelligent Systems Laboratory 9 Jun 06, 2022
Code release for NeuS

NeuS We present a novel neural surface reconstruction method, called NeuS, for reconstructing objects and scenes with high fidelity from 2D image inpu

Peng Wang 813 Jan 04, 2023
Weakly Supervised Scene Text Detection using Deep Reinforcement Learning

Weakly Supervised Scene Text Detection using Deep Reinforcement Learning This repository contains the setup for all experiments performed in our Paper

Emanuel Metzenthin 3 Dec 16, 2022
Alphabetical Letter Recognition

DecisionTrees-Image-Classification Alphabetical Letter Recognition In these demo we are using "Decision Trees" Our database is composed by Learning Im

Mohammed Firass 4 Nov 30, 2021
LV-BERT: Exploiting Layer Variety for BERT (Findings of ACL 2021)

LV-BERT Introduction In this repo, we introduce LV-BERT by exploiting layer variety for BERT. For detailed description and experimental results, pleas

Weihao Yu 14 Aug 24, 2022
A script depending on VASP output for calculating Fermi-Softness.

Fermi softness calculation for Vienna Ab initio Simulation Package (VASP) Update 1.1.0: Big update: Rewrote the code. Use Bader atomic division instea

qslin 11 Nov 08, 2022
Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving

GSAN Introduction Code for paper GSAN: Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving, wh

YE Luyao 6 Oct 27, 2022
A PyTorch implementation of the Transformer model in "Attention is All You Need".

Attention is all you need: A Pytorch Implementation This is a PyTorch implementation of the Transformer model in "Attention is All You Need" (Ashish V

Yu-Hsiang Huang 7.1k Jan 04, 2023
Multimodal Temporal Context Network (MTCN)

Multimodal Temporal Context Network (MTCN) This repository implements the model proposed in the paper: Evangelos Kazakos, Jaesung Huh, Arsha Nagrani,

Evangelos Kazakos 13 Nov 24, 2022
An off-line judger supporting distributed problem repositories

Thaw 中文 | English Thaw is an off-line judger supporting distributed problem repositories. Everyone can use Thaw release problems with license on GitHu

countercurrent_time 2 Jan 09, 2022
Pytorch implementation for Semantic Segmentation/Scene Parsing on MIT ADE20K dataset

Semantic Segmentation on MIT ADE20K dataset in PyTorch This is a PyTorch implementation of semantic segmentation models on MIT ADE20K scene parsing da

MIT CSAIL Computer Vision 4.5k Jan 08, 2023
Apply our monocular depth boosting to your own network!

MergeNet - Boost Your Own Depth Boost custom or edited monocular depth maps using MergeNet Input Original result After manual editing of base You can

Computational Photography Lab @ SFU 142 Dec 17, 2022
LUKE -- Language Understanding with Knowledge-based Embeddings

LUKE (Language Understanding with Knowledge-based Embeddings) is a new pre-trained contextualized representation of words and entities based on transf

Studio Ousia 587 Dec 30, 2022