bci2000 for p300 classification

Forum for discussion on different signal processing algorithms
Locked
sandra2014
Posts: 17
Joined: 09 Sep 2014, 09:41

bci2000 for p300 classification

Post by sandra2014 » 09 Sep 2014, 10:26

Hi !
Recently i am dealing the brain signal which got from p300 by bci2000. I wanted to make classification by means of matlab2013a . As I know , the classifier in bci2000 is linear classification , and I analog this classifier but my result is different with bci2000 's applog file's record.
Anyone can help me? :D
I think there may be some preprocessing in EEG raw data ,is anyone met the same problem ? In other words, the classification's object is not the simply averaged data but some data that is processed by some other means .

sandra2014
Posts: 17
Joined: 09 Sep 2014, 09:41

Re: bci2000 for p300 classification

Post by sandra2014 » 17 Sep 2014, 23:13

I have solved this problem ,if anyone met the same problem ,you can readthis .

Hiba_AZIZ
Posts: 18
Joined: 26 Feb 2013, 05:34

Re: bci2000 for p300 classification

Post by Hiba_AZIZ » 20 Jan 2015, 10:04

Hi
I have a problem in feature extraction witch method I can use and how can I use it?
if there any suggestion please help me
because it's not obvious to me exactly this step.
I try to download a data from BCI competition but when I come in phase of feature extraction I blocked in.

please any Idea or information about it with or without using BCI2000 tools
thank you
with my regards

sandra2014
Posts: 17
Joined: 09 Sep 2014, 09:41

Re: bci2000 for p300 classification

Post by sandra2014 » 28 Jan 2015, 07:03

I am sorry for too late to see it .
If your mean the feature extraction in BCI2000 ,that is average the data between each stimulus start time and later 800ms according to each row/column ,in the selected channels. Then concatenate them in a vector ,i.e. feature vector .
For example , if the number of selected channels is 6 , you will get a vector which dimension is 4800*1 (4800 comes from 6*800) .
If your mean the other feature extraction , I would suggest you to search some article about this field .
I hope these answer will help you .
Thanks ,
Sandra .

Hiba_AZIZ
Posts: 18
Joined: 26 Feb 2013, 05:34

Re: bci2000 for p300 classification

Post by Hiba_AZIZ » 29 Jan 2015, 02:55

hi
first thank you so much for your reply Sandra2014 it's very useful to me :D

I have another question please about features vector
I find this in article:
" For each of the 8 channels, 800-ms segments of data following each intensification were extracted.
The segments were then moving average filtered and decimated to 20Hz.
The resulting data segments were concatenated by channel for each intensification, creating a single feature vector for training the classifiers".

my first question is:

The resulting data segments were concatenated by channel for each intensification including Target and no Target epochs !!? :!:
or Target epoch in features vector and the no Target epoch in another one !!?

fo example:
I have Target epochs 192*8*30
no target epochs 192*8*150
If I concatenate a target epoch alone I find 46080 and no target epoch in anoter vector I find 230400 but if I cancatenate it in the same feature vector I will find 276480 :roll:

they said by channel in each intensification this meaning for example :

S= the 8 channels in first intensification I cancatenate together
T= the 8 channels in second intensification I will also cancatenate together.
R= the first vector S I will concatenate with the second vector T after all that


if I concatenate it in a same feature vector should I respect the apperence of target and no target epoch in each intensification or normaly I can put the target epochs first and the no target epochs after or verse versa!!?

my second question is:
if I use downsampling, in feature extraction I used the resulting segment for example contains 13 candidates or my first segment that contains 192 samples in feature vector!!??

my third question is:
if I want to represente my feature vector , I can't do it because it contain one single column !!? if I can, how can I do it !!?

please give a response I'm confusing :oops: :shock: :roll:
many thanks again
with my regards

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: bci2000 for p300 classification

Post by boulay » 29 Jan 2015, 12:54

Hiba_AZIZ wrote: my first question is:
The resulting data segments were concatenated by channel for each intensification including Target and no Target epochs !!? :!:
or Target epoch in features vector and the no Target epoch in another one !!?
Let's say your data are originally in a matrix MyTargetData of size n x t x c (t = number of time samples (192), c = number of channels (8), n = number of target flashes (30)) and your non-target data are in a matrix MyNontargetData of size m x t x c (m = number of non-target flashes (150)). k = m+n = 180

Code: Select all

y = cat(1, ones(n,1), -1*ones(m,1));  % == 1 for targets, == -1 for nontargets. Edited to make consistent with next line.
X = cat(1, MyTargetData, MyNontargetData);  % X is now 180 x 192 x 8
To concatenate by channel, you'd simply reshape the matrix:

Code: Select all

f = t*c; X = reshape(X, [k f]);  % X is now 180 x 1536
Hiba_AZIZ wrote: my second question is:
if I use downsampling, in feature extraction I used the resulting segment for example contains 13 candidates or my first segment that contains 192 samples in feature vector!!??
192 samples per 800 msec of data is far more than you need to measure a P300. Having too many samples makes it difficult for machine-learning algorithms to work. SWLDA helps pick only 'good features' among the many many features. Other methods help too, but it's always good to reduce your feature set to something that captures all the important information in fewer variables. This is why we do downsampling first. So if X is 180 x 192 x 8, you'd downsample it so it was 180 x ~16 x 8. After reshaping, your X would be of size 180 x 128.
Hiba_AZIZ wrote: my third question is:
if I want to represente my feature vector , I can't do it because it contain one single column !!? if I can, how can I do it !!?
A "vector" means several different things and can be confusing. A vector is typically a 1 x f array or a k x 1 array. You are thinking about having multiple instances of a single variable as a vector (like our "y" above, a 180 x 1 array). A vector can also mean a single instance of multiple variables. If you imagine a 3D plot, you can describe a point in its space by a vector from the origin with 3 values (1 x f = 1 x 3 = [x y z]). The concept of vector extends to 128 features too (in a 128-dimensional space). Finally, a vector can mean a k x 1 array of 1 x f feature vectors (i.e., a vector of vectors), but typically you'll only see that in programming.

To help you represent your feature vector, I'll need to know more about what you are trying to do.

sandra2014
Posts: 17
Joined: 09 Sep 2014, 09:41

Re: bci2000 for p300 classification

Post by sandra2014 » 30 Jan 2015, 08:17

Hi
In fact , I am not exactly get your question ,But I guess the following example will help you !
For first question , let's assume that there are 10 word to type by BCI2000 . So there are 10*180 intensifications . It means each row/col intensify 15 times for one word (180 = 15*12 ; 12(row&col) = 6+6 ).
After segment (800ms) ,we got 1800 segments corresponding to 1800 intensifications . For one intensification (no matter it belong to Target or nonTarget) ,ater feature extration , as your selected channel number is 8 , the feature vector dimension is (8*800)*1 .
feature_vector = [ (800ms from ch1) (800ms from ch2) (800ms from ch3) ... (800ms from ch8) ]
Then we can abtain 1800 feature_vectors . you can do "moving average filtered and decimated to 20Hz" before concatenate ,and the feature_vector's dimension will be more smaller (800/20 = 4 , 4*8 = 32).For SWLDA ,we can say that there are 1800 samples for train a model .

For second question , I think you will get answer from my answer for your first question .

For third question , I am sorry ,I didn't clear what's your mean .

I suggest you could read the book --- "A Practical Guide to Brain-Computer Interfacing with BCI2000" ,which will help a lot !


Thanks ,
Sandra .

Hiba_AZIZ
Posts: 18
Joined: 26 Feb 2013, 05:34

Re: bci2000 for p300 classification

Post by Hiba_AZIZ » 30 Jan 2015, 11:49

thank you so much boulay and sandra for your response, it's highlighting many things to me

okay, I will try to explain what I'm trying to do
I downloaded 2nd Wadsworth BCI Dataset (P300 Evoked Potentials) Data Acquired Using BCI2000 P3 Speller Paradigm ;BCI Classification Contest November 2002
I'm trying to worked on in order to classify it and predict the correct letter.
I do exactly what were you explain to me above in order to extract features vector
now, the next step is to training the dataset and classify it in order to predict the correct letter.
can please explain this step with more detail because I took a course in machine learning in the past just a theory but I neverever use a real data to process or applicate what I took.
and this is my real problem now ; please help me because should be find a result after the end of the next week; and I'm very late.
again many thank's
regards

Hiba_AZIZ
Posts: 18
Joined: 26 Feb 2013, 05:34

Re: bci2000 for p300 classification

Post by Hiba_AZIZ » 01 Feb 2015, 09:15

Hi;
I arrived to classify my training data with an accuracy of 100 % using LDA algorithm.
but when I want to classify the test data it isn't work well

I utilize StimulusType in order to recognize a Target epochs from NonTarget epochs, after that I utilise a stimulusdata content 12 segments in order to predict the desire line and column to recognize the desire letter.
but in my test data the StimulusType not exist and the result of classification not correct at all when I used a test data. any explanation please, why this result!!?
my question is:
in test data should I extract all the segments content a Target and NonTarget epoch in order with a stimulus data( ontent 12 epochs) for prediction of desire letter or just stimulus(12 segments) data without all the segment( 180 segments Target and NonTarget epoch)

anyone explain to me a defference between a classification in training data and test data in P300 classification and their procedure


thank's

Regards

Locked

Who is online

Users browsing this forum: No registered users and 5 guests