Two weird problems with the P300 speller

About the GUI application to design signal processing pipelines
Post Reply
ddvlamin
Posts: 160
Joined: Thu Aug 13, 2009 8:39 am
Location: Ghent University
Contact:

Two weird problems with the P300 speller

Post by ddvlamin »

Hi,

I'm running some tests for the demo with my old amplifier, but encountered some very weird problems with the P300 spelling device.

The first one goes as follows: when I record data with the acquisition scenario, train it and then use it in the online test scenario none of the predictions are correct, although I achieve a cross-validation success rate of nearly 100% during training. However, when I train on the data that I recorded with the online test scenario and then run another (third) online test, I get almost 100% correct predictions. So it seems the stimulations are recorded differently in the acquisition scenario and the online test scenario. Yet, in both scenarios (acquisition and online test) the boxes for the acquisition and the visualization of the P300 are completely the same (configuration included). What I noticed is that the P300 peak occurs much later when the data is recorded with the acquisition scenario than with the online test scenario. What could cause this?
Off course the online test scenario has to calculate a lot more than the acquisition scenario. Could there be a problem with the timing (it seems that the recording of the stimuli is dependent on the amount of calculations)?

The second problem (in this case I'm using the online test scenario both to record training and test data) that I have, is that I always have to stop the first run because nothing is predicted correct. When I start the scenario immediately after that without changing anything it predicts almost everything perfectly. It's like OpenVibe needs a warmup cycle :)

Best regards and thanks for considering all these (sometimes vague) questions,
Dieter

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Two weird problems with the P300 speller

Post by yrenard »

Hello ddvlamin,

First of all, you should tell us which of the two P300 processing pipeline you are using. There are two of them in the sample scenarios : the classical one (records few electrodes) and the xDAWN based one (records more electrodes but reduces dimension with a spatial filter).
ddvlamin wrote: The first one goes as follows: when I record data with the acquisition scenario, train it and then use it in the online test scenario none of the predictions are correct, although I achieve a cross-validation success rate of nearly 100% during training. However, when I train on the data that I recorded with the online test scenario and then run another (third) online test, I get almost 100% correct predictions. So it seems the stimulations are recorded differently in the acquisition scenario and the online test scenario.
Please put recorded files somewhere so we can look at them.
ddvlamin wrote: Yet, in both scenarios (acquisition and online test) the boxes for the acquisition and the visualization of the P300 are completely the same (configuration included).
You did not include configuration in your previous post. Or did you mean you are using the configuration included in the sample scenario ?
ddvlamin wrote: What I noticed is that the P300 peak occurs much later when the data is recorded with the acquisition scenario than with the online test scenario. What could cause this?
I don't understand what you mean here.
ddvlamin wrote: Off course the online test scenario has to calculate a lot more than the acquisition scenario. Could there be a problem with the timing (it seems that the recording of the stimuli is dependent on the amount of calculations)?
No it should not... if it was the case, you'd have warning messages about realtime that could not be met !
ddvlamin wrote: The second problem (in this case I'm using the online test scenario both to record training and test data) that I have, is that I always have to stop the first run because nothing is predicted correct. When I start the scenario immediately after that without changing anything it predicts almost everything perfectly. It's like OpenVibe needs a warmup cycle :)
Do you mean you press play, press stop, and then press play again ?
Do you have messages in the console that could help ?
Can you send us the designer log file for a session ?
Could it be that the configuration file(s) generated by the offline training scenario are not written on disk before a delay ? (antivirus problem ?)

I hope we can find a solution for your problem !
Yann

ddvlamin
Posts: 160
Joined: Thu Aug 13, 2009 8:39 am
Location: Ghent University
Contact:

Re: Two weird problems with the P300 speller

Post by ddvlamin »

First of all, you should tell us which of the two P300 processing pipeline you are using. There are two of them in the sample scenarios : the classical one (records few electrodes) and the xDAWN based one (records more electrodes but reduces dimension with a spatial filter).
I'm using the xDawn scenario, but I adjusted some settings. Because 12 repetitions, with averaging of 1 epoch and 12 votes for the voting classifier did not work for me, I adjusted this to 3 votes and 4 averaged epochs.
I also remember now that I threw away one box because I had no clue what is was doing there. It's about the time based epoching after the decimation box. I use sampling frequency of 256Hz and a buffer of size 32 with a decimation of four. So I don't know why this time based epoching box is there? Also shouldn't it be placed before the decimation box instead?
I also removed some other less important things like the signal display during acquisition...
In the zip-file you can find all the configuration files and the scenarios, together with the recorded files. I placed the directory directly under the "share" directory so that all the directory references are correct.
Please put recorded files somewhere so we can look at them.
See zip-file: http://www.thewired.be/blog/wp-content/ ... m_Demo.zip

The first two files (p300_dieter_12012010_rec1 and p300_dieter_12012010_rec2, I will call them recX for short now, make sure you only look at the one with date 12012010) are recorded with the online test scenario.
rec3 and rec4 with the acquisition scenario.
rec6 and rec7 again with the online scenario later that day and rec8 with the acquisition scenario.
When I train the spatial filter and the classifier on rec1 and test it on rec2, it works. However, when I test it on rec3 or rec4 it fails. Vice versa, when I train on rec3 then it works on rec4, but not on rec1 and rec2.
You did not include configuration in your previous post. Or did you mean you are using the configuration included in the sample scenario ?
see also scenarios in zip-file
I don't understand what you mean here.
there are two bmp files in the zip-file. the rec1 file shows an P300 recorded with the online test scenario which on average comes a bit earlier that the P300 that you can see in the rec3 file that was recorded with the acquisition scenario.
My stimuli based epoching starts at 100ms and takes 500ms in total.
No it should not... if it was the case, you'd have warning messages about realtime that could not be met !
As far as I remember I did not get that message (I only get one message and it's about the compression for the stream writer). But I will check again tomorrow.
Do you mean you press play, press stop, and then press play again ?
Do you have messages in the console that could help ?
Can you send us the designer log file for a session ?
Could it be that the configuration file(s) generated by the offline training scenario are not written on disk before a delay ? (antivirus problem ?)
Exactly. The EEG file rec6 was recorded when I pressed run in the online test scenario for the first time. I then pressed stop and ran the same thing again, this EEG data is recorded in file rec7. the strange thing is, that when I train the spatial filter and the classifier on rec1 and test it on rec6 it does not work at all, while it does work on rec7. Also, I can press run and then stop immediately after each other and it will work (so I don't have to complete the whole session).
No messages in the console as far as I remember, except the compression warning.
Tomorrow I will do the experiment again and send you the log files.
I had problems with the antivirus when it was updating, because the P300 flashes were irregular, so I shut it down. From now on I think I will switch all those background processes off.

Maybe my own box is causing the problem? I wrote a box to write to shared memory, so that I can send commands to my robot application (I know I should have worked with the VRPN, but I didn't know about it then). I will test this tomorrow too.

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Two weird problems with the P300 speller

Post by yrenard »

Dear ddvlamin,

Thank you for the details, give me some time to watch this files !

Yann

ddvlamin
Posts: 160
Joined: Thu Aug 13, 2009 8:39 am
Location: Ghent University
Contact:

Re: Two weird problems with the P300 speller

Post by ddvlamin »

I also remember now that I threw away one box because I had no clue what is was doing there. It's about the time based epoching after the decimation box. I use sampling frequency of 256Hz and a buffer of size 32 with a decimation of four. So I don't know why this time based epoching box is there? Also shouldn't it be placed before the decimation box instead?
In my scenarios I removed this time epoching box, but is that allowed? The reason I ask this is because today I changed the values for my stimulation epoching box (the offset from 0.1 to 0 and the duration from 0.5 to 0.6) and everything stopped working (completely wrong predictions, although I also changed the epoching values in the training scenarios). The stimulation epoching box does not exactly need buffers of a certain size such as with the decimation box, or does it?

On a side note: could the above two described problems have something to do with the problems of my acquisition device (if that's the case I should focus on getting my acquistion device working 100% correctly). As I noticed that even with the old amplifier I sometimes get the warning "dummy samples so far"? I still have to test your drivers, but after installing and deinstalling the drivers several times I get the feeling the computer is messing things up.

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Two weird problems with the P300 speller

Post by yrenard »

Dear ddvlamin,
ddvlamin wrote:In my scenarios I removed this time epoching box, but is that allowed? The reason I ask this is because today I changed the values for my stimulation epoching box (the offset from 0.1 to 0 and the duration from 0.5 to 0.6) and everything stopped working (completely wrong predictions, although I also changed the epoching values in the training scenarios). The stimulation epoching box does not exactly need buffers of a certain size such as with the decimation box, or does it?
The Time Based Epoching on the training scenarios is just present to speedup the replay of the complete file. The less chunks you have, the faster the scenario runs because the box are activated less often. If you replace big number of small chunks by small number of big chunks, each box perform a bigger work each time it is activated but it is activated far less often. So you should not have a difference in the result if you remove this box, just in processing time.

About the Stimulation Based Epoching size, indeed, you must train the xdawn spatial filter and the LDA classifier on epochs with exactly the same size. If you don't do that for the xdawn spatial filter, performances will lower. If you don't do that for the classifier, it will simply not be able to classify anything (you should have a warning about feature vectors not beeing the right size in the console). Please be carefull about the timings you put in the Stimulation Based Epoching.
ddvlamin wrote:On a side note: could the above two described problems have something to do with the problems of my acquisition device (if that's the case I should focus on getting my acquistion device working 100% correctly). As I noticed that even with the old amplifier I sometimes get the warning "dummy samples so far"? I still have to test your drivers, but after installing and deinstalling the drivers several times I get the feeling the computer is messing things up.
Keep us posted about this, Baptiste told me he found something that may solve your driver problem !

Yann

jamesLocal
Posts: 27
Joined: Sun Jun 27, 2010 3:44 pm

Re: Two weird problems with the P300 speller

Post by jamesLocal »

See zip-file: http://www.thewired.be/blog/wp-content/ ... m_Demo.zip
Is there a possibility for us to have access to this zip file ?

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Two weird problems with the P300 speller

Post by yrenard »

Dear jamesLocal,

I think ddvlamin removed that file from his blog. You may want to PM him if you want to get that files. However, I'm not sure it can be useful to you since it was for debugging purpose.

Yann

Post Reply