A transformer-based deep neural network model for SSVEP classification

Jianbo Chen, Yangsong Zhang, Yudong Pan, Peng Xu, Cuntai Guan

TL;DR

Researchers have introduced SSVEPformer, the first Transformer-based deep learning model designed to classify Steady-State Visual Evoked Potentials (SSVEP). By utilizing complex frequency spectra and a filter-bank approach, the model achieves state-of-the-art performance in "inter-subject" scenarios, potentially eliminating the need for tedious, user-specific calibration in brain-computer interfaces (BCIs).

What Problem Does This Paper Address?

Steady-State Visual Evoked Potential (SSVEP) is a cornerstone of BCI technology. When you look at a light flickering at a specific frequency (say, 12 Hz), your brain’s visual cortex generates electrical signals at that same frequency and its harmonics. By decoding these signals via EEG, a computer can tell which flickering icon you are looking at—allowing you to type or control a wheelchair just by gazing.

The "Achilles' heel" of current SSVEP systems is calibration. Most high-accuracy methods are "intra-subject," meaning the system must be trained on a specific user's brain data before it works for them. Because brain signals vary wildly between individuals, "inter-subject" (or "plug-and-play") systems usually suffer from poor accuracy. This paper aims to bridge that gap using the power of Transformer architectures to find universal, subject-invariant features in brain waves.

Methods

The authors propose two versions of their model: SSVEPformer and FB-SSVEPformer.

  1. Complex Spectrum Input: Instead of feeding raw, noisy EEG time-series data into the network, they use a Fast Fourier Transform (FFT) to convert signals into the frequency domain. Crucially, they use the complex spectrum (retaining both real and imaginary parts), which preserves vital phase information that simple magnitude spectra discard.
  2. The "Transformer-esque" Architecture: While inspired by the standard Transformer, the authors made a strategic swap. They replaced the traditional self-attention mechanism with a CNN module (1D Convolution). They argue that for spectral EEG data, local feature extraction via convolution is more efficient than global attention for capturing the relationships between frequency components.
  3. Filter Bank (FB) Technology: To capture the "harmonics" (multiples of the flickering frequency), the FB-SSVEPformer divides the signal into multiple sub-bands. Each band is processed by a separate sub-network, and the results are fused using a convolutional layer to make the final prediction.

Datasets

The model was validated on two widely recognized open-source benchmarks:

  • Dataset 1: 10 subjects, 12-class task (frequencies ranging from 9.25 Hz to 14.75 Hz).
  • Dataset 2: 35 subjects, 40-class task (a much more complex "joint frequency and phase modulation" dataset ranging from 8 Hz to 15.8 Hz).

Key Insights and Ideas

  • Phase Matters: The decision to use complex spectra was pivotal. By including the imaginary part of the FFT, the model could leverage phase differences between subjects, which is often the "secret sauce" in distinguishing similar frequencies.
  • Attention Isn't Always All You Need: In a surprising twist on the current "Transformer-everything" trend, the authors found that replacing self-attention with 1D convolutions within the Transformer block actually improved feature extraction for this specific type of biological signal.
  • Interpretability via Grad-CAM: Using Gradient-weighted Class Activation Mapping, the authors visualized what the model was "looking at." The heatmaps confirmed the model was correctly focusing on the fundamental stimulation frequencies and their harmonics, proving it wasn't just picking up on random noise.

Key Results

In the challenging inter-subject (leave-one-subject-out) scenario, the proposed models outperformed established baselines like EEGNet, CCNN, and TRCA:

  • Accuracy: On the 40-class dataset (Dataset 2), FB-SSVEPformer achieved 83.19% accuracy with a 1-second signal window.
  • Speed (ITR): It reached an Information Transfer Rate (ITR) of 157.65 bits/min, significantly higher than the baseline methods.
  • Subject-Adaptive Boost: When the researchers allowed for a tiny bit of calibration (using just one "block" of the new user's data), the accuracy for both models skyrocketed to over 90%. This suggests the model is an excellent "base" that can be quickly fine-tuned for near-perfect performance.

Limitations and Future Work

Despite the impressive results, the authors note a few hurdles:

  • Data Hunger: While it works well across subjects, the model still requires a large pool of data from other subjects to train the initial weights.
  • Offline vs. Online: The study was conducted on pre-recorded (offline) data. The next step is to prove these ITR speeds hold up in a real-time, closed-loop BCI system.
  • Dataset Diversity: The authors suggest testing on even larger datasets, such as the BETA dataset, to further prove the model's robustness across diverse populations.

Summary updated

BibTeX
@article{chen2023transformer,
  author = {Jianbo Chen and Yangsong Zhang and Yudong Pan and Peng Xu and Cuntai Guan},
  title = {{A transformer-based deep neural network model for SSVEP classification}},
  journal = {Neural Networks},
  year = {2023},
  doi = {10.1016/j.neunet.2023.04.045},
}
Figure