yasa icon indicating copy to clipboard operation
yasa copied to clipboard

Extra eeg channels in automatic sleep staging

Open zixiao-yin opened this issue 2 years ago • 9 comments

Fantastic work! I was wondering if it's possible to feed extra EEG channels (e.g., frontal and occipital channels) to yasa.SleepStaging. Will this further improve the staging accuracy? I read the preprint paper but only central EEG is mentioned. Thanks!

zixiao-yin avatar Oct 04 '21 12:10 zixiao-yin

Hi @zixiao-yin, thank you :-)

For now only a single EEG channel is supported, preferentially C4-M1 or C3-M2. Adding support for multiple EEG channels in the core algorithm should be pretty straightforward, however we'll also need to retrain the classifier (see https://github.com/raphaelvallat/yasa_classifier). I don't think this will be implemented in the near future.

Thanks, Raphael

raphaelvallat avatar Oct 04 '21 20:10 raphaelvallat

Got it, Thanks Raphael!

zixiao-yin avatar Oct 05 '21 01:10 zixiao-yin

Hi Raphael, Sorry to disturb. One more stupid question. Is yasa also supportable in detecting k-complexes and vertex sharp waves? Or I should switch to other tools to achieve this aim?

Thank you very much! Zixiao

zixiao-yin avatar Oct 07 '21 04:10 zixiao-yin

Hi @zixiao-yin,

You should be able to detect k-complexes with the yasa.sw_detect function. Make sure that you limit the detection to N2 sleep. Detection of sharp waves is not implemented.

Thanks! Raphael

raphaelvallat avatar Oct 07 '21 19:10 raphaelvallat

@raphaelvallat Just adding some weight to this issue. I think it will be quite useful to have the sleep stage in this way.

I was thinking we may also generate two different hypnograms (using two different channels, one at a time of course given the current limitation) and combine the hypnograms on base of this probability index to yield in one final hypnogram? What do you think?

umair-hassan avatar Jun 22 '22 06:06 umair-hassan

Thanks @umair-hassan — I think this is a great idea. It will be better than having to re-train a separate classifier for 2, 3, ... n EEG channels, both in terms of ease-of-implementation, maintenance of the algorithm and maybe even accuracy.

This should be pretty straightforward to do outside of YASA with the current implementation btw, but we could automatize this "majority voting" step within the SleepStaging class.

raphaelvallat avatar Jun 24 '22 17:06 raphaelvallat

@raphaelvallat Thankyou for your assertion. I would write a pull request for this soon if no one has been assigned this issue yet then.

umair-hassan avatar Jun 27 '22 14:06 umair-hassan

@raphaelvallat has this been completed? Otherwise I have time now to work on it!

umair-hassan avatar May 20 '23 13:05 umair-hassan

Hi @umair-hassan,

Please do feel free to work on a PR. I appreciate it!

Thanks Raphael

raphaelvallat avatar May 22 '23 15:05 raphaelvallat