P300 speller and LDA accuracy

Working with OpenViBE signal processing scenarios and doing scenario/BCI design
lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: P300 speller and LDA accuracy

Post by lbonnet »

Hi everyone,
This patch raised several issues, most important is a retrocompatibility issue with previous scenario using this box on algorithms with optional settings like SVM.

I don't have much time to do a proper patch right now.

While waiting for a better implementation of this functionality within the classifier trainer, the Confusion Matrix box can be used to gather FP and TP rates on the training data. It requires a dedicated scenario, with proper stimulation and signal filtering using Stimulation Filter and Stream switch.
A bit tricky for the newcomer I'm afraid...

[EDIT] I missed your previous message Yann, sry :) I delay this patch for now. I still have an eye on the discussion here; your solution would be enough for me as a user... how about you fabien and stede ? (and others of course :) )

Cheers

Merry Christmas and happy new year

L
Follow us on twitter >> openvibebci

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

stefan
Posts: 20
Joined: Thu Jul 28, 2011 2:14 am

Re: P300 speller and LDA accuracy

Post by stefan »

Hi stede,

Thanks a lot for your help. Will try and see :)

Best regards,

fabien.lotte
Posts: 112
Joined: Sun Mar 14, 2010 12:58 pm

Re: P300 speller and LDA accuracy

Post by fabien.lotte »

yrenard wrote: I'd like to point out two issues and propose one alternative solution here :
  • Computing TP/FP supposes 2-class classifiers. Even if OpenViBE does not come with multi class classifiers for now, the classifier trainer box has been designed to handle multiple class classifiers and some users may use such classifiers making this TP/FP computation irrelevant
Actually, it can be used with a multiclass-classifier, if one class or a set of class represent a "target". For instance, for a multiclass-asynchronous experiment, let say with 3 classes : left hand motor imagery, right hand motor imagery and rest (or non-control state). In this case it is relevant to compute TP/FP, to estimate how good the asynchronous part (detection of commands) is. The target there would be both the left and right hand motor imagery (i.e., the control state). But I agree, it is not relevant for all type of classification problems. For a synchronous multi-class case, it is indeed irrelevant. Maybe we could compute and display the TP/FP only if required by the user, i.e., only if a target class (or list of target class if we want to consider the multiclass case) is specified? Or, to make things even simpler, we can compute and display the TP/FP only for two-class cases (since the box is aware of the number of classes). What do you think?
yrenard wrote: [*] Adding a new setting to this box to choose which class is the target breaks the compatibility with existing scenarios, and even causes unpredictable behavior for scenarios that use classification algorithms which already add new settings (such as SVM for instance)[/list]
That could be a problem indeed, I didn't though about that. However, generally (and independently from this problem), I think we should dare to break the compatibility with existing scenarios from times to times (which can be made smoothly if we propose both a deprecated version of the modified box and the new version of the box for a while, to give time to users to switch to the new box) if it makes openvibe better. But it might not be necessary here. Otherwise, If we really want to avoid adding a new setting, we could compute and display the TP/FP only for binary problems, and for each class, i.e., using each of the two class as the target class. In this way we don't need to specify the target class.

yrenard wrote: In my opinion, the best approach would be to compute the confusion matrix for each partition and print this to the Trace log level for interested users. The confusion matrix gives all the necessary information to know how good a classifier is.
I agree, the confusion matrix gives all the necessary information and should be displayed all the time, together with the accuracy (again, the accuracy is meaningful only for balanced problems, but is completely irrelevant for non-balanced ones. As such it should not be the only measure displayed). But it would be even more convenient for the user to also have aggregated measures ( such as TP, FP, precision, recall, etc.) when it is relevant, so that he won't have to compute them himself. Wouldn't it?
yrenard wrote: More generally speaking, it is important to keep the boxes generic and not to make them specific to a particular problem in order to be able to re-use them later in different problems :)
Totally agree! And that was actually the initial problem here, since accuracy is a not a generic measure as it is meaningless for non-balanced problems. So that's good we have this discussion to find the best way to deal with that. Let's keep brainstorming! And thanks for your input Yann!

dfrazz13
Posts: 3
Joined: Sat Mar 15, 2014 2:42 pm

Re: P300 speller and LDA accuracy

Post by dfrazz13 »

Hi everybody.
First of all I would like to thank you for the excellent job you are doing, Openvibe is really helping us with our studies.
I am part of a group of students in Denmark, and we are working right now with BCI possibilities.
We have been using you software for a while, we were wondering what the accuracy value stands for and I have found this topic.
We are using the p300-speller-xDAWN scenario.

Can I ask you what is the current state of the implementation?
I am using OpenViBE designer 0.17.0, downloaded with the installer from your website.

Thank you again!

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: P300 speller and LDA accuracy

Post by gserrier »

Hi dfrazz13,

Thank you for your support.

Here are explanations on accuracy values which are displayed during the training process.
The first set of values display results of the k-fold cross validation. The training set is split in k subsets (k is a parameter of the designer's training box). Next, the classifier is trained k times where the training set consists of the full training set minus the k-th part. This part is used for the cross validation (this provides the k-th accuracy). At the end of the process, we compute some statistics about these results.
Finally, we train the classifier with the complete training set. Then, we give you the accuracy on the complete training set.

N.B.: This is the configuration obtained in the global training which is saved in the xml file.

Here are some details about the implementation:
In the 0.17.0 release, there iare three implemented classification algorithms: LDA, Shrinkage LDA and SVM. Both LDA's don't support native multi-class classification. SVM can be use in multi-class scenario (the librarylibsvm used in OpenViBE implements it with a One vs. One pairwise strategy).

I am currently implementing pairwise strategy (One vs. All and One vs. One) to add multi-class support to every algorithm. This feature should be ready for the next release. I will also extends all LDA classifier to they support native multi-class classification.

Cheers,
Guillaume.

dfrazz13
Posts: 3
Joined: Sat Mar 15, 2014 2:42 pm

Re: P300 speller and LDA accuracy

Post by dfrazz13 »

Hi, thank you very much for your answer, and again for your precious work!

-Davide

Post Reply