Table of Contents
Fetching ...

Transformer-based Spatial-Temporal Feature Learning for EEG Decoding

Yonghao Song, Xueyu Jia, Lie Yang, Longhan Xie

TL;DR

This paper presents S3T, a compact transformer-based framework for EEG decoding that emphasizes learning global spatial and temporal dependencies via a spatial-channel attention and temporal-slice attention mechanism. It introduces a CSP-based spatial filter, a feature-channel attention block, and a temporal multi-head attention module with position encoding to capture long-range dependencies in motor imagery EEG signals. Through extensive experiments on BCI IV 2a and 2b datasets, S3T achieves state-of-the-art performance with significantly fewer parameters compared to strong CNN/RNN baselines, and ablations confirm the critical roles of temporal transforming and positional encoding. The approach offers a practical, efficient backbone for EEG decoding with potential to enhance real-world brain-computer interface applications.

Abstract

At present, people usually use some methods based on convolutional neural networks (CNNs) for Electroencephalograph (EEG) decoding. However, CNNs have limitations in perceiving global dependencies, which is not adequate for common EEG paradigms with a strong overall relationship. Regarding this issue, we propose a novel EEG decoding method that mainly relies on the attention mechanism. The EEG data is firstly preprocessed and spatially filtered. And then, we apply attention transforming on the feature-channel dimension so that the model can enhance more relevant spatial features. The most crucial step is to slice the data in the time dimension for attention transforming, and finally obtain a highly distinguishable representation. At this time, global averaging pooling and a simple fully-connected layer are used to classify different categories of EEG data. Experiments on two public datasets indicate that the strategy of attention transforming effectively utilizes spatial and temporal features. And we have reached the level of the state-of-the-art in multi-classification of EEG, with fewer parameters. As far as we know, it is the first time that a detailed and complete method based on the transformer idea has been proposed in this field. It has good potential to promote the practicality of brain-computer interface (BCI). The source code can be found at: \textit{https://github.com/anranknight/EEG-Transformer}.

Transformer-based Spatial-Temporal Feature Learning for EEG Decoding

TL;DR

This paper presents S3T, a compact transformer-based framework for EEG decoding that emphasizes learning global spatial and temporal dependencies via a spatial-channel attention and temporal-slice attention mechanism. It introduces a CSP-based spatial filter, a feature-channel attention block, and a temporal multi-head attention module with position encoding to capture long-range dependencies in motor imagery EEG signals. Through extensive experiments on BCI IV 2a and 2b datasets, S3T achieves state-of-the-art performance with significantly fewer parameters compared to strong CNN/RNN baselines, and ablations confirm the critical roles of temporal transforming and positional encoding. The approach offers a practical, efficient backbone for EEG decoding with potential to enhance real-world brain-computer interface applications.

Abstract

At present, people usually use some methods based on convolutional neural networks (CNNs) for Electroencephalograph (EEG) decoding. However, CNNs have limitations in perceiving global dependencies, which is not adequate for common EEG paradigms with a strong overall relationship. Regarding this issue, we propose a novel EEG decoding method that mainly relies on the attention mechanism. The EEG data is firstly preprocessed and spatially filtered. And then, we apply attention transforming on the feature-channel dimension so that the model can enhance more relevant spatial features. The most crucial step is to slice the data in the time dimension for attention transforming, and finally obtain a highly distinguishable representation. At this time, global averaging pooling and a simple fully-connected layer are used to classify different categories of EEG data. Experiments on two public datasets indicate that the strategy of attention transforming effectively utilizes spatial and temporal features. And we have reached the level of the state-of-the-art in multi-classification of EEG, with fewer parameters. As far as we know, it is the first time that a detailed and complete method based on the transformer idea has been proposed in this field. It has good potential to promote the practicality of brain-computer interface (BCI). The source code can be found at: \textit{https://github.com/anranknight/EEG-Transformer}.

Paper Structure

This paper contains 20 sections, 14 equations, 6 figures, 2 tables.

Figures (6)

  • Figure 1: The overall framework of Spatial-Temporal Tiny Transformer (S3T). After preprocessing and spatial filter, the method contains spatial transforming and temporal transforming built with the attention mechanism. There is a simple classifier consisting of global average pooling and a fully-connected layer.
  • Figure 2: The calculation process of spatial feature-channel attention.
  • Figure 3: The classification results on BCI competition IV datasets 2a and BCI competition IV datasets 2b shown in confusion matrices.
  • Figure 4: The results of the ablation study on datasets 2a.
  • Figure 5: The results of parameter sensitivity tests. The position encoding kernel and the slice size are independently changed to test the performance of our model on the first subject of datasets 2a and datasets 2b.
  • ...and 1 more figures