Code and data associated to the paper: Exploiting task constraints for self-calibrated brain-machine interface control using error-related potentials. PLoS ONE, accepted for publication. 2015. http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0131491
TeX Matlab Other
Latest commit 68515d0 Jul 8, 2015 @jgrizou jgrizou Update README.md
Permalink
Failed to load latest commit information.
bci_thesis @ 0d78e22
lfui @ 210e052
matlab_tools @ 9efc858
offline
online
paper
.gitignore
.gitmodules
LICENSE
README.md

README.md

This folder contains the code associated to the following paper: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0131491

Title: Exploiting task constraints for self-calibrated brain-machine interface control using error-related potentials.

Authors: I. Iturrate, J. Grizou, J. Omedes, P-Y. Oudeyer, M. Lopes and L. Montesano

Abstract: This paper presents a new approach for self-calibration BCI for reaching tasks using error-related potentials. The proposed method exploits task constraints to simultaneously calibrate the decoder and control the device, by using a robust likelihood function and an ad-hoc planner to cope with the large uncertainty resulting from the unknown task and decoder. The method has been evaluated in closed-loop online experiments with 8 users using a previously proposed BCI protocol for reaching tasks over a grid. The results show that it is possible to have a usable BCI control from the beginning of the experiment without any prior calibration. Furthermore, comparisons with simulations and previous results obtained using standard calibration hint that both the quality of recorded signals and the performance of the system were comparable to those obtained with a standard calibration approach.

PlosOne: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0131491

Final version release: https://github.com/flowersteam/self_calibration_BCI_plosOne_2015/releases/tag/plosOne

Setting up the repository:

git clone https://github.com/flowersteam/self_calibration_BCI_plosOne_2015.git

cd self_calibration_BCI_plosOne_2015/
git submodule init
git submodule update

cd matlab_tools
git submodule init
git submodule update

Note: If you really don't want to use git, the result of the above commands are in the self_calibration_BCI_plosOne_2015.zip file from the plosOne release.

Finally, add the files from the plosOne release following the path given in their respective zip folder:

  • data_1.zip contains the "raw_data" folder which should be located under "data/raw_data".
  • data_2.zip contains the "experiments_selfCalibration" folder which should be located under "data/experiments_selfCalibration".
  • online.zip contains the "analysis" folder which should be located under "online/analysis".
  • offline.zip contains the "analysis" folder which should be located under "offline/samplingEEG/analysis".

File organization and usage

  • The data/raw_data folder (data_1.zip) contains the raw data from the online experiments. This folder contains, in Matlab format, the EEG-recorded error-related potentials from eight subjects in an online self-calibration experiment. The folder includes a readme.txt file explaining the data organization.

  • The data/experiments_selfCalibration folder (data_2.zip) contains the processed data from the online experiments. EEG are processed and formatted as detailled in the paper and are associated with more information about the task and the evolution of our algorithm state. Some of these files are used for the analysis of the online results, see online folder description below.

  • The online folder contains the code to analyse the online experiments as presented in the paper. Run the processData.m script to generate the analysis, and the plotData.m script to visualize useful information. The analysis files can also be downloaded from the release: online.zip.

    Do not forget to add the following folders to the Matlab path: bci_thesis, lfui, matlab_tools.

  • The offline folder contains the code to run the offline analysis comparing our self-calibration algortihm with the calibrated case using the acquired EEG data. To repeat the experiments:

    • create some jobs using the offline/samplingEEG/create_jobs.m script using the parameters you want to evaluate. Then run the offline/run_samplingEEG.m script to execute all the created jobs. Results of each individual run are stored under offline/samplingEEG/results.
    • to analyse the results, run the offline/samplingEEG/analysis.m script. The analysis files are stored under offline/samplingEEG/analysis. The analysis files generated from the experiments performed for the paper can be downloaded from the release: offline.zip.
    • to visualize the key informations, generate the tables by running the offline/samplingEEG/generate_all_tables.m script to visualize the key informations.

    Do not forget to add the following folders to the Matlab path: bci_thesis, lfui, matlab_tools.

Going into details

If you want to enter into the code, we recommend to start exploring the following repository https://github.com/jgrizou/lfui. You will find there a simple annotated example of the self-calibration code under example/gridworld/run_gridworld.m

We recommend the following papers for more details on the algortihm:

  • [1] Calibration-free BCI based control. Grizou, J., Iturrate, I., Montesano, L., Oudeyer, P. Y., & Lopes, M.. AAAI Conference on Artificial Intelligence, 2014. [pdf] [bib] [sources]

  • [2] Interactive learning from unlabeled instructions. Grizou, J., Iturrate, I., Montesano, L., Oudeyer, P. Y., & Lopes, M.. UAI Conference on Uncertainty in Artificial Intelligence, 2014. [pdf] [bib] [sources]

For even more details and illustrative drawings of these ideas, please refer to the following thesis:

For more details about the use of Errps in BCI control tasks, please refer to:

  • [4] Shared-control brain-computer interface for a two dimensional reaching task using EEG error-related potentials. Iturrate, I., Montesano, L., & Minguez, J.. In Engineering in Medicine and Biology Society (EMBC), 2013. [pdf] [bib]

License

The code is under GPL V3 the paper itself is under Creative Commons BY-NC-ND