Transformer-based Spatial-Temporal Feature Learning for EEG Decoding

Yonghao Song, Xueyu Jia, Lie Yang, Longhan Xie
6/11/2021
eess.SPcs.AIcs.LG

Official code: eeyhsong/EEG-Transformer (335 stars, GPL-3.0, last commit 2023-03-23).

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}.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

i. A practical application of Transformer (ViT) on 2-D physiological signal (EEG) classification tasks. Also could be tried with EMG, EOG, ECG, etc. ii. Including the attention of spatial dimension (channel attention) and *temporal dimension*. iii. Common spatial pattern (CSP), an efficient feature enhancement method, realized with Python.

33543MATLAB, PythonMay 27, 20213 years agoGPL-3.0
attentionattention-mechanismcommon-spatial-patterndeep-learningeeg+4 more

Similar Papers

Cite this paper

@article{song2021transformerbased,
  title  = {Transformer-based Spatial-Temporal Feature Learning for EEG Decoding},
  author = {Yonghao Song and Xueyu Jia and Lie Yang and Longhan Xie},
  year   = {2021},
  eprint = {2106.11170},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.11170}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.11170.svg)](https://codeofpaper.com/paper/2106.11170)

Discussion