eeyhsong / EEG-Conformer

EEG Transformer 2.0. i. Convolutional Transformer for EEG Decoding. ii. Novel visualization - Class Activation Topography.
GNU General Public License v3.0
389 stars 55 forks source link

Dataset used in conformer.py #8

Open Yaqian-Xu opened 1 year ago

Yaqian-Xu commented 1 year ago

First, thank you for open-source your code. And I'm wondering where the .mat data you used in conformer.py, to be specific, line #278, #294 is from. It seems neither the data format of BCI_competition_IV2a/IV2b, which is .gdf, nor the data format of SEED. These are three datasets claimed in README.md. Thank you for clarifying.

rmib200 commented 1 year ago

I'm having the same issue. Seems like the way the data was formatted in a very particular way. And a lot of the preprocessing was particular for that use case. If you could share a sample file would be very helpful, please. @eeyhsong

eeyhsong commented 1 year ago

@Yaqian-Xu @rmib200 Sorry for the late reply!

Thanks for your interest!

caikw0602 commented 1 year ago

Would you please share the shape of data label with us? Thank you for your sharing!

valentindjangone commented 1 year ago

I'm interested as well in the shape of the data label, it seems like it's not a 1D array. Thank you for your great contribution and for helping us out. @eeyhsong

@caikw0602 I'm mentioning you in case you found the right shape ?

eeyhsong commented 1 year ago

hello @caikw0602, @valentindjangone Sorry for the late reply. It is just the 1D array.

toncho11 commented 1 year ago

Hi @eeyhsong

If I use the mat files from http://bnci-horizon-2020.eu/database/data-sets/001-2014/, it is not clear where are the labels for each trial. If I use you script getData.m it requires a folder called "true_labels". Where is this folder?

eeyhsong commented 1 year ago

Hello @toncho11, You can download the results files here https://www.bbci.de/competition/iv/results/ . 🤝🤝

YamengGu commented 4 months ago

Cannot run sload function successfully. Here is the error: SLOAD: mexSLOAD('C:\Users\yameng.gu\BCI-eeg-date\CNN\data2\A01T.gdf') failed - the slower M-function is used. Unrecognized function or variable 'H'.

Error in sload (line 1232) if strcmp(H.TYPE,'CNT');

Error in getData (line 14) [s, HDR] = sload(dir_1);

Wonder if you can upload an example input data for Conformer python file. So i can create my own. Thanks

xuxiran commented 1 month ago

Cannot run sload function successfully. Here is the error: SLOAD: mexSLOAD('C:\Users\yameng.gu\BCI-eeg-date\CNN\data2\A01T.gdf') failed - the slower M-function is used. Unrecognized function or variable 'H'.

Error in sload (line 1232) if strcmp(H.TYPE,'CNT');

Error in getData (line 14) [s, HDR] = sload(dir_1);

Wonder if you can upload an example input data for Conformer python file. So i can create my own. Thanks

Today I found a problem similar to yours. After debugging, I found that this is mainly due to a function name conflict. Here's how I solved the problem: First, comment out “datavec” in "sload.m" (which is used to obtain experimental time and may cause errors in specific programs, but does not affect the experiment itself). image

Then, before filtering (line 69), add "rmpath(genpath("./biosig4octmat\"))". This is because the files in this folder are no longer needed at this point.

image

In summary, the function error is caused by a conflict with a file of the same name. If you have downloaded a different version of biosig, you just need to debug in "sload.m" and you will catch some errors. I hope this will help you and other paper meeting this problem. After all, it is a pity to lose the opportunity to learn EEG Conformer due to the inability to preprocess.

eeyhsong commented 1 month ago

Thanks for your kindness @xuxiran 😉 The input to the net is like (batch, 1, channel, samples), as which we could arrange the data.