x

MICO - Motor Imagery Classification with OpenBCI EEG Headset

MICO is a tool that uses an OpenBCI headset to classify motor imagery using spectral tomography. Motor imagery is a cognitive process of imagining movement with no muscle involvement. MICO produces pretty pictures as a side effect. Data pipeline has seven parts:

Figure 1 - System Architecture
1. EEG Time Series data are collected by OpenBCI hardware. Band power for each electrode is calculated by OpenBCI GUI v5.1.0. An LSLstream is exposed for consumption by BCI Tool. An OpenBCI Ultracortex Mark IV is used to capture data, which houses 16 electrodes from 10-20 locations.
2. Spectral Tomography Maps are a single colour channel image corresponding to bandpower at a specified brainwave category.
3. EEG Images are made by assigning spectral tomography maps to image colour channels.
4. Application Configuration contains switches to enable/disable program behaviours, and User Input is available via hotkeys to assign training labels to training data.
5. Motor imagery classifier - renders classifier prediction to file if enabled.
6. Live visualiser - renders upsampled video to screen if enabled.
7. Save training data - dumps EEG images and associated labels to files if enabled.

EEG Time Series

To run MICO, OpenBCI GUI needs to be running at least one LSL stream with the following properties:

  • Data Type: BandPower
  • Name: band_power
  • Type: EEG
  • Filters: Can be set to On or Off. Recommend On with a 50hz notch filter applied in the Time Series menu

See Networking menu for LSL stream properties.

Electrode Locations

Headset can handle up o 35 electrodes, shown in figure 2. 16 are used for this project. These are FP1, FP2, C3, C4, P7, P8, O1, O2, F7, F8, F3, F4, T7, T8, P3, P4

Figure 2 - Available slots for electrodes on the OpenBCI Ultracortex Mark IV headset, given in the 10-20 system. Source OpenBCI shop

Spectral Tomography Maps

Generated by applying Azimuthal Equidistant Projection to the 16 electrodes given their locations in 3D space. MNE used to map channel names to locations. Hardware can handle delta, theta, alpha, beta and gamma bands.

EEG Images

EEG Images are generated using a method published by Bashivan et al., 2015.

Application Configuration

Application configuration in config/application.yaml

User Input

Training data is tagged using key presses. Classifier classes left and right are supported. To tag motor imagery data as 'left' and 'right', hold the 'F' or 'J' keys, respectively, and data will be tagged with labels 'left' or 'right'.

Motor Imagery Classifier

Baseline motor imagery classifier is an MNE CSP classifier, which uses scikit-learn Linear Discriminant Analysis under the hood. More sophisticated connectionist approaches may be added in future, for example RNNs and in particular LRCN. I probably need a better graphics card before that though.

Training Data Generator

WIP

Left-click: follow link, Right-click: select node, Scroll: zoom
x