mvts_transformer
mvts_transformer copied to clipboard
EEG Classification
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.
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.
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??
我正在实施您的脑电图分类论文。脑电图数据的维度为 19x120000,其中 19 是电极数,120000 是时间点。我想了解如何将此数据集添加到实现代码中。 您好!我也在研究脑电图分类,请问你成功将数据集添加到代码里面了吗?或许我们可以交流一下!