← Projects

/projects/eeg-complex-valued-models/

Complex-Valued Models for EEG Motor Imagery

Can complex-valued representations reveal structure in EEG that standard real-valued models miss?

  • Python
  • TensorFlow / Keras
  • scikit-learn
  • SciPy
  • MNE
  • Optuna
  • signal processing
  • cross-validation
Research poster summarizing complex-valued neural network and CSP results for EEG motor imagery decoding.
fig. 1 — A Complex-Valued Neural Network for Motor Imagery Decoding in EEG. Open the full-resolution poster (PDF).

Overview

My undergraduate honors thesis: an end-to-end machine learning pipeline for high-dimensional EEG motor-imagery data, built to answer whether complex-valued signal representations carry information a real-valued baseline discards.

Problem

Motor-imagery EEG is high-dimensional, noisy, and easy to overfit to spurious structure. In this study, rCSP used the real part of the analytic signal, while cCSP used its full complex covariance structure. The thesis tested whether that representational difference affected decoding performance, with TIMBRE evaluated as a separate complex-valued model.

Approach

The primary comparison held the CSP framework and logistic-regression classifier constant while changing the spatial filters from real-valued CSP (rCSP) to complex-valued CSP (cCSP). Both were tested with 1, 2, 4, and 8 components per class. TIMBRE, a complex-valued neural architecture, was evaluated separately across hidden-layer sizes and with Optuna tuning. Preprocessing included high-pass filtering, analytic-signal construction with the Hilbert transform, and whitening.

Technical Implementation

Built in Python with MNE for EEG preprocessing, scikit-learn for logistic regression, and TensorFlow/Keras for TIMBRE. All models were evaluated per subject with 5-fold cross-validation, and whitening was fit only on each training fold. Hyperparameter searches used inner validation splits before evaluation on the held-out outer folds. Spectral analysis then examined complex projections on held-out data; class effects in TIMBRE activations were tested with a two-way ANOVA and false-discovery-rate correction.

Evaluation & Results

The consistent result was specific to the CSP comparison: cCSP outperformed rCSP for each of the three analyzed subjects at every tested component count (1, 2, 4, and 8). TIMBRE remained competitive with cCSP but did not uniformly outperform it. Its performance and gains from optimization varied by subject and configuration, so the thesis does not support collapsing these results into one overall improvement percentage.

What I Learned

The cCSP-vs-rCSP result and the TIMBRE optimization results answer different questions and need to remain separate. The former was consistent across the analyzed subjects and component counts; the latter was subject- and configuration-dependent. Because the study used three selected subjects from one dataset, it does not establish how the quantitative results generalize to a broader population.

View repository on GitHub