Skip to main content
QUICK REVIEW

[Paper Review] Efficacy of Transformer Networks for Classification of Raw EEG Data

Gourav Siddhad, Anmol Gupta|arXiv (Cornell University)|Feb 8, 2022
EEG and Brain-Computer InterfacesNeuroscience11 citations
TL;DR

This paper proposes a transformer-based end-to-end deep learning framework for classifying raw, pre-processed EEG data without hand-crafted feature extraction. It achieves state-of-the-art accuracy of 95.28% (two workload levels) and 88.72% (three workload levels) on the public STEW dataset, and 94.53% (gender) and 87.79% (age) on a local age and gender dataset, demonstrating transformers' efficacy in EEG classification.

ABSTRACT

With the unprecedented success of transformer networks in natural language processing (NLP), recently, they have been successfully adapted to areas like computer vision, generative adversarial networks (GAN), and reinforcement learning. Classifying electroencephalogram (EEG) data has been challenging and researchers have been overly dependent on pre-processing and hand-crafted feature extraction. Despite having achieved automated feature extraction in several other domains, deep learning has not yet been accomplished for EEG. In this paper, the efficacy of the transformer network for the classification of raw EEG data (cleaned and pre-processed) is explored. The performance of transformer networks was evaluated on a local (age and gender data) and a public dataset (STEW). First, a classifier using a transformer network is built to classify the age and gender of a person with raw resting-state EEG data. Second, the classifier is tuned for mental workload classification with open access raw multi-tasking mental workload EEG data (STEW). The network achieves an accuracy comparable to state-of-the-art accuracy on both the local (Age and Gender dataset; 94.53% (gender) and 87.79% (age)) and the public (STEW dataset; 95.28% (two workload levels) and 88.72% (three workload levels)) dataset. The accuracy values have been achieved using raw EEG data without feature extraction. Results indicate that the transformer-based deep learning models can successfully abate the need for heavy feature-extraction of EEG data for successful classification.

Motivation & Objective

  • To evaluate the efficacy of transformer networks for end-to-end classification of raw EEG data without hand-crafted feature extraction.
  • To address the long-standing reliance on pre-processing and feature engineering in EEG classification by leveraging the attention mechanism of transformers.
  • To demonstrate that transformers can achieve competitive or superior performance compared to existing deep learning models on both local and public EEG datasets.
  • To reduce the bottleneck caused by artifact contamination and inter-subject variability in EEG data through automated, data-driven feature learning.

Proposed method

  • A transformer encoder architecture is applied directly to raw, cleaned EEG signals, using learnable token embeddings and positional encoding to model temporal dependencies.
  • Positional encoding is adapted for EEG data, though not specifically optimized for its physiological and temporal characteristics.
  • The model uses multi-head self-attention to capture long-range dependencies across EEG channels and time points, enabling joint spatial-temporal representation learning.
  • Classifier heads are added on top of the learned representations for binary and multi-class classification tasks on both datasets.
  • The network is trained end-to-end using cross-entropy loss with early stopping, and hyperparameters are tuned via validation performance.
  • Ablation studies compare the proposed model against attention-based baselines, confirming the advantage of multi-head attention in EEG representation learning.

Experimental results

Research questions

  • RQ1Can transformer networks effectively classify raw EEG data without prior feature extraction, achieving performance comparable to or better than state-of-the-art methods?
  • RQ2How does the performance of a transformer-based model compare to traditional machine learning and deep learning models on EEG classification tasks?
  • RQ3To what extent does multi-head self-attention in transformers capture relevant spatiotemporal patterns in EEG signals for classification?
  • RQ4Does the choice of positional encoding impact performance on EEG data, and can it be optimized for neurophysiological signal characteristics?
  • RQ5Can the proposed framework generalize across different EEG classification paradigms, such as age/gender prediction and mental workload estimation?

Key findings

  • The transformer model achieved 94.53% accuracy for gender classification and 87.79% for age classification on the local EEG dataset, demonstrating strong performance without feature engineering.
  • On the public STEW dataset, the model reached 95.28% accuracy for two-level workload classification and 88.72% for three-level classification, outperforming existing state-of-the-art methods.
  • The model’s performance was consistently high across metrics including precision, recall, and F1-score, with confusion matrices and ROC curves indicating robust generalization.
  • Ablation studies confirmed that multi-head attention significantly outperforms single-attention mechanisms, highlighting its importance in learning complex EEG representations.
  • The results suggest that transformers can effectively learn meaningful representations from raw EEG data, reducing dependency on manual feature extraction.
  • Despite strong results, performance was slightly lower on the age/gender dataset compared to STEW, possibly due to suboptimal positional encoding and lack of domain-specific feature integration.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.