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

EEG Classification #30

Open
nehagour opened this issue Dec 21, 2022 · 2 comments
Open

EEG Classification #30

nehagour opened this issue Dec 21, 2022 · 2 comments

Comments

@nehagour
Copy link

I am implementing your paper for EEG classification. The EEG data is of dimension 19x120000 where 19 is the number of electrodes and 120000 are the time points. I would like to understand how this dataset can be added to the code for the implementation.

@gzerveas
Copy link
Owner

gzerveas commented Jan 7, 2023

Hi,

you would have to add a new data class in datasets/data.py. You can see other examples for data classes in that file, or the template in example_data_class.py.

The data class sets up one or more pandas DataFrame(s) containing all data, indexed by example IDs. These dataframes are accessed by the Pytorch Dataset subclasses in dataset.py.

In your case, the 120000 time steps are far too many for a single sample. For this reason, you should try some or a combination of the following: (a) downsampling/low-pass filtering the input signal, if this temporal resolution is not really necessary, (b) windowing the input signal, i.e. dividing it in multiple (possibly overlapping) windows of a fixed length L, where L should be up to something like ~512 samples. This should work well for pre-training.
If you really need predictions to take into account the whole sample of 120000 time steps for your downstream application, then you can (c) first apply a 1D-convolutional layer at the input with a stride > 1, such that the model learns to perform the temporal downsampling itself.

@nehagour
Copy link
Author

nehagour commented Jan 10, 2023

Thank you for the suggestions. In case of windowing, the final decision at testing stage will be for each window i.e. a single patient can have different decision for different windows??

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