pbashivan / EEGLearn

A set of functions for supervised feature learning/classification of mental states from EEG based on "EEG images" idea.
GNU General Public License v2.0
715 stars 221 forks source link

Applying EEGLearn on EEG Motor Movement/Imagery Dataset #44

Closed MohammadJavadD closed 4 years ago

MohammadJavadD commented 5 years ago

I am trying to use the network to classify Motor Movement but this network works very well on the author's example data but doesn't work on new data.

Actually, I am using the "EEG Motor Movement/Imagery Dataset" (https://www.physionet.org/content/eegmmidb/1.0.0/) and it's a popular dataset, other people arrived at ~80 % accuracy and I got this accuracy with brain decode (CNN - https://tntlfreiburg.github.io/braindecode/). Now, I am trying to classify this data using EEGLearn (RNN-CNN https://github.com/YangWangsky/tf_EEGLearn) but I'm still on the chance level. Do you have any suggestions?

pbashivan commented 5 years ago

I would suggest to look at the input data first. Can you say a bit about how you're transforming raw EEG to images? time-windows, power estimation, normalization, generating images ...

As far as I know motor imagery is reflected in freq domain activity so the images should pick those signals. You can also use a simpler decoding method to classify from the images and see whether that would works.

MohammadJavadD commented 5 years ago

I would suggest to look at the input data first. Can you say a bit about how you're transforming raw EEG to images? time-windows, power estimation, normalization, generating images ...

As far as I know motor imagery is reflected in freq domain activity so the images should pick those signals. You can also use a simpler decoding method to classify from the images and see whether that would works.

Thanks for the fast response. Sure, I've used STFT and z score normalization. Here is my Matlab code:

Import_EEG_MI_github_example.zip

Also, I've tried different frequency bands like gamma! As a suggestion, It would be nice if you add the feature extraction code to the repository, because of in the issues I saw more other question about this.

pbashivan commented 5 years ago

What you are doing sounds reasonable. Have you tried a simple classifier on the freq features? e.g. linear SVC

MohammadJavadD commented 5 years ago

What you are doing sounds reasonable. Have you tried a simple classifier on the freq features? e.g. linear SVC

I tried SVC on the provided feature matrix on this repository and my data's feature matrix and the accuracies by using leave one subject out are: Sample dataset= 83 +- 16 MI dataset= 50+-04

So it sounds the problem is on the feature extraction part. How could I manage the issue on that part?

MohammadJavadD commented 5 years ago

Is the sample data (Bashivan et al., 2014) publicly available? This could be useful for debugging the feauture extraction part.

pbashivan commented 5 years ago

Whether the freq domain features work on not depends on the task. As I said earlier it is expected that these features would be predictive of the motor-imagery condition (though I'm not an expert in this domain). My first guess would be to see if unnormalized data or different normalizations could alleviate.

Regarding the sample data -- the raw EEG is not publicly available.

MohammadJavadD commented 4 years ago

Here I have visualized the sample data from the article: https://github.com/MohammadJavadD/TSNE_EEG The time-frequency features that used in this repository shows a good difference between classes even in 2D and 3D space,

pbashivan commented 4 years ago

Have you tried the same on the motor imagery dataset? Does it look similar?

MohammadJavadD commented 4 years ago

Have you tried the same on the motor imagery dataset? Does it look similar?

Yes, I have tried but two classes on the MI dataset are mixed.

201540513257 commented 4 years ago

I read one of your article , titled “learning representation from EEG with deep recurrent-convolutional neural network” , it’s a very well written article and which makes a really positive contribution to my research work. And thank you for putting the implementation of the paper on GitHub, i used the data you provided to run the version of theano you posted on GitHub on my computer. Unfortunately, there are some gaps between my results and those in your paper. How did you achieve 88.9% accuracy for the first subject, it's a perfect job . Do you have any suggestions for my problems, or do you need to configure something else when you run the program

pbashivan commented 4 years ago

Some of the subjects had more variation when using different random seeds and different image-conversion settings. Unfortunately I haven't tried to replicate the results for sometime now and some parts of the code have changed a bit in the meantime. My guess is that one or a combination of these might have caused the discrepancies.

201540513257 commented 4 years ago

Thank you very much for your quick reply. I had some trouble when I extracted 64 sequence fragments. Could you provide the program for extracting the frequency domain characteristics of brainwave signals in this paper. Thanks!!!!

------------------ 原始邮件 ------------------ 发件人: "pbashivan/EEGLearn" <notifications@github.com>; 发送时间: 2020年8月24日(星期一) 凌晨3:53 收件人: "pbashivan/EEGLearn"<EEGLearn@noreply.github.com>; 抄送: "Utopia"<3070059455@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [pbashivan/EEGLearn] Applying EEGLearn on EEG Motor Movement/Imagery Dataset (#44)

Closed #44.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.