Few different questions (2/3 class, gdf, datasets)

Come here to discuss about OpenViBE in general!
dumoulinj
Posts: 4
Joined: Tue Dec 14, 2010 3:13 pm

Few different questions (2/3 class, gdf, datasets)

Post by dumoulinj »

Hi,

I’m using OpenVibe with the Emotiv EPOC headset in order to make a 3 class BCI system. (perhaps it s not possible due to the localizations of the EPOC electrodes (no Cz channel) and the quality of the sensors, so a 2 class is good to start!).

First of all congratulations for this amazing software. It’s really useful. Very good job!

After playing a lot with OpenVibe 2class motor imagery scenarios, i have some questions:

1) How can i concatenate several “.ov” files, in order to have more than only one record session to train the classifier, and enhance the classification accuracy? I didn’t find such a box. And I really need to do it because I reach only 55% classification results for a 2class (not really better than a flip coin)!

2) Is it possible to have some explanations on how to adapt the 2class motor imagery classifier trainer scenario to make a 3class (left hand/right hand/feet). I ve already modified the XML storyboarding for the Graz stimulations acquisition session (left/right/up), and I can modify the spatial filter (laplacian surface) to have 3 areas (3 out signals). But are the classifier trainer and classifier processor boxes able to handle 3 classes? I can add a third feature vector input to the classifier trainer box, but when I configure the classifier processor, it’s only possible to configure two “class label”… And, for the algo, I think we need to use SVM and not LDA?

3) I encounter some difficulties to read existing GDF files with the GDF file reader box. I know that the GDF file format allows having different sampling rates and it’s the main source of problem because OpenVibe can’t do so. But I have some GDF files (e.g. from the “BCI competition III & IV”) with all channels with the same sampling rate, and OpenVibe still says me that it’s not possible to handle the file because of different sampling rates.

3') Is it planned to soon handle gdf files with different sampling rates, or to read EDF/EDF+ files?

4) I’ve found the datasets you provide (http://openvibe.inria.fr/?q=datasets), but how to use these datas with OpenVibe as it’s not possible to read CSV files (no box for this)? Is it possible to have access to these datasets in “.ov” or “.gdf” file format? Can you share such files, to compare results?

Thanks a lot for your time!

Joël

bpayan
Posts: 46
Joined: Fri Jan 08, 2010 4:02 pm

Re: Few different questions (2/3 class, gdf, datasets)

Post by bpayan »

Dear dumoulinj,


Thank you for your interest in OpenViBE and welcome on this board.

1) How can i concatenate several “.ov” files, in order to have more than only one record session to train the classifier, and enhance the classification accuracy? I didn’t find such a box. And I really need to do it because I reach only 55% classification results for a 2class (not really better than a flip coin)!
The box "Streamed matrix multiplexer" can concatenate epochs of matrix sorted by time, so you can have this pattern in output:
First epoch of the first file
First epoch of the second file
Second epoch of the first file
Second epoch of the second file
So on...

But you can't have all signals of the first file then all signals of the second file.
By default this box use 2 inputs, but you can add more.
I never try to use 2 files to learn, but I think if you have 2 or more training process in the same scenario and you concatenate the "feature aggregator" outputs and use only one "classifier trainer", perhaps it cans works.
Like the attached image (In this case the longest file need to be put in the box reader at left)
I haven't got enough tests files to try this solution, so can you give us a feedback if you try this solution or find another.

2) Is it possible to have some explanations on how to adapt the 2class motor imagery classifier trainer scenario to make a 3class (left hand/right hand/feet). I ve already modified the XML storyboarding for the Graz stimulations acquisition session (left/right/up), and I can modify the spatial filter (laplacian surface) to have 3 areas (3 out signals). But are the classifier trainer and classifier processor boxes able to handle 3 classes? I can add a third feature vector input to the classifier trainer box, but when I configure the classifier processor, it’s only possible to configure two “class label”… And, for the algo, I think we need to use SVM and not LDA?
You're right, for using 3 class, you need the SVM algorithm because LDA can be used only for 2 class. SVM is very slow, so don't worry if openvibe is blocked few minutes, I can't give you a real time because this depends of the size of your data training.
To use a 3 class, it's possible with the "classifier trainer". You can add a new input with the right click menu of the box, but for the box classifier processor, it can't be used with 3 class for this time. Sorry for the inconvenient. We will try to fix this.


For the third question I can't help you

4) I’ve found the datasets you provide (http://openvibe.inria.fr/?q=datasets), but how to use these datas with OpenVibe as it’s not possible to read CSV files (no box for this)? Is it possible to have access to these datasets in “.ov” or “.gdf” file format? Can you share such files, to compare results?
I can't give you more details on the datasets, but to read a CSV file, you have a box for this. Can you wait a few days because this box will be in the next release.


I hope these information help,

Baptiste Payan
Attachments
motor-imagery-with-2-training-files.png
motor-imagery-with-2-training-files.png (87.39 KiB) Viewed 20131 times

dumoulinj
Posts: 4
Joined: Tue Dec 14, 2010 3:13 pm

Re: Few different questions (2/3 class, gdf, datasets)

Post by dumoulinj »

Hi and thanks a lot for your fast answer!

For question 4 (and 2), I will wait!

For question 3, I hope someone will soon be able to answer me…

For question 1, I don’t know how the classifier trainer box works exactly, but if it use the stimulation input to know the left/right stimulations in order to associate the feature vectors with the correct stimulations, it will not work correctly with the scenario you propose (attached image). Because the two training sessions have different stimulations sequences (because it’s random). But if the classifier trainer use the stimulation input only to get the “end of session” stimulation, perhaps it could work, and I will test it. But I’m quite surprised that no box able to really concatenate two “.ov” files is available.

And Y. Rennard said in the viewtopic.php?p=1761#p1761 thread : “We usually concatenate the signals recorded in the last 4 sessions to train a good classifier.”

Perhaps it’s possible to do it with other software (with a standard file format, e.g. gdf)??

Joël

bpayan
Posts: 46
Joined: Fri Jan 08, 2010 4:02 pm

Re: Few different questions (2/3 class, gdf, datasets)

Post by bpayan »

Dear dumoulinj,

The “classifier trainer” stimulation input is used to know when all epochs was received. The training start when this input receive the stimulation defined by the "Train trigger" parameter.
The “classifier trainer” has 2 or more “Feature vector” inputs, whether one per class. In your case, you used 2 inputs one for signals corresponding to move the left hand and one for signals corresponding to move the right hand. The selection of these two case are made by the "Stimulation based epoching" boxes.

Perhaps Y. Renard has another solution for concatenate two file, but I'm sorry I don't know it.
I had thought to link two readers boxes to a “stimulation multiplexer” and a “Streamed matrix multiplexer “ boxes and save it in a write box, but I'm really not sure that stimulations keep the good position.

Best regards,

Baptiste Payan

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by lbonnet »

Hello,
Perhaps Y. Renard has another solution for concatenate two file, but I'm sorry I don't know it.
There is an unstable box called "Signal concatenation". By unstable, we mean it is still incomplete and its behaviour can't be 100% trusted. But anyway you can give it a try !
It only works with gdf files (hooray !), and concatenates the inputs one after the other. There is always one signal input associated with one stimulation input.
The snapshot attached will show you how to concatenate two GDF files.
Just play fast forward and wait for a message in the console.

To display the unstable boxes in the Designer, add the following token to your personnal configuration file (openvibe.conf on windows / .openviberc on Linux) :

Code: Select all

Designer_ShowUnstable = True
Laurent-
Attachments
snapshot
snapshot
snap.png (65.82 KiB) Viewed 20126 times
Follow us on twitter >> openvibebci

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

dumoulinj
Posts: 4
Joined: Tue Dec 14, 2010 3:13 pm

Re: Few different questions (2/3 class, gdf, datasets)

Post by dumoulinj »

Great, I hope it will help me to enhance the accuracy... Thank you so much.

Another small question to have a better understanding. Which box find the ERD/ERS : the feature aggregator or the classifier trainer ?? And is it possible to see the ERD/ERS in the topographic map (as in the folowing picture) as a percentage of increase/decrease of signal power ?

Joël

Ps : merci infiniment pour votre aide :wink: !
Attachments
ERD/ERS topographic map
ERD/ERS topographic map
ERD_ERS.png (39.8 KiB) Viewed 20115 times

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by yrenard »

Dear dumoulinj,

thank you for moving this discussion to the forum, it actually saves me some time and as you can see, you can have very fast replies from my colleagues :)

The concatenation we usually do is indeed performed with the Signal Concatenation box. But the proposition of Baptiste to mux the different chunks before feeding the classifier trainer should work as well (never thought about this way to do it, that's actually much more elegant than concatenating the signals).

There is no way to visualize the ERS / ERD with a topographic map for now.

About the multi-sampling rate of the GDF files and/or reading EDF/EDF+ files, it is unfortunately not planned to add this features in OpenViBE anytime soon. A good contribution would be to have a box that loads / saves files using the biosig toolbox. This library handles a number of file formats so this would be interesting to use it for this purpose, not rewriting a file handler from scratch as we did with GDF files. However, you can still try to use the BCI Competition IIIb Reader box for what you want to do. This box as been developed for this exact purpose back when we had to test the motor imagery processing pipeline :)

I hope this helps,
Yann

dumoulinj
Posts: 4
Joined: Tue Dec 14, 2010 3:13 pm

Re: Few different questions (2/3 class, gdf, datasets)

Post by dumoulinj »

Hi!

Yann, no problem for me to use the forum… It’s just a little bit more difficult for me to write questions in English, but i see that everybody understand well what I want to say, so it’s ok!

Did you get good results with the BCI competition IIIb datasets?? Because I only reach 50-60% of classification with these data. I was surprised to get so bad results, so I tried to use the “biosig” toolbox to compare classification results, but this toolbox is not user-friendly, and I was not able to get any results (!)…

Ok, no ERD/ERS visualization for now, but can you just explain me which box is looking for this pattern in the scenario (feature aggregator or classifier trainer).

And the classifier trainer, does it handle a “neutral” state, or for a 2 class it finds every time left or right? Because with Graz visualization, we only see the feedback when it is expected (after a cue), but what would be displayed if the feedback (progress bar) is displayed all the time? And is it possible to see some statistics for the classifier processor (online mode), such as percentage of left/right, average, median… With another box than the Graz visualization???

Again, thank you so much for your time

Joël

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by yrenard »

Dear dumoulinj,

actually, the Graz visualisation box only displays feedback on feedback periods (between two specific stimulations which name I can't remember of).

As regarding your question about the BCI Competition IIIb files, I think that we had pretty good results back when it was tested. But this was almost 4 years ago from now so... :)

Hope that helps in some way...
Yann

Meriam
Posts: 1
Joined: Thu Feb 02, 2012 9:05 am

Re: Few different questions (2/3 class, gdf, datasets)

Post by Meriam »

Hi all,

I’ve some questions related to the first problem introduced by Joël about using more than one record session.

I have already tried the solution given by Batiste with 2 test files (the first one gave about 72% in the classification results, and the second one gave 74%). But the result given by the classification of the two “feature aggregator” concatenated gave a classification result of about 71%. I found that a bit disturbing. Could that result be correct? And in this case why do I have a worse result?

Also, I thought it would be a bit messy if I wanted to record like 4 sessions. So I tried the solution that uses the “signal concatenation” box.

I changed the files to .gdf files (“Generic stream reader”--> “GDF file writer”)
I did the concatenation (like mentioned before by Laurent)
Then I put the obtained file in an .ov file (“GDF file reader” --> “Generic stream writer”)

And there I coped with a problem while doing the classification with the file obtained; “Generic stream reader” box doesn’t succeed reading the file. I think it’s due to the configuration of the “signal concatenation” box. It seems that it isn’t concatenating the stimulations one after the other, what makes the file not usable for classification.
I used these settings:
End-of-file stimulation for input 1: OVTK_StimulationId_ExperimentStop
End-of-file stimulation for input 1: OVTK_StimulationId_EndOfFile

Do you have any idea of how I should change the settings to make it works?

Thanks,
Meriam

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by lbonnet »

Hi Meriam,

From what you said, I did some test with the signal concatenation box.
There some serious issue when using .ov file format.
In the current state, you can achieve good concatenation using only the GDF file writer to save your concatenation file.
e.g. you can concatenate 2+ OV or 2+ GDF files into 1 GDF file.
It worked on my file set; but if it does not work on yours, it's more complex than it seems.
I have to investigate this issue further; I'll keep you posted.

NB : you can choose unused stimulation in the signal concatenation box settings (e.g. OVTK_GDF_100_Watt). Everything will be recorded after the timeout, nothing will be discarded.

Regarding the stimulations, they are recorded correctly in my tests (in the conditions stated above). You can check the stimulations in a file using the Stimulation Listener box.

Training on a concatenated file can be tricky. The classifier trainer box needs a train trigger to perform the training process. In the scenarios given with openvibe, the train trigger used is "end of Session" or "End of file". This stimulation is recorded when concatenating raw files, thus the training process may be triggered too soon (at the end of first file in the concatenation)

This is not a problem as the train can be done more than once (data is buffered). You will get the accuracy measure of the classifier on the first file, then the first + second, and so on.

Please keep me posted !
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: Few different questions (2/3 class, gdf, datasets)

Post by lbonnet »

Hi there,

I just patched the Signal Concatenation box.
Now it should work with OV/GDF readers/writers (tested with different combinations of files).
It's available in the svn trunk.

Laurent-
Follow us on twitter >> openvibebci

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

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by ddvlamin »

Hi,

Apparently the box still contains a small bug. We concatenated the same file multiple times and we saw a delay in the output of the concatenated file that was equal to the block size.

This happens because the m_ui32HeaderReceivedCount is sometimes still lower than half the number of inputs, while one of the files is already sending his first buffer which is consequently not added because you wait until all headers are received. I have solved this by the attached patch and tested in matlab to see if there is a delay between the concatenated parts and the original file, it should work now.

Best regards,
Dieter Devlaminck

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by lbonnet »

Thanks Dieter!

Maybe you forgot to attach the patch (I don't see it on your previous post).
I'll integrate it directly...

L-
Follow us on twitter >> openvibebci

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

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

Re: Few different questions (2/3 class, gdf, datasets)

Post by ddvlamin »

Oops, my mistake, it didn't like the .patch extension
Attachments
signal_concatenation.txt
(11.08 KiB) Downloaded 249 times

Post Reply