How P300 LinearClassifier works?

Forum for discussion on different signal processing algorithms
Post Reply
bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

How P300 LinearClassifier works?

Post by bertocasta » 06 Jun 2015, 05:16

Hi everyone. I'm really new in this world, but I'm performing my Degree Project using BCI2000, so I have few questions about how modules work.

I've found some information about how the P300SignalProcessing works, if I'm not wrong:
  • It applies a spatial filter. It takes a matrix ChannelsxSamples and gives a matrix ChannelsxSamples but filtered somehow.
  • It averages a number of epochs for the same stimulus
  • It applies a LinearClassifier
Well, my question is, what does this Classifier in detail? I read that it combines a number of channels and samples into a single number. How it is possible and what is the purpose of it?

Thank you guys and, btw, sorry for mi english.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 06 Jun 2015, 20:28

bertocasta,

lets assume that you have a 6x6 matrix of characters and a block-randomized sequence in which each row and column is flashed one at a time. Lets further assume that the BCI system averages the ERPs (i.e., the time-locked EEG response from each scalp location) that are elicited from the 6 row and 6 column flashes.

Lets further assume that you pay attention to one of the characters in this matrix. In this case the ERP responses of the row and column flashes that contains this character (i.e., the target ERP response) will be markedly different than the ERP responses elicited by the other rows and column flashes (i.e., the non-target ERP response).

Now what happens in BCI2000 to translate incoming continuous EEG into a character selection? First the signals are re-referenced to a common average reverence (i.e., a spatial filter) to remove any component that affects all channels equally. Then the ERPs for each row and column are extracted and averaged. Next a multi-variate regression is calculated for each each of the 6 rows and columns. In this multivariate regression each time point is multiplied with a weight and summed up resulting in a regression variable. Finally the row and the column with the highest regression variable determine the character that you payed attention to.

Please note that to calculate the multivariate regression you first need training data, i.e., so called "copy spelling" data for which you know which character you have selected. On this data you apply a feature selection algorithm to calculate the regression weight for each time point. Also as this system is linear it does not matter whether you average the ERPs and then calculate the regression or if you apply the regression to each ERP and then average the regression variable. Also to make the feature selection easier, you can decimate the temporal resolution of your ERPs.

Regards, Peter

bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

Re: How P300 LinearClassifier works?

Post by bertocasta » 09 Jun 2015, 16:39

pbrunner,

Thank you so much for your answer, it clarified a lot of my questions about it.

Next question, can you explain to me in more detail what's that you called multi-variate regresion?

Thank you.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 09 Jun 2015, 17:04

bertocasta,
Next question, can you explain to me in more detail what's that you called multi-variate regression?
That relates to the fact that you combine multiple features into one regression output. The multiple features are the ERP voltage of a particular channel and a particular time point.

bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

Re: How P300 LinearClassifier works?

Post by bertocasta » 10 Jun 2015, 06:39

pbrunner,

Ok, I think I gor it. The Classifier Matrix contains the weights for the element we are interested in, right?

While performing a calibrating sesion, I am supposed to chose those values with larger r-squared calculated between attended and unattended stimulus, right? Those time marks will be the chosen for classifiy the response. But, if I'm not wrong, the larger the r-squared, the more correlation between the two vectors, in other words, vectores (or stimulus) are more like each other. So it's a contradiction to me.

Regards.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 10 Jun 2015, 10:29

bertocasta,

the r-squared value relevant for the feature selection is calculated by correlating the ERP voltages at a certain time point after the stimulus onset with the corresponding target/non-target label.

Regards, Peter

bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

Re: How P300 LinearClassifier works?

Post by bertocasta » 10 Jun 2015, 13:35

Peter,

I understand how it is calculated. What I don't know is why the relevant marks of time are those with largest r-squared values since the larger the r2, the more correlated are both stimulus (target and not target).

Regards, Alberto.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 10 Jun 2015, 13:42

bertocasta,

you are not correlating the ERPs with each other. You correlate the ERP voltages at one time point with the corresponding label (e.g, 0 for non-target and 1 for target). The resulting r-square value will tell you how much of the variance in the ERPs at that time point can be explained by the task condition. Thus the higher the r-squared value the more different the ERP voltages are at this time point.

Regards, Peter

bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

Re: How P300 LinearClassifier works?

Post by bertocasta » 10 Jun 2015, 14:16

pbrunner,

Let's see if I understood it.

*You correlate those time points corresponding to a target stimulus with 1.
*You correlate those time points corresponding to a non-target sitmulus with 0.

So, when the r-squared of these correlations are maximum, those are the time points with the strongest response. Am I right?

Regards, Alberto.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 10 Jun 2015, 16:29

Alberto,

correct, except that there is only one correlation value per time point as you concatenate all responses from one time point from target and non-target stimuli and then correlate this vector with a vector of the same length that contains the labels (e.g., 1 and 0, for target and non-target).

Regards, Peter

bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

Re: How P300 LinearClassifier works?

Post by bertocasta » 10 Jun 2015, 17:24

Peter,

I attach a image showing what I think that correlation do.
Image

That's right?

Regards, Alberto.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 10 Jun 2015, 17:28

Alberto,

your illustration is correct.

Regards, Peter

bertocasta
Posts: 10
Joined: 28 May 2015, 05:15

Re: How P300 LinearClassifier works?

Post by bertocasta » 11 Jun 2015, 06:47

Peter,

Thank you so much for your help. I appreciate it so much man. Thank you.

Regards

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How P300 LinearClassifier works?

Post by pbrunner » 11 Jun 2015, 11:02

Alberto,

you are welcome.

Regards, Peter

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest