Difference between revisions of "Mu and beta rhythm-based BCI"
Line 35: | Line 35: | ||
The main purpose of this project is to implement the BCI algorithms used at the Wadsworth Center and proposed by J.R.Wolpaw and D.J.McFarland in their 2004 paper. In that experiment, subjects were able to control the position of a cursor on the screen by appropriately modifying the amplitude of their Mu and Beta rhythms. | The main purpose of this project is to implement the BCI algorithms used at the Wadsworth Center and proposed by J.R.Wolpaw and D.J.McFarland in their 2004 paper. In that experiment, subjects were able to control the position of a cursor on the screen by appropriately modifying the amplitude of their Mu and Beta rhythms. | ||
− | === The study protocol === | + | === The Wadsworth BCI === |
+ | |||
+ | ==== The study protocol ==== | ||
[[Image:wadsworth_trial_structure.jpg]] | [[Image:wadsworth_trial_structure.jpg]] | ||
Line 43: | Line 45: | ||
A session is composed of eight 3-minutes runs, separated by 1 minute breaks. | A session is composed of eight 3-minutes runs, separated by 1 minute breaks. | ||
− | === Control of cursor movement === | + | ==== Control of cursor movement ==== |
[[Image:wadsworth_control.jpg]] | [[Image:wadsworth_control.jpg]] | ||
Line 59: | Line 61: | ||
where Rv, Lv, Rh, Lh are right and left Mu and Beta amplitudes, wij are weight factors adaptively selected (see below), and av, bv, ah, bh are normalizing factors. | where Rv, Lv, Rh, Lh are right and left Mu and Beta amplitudes, wij are weight factors adaptively selected (see below), and av, bv, ah, bh are normalizing factors. | ||
− | === Adaptation algorithm === | + | ==== Adaptation algorithm ==== |
Initially, the weights in the linear equations above were set as: | Initially, the weights in the linear equations above were set as: | ||
Line 72: | Line 74: | ||
The weights were adapted automatically at each trial in order to optimize the transformation of EEG signals in cursor movement signals. First of all, each target was expressed as a couple of values (or coordinates) representing one of the four horizontal or vertical possible positions. Then, at each trial, Least-Mean-Square algorithm was used to minimize for past trials the difference between the actual target position and the position predicted by the two linear equations. | The weights were adapted automatically at each trial in order to optimize the transformation of EEG signals in cursor movement signals. First of all, each target was expressed as a couple of values (or coordinates) representing one of the four horizontal or vertical possible positions. Then, at each trial, Least-Mean-Square algorithm was used to minimize for past trials the difference between the actual target position and the position predicted by the two linear equations. | ||
+ | |||
+ | === Implementation === | ||
+ | |||
+ | ==== BCI2000 ==== | ||
+ | |||
+ | This project's Brain-Computer Interface is realized with [http://www.bci2000.org BCI2000]. BCI2000 is a multi-purpose EEG software toolbox, developed by the Wadsworth Center and the University of Tubingen, designed to facilitate research and application development in the BCI area. | ||
+ | |||
+ | (More detailed information about BCI2000 can be found at the [http://www.bci2000.org application website] or at the [http://www.bci2000.org BCI2000 wiki]). | ||
+ | |||
+ | BCI2000 is structured in blocks called modules: the Source, Filtering and Application modules are independent on each other and allow easy modification and insertion of new code. | ||
+ | |||
+ | In our case, we need to write a new filter. The filtering section of a BCI2000-developed interface is represented by a filter chain: the input signal from the Source module passes through a series of filters in order to be translated in a control signal. For example, a simplified Wadsworth BCI could have a spatial (laplacian) filter, an autoregressive filter for frequency analysis, a linear classifier and a normalizer. | ||
+ | |||
+ | In such a situation, all we need is a filter between the autoregressive filter and the linear classifier, applying an iterative version of the LMS algorithm on the classifier weights and updating them at the end of each trial. | ||
+ | |||
+ | ==== Delta Rule Adapter ==== | ||
+ | |||
+ | The new filter is called DeltaRuleAdapter. It implements the [http://www.willamette.edu/~gorr/classes/cs449/Classification/delta.html Delta Rule], a gradient descent learning rule. | ||
+ | |||
+ | The filter takes the current weights from the classifier at the beginning of each trial, and then updates them iteratively in his buffer according to the Delta Rule along the trial duration. At the end of the trial, it updates the classifier's weights. | ||
+ | |||
+ | <pre>here goes a code snippet</pre> | ||
+ | |||
+ | === Laboratory activity === | ||
+ | |||
+ | (coming soon) |
Revision as of 17:28, 6 October 2009
Part 1: project profile
Project name
Control of a two-dimensional movement signal by a noninvasive BCI
Project short description
The aim of this project is to design and develop a Brain-Computer Interface in order to control a two-dimensional movement signal, as done at the Wadsworth Center (Wolpaw and McFarland, 2004). A non-invasive approach will be adopted, using EEG as a signal source and Mu and Beta rhythms over sensorimotor cortex as information carriers.
Dates
Start date: 2008/04/01
End date:
People involved
Project head(s)
Other Politecnico di Milano people
Students currently working on the project
Laboratory work and risk analysis
Laboratory work for this project will be mainly performed at AIRLab/Lambrate. The main laboratory activity will be the EEG data acquisition. Though apparently safe, the contact between the subject's body and the EEG instrumentation makes this activity potentially harmful. For safety's sake any electronic device connected to the system should be isolated from the power line. In addition to this, more general risks are present in the laboratory. Standard safety measures described in Safety norms will be followed.
Part 2: project description
The main purpose of this project is to implement the BCI algorithms used at the Wadsworth Center and proposed by J.R.Wolpaw and D.J.McFarland in their 2004 paper. In that experiment, subjects were able to control the position of a cursor on the screen by appropriately modifying the amplitude of their Mu and Beta rhythms.
The Wadsworth BCI
The study protocol
While the subject sat in front of the screen, EEG data from 64 electrodes on the scalp were recorded, bandpass filtered (0.1Hz - 60Hz) and digitized at 160Hz. At the beginning of a trial, a target appeared at one of eight possible locations along the edges of the screen, in a block-randomized fashion. One second later, the cursor appeared in the center of the screen and began to move around according to the EEG activity. The movement lasted for 10 seconds (or less if the cursor reached the target before), then there was one second of blank screen and another trial began.
A session is composed of eight 3-minutes runs, separated by 1 minute breaks.
Control of cursor movement
The position of the cursor was updated every 50ms. The movement amount depended from Mu and Beta amplitudes in the right and left emispheres (the selection of precise Mu and Beta bands was based on previous experiments on the subjects).
Last 400ms of signal data from electrodes C3 and C4 went through autoregressive frequency analysis to determine the spectral features; movement in vertical and horizontal directions was calculated as:
Mv = av (wrv*Rv + wlv*Lv + bv)
Mh = ah (wrh*Rh + wlh*Lh + bh)
where Rv, Lv, Rh, Lh are right and left Mu and Beta amplitudes, wij are weight factors adaptively selected (see below), and av, bv, ah, bh are normalizing factors.
Adaptation algorithm
Initially, the weights in the linear equations above were set as:
wrv = wlv = 1
wrh = 1
wlh = -1
so that the vertical movement was controlled by the sum of right and left spectral amplitudes in one of the two bands, while the horizontal one was controlled by the difference between right and left amplitudes in the other.
The weights were adapted automatically at each trial in order to optimize the transformation of EEG signals in cursor movement signals. First of all, each target was expressed as a couple of values (or coordinates) representing one of the four horizontal or vertical possible positions. Then, at each trial, Least-Mean-Square algorithm was used to minimize for past trials the difference between the actual target position and the position predicted by the two linear equations.
Implementation
BCI2000
This project's Brain-Computer Interface is realized with BCI2000. BCI2000 is a multi-purpose EEG software toolbox, developed by the Wadsworth Center and the University of Tubingen, designed to facilitate research and application development in the BCI area.
(More detailed information about BCI2000 can be found at the application website or at the BCI2000 wiki).
BCI2000 is structured in blocks called modules: the Source, Filtering and Application modules are independent on each other and allow easy modification and insertion of new code.
In our case, we need to write a new filter. The filtering section of a BCI2000-developed interface is represented by a filter chain: the input signal from the Source module passes through a series of filters in order to be translated in a control signal. For example, a simplified Wadsworth BCI could have a spatial (laplacian) filter, an autoregressive filter for frequency analysis, a linear classifier and a normalizer.
In such a situation, all we need is a filter between the autoregressive filter and the linear classifier, applying an iterative version of the LMS algorithm on the classifier weights and updating them at the end of each trial.
Delta Rule Adapter
The new filter is called DeltaRuleAdapter. It implements the Delta Rule, a gradient descent learning rule.
The filter takes the current weights from the classifier at the beginning of each trial, and then updates them iteratively in his buffer according to the Delta Rule along the trial duration. At the end of the trial, it updates the classifier's weights.
here goes a code snippet
Laboratory activity
(coming soon)