Code Monkey home page Code Monkey logo

code-sblest's Introduction

Code-SBLEST

This repo contains Matlab and Python code for the SBLEST (Sparse Bayesian Learning for End-to-End Spatio-Temporal-Filtering-Based Single-Trial EEG Classification) algorithm, as well as implementations of Convolutional Neural Networks (CNNs) used in the paper. Detailed information about the algorithms and CNN implementations can be found in W. Wang, F. Qi, D. Wipf, C. Can, T. Yu, Z. Gu, Y. Li, Z. Yu, W. Wu. Sparse Bayesian Learning for End-to-End EEG Decoding, IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 45, no. 12, pp. 15632-15649, 2023.

Data

The data used in this repository is from Subject L1 (foot vs. tongue) in Dataset II, as mentioned in the referenced paper.

File Descriptions

Matlab code for SBLEST

The MATLAB scripts provided in this section implement the SBLEST algorithm and have been tested with MATLAB R2018b.

File Descriptions

  • SBLEST.m —Matlab code for the SBLEST algorithm.

  • SBLEST_main.m — An example code for classifying single-trial EEG data using SBLEST in Matlab.

Usage

  1. To run the code, download and extract them into a folder of your choice, and navigate to this folder within MATLAB.

  2. At the MATLAB command line, type

SBLEST_main

Python code for SBLEST

The Python scripts for SBLEST are implemented in PyTorch and have been fully tested with Python 3.9.

File Descriptions

  • SBLEST_model.py —Python code for the SBLEST algorithm.

  • SBLEST_main.py — An example code for classifying single-trial EEG data using SBLEST in Python.

Python Implementations of sCNN, dCNN, EEGNet, EEG-Inception, and EEGSym

sCNN and dCNN are implemented in PyTorch using the braindecode package, which is provided at https://github.com/robintibor/braindecode.

EEGNet is implemented in TensorFlow using the Keras API, with the model provided at https://github.com/vlawhern/arl-eegmodels.

EEG-inception and EEGSym are also implemented in TensorFlow, with the models provided at https://github.com/esantamariavazquez/EEGInception and https://github.com/Serpeve/EEGSym, respectively.

File Descriptions

  • sCNN_main.py — An example code for classifying single-trial EEG data using sCNN.

  • dCNN_main.py — An example code for classifying single-trial EEG data using dCNN.

  • EEGNet_main.py — An example code for classifying single-trial EEG data using EEGNet.

  • EEGModels.py — A model file used in the EEGNet implementation.

  • EEGInception_main.py — An example code for classifying single-trial EEG data using EEG-inception.

  • EEGInception.py — A model file used in the EEG-inception implementation.

  • EEGSym_main.py — An example code for classifying single-trial EEG data using EEGSym.

  • EEGSym_architecture.py — A model file used in the EEGSym implementation.

  • EEGSym_DataAugmentation.py — A python file for data augmentation used in the EEGSym implementation.

  • signal_target.py — A code for preprocessing the signal and target used in all the cNNs implementations.

code-sblest's People

Contributors

eegdecoding 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.