AutoSleepScorer icon indicating copy to clipboard operation
AutoSleepScorer copied to clipboard

How to run the model with only eeg data in edf file?

Open yiboliu94 opened this issue 6 years ago • 4 comments

Hi,

It's really a good project(not flattering, it's really fantastic). In your thesis, you compared the accuracy of different input channel selection such as eeg, eeg+emg, eeg+eog, and all. But the coed itself requires all channels? I wonder how can I run the AutoSleepScorer with only eeg channel?

Sincerely Liu

yiboliu94 avatar Aug 09 '18 15:08 yiboliu94

Hi Liu, Did you try like this ?

  • create a SleepData object with EEG only (here Fpz & Cz): from sleepscorer import Scorer, SleepData file = SleepData('yourEEGfile.edf', start = xxx, stop = yyy, channels={'EEG':'EEG Fpz-Cz'}, preload=False)
  • Create and run Scorer scorer = Scorer([file], hypnograms=True, demo=True) scorer.run() tools.show_sample_hypnogram('sample-psg.groundtruth.csv', start=960, stop=1800)

PaulMuadDib avatar Sep 09 '18 09:09 PaulMuadDib

Thanks!

The (preliminary) pre-trained weights that I supplied need all three channels to work correctly. For usage of only one channel (EEG), you would need to re-train a network. It is not possible to leave one channel empty, as the neural network expects all three channels being present. This decision was made as all channels turned out to give the highest accuracy.

@PaulMuadDib With the example you provided, it will try to infere the EMG/EOG channel automatically from the edfx file (if I remember correctly). A single-channel mode is not yet implemented (also as the weights provided require three input channels)

skjerns avatar Sep 12 '18 17:09 skjerns

@skjerns do you think that such a network could learn (valuable representations of the EEG signals) while training with different subsets of electrodes & injecting null (or a low variance white noise / null information) signals in the unused inputs ? Or we must fully rethink the network architecture / principles to enable it to train on different sleep databases with different electrode montages ?

PaulMuadDib avatar Sep 14 '18 16:09 PaulMuadDib

It is possible to just remove the channels not used. However, it is necessary to re-train the network. Although training one network to be able to use a variable subset of electrodes will be possible, I'd say it is easier to train separate networks for different channel combinations.

skjerns avatar Sep 14 '18 16:09 skjerns