CNN-Based Rhythm Selectivity in Motor Imagery EEG: An Occlusion-Based Interpretability Study
Keywords: Brain–computer interface; EEG; motor imagery; convolutional neural network; interpretability; occlusion
CNN-Based Rhythm Selectivity in Motor Imagery EEG: An Occlusion-Based Interpretability Study
Keywords: Brain–computer interface; EEG; motor imagery; convolutional neural network; interpretability; occlusion
Introduction
Brain–computer interfaces (BCIs) are systems that convert patterns of brain activity into outputs such as computer commands, cursor movements, or device control signals.¹,2 Non-invasive BCIs often use electroencephalography (EEG) because it is relatively low-cost, portable, and has high temporal resolution suitable for tracking rapid neural dynamics.¹,2 A widely studied BCI paradigm is motor imagery, in which an individual imagines performing a movement (e.g., left-hand vs right-hand movement) without executing it.³ Motor imagery can modulate oscillatory EEG activity, producing measurable changes in spectral power and synchrony over the sensorimotor cortex.⁴ In classical motor imagery BCI pipelines, EEG signals are typically filtered into canonical frequency bands and transformed into hand-engineered features.⁵ Common feature approaches include spatial filtering methods (e.g., common spatial patterns) coupled with conventional classifiers such as linear discriminant analysis or support vector machines.⁵,6 These methods can be effective, but they may require domain-specific choices about frequency ranges, channel subsets, and feature definitions that can limit flexibility across subjects and recording conditions.⁵ Deep learning offers an alternative by learning hierarchical representations directly from time-series data, potentially reducing reliance on manually designed feature sets.⁷ Convolutional neural networks (CNNs), in particular, can learn localized temporal filters and channel-interaction patterns that are well matched to EEG’s multichannel time structure.⁷ A key challenge, however, is interpretability: high-performing neural networks do not automatically explain which physiological components drive their decisions.⁷ For EEG BCIs, interpretability is not only scientifically relevant but also practically important for clinical translation and trustworthiness in high-stakes assistive applications.¹,2 This study investigated whether a CNN trained on preprocessed EEG trials could (1) classify motor imagery above chance and (2) yield interpretable evidence of frequency-band importance through an explicit occlusion procedure. The primary research question was: Which canonical EEG frequency bands most strongly influence a CNN’s motor imagery classification performance under the current training and preprocessing pipeline? We hypothesized that removing μ/α (8–13 Hz) and β (13–30 Hz) activity — frequency ranges closely associated with sensorimotor rhythms — would produce a larger drop in accuracy than occluding other bands.⁴ To test this hypothesis, the study paired a compact DeepConvNet-style CNN with frequency-band occlusion analysis and quantified performance changes when individual bands were removed from validation data.
BCIs are valuable because they can restore or augment function (e.g., communication aids⁸ and assistive control) while also providing a window into neural mechanisms.¹,2 In this project, I focus on non-invasive EEG motor imagery decoding and ask not only whether a CNN can classify above chance, but also what frequency content the model depends on. To connect performance with interpretability, I pair end-to-end CNN decoding with frequency-band occlusion and quantify the accuracy change when canonical bands are removed. This provides an explicit, testable way to relate a black-box decoder to neurophysiologically motivated rhythms under the chosen preprocessing pipeline.
Methods
Study Design
This work was a secondary analysis of an open EEG dataset and used a supervised learning framework. Classification performance was evaluated using stratified k-fold cross-validation, and interpretability was assessed using a post hoc occlusion procedure applied to held-out validation trials.
Dataset and Data Access
EEG data were downloaded programmatically using the MNE-Python EEGBCI interface to the PhysioNet EEG Motor Movement/Imagery dataset.
Data from three subjects (Subjects 1–3) were used.
Motor imagery runs 6, 10, and 14 were included, consistent with the experiment configuration in the analysis code.
Only the event codes present in runs 6, 10, and 14 were used; in this subset, the data formed a two-class problem (event codes 2 and 3), mapped to labels 0 and 1 for classification.
Signal Conditioning and Standardization
Raw recordings were standardized using MNE’s EEGBCI standardization routines and mapped to a standard scalp montage (10–20 system) to ensure consistent channel naming and geometry across subjects.
A 50 Hz notch filter was applied prior to band-pass filtering as a precautionary denoising step, although the subsequent 1–40 Hz band-pass removes 50 Hz from the modeled spectrum.
Signals were band-pass filtered from 1–40 Hz to remove slow drifts below 1 Hz and attenuate higher-frequency components outside the modeled range.
Data were resampled to 250 Hz to standardize sampling frequency across inputs and reduce computational load while preserving relevant temporal information.
Epoching and Label Construction
Motor imagery trials were segmented into epochs spanning −0.5 to 2.5 seconds relative to motor imagery event onset.
Baseline correction was not applied in which the parameter “baseLine” was given the value of None because each epoch was normalized (per-trial channel-wise z-scoring and fold-specific scaling), which removes mean offsets without relying on a pre-stimulus baseline.
Labels were derived from event annotations, and the resulting data used for the reported analyses contained two classes (binary classification), as shown by the final label counts prior to balancing.
Artifact Modeling via Independent Component Analysis (ICA)
ICA (FastICA; 20 components) was fit to characterize artifacts; no components were excluded in the executed run. Accordingly, residual non-neural activity may remain and is treated as a limitation in interpreting band-importance results.
Outlier Trial Rejection
To reduce the impact of extreme noise or saturated segments, each epoch’s log-variance across channels and time was computed as a scalar contamination metric.
Epochs were ranked by this metric, and the highest-variance trials were discarded.
A keep fraction of 0.70 was applied, retaining 94 of 135 epochs in the reported run.
This step was intended to improve signal quality and stabilize downstream model training by removing highly contaminated trials.
Class Balancing
After outlier rejection, class counts were equalized using random undersampling of the majority class.
This produced a balanced dataset of 45 trials per class (90 total), reducing the risk that accuracy estimates would be inflated by class prevalence rather than true discriminative learning.
Normalization and Leakage Control
Within each trial, channel-wise mean was subtracted and divided by channel-wise standard deviation to normalize amplitude scale and reduce sensitivity to absolute voltage differences.
For CNN training, a StandardScaler was additionally fit only on training folds after flattening each trial (channels × time) and then applied to the corresponding validation fold.
This fold-specific scaling was used to reduce data leakage and ensure that validation performance reflected generalization rather than shared normalization statistics.
CNN Architecture
The model follows a compact DeepConvNet-style design: a temporal convolution learns short time-local filters, a spatial convolution learns cross-channel structure, and batch normalization + ELU introduces stable nonlinearities. Max pooling reduces temporal resolution, dropout regularizes training, and a final fully connected layer outputs class logits. Architecture details and hyperparameters are summarized in Table 1, and a schematic is shown in Figure 1.


The fully connected input dimension was computed dynamically by forwarding a dummy tensor through the feature extractor, preventing shape errors when epoch length or channel counts change.
Training Procedure and Cross-Validation
Model training used 5-fold StratifiedKFold cross-validation to preserve class balance in each fold.
Optimization used Adam with learning rate 1×10⁻³, batch size 64, and cross-entropy loss.
Training ran for up to 60 epochs with early stopping patience = 10 epochs based on validation accuracy.
For each fold, the best validation accuracy was retained, and mean ± standard deviation across folds was reported.
Data Augmentation (Secondary Model)
A secondary training regime used simple on-the-fly EEG augmentations:
- Additive Gaussian noise (σ ≈ 0.01),
- Random channel dropout (p = 0.1),
- Short time masking (~0.2 s segments set to zero).
This augmentation model was trained using a stratified train/validation split (20% validation) and evaluated separately from the k-fold CV results.
Frequency-Band Occlusion Analysis
To estimate the importance of canonical rhythms, band occlusion removed activity in predefined bands and measured the resulting accuracy change.
Bands were defined as:
- δ: 1–4 Hz
- θ: 4–8 Hz
- μ/α: 8–13 Hz
- β: 13–30 Hz
- low-γ: 30–40 Hz
For a given band, band-limited activity was estimated via filtering and subtracted from the signal (i.e., the band component was removed).
The trained model was then re-evaluated on the modified validation set, and the difference from baseline accuracy was recorded as evidence of reliance on that band.
Results
Classification Performance
Across 5 stratified folds, the mean best-fold validation accuracy was:
- Mean CV accuracy: 0.722 ± 0.035
Here, mean ± standard deviation are computed across folds using the best validation accuracy achieved within each fold under early stopping.
On the final fold’s validation split (used for the occlusion evaluation in the printed output):
- Baseline accuracy (final fold validation): 0.778
Band Occlusion Results (Baseline CV Model; Final Fold Validation Set)
Condition
Accuracy
Δ Accuracy (Baseline − Occluded)
Baseline
0.778
—
Occlude δ (1–4 Hz)
0.500
0.278
Occlude θ (4–8 Hz)
0.778
0.000
Occlude μ/α (8–13 Hz)
0.611
0.167
Occlude β (13–30 Hz)
0.611
0.167
Occlude low-γ (30–40 Hz)
0.778
0.000
Augmentation Model (Held-Out Split)
- Best validation accuracy (augmented model): 0.667
- Baseline accuracy (augmented model validation): 0.667
Occlusion accuracies for the augmented model validation set were: δ = 0.444, θ = 0.556, μ/α = 0.556, β = 0.556, low-γ = 0.667, indicating a broadly similar pattern in which δ occlusion reduced performance the most.
Discussion
This study demonstrated that a compact CNN trained on preprocessed EEG trials achieved above-chance performance on a binary motor imagery classification task, with a mean cross-validated accuracy of approximately 0.72.
The occlusion analysis suggested that removing δ-band activity produced the largest performance decrease in the baseline model’s evaluated validation split.
In this evaluation, δ-band occlusion produced the largest accuracy drop on the validation split, indicating the model was most sensitive to removing low-frequency content under the current preprocessing and sample size.
This outcome did not match the initial hypothesis that μ/α and β occlusion would dominate performance reductions, although μ/α and β removal still reduced accuracy relative to baseline.
Several non-exclusive explanations could account for the apparent δ-band dependence.
First, low-frequency components can contain slow cortical potentials and task-locked drifts, but they can also reflect residual artifacts (e.g., movement, electrode drift, or imperfect removal of ocular activity) that are correlated with class labels.
Second, the small dataset size after balancing (90 trials) increases variance in fold-level estimates and can amplify sensitivity to idiosyncratic features in the validation set.
Third, the executed configuration applied ICA but did not exclude components, which may have left low-frequency artifact structure in the signals.
Fourth, band-occlusion filtering on short epochs can introduce edge effects or imperfect band isolation, and warnings during filtering indicate potential distortion due to filter length relative to signal length; this increases uncertainty in attributing accuracy changes strictly to physiological rhythms.
Despite these caveats, the approach remains useful as a hypothesis-generating interpretability method: it provides a quantitative map of which spectral ranges the model uses under a given preprocessing pipeline.
From an application perspective, integrating decoding performance with explicit interpretability tests can help guide more reliable BCI model development, especially when the goal includes transparent clinical or assistive deployment.
Limitations
Dataset scope and sample size: Only three subjects were included, and class balancing reduced the final dataset to 90 trials, limiting statistical power and robustness.
Task dimensionality: Although the initial narrative referenced four motor imagery tasks, the executed run produced a binary classification setting; conclusions therefore apply to the two-class configuration reported in the output.
ICA configuration: ICA was fit, but no components were removed in the recorded run, which may have allowed artifacts to persist and influence both accuracy and occlusion sensitivity.
Occlusion assumptions: Band occlusion treats bands as separable contributors and can be affected by filtering artifacts, boundary effects, and band overlap.
Generalizability: Results were reported at the fold and held-out split level; broader generalization would require additional subjects, subject-wise splits, and repeated-run stability analyses.
Conclusion
A compact DeepConvNet-style CNN classified motor imagery EEG above chance in a binary setting, achieving 0.722 ± 0.035 mean best-fold accuracy under stratified 5-fold cross-validation.
Frequency-band occlusion indicated that removing δ-band activity caused the largest observed accuracy reduction in the evaluated validation split, with μ/α and β also contributing to performance.
These findings demonstrate the practical value of pairing CNN decoding with occlusion-based interpretability, while also highlighting the need for follow-up controls — particularly artifact removal choices, subject-wise evaluation, and improved spectral attribution methods — to determine whether low-frequency reliance reflects neurophysiology or residual confounds.
Future work should expand to more subjects, test explicit subject-independent generalization, compare against classical baselines (e.g., CSP + LDA), and incorporate complementary interpretability approaches such as gradient-based saliency or layer-wise relevance propagation.
References
- J. R. Wolpaw, N. Birbaumer, W. J. Heetderks, D. J. McFarland, P. H. Peckham, G. Schalk, E. Donchin, L. A. Quatrano, C. J. Robinson, T. M. Vaughan. Brain-computer interface technology: a review of the first international meeting. IEEE Transactions on Rehabilitation Engineering. Vol. 8(2), pg. 164–173, 2000, https://doi.org/10.1109/TRE.2000.847807.
- L. F. Nicolas-Alonso, J. Gomez-Gil. Brain computer interfaces, a review. Sensors (Basel). Vol. 12(2), pg. 1211–1279, 2012, https://doi.org/10.3390/s120201211.
- C. Neuper, R. Scherer, S. Wriessnegger, G. Pfurtscheller. Motor imagery and action observation: modulation of sensorimotor brain rhythms during mental control of a brain–computer interface. Clinical Neurophysiology. Vol. 120(2), pg. 239–247, 2009, https://doi.org/10.1016/j.clinph.2008.11.015.
- G. Pfurtscheller, F. H. Lopes da Silva. Event-related EEG/MEG synchronization and desynchronization: basic principles. Clinical Neurophysiology. Vol. 110(11), pg. 1842–1857, 1999, https://doi.org/10.1016/S1388-2457(99)00141-8.
- F. Lotte, M. Congedo, A. Lécuyer, F. Lamarche, B. Arnaldi. A review of classification algorithms for EEG-based brain–computer interfaces. Journal of Neural Engineering. Vol. 4(2), pg. R1–R13, 2007, https://doi.org/10.1088/1741-2560/4/2/R01.
- H. Ramoser, J. Müller-Gerking, G. Pfurtscheller. Optimal spatial filtering of single trial EEG during imagined hand movement. IEEE Transactions on Rehabilitation Engineering. Vol. 8(4), pg. 441–446, 2000, https://doi.org/10.1109/86.895946.
- R. T. Schirrmeister, J. T. Springenberg, L. D. J. Fiederer, M. Glasstetter, K. Eggensperger, M. Tangermann, F. Hutter, W. Burgard, T. Ball. Deep learning with convolutional neural networks for EEG decoding and visualization. Human Brain Mapping. Vol. 38(11), pg. 5391–5420, 2017, https://doi.org/10.1002/hbm.23730.
- L. A. Farwell, E. Donchin. Talking off the top of your head: toward a mental prosthesis utilizing event-related brain potentials. Electroencephalography and Clinical Neurophysiology. Vol. 70(6), pg. 510–523, 1988, https://doi.org/10.1016/0013-4694(88)90149-6.
메타데이터
- post_id
- 35fc2153cc34
- slug
- cnn-based-rhythm-selectivity-in-motor-imagery-eeg-an-occlusion-based-interpretability-study-35fc2153cc34
- url
- https://medium.com/@surdeep.thota/cnn-based-rhythm-selectivity-in-motor-imagery-eeg-an-occlusion-based-interpretability-study-35fc2153cc34
- canonical_url
- https://medium.com/@surdeep.thota/cnn-based-rhythm-selectivity-in-motor-imagery-eeg-an-occlusion-based-interpretability-study-35fc2153cc34
- author_url
- https://medium.com/@surdeep.thota
- status
- ok
- fetched_at
- 2026-07-14 22:33:28