OpenVibe scenario 3 classes

Come here to discuss about OpenViBE in general!
Post Reply
KB88
Posts: 2
Joined: Mon Jun 11, 2012 11:59 am

OpenVibe scenario 3 classes

Post by KB88 »

Hello to all,

Thanks about your nice software.
I would like to create a BCI scenario (hands/feet movement) with three classes (Right/Left/Forward).
I shown your tutorial video and i read some papers about BCI and how to connect BCI with OpenVibe. About the examples that you have already done they are understandable. But when i try to improve your scenario and to add a third class i have some problems. Below i attached my scennario with three classes and the lua code about Lua stimulation box.
The first think that i have problem is with Classification. As you wrote in an example if you want to replace the LDA
with a SVM classifier, you will have to shift the value by -0.5 with the simple DSP. Indeed, SVM outputs values from 0 to 1. I dont understand what exactly to change.
Secondly it is how i can have conjunction between classifier trainer and classifier processor.

You can see my scenario and you can check it. If it possible you can correct, which part i have the problem.
motor-imagery-bci-3classes-replay.xml
(148.53 KiB) Downloaded 353 times
Lua code 3 classes.txt
(2.48 KiB) Downloaded 304 times

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: OpenVibe scenario 3 classes

Post by lbonnet »

Hi KB88,
I would like to create a BCI scenario (hands/feet movement) with three classes (Right/Left/Forward).
The lua file must produce a random set of trials, i.e. a random set of triplets, using [OVTK_GDF_Right, OVTK_GDF_Left, OVTK_GDF_Up].

The Graz visualization box is able to display the instructions in 4 directions, but I believe it can only display the feedback bar on the right or left.
You can still see the performance in the confusion matrix and classifier accuracy measure boxes.
with a SVM classifier, you will have to shift the value by -0.5 with the simple DSP. Indeed, SVM outputs values from 0 to 1. I dont understand what exactly to change.
The classifier processor box outputs a classification label (a stimulation indicating what is the class of the last feature processed) and a classification state.
This state provides additional information, depending on the classifier. For LDA it's the distance to the separating hyperplan, negative values for one class and positive values for the other class. From what I understood from the code, for SVM it's the probability for the last class, thus in [0;1].
The Graz Visualization box after the classifier processor takes the classification state and gives a feedback : positive values on one side, negative values on the other side.
In the motor-imagery scenario given with openvibe we only use 2 classes. Thus the probability given by SVM can be used directly : if x > 50% it's one class, if x < 50% then probability is higher for the other class. This is why in these scenarios you have to use a DSP (x-0.5) after the classification state (you may have to change the identity box input type to Streamed matrix though, I just saw it was signal and you won't be able to connect it that way).

This won't be the case in a 3-class scenario.
In the current state, you should only use the classification label as a result.
Secondly it is how i can have conjunction between classifier trainer and classifier processor.
The classifier Trainer produces a configuration file for the Classifier processor.
when you run the training, the file is written and when you run the online or replay scenarios the file is read.

Hope this helps !

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: OpenVibe scenario 3 classes

Post by lbonnet »

As for the classifier processor, I forgot something...
I'm afraid that SVM can be trained with multi-class but the processor does not handle more than 2 classes at the moment.
You cannot add a third "class label" setting in the box.

We don't use 3 class classifiers, so it was not implemented when the original developer implemented SVM.
It could be a nice contribution.

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

rdwivedi87
Posts: 3
Joined: Thu Aug 09, 2012 8:28 am

Re: OpenVibe scenario 3 classes

Post by rdwivedi87 »

can you please send me the data .ov file for generic stream reader box for replay.xml.........

Post Reply