moabb.paradigms.LeftRightImagery#

class moabb.paradigms.LeftRightImagery(fmin=8, fmax=32, events=None, tmin=0.0, tmax=None, baseline=None, channels=None, resample=None, scorer=None, overlap=None, reject_by_annotation=True)[source]#

Motor Imagery for left hand/right hand classification.

Metric is ‘roc_auc’ by default

Parameters:
  • fmin (float (default 8)) – cutoff frequency (Hz) for the high pass filter.

  • fmax (float (default 32)) – cutoff frequency (Hz) for the low pass filter.

Notes

Why 8-32 Hz by default. The default band-pass filter (fmin=8, fmax=32) keeps the mu (about 8-13 Hz) and beta (about 13-30 Hz) rhythms, whose event-related desynchronization and synchronization carry most of the motor-imagery information. It also removes slow drifts and most ocular activity, and limits the high-frequency muscle activity that a classifier could otherwise exploit instead of brain activity [3]. MOABB applies the same preprocessing to every dataset so that pipelines are compared on equal terms: the MOABB benchmark [1] filters all motor-imagery datasets to 8-32 Hz, following the BCI literature [2]. The filter is an IIR filter with MNE’s default parameters (4th-order Butterworth, applied forward and backward).

The default serves comparability; it is not a requirement. If your pipeline needs another band (deep-learning models often use a wider one), change it and report the band you used:

  • LeftRightImagery(fmin=4, fmax=40) filters to another band.

  • LeftRightImagery(fmin=None, fmax=None) disables the filter.

  • fmin=None alone gives a low-pass filter at fmax, and fmax=None alone a high-pass filter at fmin.

  • FilterBankLeftRightImagery applies a bank of bands, set with its filters argument.

To get the signal with no paradigm preprocessing at all, load it from the dataset object (dataset.get_data()) instead of from the paradigm.

References

[1]

S. Chevallier, I. Carrara, B. Aristimunha, P. Guetschel, S. Sedlar, B. Lopes, S. Velut, S. Khazem and T. Moreau. The largest EEG-based BCI reproducibility study for open science: the MOABB benchmark. arXiv:2404.15319 (2024). https://arxiv.org/abs/2404.15319

[2]

C. S. Nam, A. Nijholt and F. Lotte (eds.). Brain-Computer Interfaces Handbook: Technological and Theoretical Advances. CRC Press (2018).

[3]

V. Jayaram and A. Barachant. MOABB: trustworthy algorithm benchmarking for BCIs. Journal of Neural Engineering 15(6), 066011 (2018). https://doi.org/10.1088/1741-2552/aadea0

property scoring#

Property that defines scoring metric (e.g. ROC-AUC or accuracy or f-score), given as a sklearn-compatible string or a compatible sklearn scorer.

Examples using moabb.paradigms.LeftRightImagery#

Tutorial 0: Getting Started

Tutorial 0: Getting Started

Tutorial 1: Simple Motor Imagery

Tutorial 1: Simple Motor Imagery

Tutorial 2: Using multiple datasets

Tutorial 2: Using multiple datasets

Tutorial 3: Benchmarking multiple pipelines

Tutorial 3: Benchmarking multiple pipelines

Tutorial 4: Creating custom datasets

Tutorial 4: Creating custom datasets

Cross-Session Motor Imagery

Cross-Session Motor Imagery

Cross-Session on Multiple Datasets

Cross-Session on Multiple Datasets

Cache on disk intermediate data processing states

Cache on disk intermediate data processing states

Explore Paradigm Object

Explore Paradigm Object

Check paradigm metadata before loading

Check paradigm metadata before loading

Benchmarking with MOABB showing the CO2 footprint

Benchmarking with MOABB showing the CO2 footprint

Benchmarking with MOABB

Benchmarking with MOABB

Benchmarking with MOABB with Grid Search

Benchmarking with MOABB with Grid Search

Cross-subject transfer with Riemannian alignment

Cross-subject transfer with Riemannian alignment

Trialwise cross-subject subject-prototype classification

Trialwise cross-subject subject-prototype classification

Tutorial: Within-Session Splitting on Real MI Dataset

Tutorial: Within-Session Splitting on Real MI Dataset

Pipelines using the mne-features library

Pipelines using the mne-features library

Euclidean Alignment for cross-subject transfer

Euclidean Alignment for cross-subject transfer

FilterBank CSP versus CSP

FilterBank CSP versus CSP

Comparing fitted and test-batch tangent-space references

Comparing fitted and test-batch tangent-space references

Playing with the pre-processing steps

Playing with the pre-processing steps

Select Electrodes and Resampling

Select Electrodes and Resampling

Time-Resolved Decoding with SlidingEstimator

Time-Resolved Decoding with SlidingEstimator

Statistical Analysis and Chance Level Assessment

Statistical Analysis and Chance Level Assessment

Within Session Motor Imagery with Learning Curve

Within Session Motor Imagery with Learning Curve