MI-BCI training is based on visuo-motor imagination and together with other mental task imagination (e.g. mental subtraction, word association) is the only paradigm of endogenous nature that does not require external stimulation but only the user’s imaginative action. In addition, MI is considered the most importan type of BCI paradigm for motor function restoration. Results from different studies have proven mental practise of action to be useful in MI-BCI, and have shown beneficial effects of motor imagery practise during stroke recovery. Unfortunately, an estimated 15-30% of people cannot use a BCI system, resulting in a big amount of BCI illiteracy in the user base.
This post covers how to implement a MI-BCI training with OpenBCI 32bit Board by adding two external buttons to the board, adding extra features to the Processing code, and rewrite the OpenBCI Board code.
Motor imagery has become the newest trend in BCI research since imagination of movements appears to recruit neural mechanisms in the brain, which are similar – or the same – to those used to perform the same movements. However, the question of whether similar functional connectivity patterns among recruited brain areas associated with both real and imagined movements exist has been less addressed in the BCI frame.
For a better understanding of brain correlates of real and imagined movements, in the present work, we investigated the spatiotemporal EEG brain activity during a real and an imaginary rhythmic finger-tapping task. Repetitive finger movements externally paced by auditory or visual cues have been studied to investigate cortical connectivity, sensorimotor coordination. Moreover, in the frame of BCI research, repetitive finger and hand movements, real and imagined one, where used to extract characteristic features that serve as inputs for the detection of the intention of movement. These features include lateralized patterns of power decrease and an increase in the alpha and beta frequency bands.
It is widely accepted that while brain processes certain events, the ongoing brain rhythmical activity can be blocked or desynchronized. These types of changes are better detected by frequency analysis because they represent frequency-specific changes of the ongoing EEG activity. They consist, in general of a power decrease (event-related desynchronization, ERD) and of a power enhancement (event-related synchronization, ERS) of certain frequency bands. This is considered to be due to a decrease or an increase in synchrony of the underlying neuronal populations, respectively.
The evolution of ERD and ERS patterns for both actual and imagined movements is calculated by averaging the energy distributions of EEG single trials at each time instant in the time-frequency domain. We focused on the detection of beta rhythms and associated ERD/ERS patterns, previously described to occur with initiation and execution of motor actions as well as with motor imagination. Discrimination of short time activations during motor imagery based on the frequency content may improve decision-making and enhance the performance of a BCI system.
The aim of the present training is to investigate the cortical activation and connectivity sub-serving real and imaginary rhythmic finger tapping, from the analysis of multi-channel electroencephalogram (EEG) scalp recordings. Several studies in Motor Imagery involving finger tapping showed a similar methodology, emphasizing three short-period of time: focus, cue, and rest.
The experiment involves two tasks of simple limb motor imagery (left hand, right hand). The simultaneous imagination of different limbs contributes to the activation of larger cortical areas as well as two estimated sources located at corresponding motor areas within beta rhythm.
Every trial is 10 seconds time long, and it’s composed by different status:
- Ready: The first second of each trial command shows up an alarm
- Focus: The following three seconds are based on a countdown before the cue, just to let the subject prepare himself for what is coming.
- Cue: It’s only four seconds long, and it shows the cue that has to be done in the trial. In each trial the cue is different. This is the non-random version, which means that the cues appear in the following order:
Move right finger Move left finger Imagine moving right finger Imagine moving left finger
- Rest: The subject has two seconds to rest between trials.
OpenBCI EEG Headset
Whatever OpenBCI EEG Headset version that you have will work. Personally, I use the Ultracortex Mark III “Supernova”. You can read more information in this post.
Electrodes are placed over the motor and somatosensory cortices. Reference and ground electrodes are at the left and right ear lobes, respectively.
Two external buttons
Sometimes, when studying EEG or other biopotential signals, you will want to have precise timing between external events or stimulus and the data stream. Indeed, motor imagery based brain-computer interface (BCI) translates the subject’s motor intention into a control signal through real-time detection of characteristic EEG spatial distributions corresponding to the motor imagination of different body parts. In this case, it is necessary to know the exact time that an external input has been presented to the subject to look for the tell-tale brain wave that happens about 400ms after the stimulus. Moreover, if you want to distinguish between right and left movements while you are studying motor imagery or motor execution, you better pay attention to the following steps.
Connection (OpenBCI 32bit Board)
Another post from this blog explains how to implement and add two external buttons to the OpenBCI 32bit Board, and how to connect the two external buttons to the correct pins in the OpenBCI 32bit board.
Edit OpenBCI GUI
On the top-right of the image, the Playground tab appears showing the time of each trial, the number of trial you are, and all the commands related with start/stop experiment.
In the figure above you can see with more detail, the methodology showed in Playground tab in OpenBCI GUI.
Upload new code to OpenBCI board
You need to upload the new code to the OpenBCI 32bit board in order to get the information of each trial, and everytime the two buttons are pressed.
 “Evaluation of EEG Oscillatory Patterns and Cognitive Process during Simple and Compound Limb Motor Imagery”, Weibo Yi , Shuang Qiu , Kun Wang, Hongzhi Qi Lixin Zhang, Peng Zhou, Feng He, and Dong Ming. Published: December 9, 2014. http://dx.doi.org/10.1371/journal.pone.0114853
 “EEG feature comparison and classification of simple and compound limb motor imagery”, Weibo Yi, Shuang Qiu, Hongzhi Q, Lixin Zhang, Baikun Wan and Dong Ming. Journal of NeuroEngineering and Rehabilitation 2013 10:106, DOI: 10.1186/1743-0003-10-106, © Yi et al.; licensee BioMed Central Ltd. 2013.
 “The Study of Object-Oriented Motor Imagery Based on EEG Suppression”, Lili Li, Jing Wang, Guanghua Xu, Min Li, and Jun Xie. Published: December 7, 2015. http://dx.doi.org/10.1371/journal.pone.0144256
 Thesis: “EEG-based Brain Computer Interfaces (BCIs): An investigation of motor imagery for assistive devices” by Hina Mistry.