Feature extraction in MI-CSP
Feature extraction in MI-CSP
Hello
I have some questions about scenarios mi-csp-2-train-CSP.xml & mi-csp-3-classifier-trainer.xml
After running them I received the following messages (see image).
1) Data covariance dims are [19x19]. What does this mean and why is it [19x19]?
2) cond1 = 20 chunks, sized 500 ->10000 samples.
cond2 = 20 chunks, sized 500 ->10000 samples. Ηere I guess it's 20 chunks because it's 20 trials per class, right? Also sized 500 ->10000 samples. What does this mean and why is it sized 500 ->10000 samples. Means 500 bytes for 10000 samples? Why is 10000 samples?
3) Received train stimulation. Data dim is [2160x6]. What does this mean and why is it [2160x6]?
4) 1080 feature vectors for input 1.
1080 feature vectors for input 2. Why 1080 feature vectors? What is into the feature vectors ? How many features are extracted for each trial?
I have some questions about scenarios mi-csp-2-train-CSP.xml & mi-csp-3-classifier-trainer.xml
After running them I received the following messages (see image).
1) Data covariance dims are [19x19]. What does this mean and why is it [19x19]?
2) cond1 = 20 chunks, sized 500 ->10000 samples.
cond2 = 20 chunks, sized 500 ->10000 samples. Ηere I guess it's 20 chunks because it's 20 trials per class, right? Also sized 500 ->10000 samples. What does this mean and why is it sized 500 ->10000 samples. Means 500 bytes for 10000 samples? Why is 10000 samples?
3) Received train stimulation. Data dim is [2160x6]. What does this mean and why is it [2160x6]?
4) 1080 feature vectors for input 1.
1080 feature vectors for input 2. Why 1080 feature vectors? What is into the feature vectors ? How many features are extracted for each trial?
Re: Feature extraction in MI-CSP
Hi,
1)19x19 is bevause you have 19 features (channels)
2) 20 Chunks is because 20 trials with a size of 500 so you have 10000 sample (500*20)
3) You have 2160 features vector (1080 and 1080) with 6 features. (the CSP have reduce the feature number from your signal in fact 19 to 6)
4) Because it's the number of feature vector.^^
Thibaut
1)19x19 is bevause you have 19 features (channels)
2) 20 Chunks is because 20 trials with a size of 500 so you have 10000 sample (500*20)
3) You have 2160 features vector (1080 and 1080) with 6 features. (the CSP have reduce the feature number from your signal in fact 19 to 6)
4) Because it's the number of feature vector.^^
Thibaut
Re: Feature extraction in MI-CSP
Dear @Thibaut thanks for your response.
Why every trial size is 500? And what type of measurement is it? 500 bytes?
I still do not understand why 1080 feature vectors. Can I change the number of feature vectors? How? and Why is a bad or good idea?
Thanks.
Why every trial size is 500? And what type of measurement is it? 500 bytes?
I still do not understand why 1080 feature vectors. Can I change the number of feature vectors? How? and Why is a bad or good idea?
Thanks.
Re: Feature extraction in MI-CSP
HI,
1) 500 Samples (Depends of your epoch size).
2) It's the base of classification, The dataset change all. Too much, not enough, bad input.....
Thibaut
1) 500 Samples (Depends of your epoch size).
2) It's the base of classification, The dataset change all. Too much, not enough, bad input.....
Thibaut
Re: Feature extraction in MI-CSP
Hi,
To fill in what Thibaut said, basically, the numbers you see depend on the number of channels, the sampling frequency at which data is acquired, and also the epoching boxes (time based and stimulation based).
So the first thing to understand the values you're seeing: What is your acquisition sampling frequency ?
And then, did you change any of the epoching boxes settings (in the CSP trainer scenario and the classifier trainer scenario) ? If yes, could you detail those changes ?
Thanks,
Thomas
To fill in what Thibaut said, basically, the numbers you see depend on the number of channels, the sampling frequency at which data is acquired, and also the epoching boxes (time based and stimulation based).
So the first thing to understand the values you're seeing: What is your acquisition sampling frequency ?
And then, did you change any of the epoching boxes settings (in the CSP trainer scenario and the classifier trainer scenario) ? If yes, could you detail those changes ?
Thanks,
Thomas
Re: Feature extraction in MI-CSP
Hello Thomas thanks for your response. I appreciate a lot your help.
OpenBCI device
Sampling rate = 125 Hz
Sample count per sent block = 32
I didn't change any settings on the boxes.
Stimulation based epoching
epoch duration = 4sec
epoch offset = 0.5 sec
Time based epoching
epoch 1 duration = 1 sec
epoch 1 intervals = 0.0625 sec
OpenBCI device
Sampling rate = 125 Hz
Sample count per sent block = 32
I didn't change any settings on the boxes.
Stimulation based epoching
epoch duration = 4sec
epoch offset = 0.5 sec
Time based epoching
epoch 1 duration = 1 sec
epoch 1 intervals = 0.0625 sec
Re: Feature extraction in MI-CSP
Thanks for the details.
The value 500 is an amount of samples per chunk.
The stimulation based epoching generates a 4 seconds epoch. So for that chunk of 4 seconds: 4 * 125 = 500 samples.
Now the 1080 (per condition) or 2160 altogether comes from the combination of the Stim based epoching followed by the time based epoching.
The Stim based epoching outputs chunks of 4 seconds (20 for each side), and each of them goes through the time based epoching.
Each chunk is therefore re-epoched (with overlap since the interval between epochs is 0.0625 second), generating a total of 1080 epochs that are processed and aggregated.
Hope this helps clarifying where the values come from.
Cheers,
Thomas
The value 500 is an amount of samples per chunk.
The stimulation based epoching generates a 4 seconds epoch. So for that chunk of 4 seconds: 4 * 125 = 500 samples.
Now the 1080 (per condition) or 2160 altogether comes from the combination of the Stim based epoching followed by the time based epoching.
The Stim based epoching outputs chunks of 4 seconds (20 for each side), and each of them goes through the time based epoching.
Each chunk is therefore re-epoched (with overlap since the interval between epochs is 0.0625 second), generating a total of 1080 epochs that are processed and aggregated.
Hope this helps clarifying where the values come from.
Cheers,
Thomas
Re: Feature extraction in MI-CSP
Thank you very much Thomas for your explanation.
I fully understand the 1st part.
Unfortunately, I don't fully understand where 1080 examples comes from.
According to what you have said:
What am I calculating wrong?
Finally how many features are extracted for each trial?
I fully understand the 1st part.
Unfortunately, I don't fully understand where 1080 examples comes from.
According to what you have said:
If I calculate 4 / 0.0625 = 64 epochs per trial. 64 epochs * 20 trials = 1280 and not 1080.Now the 1080 (per condition) or 2160 altogether comes from the combination of the Stim based epoching followed by the time based epoching.
The Stim based epoching outputs chunks of 4 seconds (20 for each side), and each of them goes through the time based epoching.
Each chunk is therefore re-epoched (with overlap since the interval between epochs is 0.0625 second), generating a total of 1080 epochs that are processed and aggregated.
What am I calculating wrong?
Finally how many features are extracted for each trial?
Re: Feature extraction in MI-CSP
Hi,
Sorry I didn't go into details, and actually had not done it for your example.
For a chunk of 4 seconds, the time based epoching will generate 49 epochs of 1 second, not 64 as the last epoch is starting at 3.0s and finishing at 4.0s.
The calculation is more like : 3 / 0.0625 = 48 + 1(the epoch between the 3rd and 4th seconds) = 49.
To answer your last question, this is the number of features extracted for each trial.
Then, as you did, multiplied by the number of trial should give you the number of features generated. However I realise that 49 * 20 is only 980, and not the 1080 you are displaying. These calculation are as expected in the exemple scenario and data provided with OpenViBE. I am not sure what makes it different with your scenario/data. Are you reusing the same data for the CSP trainer and the Classifier trainer ?
Thanks,
Thomas
Sorry I didn't go into details, and actually had not done it for your example.
For a chunk of 4 seconds, the time based epoching will generate 49 epochs of 1 second, not 64 as the last epoch is starting at 3.0s and finishing at 4.0s.
The calculation is more like : 3 / 0.0625 = 48 + 1(the epoch between the 3rd and 4th seconds) = 49.
To answer your last question, this is the number of features extracted for each trial.
Then, as you did, multiplied by the number of trial should give you the number of features generated. However I realise that 49 * 20 is only 980, and not the 1080 you are displaying. These calculation are as expected in the exemple scenario and data provided with OpenViBE. I am not sure what makes it different with your scenario/data. Are you reusing the same data for the CSP trainer and the Classifier trainer ?
Thanks,
Thomas
Re: Feature extraction in MI-CSP
Hi Thomas,
Yes, I use the same data for the CSP trainer and the Classifier trainer.
Unfortunately, I can not understand why this happens.
Yes, I use the same data for the CSP trainer and the Classifier trainer.
Unfortunately, I can not understand why this happens.
Re: Feature extraction in MI-CSP
Following on from the previous discussion, Thibaut stated the following:
"3) You have 2160 features vector (1080 and 1080) with 6 features. (the CSP have reduced the feature number from your signal in fact 19 to 6)"
a) Why did CSP reduce the features from 19 to 6 and not more or less than 6?
b) What are these 6 features?
c) Are these features related at all to the ERD/ERS mentioned by Pfurtscheller?
Pfurtscheller, G., and Aranibar, A. (1979). Evaluation of event-related desynchronization (ERD) preceding and following voluntary self-paced movement. Electroencephalogr. Clin. Neurophysiol. 46, 138–146.
doi: 10.1016/0013-4694(79)90063-4
https://www.sciencedirect.com/science/a ... via%3Dihub
"3) You have 2160 features vector (1080 and 1080) with 6 features. (the CSP have reduced the feature number from your signal in fact 19 to 6)"
a) Why did CSP reduce the features from 19 to 6 and not more or less than 6?
b) What are these 6 features?
c) Are these features related at all to the ERD/ERS mentioned by Pfurtscheller?
Pfurtscheller, G., and Aranibar, A. (1979). Evaluation of event-related desynchronization (ERD) preceding and following voluntary self-paced movement. Electroencephalogr. Clin. Neurophysiol. 46, 138–146.
doi: 10.1016/0013-4694(79)90063-4
https://www.sciencedirect.com/science/a ... via%3Dihub
Re: Feature extraction in MI-CSP
Hi mhadji05,
Each channel is a feature, but the CSP Spatial Filter performs filtering and reduces this amount of channels and therefore the amount of features.
The CSP Spatial Filter Trainer box has its parameter "filter dimension" set to 6. Its model is saved in the configuration file (also specified as a parameter of the box) that is then used by the CSP Spatial Filter box in the next scenario.
It is this value of 6 that sets the amount of output channels from the CSP Spatial Filter box.
And for your last point, I don't think this is quite the same no, since the features from the CSP Spatial Filter are modelled by the box from channels, and do not correspond to ERD/ERS.
Hope this helps a little.
Cheers,
Thomas
Each channel is a feature, but the CSP Spatial Filter performs filtering and reduces this amount of channels and therefore the amount of features.
The CSP Spatial Filter Trainer box has its parameter "filter dimension" set to 6. Its model is saved in the configuration file (also specified as a parameter of the box) that is then used by the CSP Spatial Filter box in the next scenario.
It is this value of 6 that sets the amount of output channels from the CSP Spatial Filter box.
And for your last point, I don't think this is quite the same no, since the features from the CSP Spatial Filter are modelled by the box from channels, and do not correspond to ERD/ERS.
Hope this helps a little.
Cheers,
Thomas