Skip to content

Master thesis subject: Leveraging Deep Learning for Real-time EEG Classification at Cybathlon's BCI-race

License

Notifications You must be signed in to change notification settings

fdebrain/Brain-Computer-Interface-Cybathlon2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Leveraging Deep Learning for Real-time EEG Classification at Cybathlon's BCI-race

Frédéric Debraine, April 2020

This repository contains the code, reports and presentation slides of my master thesis carried out in NCM Lab at ETHZ between March and September 2019 under the supervision of Prof. Dr. Nicole Wenderoth and Ernest Mihelj.

This work aspires to propose a fully functional Brain Computer Interface (BCI) composed of the following elements:

  • An offline pipeline for the training and development phase that will take care of formatting, loading, preprocessing the data, extract features using one of the multiple proposed methods, train, validate and optimize the model.
  • An online pipeline in which we will benchmark our trained models with relevant metrics regarding the real-time Cybathlon competition.
  • Visualization tools for offline/online analysis comprising signal and embedding representation, model inference and metrics to provide better interpretability and easier debugging.

Presentations slides:

Colab Notebooks:

Remark: You need to have the ./Datasets/ folder on your Google Drive before running the Colab notebooks. The data_path parameter should be adapted to your path once your Drive has been mounted. Create a local copy of the notebooks before running them and change runtime type to GPU (runtime -> change runtime type).

Game Environment

1. Installation

  • 1. Download Anaconda (Python 3.7 distribution): conda 4.7.12
  • 2. Clone/download the current repository
  • 3. Create Conda environment:
    • conda create -n cybathlon
    • conda activate cybathlon
  • 4. Install dependencies:
    • pip install -r requirements.txt
    • pip install -e .

2. Getting the data

Datasets

Folder structure

master-thesis-cybathlon
└── code
└── Datasets
    ├── BCI_IV_2a
    │    └── gdf
    │        ├── test
    │        │    ├── labels
    │        │    │    ├── A01E.mat
    │        │    │    ├── ...
    │        │    │    └── A09E.mat
    │        │    ├── A01E.gdf
    │        │    ├── ...
    │        │    └── A09E.gdf
    │        └──  train
    │            ├── A01T.gdf
    │            ├── ...
    │            └── A09T.gdf
    ├── BCI_IV_2b  #(idem)
    └── Pilots
        ├── Pilot_1
        └── Pilot_2
            ├── Session_1
            ├── ...
            └── Session_8
                └── vhdr
                    ├── ***.eeg
                    ├── ***.vhdr
                    └── ***.vmrk

3. Launching the visual interface

  • conda activate cybathlon
  • bokeh serve main --show

Player interface

4. Demo

Data stream Game preview

How to cite

@misc{debraine2020,
  author = {Frederic, Debraine},
  title = {Leveraging Deep Learning for Real-time EEG Classification at Cybathlon's BCI-race},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/fdebrain/master-thesis-cybathlon}},
  commit = {97ef32ea154ca2403c9fb7f8a7110908565e42a5}
}