Classifier trainer and classifier processor

Come here to discuss about OpenViBE in general!
Post Reply
tekoft05
Posts: 5
Joined: Tue Apr 24, 2012 2:39 am

Classifier trainer and classifier processor

Post by tekoft05 »

Hi,

I'm trying to build a BCI but i'm having a problem in the classification process. I have several question about classifier trainer and classifier processor, and a little bit about voting classifier..

1. I'm using the LDA method for the classifier trainer but I'm not sure about the "train trigger". What stimulation should I put inside this parameter? What is exactly the function of "train trigger"?

2. I try to make a 3 class system by using LDA method, i've built a scenario that contain 3 classifier trainers (each with LDA method) which every classifier trainer get 2 input of stimulation (right-left, right-up, left-up). Another scenario for testing the classifier is made by using 3 classifier processor associated with each classifier trainer. And in the end i used a voting classifier. But it gives 2 warnings that said:

[WARNING] Box algorithm <Voting Classifier> has been deactivated because process phase returned bad status
[WARNING] <Algorithm::LDA classifier - GPL> Feature vector size 3 and hyperplane parameter size 3 does not match

I don't understand why this warning came up. And how should I deal with this problem?


Thank you,

Ayu

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

Re: Classifier trainer and classifier processor

Post by ddvlamin »

Hi,

The train trigger should indicate the end of the experiment at which all features have been collected and thus computation of the parameters can begin. The value of this trigger depends on what stimulus you used to indicate the end of your experiment in the file you have save during acquisition. This could for example be OVTK_StimulationId_ExperimentStop.

Concerning you voting mechanism. I would go for one-versus-rest. I'm not sure how your voting works with one-versus-one. You could construct three classifiers, the first discriminating left/up versus right, the second one right/up versus left and the third one left/right versus up. In an online setting one can then use the voting classifier to see which one of these three classifiers marks the input sample as target. If it is for example the third classifier you know that the signal corresponds to the up condition.

Concerning your error "Feature vector size 3 and hyperplane parameter size 3 does not match" I think you extract a different amount of features during your training compared to your test scenario. If you check you classifier config file you should have three coefficients, two for the hyperplane and one for the bias term. This means you should only extract two features in the test scenario.

Best regards,
Dieter Devlaminck

tekoft05
Posts: 5
Joined: Tue Apr 24, 2012 2:39 am

Re: Classifier trainer and classifier processor

Post by tekoft05 »

Hi,

thank you for your explanation. I've figured my mistake on the train trigger.
but I still don't get the idea of building a classifier that discriminates left/up vs right, left/right vs up, and right/up vs left..
from what I know, we must input the classes into LDA classifier, so it will be left-right, left-up, and right-up.
how can i separate the classes into one vs rest?

please correct me if i made a big mistake in my understanding...

Thank you,
Ayu Gareta

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

Re: Classifier trainer and classifier processor

Post by ddvlamin »

Hi,

You need to take all the left trials as class one and all the right/up trials as class two. You can achieve this in the training scenario by using the multiplexer box that multiplexes the data from the right and up trials into one stream. To the classifier trainer this will look like it is data all from the same class although it is multiplexed from two different types of trials. This way you construct three classifiers.

The following topic could be of interest to you viewtopic.php?f=13&t=533&hilit=multiclass

It seems that in my OpenViBE version the classifier trainer is capable of accepting input features of more than two classes, so maybe it is already possible to construct multiclass classifiers without the need of going throught the above voting scheme (although I'm not sure whether the underlying algorithm is able to process more than two classes, but it is worth a try).

Best regards,
Dieter

tekoft05
Posts: 5
Joined: Tue Apr 24, 2012 2:39 am

Re: Classifier trainer and classifier processor

Post by tekoft05 »

I just want to make sure that my interpretation is correct.

so, you say that I need to do different trials to make sure that I get the classes I want. 1st is left (to get the features for left arrow), 2nd is up/right (to get the rest feature). Then I multiplexed data from both trials and feed it to one classifier.
And I should do this for the other one vs rest.

I will try to see your classifier trainer version, but from what I know, the problem lies in the classifier processor that can only accept two kind of stimulus... Thank you for your help. I will try to do it that way... :D

Best regards,
Ayu Gareta

tekoft05
Posts: 5
Joined: Tue Apr 24, 2012 2:39 am

Re: Classifier trainer and classifier processor

Post by tekoft05 »

And by the way, for the classification result, can I still use graz visualization?

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

Re: Classifier trainer and classifier processor

Post by ddvlamin »

You could connect the features of class left to the first feature input of the classifier trainer, then connect the features of the multiplexed up/left trials to the second feature input of the classifier trainer.

Actually the one-versus-one approach as you described it for the three-class case will probably also work. the first right-vs-left classifier should then output a target label for right, the second left-vs-up classifier should output a target label for a left trial and the third up-vs-right classifier should output a target label for an up trial. I'm not sure which one would work best.
tekoft05 wrote: I will try to see your classifier trainer version, but from what I know, the problem lies in the classifier processor that can only accept two kind of stimulus... Thank you for your help. I will try to do it that way... :D
Yes you are right, the problem seems indeed to be the classifier processor.

The graz visualisation should enable you to use up to four classes I think.

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

Re: Classifier trainer and classifier processor

Post by ddvlamin »

I just took a look at the graz visualisation box and I don't think it is possible to give continuous feedback in the four directions, for this the box should be extended. Recording of the four directions should be possible, maybe one could give discrete feedback in the four directions with the current box.

tekoft05
Posts: 5
Joined: Tue Apr 24, 2012 2:39 am

Re: Classifier trainer and classifier processor

Post by tekoft05 »

Hi,

Now, I can understand better about the scenario (after downloading your xml file). Thanks a lot for your help.

So, for the classification result from the voting classifier, is it visible to use the matrix display? or maybe the classifier accuracy measure? Well, I haven't tried both, but surely i will try. But if you have any suggestion, I will appreciate it very much..

Thank you,
Ayu

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

Re: Classifier trainer and classifier processor

Post by ddvlamin »

I have never used the matrix display before, but I have used the accuracy box before and that should work.

Post Reply