Projects:2018s1-155 Brain Computer Interface Control for Biomedical Applications
Abstract
The aim of this project is to develop a brain-computer interface (BCI) for rehabilitation of stroke patients with impaired limb movement. A BCI is a device which is capable of directly measuring neural oscillations of the brain (aka brainwaves) and interpreting these to perform various functions.[1][2] In our project we will interpret the brainwaves associated with muscle movement and use this to control a bio-mechanical limb. Not only will this enable motion of a previously paralysed limb, it will also assist in the brain's ability to rewire itself (a concept known as neuroplasticity), since the limb will respond and send feedback to the brain. After a successful rehabilitation the patient will regain control of their limb, and new area of the brain will take on this function.
Contents
Project Team
Students
Alex Woodcock
Artem Vasilyev
Supervisors
Assoc.Professor Mathias Baumert
Mr David Bowler
Introduction
To explain what a BCI, brain computer interface, is, it is a system that measures neural oscillations or brainwaves. The resulting waveform presented to the researchers is influenced by various factors such as the subject’s thoughts, intentions, movements and emotions. The data is collected using various mechanisms which can be electric, magnetic and optical.
Motivation
A stroke is a disease that causes damage to the brain, usually due to a blood clot. Often the stroke causes partial or complete loss of motor functions, preventing people from even doing something as simple as independently getting a glass of water. However, through advances in brain research and personalised brain wave monitoring technology, researchers have found ways to restore lost motor functions.
Current Technology
Commonly, researchers use specially made caps with predetermined holes for electrodes. This is because the human scalp has been fully mapped. This allows for consistency in readings and in between research initiatives. There is a broad spectrum of BCI uses such as helping people with disability by controlling various devices and gaming.
The technology is not ideal and there are many challenges in using it. For example due to the many neurons in the human brain, there is a very low Signal To Noise ratio and spatial resolution. The electrodes that are placed on the subjects’ scalp are also prone to being affected by artefacts. Artefacts are undesirable potentials that are caused not by brain signals, but by some external origin. This can be something as subtle as blinking, eye movements or facial muscle movements such as the jaw. During data acquisition, subjects are carefully instructed to minimise movements, but digital filters are also used to isolate their effects.
Work by previous UoA Students
This is a quick rundown of what the previous groups did on this project. They have used the official proprietary Emotiv software to test the headset, constructed a robotic limb, connected the Emotiv hardware to the open source BCI2000 software package and redesigned the headset itself. Sadly the latest iteration of the headset is somewhat unusable, therefore we will redesign it once more.
Objectives
The key goal of this project is to develop a low cost BCI system that uses commercial hardware. It is to be non invasive, meaning no probes will go in someone’s skull, and to interface with Emotiv BCI hardware. We also plan to develop brand new BCI software that will have a modern Graphical User Interface, visualizations, and allow us direct control over the implemented filters. Then, we will analyse our readings, classify relevant features that correspond to hand movements and develop a robotic limb support system that will enable neuroplasticity in stroke patients, allowing them to return to normal lives. Neuroplasticity is a relatively newly discovered phenomenon which is essentially rewiring the neurons in the brain, allowing different areas of the brain control over new functions.
Background
Neurons
The Human Brain
Neural Frequency Bands
Control Signals
Neuroplasticity
Brain Cortex
In case you do not know, the human brain consists of many cortex that are responsible for different functions of our bodies, for example the motor cortex is the one responsible for movement.
System Overview
Hardware
Electrodes
Data Aquisition
Software
Spatial Filters
Temporal Filters
Visulisations
Bio-Mechanical Limb
Header 1 | Header 2 | Header 3 |
---|---|---|
row 1, cell 1 | row 1, cell 2 | row 1, cell 3 |
row 2, cell 1 | row 2, cell 2 | row 2, cell 3 |
<source lang="java"> /** @file paex_saw.c @ingroup examples_src @brief Play a simple (aliasing) sawtooth wave. @author Phil Burk http://www.softsynth.com
- /
- include <cstdio>
- include <iostream>
- include <cmath>
- include "portaudio.h"
- define NUM_SECONDS (12)
- define SAMPLE_RATE (44100)
typedef struct { float left_phase; float right_phase; } paTestData;
/* This routine will be called by the PortAudio engine when audio is needed.
- It may called at interrupt level on some machines so don't do anything
- that could mess up the system like calling malloc() or free().
- /
static int patestCallback(const void* inputBuffer, void* outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData) { static int n = 0; float* out = (float*)outputBuffer;
for (int i = 0; i < framesPerBuffer*2; i+=2) { static float decay = 1; static float decay2 = 1.4;
decay *= 0.999995; decay2 *= 0.99996; float mag = (6.0 + sin(2 * n * 2 * 3.1415 / 176400.0)) / 80.0; out[i] = decay * mag * sin(0.04 * n); out[i + 1] = decay * mag * sin(0.04 * n + 2*n*2*3.1415/176400.0);
out[i] += decay * 0.07 * sin(1.334839854 * 0.04 * n); out[i + 1] += decay * 0.07 * sin(1.334839854 * 0.04 * n + 1.334839854 * 2 * n * 2 * 3.1415 / 176400.0);
out[i] += decay2 * 0.07 * sin(1.334839854 * 0.02 * n); out[i + 1] += decay2 * 0.07 * sin(1.334839854 * 0.02 * n + 1.334839854 * n * 2 * 3.1415 / 176400.0);
if (n > 88200*3)
{
out[i] += decay * 0.05 * sin(1.681792831 * 0.04 * n);
out[i + 1] += decay * 0.05 * sin(1.681792831 * 0.04 * n + 1.681792831 * 2 * n * 2 * 3.1415 / 176400.0);
out[i] += decay * 0.02 * sin(2 * 0.04 * n);
out[i + 1] += decay * 0.02 * sin(2 * 0.04 * n + 2 * 2 * n * 2 * 3.1415 / 176400.0);
}
else
{
if (n == 88200 * 3)
{
decay = 1;
decay2 = 0.5;
}
out[i] += decay * 0.04 * sin(1.781797436 * 0.04 * n); out[i + 1] += decay * 0.04 * sin(1.781797436 * 0.04 * n + 1.781797436 * 2 * n * 2 * 3.1415 / 176400.0);
} ++n; }
return 0; }
/*******************************************************************/ static paTestData data;
int main(void) { PaStream *stream; PaError err;
printf("PortAudio Test: output sawtooth wave.\n"); /* Initialize our data for use by callback. */ data.left_phase = data.right_phase = 0.0; /* Initialize library before making any other calls. */ err = Pa_Initialize(); if (err != paNoError) goto error;
/* Open an audio I/O stream. */ err = Pa_OpenDefaultStream(&stream, 0, /* no input channels */ 2, /* stereo output */ paFloat32, /* 32 bit floating point output */ SAMPLE_RATE, 1024, /* frames per buffer */ patestCallback, &data); if (err != paNoError) goto error;
err = Pa_StartStream(stream); if (err != paNoError) goto error;
/* Sleep for several seconds. */ Pa_Sleep(NUM_SECONDS * 1000);
err = Pa_StopStream(stream); if (err != paNoError) goto error; err = Pa_CloseStream(stream); if (err != paNoError) goto error; Pa_Terminate(); printf("Test finished.\n");
std::cin.clear(); // reset any error flags std::cin.ignore(32767, '\n'); // ignore any characters in the input buffer until we find an enter character std::cin.get(); // get one more char from the user
return err;
error: Pa_Terminate(); fprintf(stderr, "An error occured while using the portaudio stream\n"); fprintf(stderr, "Error number: %d\n", err); fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err)); return err; }
</source>
Glossary
Further Reading
References
- ↑ Schalk, G & Mellinger, J 2010, A Practical Guide to Brain-Computer Interfacing with BCI2000, Springer, London.
- ↑ Nicolas-Alonso, LF & Gomez-Gil, J, 'Brain Computer Interfaces, a Review', Sensors; 2012, vol. 12, pp. 1211-1279.