Stimulus Presentation and Offline Analysis

Forum for discussion on different user applications
Locked
aloplop
Posts: 41
Joined: 03 Sep 2008, 07:20

Stimulus Presentation and Offline Analysis

Post by aloplop » 08 Oct 2008, 07:46

Hi,

after the message of Mr. Mellinger in [url] http://www.bci2000.org/phpbb/viewtopic.php?t=512, I have tried new experiments with the Stimulus Presentation tutorial.

Well, I used again the 4 channels FC3, CP3, FC4, CP4 referenced to my left ear using the right ear as GND.

I have seen in the "Source Signal" window the artifacts which can affect to the signal, including the alpha rhythm around 10 Hz.

1º) My tests began moving my arms and my feet but, as I had obtained previously, a great peak at around 4-6 Hz appears with an amplitude at around 600 in its spectra. The most important difference was obtained in CP4 with a value of r^2 = 0.4 at around 15 Hz where the maximum value of the spectra was 100.

2º) In another test I closed my eyes and I could see the peak at around 10 Hz with an amplitude around 1500. The gain of the channels was 0.2.

3º) I have tried also to stay totally relaxed in the experiment, but I haven´t obtained any peak at around 10 Hz.

4º) In another test I used as the gain for the channels a value of 1000 (but it doesn´t seem to affect to the value of the spectra). Then I relaxed when the arrow was up and down and imagined the movement of the right hand. The maximum tiny peak at 10 Hz was obtained for the CP3 channel and its value for r^2 = 0.15.

I don´t know if these tiny peaks would be OK to continue for using in the Cursor Feedback Task. As you may have noticed it doesn´t appear such a great peak than the one in the tutorial, where a spectra of 2*10^5 appears.

After following the tutorial I wanted to ask to you:

1º) May the problem be that any parameter can be bad configured?? I used the InitialMuSession parameters and the gUSBamp.prm file. I have only modified the bandpass and the notch filters. Sampling Rate=128Hz, Block Size = 8.

2º) In the last reply of Mr. Mellinger, he mentioned to try to connect more electrodes like C3, C4 C1 etc....If I do that, what would be the spatial filter.?? Would be valid to use none??
We only have 1 gUSBamp so I can connect 16 electrodes at max.


I know it´s hard to read but I think it is an important problem because the peak at around 10 Hz doesn´t appear!!!

Thanks,

Álvaro

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

offline analyses ...

Post by gschalk » 08 Oct 2008, 08:58

Alvaro,

You seem to be on the right track.

Both an r^2 of 0.4 at CP4 at 15 Hz, as well as an r^2 of 0.15 at CP3, seem like a good start and could be candidates for BCI control.

What you need to do is to make sure is 1) that these features are robust and 2) are associated with brain signals and not muscle artifacts. You cannot do either with only little data from very few electrodes.

To make sure this is robust, I suggest to record several runs of one particular experiment, e.g., arms/feet, left/right hand, etc., so that you have at least 50 trials for each condition. To make sure that these are brain and not artifactual signals, you need to record from all 16 channels.

Then, you need to analyze these signals. If you get responses that resemble those in the tutorial, then you can think about using those responses for BCI control.

Gerv

aloplop
Posts: 41
Joined: 03 Sep 2008, 07:20

Offline Analysis

Post by aloplop » 10 Oct 2008, 05:41

Hi,

thanks for your quick responses. You are helping me greatly.

Finally, I connected 16 channels to get more signals. The were (in order):
FC3 C3 CP3 FC1 C1 CP1 FCz Cz CPz FC2 C2 CP2 FC4 C4 CP4 Pz

Also, I didn´t use any filter to get these signals, so I used a full identity matrix in
the filtering tab (because nothing else is indicated in the tutorial).

I made 5 Stimulus Presentation tests for the following tasks:

Moving and imagining arms and feet, Moving and imagining one arm (right or left) and
Moving and imagining both arms up and both feet. 6 complete experiments (almost 50 trials of each task).

My questions are:

1º) In the OfflineAnalysis program, I don´t know whether to trust in the values obtained using
none filter or the CAR filter (I have raw data files).

2º) I want to move the cursor to the left or to the right so I suppose I should search for the highest
value of r^2 obtained and use that frequency and that channel for my purpose.
So, how many channels should I connect at least?? Only one?? Or would be OK to connect that channels
and some which surround it and produce a spatial filtering??

3º) For example, one of my results was a r^2 of 0.12 at 10 Hz when imagining stimulus 1 (left) and 2 (right). Is it OK?

In that experiment, if I select 8, 10 and 12 Hz to create a topo plot the r^2 doesn´t appear well,but if I only select 10 Hz
I obtain a good result.


4º) In the signals of my colleagues and mine happens that when we are relaxed, most times (almost all), the peak for the relaxed condition
is lower than when we imagine something or make a movement. Have you got any possible explanation??

5º) My next part in the project is try some feature extraction methods previously implemented in Matlab but the application will be the same
(cursor task with targets in the left and in the right).

Should I maintain the electrodes obtained in the mu analysis and try each Signal Processing method ??


Thanks for all. Regards,

Álvaro.

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

questions ...

Post by gschalk » 15 Oct 2008, 07:11

Alvaro,

1) In the OfflineAnalysis program, I don´t know whether to trust in the values obtained using none filter or the CAR filter (I have raw data files).
You can "trust" both versions. The purpose of the different filters is to see which filtering can improve the difference (i.e., r^2) between two particular conditions. Usually, the CAR should give better results.

2º) I want to move the cursor to the left or to the right so I suppose I should search for the highest value of r^2 obtained and use that frequency and that channel for my purpose. So, how many channels should I connect at least?? Only one?? Or would be OK to connect that channels and some which surround it and produce a spatial filtering??
You are right. If you get the best result using a CAR (which will usually be the case), then you need to do spatial filtering online, and thus need to connect more channels. A practical version is to use one center electrode and four next-nearest neighbors for the spatial filtering (called the Large Laplacian). There is a Wolpaw/McFarland article on spatial filtering, and see also the description of the Spatial Filter in the BCI2000 documentation.

3º) For example, one of my results was a r^2 of 0.12 at 10 Hz when imagining stimulus 1 (left) and 2 (right). Is it OK?
I assume you mean you get an r^2 of 0.1 when you compare left vs. right. 0.12 is not very high, but if the spatial distribution and the frequency distribution look somewhat similar to those in the BCI2000 mu rhythm tutorial, and you have gotten these results from at least 30 trials left/right each, then you could try using it.

In that experiment, if I select 8, 10 and 12 Hz to create a topo plot the r^2 doesn´t appear well,but if I only select 10 Hz
I obtain a good result.
This does not appear to make sense. The 10 Hz topographies should look the same in both cases. Please double check.

4º) In the signals of my colleagues and mine happens that when we are relaxed, most times (almost all), the peak for the relaxed condition is lower than when we imagine something or make a movement. Have you got any possible explanation??
There is a lot of variability within and across subjects. However, you should be getting larger mu/beta values for the relaxed state typically. If you consistently observe the opposite, there is something wrong.

5º) My next part in the project is try some feature extraction methods previously implemented in Matlab but the application will be the same (cursor task with targets in the left and in the right).

Should I maintain the electrodes obtained in the mu analysis and try each Signal Processing method ??
It does not seem like you are getting consistent results yet. I would try to get to a functioning BCI using the existing methods (which we know work very well if used properly), then collect a substantial body of data to see what performance you can achieve, and only then begin to try to improve the system using your own methods.


Gerv

aloplop
Posts: 41
Joined: 03 Sep 2008, 07:20

Post by aloplop » 15 Oct 2008, 11:37

Hi,

thanks a lot Gerwin. I´ll try to have another look at the data collected the next week.

Regards,

Álvaro

aloplop
Posts: 41
Joined: 03 Sep 2008, 07:20

Tests

Post by aloplop » 21 Oct 2008, 11:40

Hi,

finally I decided to connect these electrodes: CP2 C2 CP4 P2 CPz because I obtained the higher values of r^2 in that area.

After testing the Stimulus presentation with these electrodes I obtained r^2 values around 0.17 in the CP4 and CPz electrodes, so I have decided to use them to move the cursor in the Cursor feedback task.

I used a CAR filtering and the SpatialFilterCAROutput was "3 5" so I have both channels to make tests (CP4 and CPz).

My questions are:

1º) What values of r^2 should I obtain in the cursor task tests to consider them valid ??
{ Using in the offlineAnalysis "states.TargetCode.*states.Feedback ==1 or 2" as conditions and "states.Feedback==1" as trial change condition}

2º) How could I obtain a good measure of performance in cursor feedback task?? I mean, can I use hits and misses as a value for performance?? What else can I use??


Thanks,

Alvaro

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

performance ...

Post by gschalk » 21 Oct 2008, 15:43

Alvaro,

ad 1) it is not so much about how big r^2 values have to be to be valid (although you would probably want them to be >0.1 or so). What you are looking for is to train the person for several sessions (where one session is about 6-8 3 min runs). You would do an offline analysis after each session. Hopefully, you would see a somewhat similar spatial and spectral pattern across the sessions. You would also hope that the r^2 value goes up over time. It may plateau when the task becomes to simple for the subject. Then, you may want to increase the number of targets as described on the wiki.

ad 2) yes, hit percentage and also r^2 are good performance metrics.

Gerv

aloplop
Posts: 41
Joined: 03 Sep 2008, 07:20

Results & doubts

Post by aloplop » 30 Oct 2008, 08:46

Hello again,

as I commented in the last post I have used these electrodes CP2 C2 CP4 P2 CPz for my experiments (they seem as a small Laplacian configuration).

I made some tests using the Stimulus Presentation and these electrodes. I obtained a bit more than 0.1 in r^2 in the electrodes CP4 and Cz so I did some tests with combinations of them in the Cursor Task.

The results weren´t so good but, after 210 trials the best results were (using the CAR filtering taking the channels 3 and 5):

CPz*0.75 and Cp4*0.25 --> 62.86% hits (In the Classifier)
CPz alone --> 59.68% hits

Also, the adaptation for the coefficients in the normalizer was turned on.

As supposed in other messages in the forum, the mu rhythm can vary day by day...so before the sessions I have performed I have done 5 Stimulus Presentations to analyse where is the best value for r^2 and use this value for the AR Filter. I have done 2 sessions for a BinWidth of 1Hz and 3 Hz (similar as the described in the article of the mu-rhythm matched filter...). Using the first combination of electrodes the results have been even worse:

First session:

AR1 (BinWidth=3Hz) --> 58.5 % (After 200 trials of test and 40 of adaptation as suggested in another post).

AR2 (BinWidth = 1Hz) --> 56.5 % (the same conditions as AR1)


Second session:

AR1 and AR2 --> just 53.5% with adaptation in all 200 trials.


So, before going on with bad results my questions are (sorry for all the problems this is giving to me...and to you :? ):

1º) Can you suggest me what could be the problem?? May I use a Sparse Matrix in spite of using the CAR filtering??? May I use a Large Laplacian with another electrode configuration??

2º) I also feel that the adaptation remember your past thoughts and performs in the next trial what you have thought previusly so may is the bufferlength badly used?? I use 6 seconds of buffer and the conditions you incorporate in the BCI2000...

3º) As it is mentioned in the third message I used 15 electrodes to see which ones would fit better for the cursor control. However, centering the control in the CP2 might not be adecuated. I saw yesterday in the web of gtec a configuration for sensoriomotor rhytms based on these electrodes
http://www.gtec.at/content.htm:

F3 F4 T7 C3 Cz C4 T8 and Pz

I am thinking about using them and using also CAR or the Sparse Matrix to create a Laplacian filtering....



I am sorry about all these problems but I don´t know what to do next. Also connecting the cap puts my hair very dirty :lol:.

Thank you very much,

Álvaro López López

aloplop
Posts: 41
Joined: 03 Sep 2008, 07:20

Good results !

Post by aloplop » 05 Nov 2008, 10:57

Hi,

today I tried again the last configuration: CP2 C2 CP4 P2 CPz using the MuFeedback.prm file adapted for 5 channels.

The fact is that I used a smaller EEGcap to make the tests and using a CAR filtering I have obtained an accuracy of 70%
using the AR Filter and 3 Hz as bin width (60 % using 1 Hz bin width).

For the classifier I used the 2 highest peaks obtained in the Stimulus Presentation which where the bins at 9 and 21 Hz in the CP4 channel.

In the next sessions I will continue training to see if this accuracy increases although I think the ball goes too fast for the 2 seconds tests
(I´ve seen that in some articles this is the test realized and I also know how to decrease its speed in the Normalizer).

- I might use the electrode configuration proposed by gTec but I would like to know about a typical Large Laplace configuration
which uses less than 16 channels
to try it in the incoming tests.

Thanks,

Alvaro.

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

mu rhythm ....

Post by gschalk » 05 Nov 2008, 20:28

Alvaro,

You have encouraging results.

I would slow down the cursor to about 3 secs per trial.

You should not be using a small laplacian (i.e., the nearest neighbors as reference). You should be using a Large Laplacian (i.e., the next-nearest neighbors on the 64-channel Sharbrough (Sharbrough, 1991) montage). See the McFarland/Wolpaw Spatial Filtering paper from around 2000.

Gerv

Locked

Who is online

Users browsing this forum: No registered users and 15 guests