Lidia Scudiero
Lidia Scudiero

Motor Imagery BCI: Decoding Neural Intentions

Decoding motor imagery (left vs right hand vs foot vs tongue) from noisy EEG signals using Spatial Filters (CSP), Deep Learning (EEGNet), AttentionBaseNet and Riemannian geometry .

BCI Neural Decoding Showcase

Project Overview

Brain-Computer Interfaces (BCIs) represent the ultimate bridge between human cognition and machine execution. This project focuses on Motor Imagery (MI) decoding—identifying a user's intention to move their hands,feet and tongue just by analyzing brain's electrical activity (EEG) captured via noisy sensors.

The core challenge was the low Signal-to-Noise Ratio (SNR) and high inter-subject variability of EEG data. I implemented and compared multiple decoding approaches: a classical pipeline using Common Spatial Patterns (CSP) + LDA, compact deep learning with EEGNet, and AttentionBaseNet with channel-attention mechanisms. I also explored Riemannian geometry using covariance-based classifiers and tangent-space methods with pyRiemann.

Key Technical Milestones

A major focus was subject-independent evaluation, assessing whether models could generalize to unseen participants using subject-wise holdout and Leave-One-Subject-Out (LOSO) protocols. I also investigated within-subject cross-session generalization, training EEGNet on one recording session and evaluating it on a separate session. These experiments enabled a more rigorous assessment of generalization under different data-splitting and calibration conditions.

I evaluated Gaussian noise augmentation as a potential regularization strategy and investigated Riemannian Alignment and tangent-space updating to mitigate inter-subject variability using unlabeled target data. Results showed that adaptation improved the reported performance of Riemannian methods, while Gaussian augmentation did not produce a clear aggregate improvement in the evaluated settings.

To investigate model interpretability, I analyzed CSP topographies, mu/beta frequency-band perturbations, channel occlusion, and class-confusion patterns. These analyses helped assess whether model behavior was qualitatively consistent with sensorimotor EEG characteristics around regions such as C3 and C4, providing evidence of physiological plausibility rather than definitive cortical source localization.

Finally, I developed interactive Streamlit BCI demonstrations for binary CSP + LDA and four-class EEGNet decoding, including simulated streaming inference with PyLSL.

For a deep dive into my analytical process, the GitHub repository includes all the Jupyter Notebooks, preprocessing steps, and detailed statistical analyses conducted throughout the project.

Tools

MNE-Python
PyLSL
TensorFlow (EEGNet)
Braindecode
pyRiemann
Scikit-Learn
CSP Filters
Streamlit
Signal Processing