Contrastive Representation Learning for Electroencephalogram Classification

Mostafa Neo Mohsenvand, Mohammad Rasool Izadi, Pattie MaesML4H @ NeurIPS 2020

Introduction

Electroencephalography (EEG) provides a non-invasive window into brain activity, but the resulting signals are notoriously noisy, complex, and difficult to interpret. Traditionally, machine learning on EEG data has relied on handcrafted features or supervised deep learning. However, supervised learning demands massive amounts of labeled data—a resource that is expensive and requires years of medical expertise to generate. Furthermore, existing public EEG datasets are relatively small and often incompatible due to varying sampling rates or sensor setups.

While self-supervised contrastive learning (like SimCLR) has revolutionized computer vision by learning robust representations from unlabeled data, translating these successes to EEG is not straightforward. It is not intuitively obvious which data augmentations (akin to cropping or color jittering in images) will preserve the underlying physiological "meaning" of a brainwave.

To address this, researchers introduce SeqCLR (Sequential Contrastive Learning of Representations), a self-supervised contrastive learning framework tailored specifically for time-series EEG data. By leveraging domain-specific augmentations and a clever "channel recombination" technique, SeqCLR learns robust, label-free representations that achieve state-of-the-art performance across diverse downstream tasks.

The SeqCLR Framework

SeqCLR extends the popular SimCLR framework, adapting it for the unique properties of time-series physiological data.

SeqCLR Framework Overview

The methodology relies on several key innovations:

  • Channel Recombination (CR): An EEG channel represents the voltage difference between a sensor and a common reference. By subtracting two channels, the authors create a new, physiologically valid channel—a standard clinical practice known as "re-referencing." This technique quadratically increases the number of training samples per recording (an $n$-channel recording yields $n^2$ channels), providing vastly more data without requiring new physical recordings.
  • Dataset Fusion (DF): To overcome the limitations of small individual datasets, the researchers resampled and filtered five different EEG datasets to a standard 200Hz. This created a massive, unified, unlabeled dataset for pre-training.
  • Domain-Specific Augmentations: Consulting with neurologists, the authors identified six transformations that alter the signal numerically but preserve its clinical meaning.
Domain-Specific EEG Augmentations
  • Architecture: The framework utilizes Convolutional and Recurrent (GRU-based) encoders designed to output sequential representations of the same length as the input signal. This flexibility allows the model to handle the varying sequence lengths required by different downstream tasks.

Key Insights and Performance

SeqCLR was pre-trained on a massive fusion of unlabeled datasets (including TUH, SEED, SleepEDF, and others) and then evaluated on three distinct downstream tasks: Emotion Recognition (SEED), Abnormal EEG Classification (TUH), and Sleep-Stage Scoring (SleepEDF).

Universal Brainwave Features

A single pre-trained encoder successfully extracted features useful for entirely different domains of brain research—emotion, pathology, and sleep. This demonstrates that the contrastive learning process captures fundamental, generalizable physiological structures rather than task-specific artifacts. Furthermore, ablation studies revealed that not all augmentations are equal: zero-masking and amplitude scaling proved to be the most critical for learning good EEG representations, while additive noise and DC shifts had the least impact.

State-of-the-Art Results

SeqCLR significantly outperformed other self-supervised baselines (like Contrastive Predictive Coding) and competed with or beat state-of-the-art (SOTA) supervised models when fine-tuned on 100% of the labels:

  • Emotion Recognition (SEED): Achieved 85.77% accuracy, edging out the previous supervised SOTA (85.40%).
  • Sleep-Stage Scoring (SleepEDF): Reached 85.12% accuracy, beating established supervised models like IITNET (84.00%).
  • Abnormal EEG Detection (TUH): Hit 87.45% accuracy, vastly outperforming other self-supervised methods and approaching the supervised SOTA (87.68%).

Crucially, SeqCLR demonstrated exceptional sample efficiency. Even when fine-tuned on just 1% or 10% of the labeled data, the model maintained strong performance, underscoring the high quality of the pre-trained representations.

Limitations and Future Directions

While highly effective, the approach has limitations. The recurrent encoder architecture takes an order of magnitude longer to fine-tune than the convolutional encoder, potentially bottlenecking rapid iteration. Additionally, the encoder was pre-trained on fixed 20-second chunks; dynamically optimizing this sequence length for specific downstream tasks (e.g., 1 second for emotion vs. 30 seconds for sleep) could yield further improvements.

Overall, these strong results suggest that contrastive learning is a highly promising tool for EEG analysis. Future work could explore more complex, neurologically-informed augmentations, novel pretext tasks, or broader clinical applications such as seizure prediction and brain-computer interfaces.

Summary updated

BibTeX
@inproceedings{mohsenvand2020contrastive,
  author = {Mostafa Neo Mohsenvand and Mohammad Rasool Izadi and Pattie Maes},
  title = {{Contrastive Representation Learning for Electroencephalogram Classification}},
  booktitle = {ML4H @ NeurIPS},
  year = {2020},
}
Figure