Deep Learning classification of EEG data

Honours thesis applying CNNs to decode how the brain represents semantic concepts from brainwave patterns.

PythonTensorFlowKerasMATLABEEGLAB

My honours thesis investigated a fundamental question in cognitive neuroscience: how does the brain represent and process semantic concepts? Using deep learning on EEG data, I explored whether the brain uses amodal representations, modality-specific representations, or a combination of both.

Research Background

Semantic Categorization: When we think about "red" - whether seeing the color, reading the word, or hearing it described - does our brain activate the same neural representation? Or do different modalities (visual, linguistic) engage different neural circuits?

Two Competing Theories:

  1. Amodal Theory: Semantic concepts are represented abstractly, independent of sensory modality
  2. Modal Theory: Concepts are grounded in sensory-motor experiences, with modality-specific representations

My research aimed to determine which theory better explains brain activity patterns, or whether the truth lies in between.

Experimental Design

Participants: Multiple participants with 64-channel EEG caps recorded brain activity at high temporal resolution.

Stimulus Design: Semantic concepts presented in three modalities:

  • Red: The word "red", the question "The colour of blood?", or a red screen
  • Numbers: The digit "5", the word "five", or roman numeral "V"
  • Additional semantic categories with similar multi-modal presentations

Timing: Stimuli presented every few seconds with precise timing, allowing event-related potential analysis.

Data Collection: 63 channels of continuous EEG data captured at high sampling rates, generating massive datasets requiring careful preprocessing.

Technical Implementation

Preprocessing Pipeline (MATLAB/EEGLAB):

  • High-pass filtering to remove drift
  • Independent Component Analysis (ICA) for artifact removal (eye blinks, muscle activity)
  • Epoch extraction around stimulus presentation
  • Channel location mapping and dipole fitting
  • Automated and semi-automated rejection of noisy trials

Data Processing (Python):

  • Conversion from EEGLAB .set files to CSV format
  • Feature scaling and standardization
  • Train/validation/test splitting with stratification
  • Pickle serialization for efficient loading

Deep Learning Architecture (TensorFlow/Keras):

  • Convolutional layers for spatial feature extraction (across channels)
  • Temporal convolutions for time-series patterns
  • Dropout for regularization
  • Dense layers for classification
  • Multiple output configurations for different semantic categories

Training Strategy:

  • K-fold cross-validation to maximize use of limited data
  • Early stopping to prevent overfitting
  • Model checkpointing to save best weights
  • Per-participant models and aggregate models

Key Findings

Classification Performance: Models achieved above-chance accuracy in distinguishing between modalities for the same semantic concept, demonstrating that different presentation formats engage distinguishable neural patterns.

Theoretical Implications: Results suggested a combination of both theories - some abstract semantic representation exists, but modality-specific processing also occurs. While not statistically conclusive, the pattern aligned with modern theories of distributed semantic networks.

Neural Timing: Analysis revealed critical processing windows 300-500ms post-stimulus, consistent with known semantic processing timeframes in cognitive neuroscience literature.

Technical Challenges

Data Quality: EEG data is notoriously noisy. Extensive preprocessing was required, with manual rejection of particularly noisy epochs after automated cleaning.

Limited Sample Size: Biological data collection is time-consuming and expensive. Cross-validation and careful regularization were essential to avoid overfitting.

Computational Resources: Training CNNs on high-dimensional EEG data required careful memory management and efficient data loading strategies.

Interdisciplinary Integration: Bridging neuroscience theory, signal processing mathematics, and deep learning required deep knowledge across domains.

Skills Developed

Signal Processing: Fourier analysis, filtering, ICA, time-frequency analysis

Machine Learning: CNN architecture design, hyperparameter tuning, cross-validation, regularization

Neuroscience: EEG methodology, cognitive theories, experimental design

Programming: MATLAB scripting, Python data pipelines, TensorFlow model building

Research: Literature review, hypothesis formulation, statistical analysis, scientific writing

Broader Impact

This work contributes to understanding human cognition and has implications for:

  • Brain-computer interfaces for communication
  • Cognitive rehabilitation after brain injury
  • Educational neuroscience and learning optimization
  • Artificial intelligence inspired by biological intelligence

The experience solidified my fascination with interdisciplinary problems where engineering, neuroscience, and AI converge.