P300 Callibration

Locked
mariru
Posts: 3
Joined: 13 Jun 2012, 01:39

P300 Callibration

Post by mariru » 18 Jul 2012, 08:02

Hello!
Our lab finally finished setting up BCI2000 with the BioSemi amplifier.

Yesterday we were able to do our first P300 calibration session as described in the tutorial
http://www.bci2000.org/wiki/index.php/U ... I_Tutorial. During the first run the subject was not able to hit any letters correctly and in the offline analysis the best r^2 correlation values were of magnitude around 10^(-5) and only on 3 channels.
We updated the user specific parameter files and did a second calibration run and then a third. The spelling capabilities increased to 80% and wrong letters were at least either in the same row or in the same column as the target letter.

What made us curious is the fact that in the plots produced by the Offline Analysis the r^2 value increased from 0.003 on the second calibration run to around 0.016 on the third run. In addition, there were higher r^2 values visible for many more channels. So I have a few questions:
1. Is the improvement a result of the subject getting better at producing a p300 response signal to the speller? Or is it purely due to the updated values in the classifier matrix?
2. How do the entered values in the classifier matrix affect the algorithm?
3. How much weight is given to selected channels in comparison to the other channels (128 total)?
4. Does the algorithm pay closer attention only to the specified channels or also surrounding channels (we noticed that the significant channels were clustered in two areas on the back of the scull)?

Any insight people could provide would be highly appreciated.

Another impression that we had was that the runs were getting faster i.e. the stimulus time duration seemed to get shorter (however, we don't have evidence for that).
5. Is that related to the updates in the classifier matrix?

Thank you!
Maja

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: P300 Callibration

Post by mellinger » 18 Jul 2012, 09:24

During the first run the subject was not able to hit any letters correctly
The calibration session is necessary to adapt ("calibrate") the speller to the subject. During the first session, the speller thus has no information about the subject, and cannot infer the selection from the subject's brain signal.
in the offline analysis the best r^2 correlation values were of magnitude around 10^(-5) and only on 3 channels
The subject might have been disturbed by the unexpected fact that no letters could be selected correctly. Also, movement or blink artifacts may reduce the computed r^2 values. More on artifacts may be found at
http://www.bci2000.org/wiki/index.php/U ... ment_Setup
1. Is the improvement a result of the subject getting better at producing a p300 response signal to the speller? Or is it purely due to the updated values in the classifier matrix?
The classifier matrix is used for online classification of brain signals. It does not affect offline analysis of the data.
2. How do the entered values in the classifier matrix affect the algorithm?
The algorithm is a linear classifier that gets averaged EEG time courses from multiple channels as input. A linear classifier computes a single number (classification score) simply by multiplying each feature with a weight factor, and adding the results together. In the P300 speller, classification scores for all rows are compared, and the row with the largest classification score is interpreted to be the selected row. Likewise, it proceeds for columns.

The values in the classifier matrix are the weight factors of the linear classifier. For more information on linear classifiers, see http://en.wikipedia.org/wiki/Linear_dis ... t_analysis.
3. How much weight is given to selected channels in comparison to the other channels (128 total)?
What do you mean by "selected channels"? Where and how did you select them?
5. Is that related to the updates in the classifier matrix?
The classifier matrix determines the weights of the linear classifier, as described. Stimulus duration is determined by the StimulusDuration parameter, the duration of the inter-stimulus interval is determined by the ISIMinDuration and ISIMaxDuration parameters, and the number of stimuli presented for each letter selection is defined by the NumberOfSequences parameter (http://www.bci2000.org/wiki/index.php/U ... pellerTask, all parameters are on the Application tab).

You may open a data file with the BCI2000FileInfo tool (BCI2000/tools/BCI2000FileInfo), in order to view the parameter settings that were used when recording that data file.

Regards,
Juergen

skmody
Posts: 12
Joined: 16 Aug 2011, 08:06

Re: P300 Callibration

Post by skmody » 19 Jul 2012, 07:13

Hello,

This is my understanding of the P300 calibration procedure. Please tell me if it is conceptually correct.

1. Assume we have 128 channels to start with.

2. The speller application initially chooses some plausible channels (or all) and plausible delays (say 300 ms) in order to guess the word (although I admit that I couldn't understand the values in the initial classifier matrix). Since this is a calibration session (with parameters from the InitialP3Session.prm file), it also records the _correct_ "stimulus" vs "no stimulus" period in the data file, where "stimulus" refers to a period when one of the letters from the actual word was displayed. When we run the Offline analyser, it can therefore know the actual "stimulus" and "non-stimulus" periods).

3. The Offline analyser can then look at the record specifically in the neighborhood of those times when the stimulus was displayed.

4. For each channel it looks at the signal amplitude for every millisecond from say 0 - 500 milliseconds from the time of the stimulus. Since there are about 20 illuminations per letter, then assuming say 3 letters in the word, it has about 60 amplitude values per channel, per millisecond.

5. For each channel, it randomly (?) takes about 60 amplitude values _outside_ the 0 - 500 millisecond period.

6. It can then compare the two sets of values. For example, take the difference of the means and divide by the std deviation. This is the r^2 value.

7. The color plot of channel vs "millisecond from stimulus" can now be made.

8. Using the color plot, we determine which channels and delays are most significant. Take 4 or 5 of the points where the r^2 value is the highest.

9. Feed these values into the classifier.

10. Now the speller application can use only those timings and channels that we have identified in order to guess the spelling.

Maya's question was essentially: "How does the speller application weight the values". Does it only take into account the values entered into the classifier matrix or does it also give some weight to all of the 128 channels or perhaps some of the channels surrounding the entered ones. For example if we enter channel 2, does it also pay attention to channels 1 and 3 ?
Also it is true that every time new classifier values are entered, the speller can make a better guess based on the new information. But after every configuration session, the subject may also be having a stronger response across channels. So her hunch was that the stronger response may also be playing a role in the improved guess.

In addition, can we also feed the r^2 value into the classifier. Is that what the "weights" column is for?

Best Regards,
Sandeep.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: P300 Callibration

Post by mellinger » 19 Jul 2012, 08:19

2. The speller application initially chooses some plausible channels (or all) and plausible delays (say 300 ms) in order to guess the word (although I admit that I couldn't understand the values in the initial classifier matrix).
The initial classifier matrix has no meaning at all. While it would be possible to pre-define it the way you suggest, this would imply specifying some channels by name. In turn, this would lead to error messages for users who don't have the pre-specified channels available in their configuration.
5. For each channel, it randomly (?) takes about 60 amplitude values _outside_ the 0 - 500 millisecond period.
No, it does not. It compares responses to "correct" stimuli (flashes of rows or columns that contain the predefined letter) against responses to the remaining stimuli, not against any sort of "baseline". This is because the speller needs to discriminate between those two kinds of responses, not between response and "baseline".
6. It can then compare the two sets of values. For example, take the difference of the means and divide by the std deviation. This is the r^2 value.
Computing a r^2 value is a bit more involved than that (see http://www.bci2000.org/wiki/index.php/G ... ination.29). However, you are right in that the r^2 value assumes this form for Gaussian-distributed data.
Maya's question was essentially: "How does the speller application weight the values". Does it only take into account the values entered into the classifier matrix or does it also give some weight to all of the 128 channels or perhaps some of the channels surrounding the entered ones. For example if we enter channel 2, does it also pay attention to channels 1 and 3 ?
The classifier matrix contains the weights of the linear classifier. No other information enters into classification. If there is no weight specified for a certain channel/time point combination, it is taken to be zero. This is explained in the LinearClassifier documentation: http://www.bci2000.org/wiki/index.php/U ... Classifier
Also it is true that every time new classifier values are entered, the speller can make a better guess based on the new information. But after every configuration session, the subject may also be having a stronger response across channels. So her hunch was that the stronger response may also be playing a role in the improved guess.
Sure. The results of running OfflineAnalysis will provide you with information about the "quality" of the subject's response, while spelling accuracy will provide you with information how well the speller used the information that was present in the response.

If your question is whether learning may be involved in generating a P300 signal, then, from a physiological point of view, the answer is no. An evoked response is always elicited if the necessary conditions are met (see http://www.bci2000.org/wiki/index.php/U ... 0_Response for details), it cannot be improved by training the brain how to generate it.

In a wider sense though, learning may be involved in operating a P300 speller: Learning how to avoid artifacts, how to control and maintain attention to the desired letter, how to adjust display brightness vs ambient light, and other factors affecting the "quality" of the response in terms of r^2 values.
In addition, can we also feed the r^2 value into the classifier. Is that what the "weights" column is for?
The weights column contains the weights for the linear classifier. With manual configuration, there are so many uncertainties involved that it makes little sense trying to improve classification by entering values different from 1. Also, r^2 values are not optimal classifier weights. There are various ways how to determine optimal weights ("training" a classifier). The most elementary way is called "Linear Discriminant Analysis" (LDA), and its basic idea is to search for the maximum r^2 over all possible linear combinations of features (data dimensions). The coefficients of the linear combination associated with the maximum r^2 are the optimal classifier weights.
The P300Classifier program coming with BCI2000 does classifier training based on a variant of LDA, which is called "Stepwise LDA" (SWLDA), which uses a stepwise approach in order to identify and remove all data dimensions that do not contribute to classification.

HTH,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 0 guests