MIRepNet: EEG Model for Motor Imagery Decoding
- The paper introduces MIRepNet, a paradigm-specific EEG foundation model that achieves state-of-the-art cross-subject and cross-dataset performance on motor imagery tasks.
- It employs a robust preprocessing pipeline with neurophysiologically informed channel interpolation and Euclidean alignment to ensure consistent data representation across devices.
- The hybrid pretraining strategy, combining masked token reconstruction with supervised MI classification, enables rapid adaptation and improved reliability in BCI applications.
MIRepNet is an EEG foundation model and modular preprocessing pipeline specifically developed for the decoding of motor imagery (MI) signals in brain–computer interfaces (BCIs). Unlike previous foundation models merging heterogeneous EEG paradigms, MIRepNet leverages paradigm-specific neurophysiological insights inherent to MI tasks. The approach integrates a neurophysiologically informed channel interpolation strategy, robust distribution alignment, and a hybrid pretraining regime that jointly optimizes for masked token reconstruction and supervised MI classification. Empirical validation across multiple public datasets and benchmark comparisons demonstrates that MIRepNet obtains consistent state-of-the-art cross-subject and cross-dataset performance, enabling accurate motor intention decoding with minimal adaptation data and computational overhead (Liu et al., 27 Jul 2025).
1. Motivation and Paradigm-Specific Modeling
MIRepNet is designed to address core challenges in EEG-based BCIs, with a focus on MI tasks commonly used in stroke rehabilitation and assistive robotics. The model overcomes three principal limitations of earlier methods:
- Inter-subject variability and limited high-quality training data
- Variability in electrode configurations across EEG headsets
- Suboptimal generalization of models pretrained on mixed-paradigm data (e.g., ERP/SSVEP/MI)
Consequently, MIRepNet is restricted to the MI paradigm, under the practical observation that in most BCI use cases, the paradigm is predetermined before data acquisition. This tailored approach exploits MI-specific brain dynamics—such as sensorimotor rhythm event-related desynchronization—leading to greatly improved robustness and fast adaptation to new subjects with limited calibration data (<30 trials/class).
2. Neurophysiologically-Informed EEG Preprocessing Pipeline
The preprocessing pipeline is fundamental to MIRepNet’s cross-device and cross-user generalizability.
Unified Channel Template and Spatial Alignment
Given diverse electrode layouts among commercial and research headsets, MIRepNet first introduces a neurophysiologically informed electrode template selecting channels covering frontal–central (FC), central (C), centro–parietal (CP), and temporal (T) areas. For each incoming trial , spatial interpolation via inverse–distance weighting is performed:
- Compute Euclidean distances between template locations and device electrodes :
- Assign interpolation weights:
- Reconstruct spatially aligned trial:
where is the temporally filtered EEG segment (8–30 Hz bandpass to preserve sensorimotor rhythms; typically resampled to 250 Hz).
Distribution Alignment (Euclidean Alignment)
To further mitigate inter-subject statistical disparities, the pipeline applies Euclidean Alignment (EA). For each subject, a reference covariance matrix is estimated:
Subsequently, whitening is performed:
This normalization ensures that all input data exhibits consistent second-order statistics across subjects and studies.
3. Hybrid Pretraining: Self-Supervision and MI Classification
MIRepNet incorporates a hybrid pretraining strategy to exploit both self-supervised and supervised signals.
Tokenization and Self-Supervised Reconstruction
Spatially and statistically aligned EEG segments () are embedded as temporal–spatial tokens via convolutional feature extractors, yielding representations . A core innovation is masked token reconstruction: with a mask ratio (empirically 50%), a subset is obfuscated and passed through a Transformer encoder (), then reconstructed with a lightweight Transformer decoder ():
Supervised MI Classification
In parallel, an MI classification head is trained using aggregated context vectors:
producing softmax logits and a standard cross-entropy loss:
The total pretraining objective is:
This dual objective ensures that MIRepNet internalizes both general temporal–spatial EEG patterns and task-discriminative features critical for MI classification.
4. Empirical Performance and Benchmarking
MIRepNet’s effectiveness is validated on five public MI datasets encompassing 47 target subjects.
Key experimental findings:
- When fine-tuned using only 30% of within-session data (typically <30 trials/class), MIRepNet outperforms both specialized pipelines (CSP+LDA, ShallowConvNet, EEGNet) and generalist EEG foundation models (BIOT, BENDR, LaBraM).
- Achieves state-of-the-art average decoding accuracy in all test cases, with faster convergence: near-optimal performance within ∼10 fine-tuning epochs.
- Generalist models often require extensive subject pooling post-training for effective adaptation, whereas MIRepNet’s hybrid pretraining and preprocessing achieve robustness with minimal additional data.
The quantitative results demonstrate that neurophysiologically grounded preprocessing and paradigm-specific representation learning yield superior transferability and calibration efficiency for BCI applications.
5. Applications in BCI Systems
MIRepNet directly enables a broad set of BCI use cases requiring fast and reliable MI decoding:
- Stroke Rehabilitation: Decoding MI signals to control neurorehabilitative aids, facilitating restoration of voluntary movement through exoskeletons or FES devices.
- Assistive Robotics: Interpreting user intent (e.g., imagined hand or arm movement) to operate smart wheelchairs or prosthetics in real time for individuals with motor impairments.
The paradigm-specific architecture illustrates a broader trend: building BCI foundation models that explicitly code for domain neurophysiology—such as leveraging event-related desynchronization over α and β bands in MI—enables more robust and usable neural interfaces.
6. Future Directions and Open-Source Availability
Planned extensions include:
- Individualized calibration methods that further minimize per-user adaptation requirements
- Application of the MIRepNet paradigm to additional BCI paradigms by designing foundation models informed by other neurophysiological mechanisms
- Scaling pretraining to larger and more diverse datasets, or incorporating advanced network designs to capture finer temporal–spatial EEG structure
The complete codebase and implementation details have been released at [https://github.com/staraink/MIRepNet], supporting reproducibility, benchmarking, and community-driven development.
7. Significance and Implications
MIRepNet demonstrates that EEG foundation models tailored to specific paradigms, with pipelines grounded in neurophysiological knowledge, achieve rapid adaptation and high accuracy while minimizing data and computation requirements. This supports the broader adoption of BCIs in clinical and assistive settings, and suggests that future EEG foundation models will benefit from tight linkage between preprocessing, representation learning, and domain-specific neural phenomena (Liu et al., 27 Jul 2025).