Using the basic P300 example scenarios of OpenViBE

  • NB: Document ONLY concerns OpenViBE 1.1.0 and earlier

In OpenViBE 1.1.0 and earlier, the P300 scenarios bundled with OpenViBE in bci-examples/p300-speller* suffer from a glitch that makes them non-precise in some conditions. In order to make them work well you should follow some specific practices.

Where is the problem

This paragraph explains where is the issue with the current implementation. If you want to simply make P300 work you can safely skip to the next paragraph.

Openvibe designer operates in simulated time. What this means is that at the start of the loop of the openvibe kernel (a loop is a period during which each box in a scenario executes exactly once) a time is set and each box will work as if this time was the current time. In the meantime the real time progresses and both times diverge.

P300 paradigm needs one real time event to execute properly which is the time of the flash on screen.

In openvibe such flash is produced by three subsequent calls to box algorithms:

  1. p300 sequence generator sends a stimulation which marks the flash
  2. p300 target letter generation decides whether the row is p300-target or not depending on the target letter
  3. p300 visualisations asks the Gtk to draw the highlighted row/column

These three boxes execute one after another, they all operate as if the time did not flow in between the executions. This means that the timestamp of the flash written into the signal stream precedes the actual real moment when the letters flash.

The difference between the real time and simulated time is constant, but it depends on the processor load during the scenario execution. It is thus difficult to obtain good results when the training is done by a different scenario than the online testing.

How to make it work

In order to obtain good results one has to train the p300 classifier with the same scenario which will be used for the online testing. It is also important that all of the boxes execute during the training.

Short version

  1. Train the classifiers with the training scenario on 1 letter
  2. Run the online scenario for the full lenght, ignore the results of the classification (in green)
  3. Train the classifier with data obtained in step 2
  4. Run the online scenario, now well trained

(The sequence in which to run the scenarios is thus 1-2-3-4-2-3-4)

Detailed version

Open the p300-speller-1-acquisition.xml scenario.

Double click on the Flashing Sequence box.

Expand the Override settings with a configuration file setting at the bottom of the dialog.

Uncheck the checkbox in this setting.

Modify the Number of trials setting and set it to 1.

Configuration of the Flashing Sequence Configuration of the Flashing Sequence

Run the scenario, let it finish (no more flashes). Stop the scenario.

Open the p300-speller-2-train-xDAWN.xml scenario.

Make the Generic Stream Reader read your latest recorded file.

Run the scenario until the end.

Open the p300-speller-3-train-classifier.xml scenario.

Make the Generic Stream Reader read your latest recorded file.

Run the scenario until the end.

Open the p300-speller-4-online.xml scenario.

Run the scenario. When all of the boxes load focus the Keyboard stimulator and press A.

A flashing sequence will appear, the blue squares indicate targets to concentrate at. Green squares indicate the classifier’s output.

Since you have not yet trained the classifier on real data the detection will be random.

Focus on the letters indicated by the blue squares.

Once the scenario finishes go back to the step using the p300-speller-2-train-xDAWN.xml and redo all of the steps. Do not forget to use the right file with the Generic Stream Reader.

You can now run the online scenario with real training.

This entry was posted in Deprecated and old documents and tagged , . Bookmark the permalink.