Skip to content

okbalefthanded/pyLpov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyLpov : python-LARESI-processing-OpenVibe

  • Accompanying LARESI_BCI Python scripts for offline/online analysis and classification of EEG data in OpenVibe

Version requirements


Installation

Option 1 : build from source

First, clone repo from github:

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

Then,

cd pyLpov

pip install -r requirements.txt

python setup.py install

Option 2 : using pip

pip install git+https://github.com/okbalefthanded/pyLpov.git

CPU Inference Acceleration

In online processing with Deep Neural Networks, Keras/TensorFlow models are supported. When only CPU (Intel CPUs) is used for inference it is recommanded to install and use Intel's OpenVINO toolkit.

OpenVINO installation guide


Usage

Offline processing

- Feature engineering pipeline

The API is built in a way that provides automatic processing through the use of YAML configuration files and Scikit-learn classes : Pipeline and Estimators (inspired from the API of MOABB)

A configuration file specifies the pipline chain of operations from preprocessing to feature extractors to classifiers.

Using CLI

see cmd_tuto.bat on how to set and execute the offline analysis, and follow sa_hybrid_train.py in pyLpov/scripts/standalone on how to set an automatice processing script.

- End-To-End Deep Neural Networks

Trained Keras models saved in H5 and TF2 SavedModl format are supported.

Online processing

  • Make sure the python scripting box is available in the OpenVibe Designer Scripting tab.
  • Add a python scripting box to the scenario.
  • Follow this tutorial for correct usage of python scripts Python in Openvibe
  • Add one of the online scripts from pyLpov/scripts/scenarios to your experiment scenario, for example use ssvep_py_online.py for SSVEP online detection.

Methods available

As pyLpov API relies heavily on scikit-learn, any built-in classifier or regressor can be easily defined in the pipeline, the same goes for any 3rd-party methods developed with scikit-learn's estimators. Nevertheles we keep adding specific BCI methods, the following list shows the available methods so far:

Event-Related Potentials (ERP)

  • Downsample and vector concatenation.
  • EPFL approach

Steady-State Visual Evoked Potentials (SSVEP)


Citation

@misc{bekhelifi2022fast,
    title={Towards Fast Single-Trial Online ERP based Brain-Computer Interface using dry EEG electrodes and neural networks: a pilot study},
    author={Okba Bekhelifi and Nasr-Eddine Berrached},
    year={2022},
    eprint={2211.10352},
    archivePrefix={arXiv},
    primaryClass={eess.SP}
}

Acknowledgment