← all work

Machine Learning · Research

Motor Imagery Recognition (EEG)

Bachelor's thesis: a CNN-1D architecture for subject-independent motor-imagery classification from EEG signals, aimed at Brain-Computer Interfaces for assistive technologies.

Role
Researcher · author
Stack
  • Python
  • TensorFlow / Keras
  • CNN
  • EEG / BCI
  • NumPy

Overview

My bachelor's thesis at the Universidade de Caxias do Sul tackled a Brain-Computer Interface (BCI) problem: recognizing motor imagery — the intention of movement — from raw EEG signals, in a way that generalizes across people. For users with severe paralysis, such a system can drive assistive devices through thought alone, so the classifier at its core is the hard, decisive component.

Approach

I started from a published CRNN baseline (Zhang et al., 2018) that used 2D convolutions over the spatial layout of EEG electrodes followed by LSTM layers for temporal features. Signals were normalized to reduce variability between subjects and sessions, targeting a subject-independent model, and everything was evaluated on the public PhysioNet dataset and two datasets from the IV BCI Competition.

Key contribution: a CNN-1D architecture

Two experiments reshaped the model into something simpler and stronger:

  • Spatial information didn't help. Preserving electrode neighborhoods in a 2D input gave no measurable gain, so I dropped it and convolved over the temporal domain only.
  • CNN beat LSTM for temporal features. With 3-second windows, temporal CNNs reached over 80% accuracy where the LSTM plateaued at 59–61% — so I replaced the recurrent layers entirely.
  • Fewer parameters. Reduced feature maps and average pooling made the pure-CNN model lighter than the CRNN reference while performing as well or better.
Optimized neighborhood-preserving matrix representation of multi-electrode EEG signals
Figure 42 from the thesis — the optimized, neighborhood-preserving matrix representation of the raw EEG (fewer zero-padded values than the reference). Experiments showed this electrode neighborhood added no information, motivating the move to a purely 1-D input.

Results

Subject-independent accuracy across datasets:

TaskDatasetAccuracyNotes
Binary left fist · right fist PhysioNet 82.11% ± 3.65 On par with the best in the literature (82.43%)
4-class eyes closed · left fist · right fist · feet PhysioNet 66.11% ± 4.46 +1.6% relative vs Wang et al. (2020)
Binary left hand · right hand BCI Competition IV II-A 78.31% ± 5.49 +15.86% relative vs best feature-engineering approach
Binary left hand · right hand BCI Competition IV II-B 71.14% ± 5.63 Subject-independent (leave-one-out)

A secondary finding: subjects who received feedback during EEG acquisition showed an 11.19% relative accuracy improvement, suggesting feedback helps people modulate motor-imagery signals more clearly.

Outcome

The work is open source and has become my most-starred research — the motor-imagery and motor-imagery-deep-learning repositories together carry 30+ GitHub stars from others working on the same problem.