Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fCWT vs STFT in CNN-based EEG emotion recognition #41

Open
fastlib opened this issue Jul 6, 2023 · 6 comments
Open

fCWT vs STFT in CNN-based EEG emotion recognition #41

fastlib opened this issue Jul 6, 2023 · 6 comments

Comments

@fastlib
Copy link
Owner

fastlib commented Jul 6, 2023

          Understood. Thanks a lot for the clarification. Furthermore, I have a few more confusion that I would also like to ask for your expert opinions, 

Currently, I'm trying to build CNN-based eeg emotion recognition model with CWT, STFT, and fCWT respectively, and compare the performance of each model with different methods. However, I found that the performance of STFT is better than CWT (the parameters of both methods have been tuned to the highest performance on CNN). Therefore, would like to ask, if it is possible that using STFT on a narrow band frequency signal such as the Alpha band of an eeg signal will provide better performance than CWT ?

Originally posted by @whip123 in #40 (comment)

@fastlib
Copy link
Owner Author

fastlib commented Jul 6, 2023

It is not possible to answer your question without more information. Can you specify model architecture, STFT and fCWT parameters, datasets, frequency range, performances, statistical significance of these tests, etc.

@whip123
Copy link

whip123 commented Jul 6, 2023

The EEG signal that I used is the Alpha band(8-12Hz) of the difference between 2 eeg signals with a sampling frequency of 200Hz (SEED dataset). To have a fair comparison between fCWT and STFT, I have tried to generate the spectrogram with different window lengths (Hanning window) that range from 5 to 13 seconds with 50% overlapping. Coming to fCWT, I have also tried to generate scalograms with different sigma values ( 10, 15, 20 ,25, 30) (Morlet Wavelet) and set the number of frequencies to 480, frequency limits = 0.25 to 20. All the generated scalograms and spectrograms will then be fed into the pre-trained CNN model for training and determining which data set has the highest accuracy. Consequently, I found that spectogram with 11 seconds window length and scalogram with a sigma value of 20 has the highest accuracy. But the model trained with spectrogram has higher accuracy than the model trained with Scalogram

@fastlib
Copy link
Owner Author

fastlib commented Jul 6, 2023

Thank you for the information.

Can you post time-frequency plots of both techniques on a small segment of EEG data?

Additionally, what are the performances and what is their statistical significance? Did you do multiple runs of both models or is this based on one run?

@whip123
Copy link

whip123 commented Jul 7, 2023

Sure, the following are the plots of both techniques

STFT (window length = 11 seconds) (Accuracy = 75%)
image
fCWT (sigma = 20) (Accuracy = 70%)
image

As the available data is very limited. Hence, all these results are based on one run and the accuracy difference between these 2 techniques is around 5%.

@fastlib
Copy link
Owner Author

fastlib commented Jul 7, 2023

Alright, we do see more detail in the fCWT analysis, which is what you would expect. My best guess, is that the difference in classification is because your CNN model overfits on the extra amount of detail the fCWT provides. That in combination with your statement of the limited data, I would advice against using a CNN on raw time-frequency spectra. Use the time-frequency spectrum as input for further feature extraction to reduce dimensionality in the search space. Does that makes sense?

@whip123
Copy link

whip123 commented Jul 8, 2023

Yeah, it makes sense to me. Apart from using the Alpha band eeg, I also have tried using EEG signals with all frequency bands on the same experiment, and the difference between fCWT and STFT is a lot bigger as shown below.

STFT (window length = 0.07 seconds) (Accuracy = 56.7%)
image
fCWT(Sigma = 2 ) (Accuracy =61.7%)
image

Could this suggest that, for this method, the STFT is able to extract the frequency effectively due to the narrow band frequency? However, for wideband frequency, the fCWT is more suitable. Although the resolution of fCWT is higher than the STFT. But the resolution difference between the 2 is not as big as compared to the one with all frequency bands eeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants