vlawhern / arl-eegmodels

This is the Army Research Laboratory (ARL) EEGModels Project: A Collection of Convolutional Neural Network (CNN) models for EEG signal classification, using Keras and Tensorflow
Other
1.12k stars 280 forks source link

How to define the dataset size as the input to EEGNet model #40

Open AminHosseiniNejad opened 2 years ago

AminHosseiniNejad commented 2 years ago

Hello, I am working on a course project using 4 channels of EEG signals and 256 as sampling rate for BCI application of binary image classification. My training dataset size is 1004256 and my label array is of 1001 size, in which I trimmed 100 epochs of signals in each an image was shown to the user. I can see that the input size is considered as channelssamples in your codes, but I don not know how to reshape the size of the training and test data sets to make compatible with your codes, so I would appreciate it if you could direct me on that. Thank you and looking forward to hearing back from you soon. Regards Amin

okbalefthanded commented 2 years ago

the model assumes the input shape to follow the (Channels x Samples x 1) format, assuming the training size to be you should reshape your data to (N x Channels x Samples x 1) format.

AminHosseiniNejad commented 2 years ago

Thank you. I have been tuning the network hyperparameters to get good results, but every time the loss and accuracy plots during both training and validation are so fluctuating, like in the attached image, and my accuracy scores for both training and validation are almost 0.5 almost all the time. My device sampling rate is 256 Hz, so I increased both the kernel length and the averaging size in both the blocks 1 and 2 in EEGNet network by twice. I have been running the training process with a wide variety of number of epochs, from 1000 t0 20000, different batch sizes, and different learning rates, but as I said, every time I get almost the same unrealistic results. Any advices or ideas would be appreciated. Regards Amin

output n

okbalefthanded commented 2 years ago

Make sure to collect good quality data before any training, although EEGNet is quite robust, It can't work well on too much noisy data. In the preprocessing stage filter the unnecessary frequencies and normalize the data It will help the network.

What type of experiments are you working on ?

AminHosseiniNejad commented 2 years ago

Thank you for you time answering to my questions. I am using a Muse s headband, having 2 sensors on forehead and 2 sensors behind ears, to build a BCI application for binary image classification as my university course project. I have been trying different ML techniques, but no acceptable success yet. In addition to outliers removal and data normalization, what preprocessing steps would you recommend me to do? Regards Amin