braindecode.preprocessing.RemoveBadChannelsNoLocs#

class braindecode.preprocessing.RemoveBadChannelsNoLocs(*, min_corr=0.45, ignored_quantile=0.1, window_len=2.0, max_broken_time=0.4, linenoise_aware=True)[source]#

Remove EEG channels with problematic data; variant that does not use channel locations. Implemented as in [Kothe2013].

Conceptual image of bad-channel removal.

This is an automated artifact rejection function which ensures that the data contains no channels that record only noise for extended periods of time. The criterion is based on correlation: if a channel is decorrelated from all others (pairwise correlation < a given threshold), excluding a given fraction of most correlated channels, and if this holds on for a sufficiently long fraction of the data set, then the channel is removed.

This method does not require or take into account channel locations; if you do have locations, you may get better results with the RemoveBadChannels preprocessor instead.

Preconditions:

Parameters:
  • min_corr (float) – Minimum correlation between a channel and any other channel (in a short period of time) below which the channel is considered abnormal for that time period. Reasonable range: 0.4 (very lax) to 0.6 (quite aggressive). Default is 0.45.

  • ignored_quantile (float) – Fraction of channels that need to have at least the given min_corr value w.r.t. the channel under consideration. This allows to deal with channels or small groups of channels that measure the same noise source. Reasonable range: 0.05 (rather lax) to 0.2 (tolerates many disconnected/shorted channels).

  • window_len (float) – Length of the windows (in seconds) over which correlation stats are computed. Reasonable values are 1.0 sec (more noisy estimates) to 5.0 sec (more reliable, but can miss brief artifacts). Default is 2.0 sec.

  • max_broken_time (float) – Maximum time (either in seconds or as fraction of the recording) during which a channel is allowed to have artifacts. If a channel exceeds this, it will be removed. Not usually tuned. Default is 0.4 (40%), max is 0.5 (breakdown point of stats). Pretty much never tuned.

  • linenoise_aware (bool) – Whether the operation should be performed in a line-noise aware manner. If enabled, the correlation measure will not be affected by the presence or absence of line noise (using a temporary notch filter).

References

[Kothe2013]

Kothe, C.A. and Makeig, S., 2013. BCILAB: a platform for brain–computer interface development. Journal of Neural Engineering, 10(5), p.056014.

Methods

apply_eeg(eeg, raw)[source]#

Apply the preprocessor to an EEGLAB EEG structure.

Return type:

dict[str, Any]