GithubHelp home page GithubHelp logo

okbalefthanded / aawedha Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1007 KB

Deep Learning toolbox for EEG based Brain-Computer Interface signals decoding and benchmarking

License: GNU General Public License v3.0

Python 100.00%
deep-learning brain-computer-interface eeg machine-learning benchmark erp ssvep motor-imagery

aawedha's Introduction

Aawedha

Aawedha (عاودها means repeate it or do it again in Algerian arabic) is a deep learning learning package based on Keras with Tensorflow backend, for EEG based Brain-Computer Interface (BCI) decoding research and application.

Compatible with Python 3.6 and above


Motivation

The main goal for this package is to provide a flexible and complete analysis and benchmarking tool for Deep Learning research in BCI.


Features

Aawedha provides a complete set of operations from raw data preprocessing to model evaluation and results visualization. A regular workflow using this package consists of 5 instructions:

  • Create a dataset: preprocess raw data to create epoched EEG trials (run once)
  • Define an Evaluation : Single subject or Cross Subject analysis with the data and model.
  • Generate a random data split.
  • Run evaluation : train and test model.
  • Visualize the results and what the model has learnt.

The tables below show the available datasets and models, for a detailed tutorial on running the evaluations follow the colaboratory notebook in the examples folder.

Data

Datasets Paradigm Participants(subjects)
BCI Competetion IV 2a Motor Imagery 9
Exoskleton SSVEP 12
Freiburg Online ERP ERP 13
Inria ERN ErrP 26
Laresi Hyrbid Hybrid ERP/SSVEP 1
Physionet_MI Motor Imagery 109
San Diego SSVEP 10
Tsinghua SSVEP 35

Deep Learning Models

Title Paradigm Architecture
EEGNET Motor Imagery / ERP/Errp ConvNet
EEGNet SSVEP SSVEP ConvNet
DeepConvNet/ ShallowConvNet Motor Imagery / ERP/Errp ConvNet
1DCSU SSVEP ConvNet
PodNet SSVEP ConvNet
KoreaU CNN SSVEP ConvNet
Xu_Jiang CNN SSVEP ConvNet

Installation

First, clone Aawedha using git:

git clone https://github.com/okbalefthanded/aawedha.git

Then, cd to the Aawedha folder, install requirements using pip then proceed to package setup:

cd aawedha

pip install -r requirements.txt

python setup.py install

Usage

Follow the colab notebooks in /examples

Citation


Acknowledgment

aawedha's People

Contributors

okbalefthanded avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

aawedha's Issues

[Enhacement] Custom/Addon Model Configurations

Custom and new modules such as Layers, Optimizers and Losses are often developed outside the Keras/Tensorflow main repo and takes time to be officially adopted.
we'll add and test these modules from different sources: Tensorflow-addons, third-party github repos.

[Features] Add Pytorch support

Currently we only support TF/Keras as computing engines, but due to the wider adoption of PyTorch by both the ML and BCI communities, we require an urgent PyTorch support. We will keep both frameworks and experiment with the situation.

[Enhacement] Refactor code

The current code contains a lot of duplication, and since the core features are mature and stable enough; a general refactor is required.

TF calibration metrics

  • Expected calibration error (ECE) and Brier loss from Tensorflow probability do not support sparse labels and require nd logits.
  • Tensorflow addons Matthew Correlation Coefficient (MCC) does not support sparse labels yet. An open PR is yet to be merged.

Tensorflow/Keras update

  • Since the adoption of PyTorch, we reduced the feature development of TF/Keras based operations. Additionally, TFA (tensorflow addons) announced moved to a wind down minimal maintenance and release mode.
    tensorflow/addons#2807

[Feature] [dependency] PyTorch-Optimizers

  • PyTorch optimizers that are not supported by the official torch implementation are added as separate classes, this behavior makes the codebase heavier, a fix for this is to base the torch optimizers on the PyTorch-Optimizer (as we've done with torchmetrics).

Torchmetrics Breaking changes

Starting from torchmetrics version 0.11.0, all metrics require "task" argument to be specified at instantiation. Also, for multiclass tasks, the number of classes must be provided as "num_classes" argument.

[DL] Add Models

EEGNet and the models available with it are well tested, newer and different architectures are required.

[Enhacement] port to TF 2.0

The package is well tested on TF 1.15, a quick test with TF 2.0 revealed that the evaluation loop breaks while calling .fit() method with callbacks.
This issue is first raised for class_weights callback when the train_data split has only a portion of all classes. a quick fix can be using Stratified k-fold cross-validation for data split to ensure same percentage of samples of each target class.

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.