yasa icon indicating copy to clipboard operation
yasa copied to clipboard

Bad channel detection

Open Pierre-Bartet opened this issue 2 years ago • 4 comments

Nice job and very honest comparison to other models in the article. Do you plan to implement some bad channel detection ? Unproperly connected or highly noisy leads are currently not identified by the artifact detection (same for pyprep and MNE).

Pierre-Bartet avatar Nov 03 '21 10:11 Pierre-Bartet

Thank you @Pierre-Bartet, appreciate it! I agree that it would be a nice feature, i.e. detecting disconnected / flat or very noisy channels, not only for sleep staging but as a general preprocessing function in YASA (e.g. yasa.detect_bad_channels). Do you know of existing algorithms work well and that we could re-implement in YASA? Or should we design something from scratch?

raphaelvallat avatar Nov 03 '21 15:11 raphaelvallat

For very simple cases (for example flat), MNE or pyprep seems OK, but they can fail on cases that are obvious for human reviewers. Are there some epochs labeled as "bad EEG signal" in the different training datasets you used for the sleep stage classification? They could be used to train some simple models.

Pierre-Bartet avatar Nov 03 '21 15:11 Pierre-Bartet

Not epochs, but we do have some markers of overall EEG signal quality (e.g. https://sleepdata.org/datasets/mesa/variables/quo2m15). However, I think I'd prefer to use a more heuristic approach for this one and stay away from ML model if possible.

raphaelvallat avatar Nov 04 '21 16:11 raphaelvallat

Not epochs, but we do have some markers of overall EEG signal quality

Ok, it would have been really helpful at least to evaluate the model performances, whether it be a ML model or a heuristic approach. I think a problem is that clinical study data is often much better than real world data, because bad signals are often immediately manually rejected.

However, I think I'd prefer to use a more heuristic approach for this one and stay away from ML model if possible.

Whatever give the best and most robust performances is the best, but I agree that a good priority order is:

  1. No need for a model at all, for example because the hardware makes it physically impossible to have noise or immediately reject it
  2. Simple hard coded rules, which physically / physiologically make sense and are expected to be robust
  3. Simple models such as regressions or random forests
  4. Complex models such as neural networks

Pierre-Bartet avatar Nov 04 '21 16:11 Pierre-Bartet