Coder Social home page Coder Social logo

t9_ssvep's Introduction

T9 BCI using SSVEP

Python scripts of a Brain Computer Interface (BCI) using SSVEP stimuli to operate a T9 (11 classes). The online (synchronous) classification relies on TRCA. The GUI is using Psychopy3.
It was developped in the Human-Factors department of ISAE-Supaero (France) by the team under the supervision of Frédéric Dehais.

Contents

Dependencies
Installation
Example usage
Help

Dependencies

Installation

Clone the repo:

git clone https://github.com/ludovicdmt/t9_ssvep
cd ${INSTALL_PATH}

Install conda dependencies and the project with

conda env create -f environment.yml

The pyRiemann package has to be installed separately using pip:

conda activate psychopy
pip install pyriemann

If the dependencies in environment.yml change, update dependencies with

conda env update --file environment.yml

You will need to set path to the scripts in either run_T9.sh or run_T9.bat.
Depending on your EEG system, you may want to change the electrodes selection. Here it works with BrainProduct system streaming the electrode number, instead of their names.

This was tested using an EEG BrainProduct system with a native sampling frequency Fs of 500Hz, downsampled to 250Hz for the TRCA algorithm. If your EEG system uses a lower sampling frequency, please consider changing the downsampling argument, to ensure that the signal fed to TRCA algorithm is sampled at 250Hz.

Example Usage

Run it on Linux:

cd ${INSTALL_PATH}
chmod u+x run_T9.sh
./run_T9.sh

Or on Windows, just click on run_T9.bat.

The script will first run a calibration phase, used to train the classification model. This model will be saved in the main directory, along calibration data. This model can be re-used within the same session and with the same subject.

A PyLSL stream from an EEG is required to make the script run.

To change frequencies, phases or amplitude of the stimuli please go to the config file.

Help

You will probably need to do some adjustement to collect EEG stream if you are not using a BrainProduct EEG.
If you experience issues during use of this code, you can post a new issue on the issues webpage.
I will reply to you as soon as possible and I'm very interested in to improve it.

References

  1. M. Nakanishi, Y. Wang, X. Chen, Y. -T. Wang, X. Gao, and T.-P. Jung, "Enhancing detection of SSVEPs for a high-speed brain speller using task-related component analysis", IEEE Trans. Biomed. Eng, 65(1): 104-112, 2018. http://ieeexplore.ieee.org/document/7904641/
  2. X. Chen, Y. Wang, M. Nakanishi, X. Gao, T. -P. Jung, S. Gao, "High-speed spelling with a non-invasive brain-computer interface", Proc. Natl. Acad. Sci. U.S.A, 112(44): E6058-E6067, 2015. http://www.pnas.org/content/early/2015/10/14/1508080112.abstract
  3. Peirce, J. W., Gray, J. R., Simpson, S., MacAskill, M. R., Höchenberger, R., Sogo, H., Kastman, E., Lindeløv, J. (2019). PsychoPy2: experiments in behavior made easy. Behavior Research Methods. 10.3758/s13428-018-01193-y

t9_ssvep's People

Contributors

ludovicdmt avatar

Stargazers

 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.