Page 1 of 1
How P300 LinearClassifier works?
Posted: 06 Jun 2015, 05:16
by bertocasta
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.
Re: How P300 LinearClassifier works?
Posted: 06 Jun 2015, 20:28
by pbrunner
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
Re: How P300 LinearClassifier works?
Posted: 09 Jun 2015, 16:39
by bertocasta
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.
Re: How P300 LinearClassifier works?
Posted: 09 Jun 2015, 17:04
by pbrunner
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.
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 06:39
by bertocasta
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.
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 10:29
by pbrunner
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
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 13:35
by bertocasta
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.
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 13:42
by pbrunner
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
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 14:16
by bertocasta
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.
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 16:29
by pbrunner
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
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 17:24
by bertocasta
Peter,
I attach a image showing what I think that correlation do.
That's right?
Regards, Alberto.
Re: How P300 LinearClassifier works?
Posted: 10 Jun 2015, 17:28
by pbrunner
Alberto,
your illustration is correct.
Regards, Peter
Re: How P300 LinearClassifier works?
Posted: 11 Jun 2015, 06:47
by bertocasta
Peter,
Thank you so much for your help. I appreciate it so much man. Thank you.
Regards
Re: How P300 LinearClassifier works?
Posted: 11 Jun 2015, 11:02
by pbrunner
Alberto,
you are welcome.
Regards, Peter