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:
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=Nonealone gives a low-pass filter atfmax, andfmax=Nonealone a high-pass filter atfmin.FilterBankLeftRightImageryapplies a bank of bands, set with itsfiltersargument.
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#
Trialwise cross-subject subject-prototype classification
Tutorial: Within-Session Splitting on Real MI Dataset
Comparing fitted and test-batch tangent-space references