lu-wo / DETRtime

DETRtime, a framework for time-series segmentation
MIT License
19 stars 0 forks source link

Hello, I'd like to ask you how you process datasets. Would it be possible to provide a portion of your processed dataset? #3

Closed Onlyknight closed 1 year ago

lu-wo commented 1 year ago

Hi! The data is available here. I also added the link to the data to the README. Thanks for pointing this out!

Let me know if there are any further issues!

Onlyknight commented 1 year ago

Your prompt reply and willingness to share your data with me are greatly appreciated. Thank you very much for your kindness and generosity.

Onlyknight commented 1 year ago

Hi,I downloaded your dataset and noticed that its shape is [N, 500, 129]. I understand that the frequency is 500Hz, but I'm confused about why there are 129 channels when your paper mentions using a 128-channel EEG Geodesic Hydrocel system.

lu-wo commented 1 year ago

That's a good question that needs clarification: during preprocessing, we compute the average of the signal at all 128 physical EEG electrodes and subtract it from the EEG signal at every electrode for every time point. This average of the 128 channels is then added as 129-th channel for every time point.

Let me know if you have any further questions!

Onlyknight commented 1 year ago

Hello,I want to konw what's your method of solving the probelm that the train set without any object on it. Thanks

lu-wo commented 1 year ago

Hi @Onlyknight ! Can you specify in more detail what your question is? I understand it as how we handle the case that during training, there might be no object in a sample.

If this is indeed your question: for the segmentation tasks we consider (eye events and sleep stages), this case does not occur, since there is always some eye event (fixation, saccade, blink) present (similar in the domain of sleep staging). The architecture can be generalized easily to have a "no object" class (like the original DETR for vision) in case you are processing time series data where "no object" is a valid case.

Onlyknight commented 1 year ago

Hi,@lu-wo ,thank you for your answer. Yet,when I try to use the DETRTime for my training task on my dataset, I found that the train set must have object in order to finish the HungarianMatcher. I hope to train the DETRTime on my dataset in order to detect the sleep apnea event. But most samples of my train samples without any object , I mean that they are negative samples. Now, I try to solve the problem with a method that I regard the normal time as a object (like the fixation in your eye event).But, I want to know how to set the biased_weights and empty_weight, can you give some guiding opinions? Thanks.

lu-wo commented 1 year ago

Hi @Onlyknight! It seems like you want to train a segmentation task with binary labels (sleep apnea event vs. none). The easiest way to do this, is simply assigning "no event" class 0, and "sleep apnea" class 1.

Let me know if you need further advice!

Onlyknight commented 1 year ago

Hello, I would like to ask, what is the basis for setting the loss weights and sampling weights in your network?

lu-wo commented 1 year ago

Loss weights: The loss weights are taken from the original DETR implementation and can be adapted depending on the convergence of a particular loss component during training.

Sampling weights: You can set them to upsample minority classes. For example, in our ocular event datasets, fixation is the (temporal) majority class, while saccades and especially blinks occur less often. By setting the sampling weights, one can guarantee that the model is being updated oftentimes on the minority classes as well.

Let me know if you have further questions.