FoME: A Foundation Model for EEG using Adaptive Temporal-Lateral Attention Scaling

Enze Shi, Kui Zhao, Qilong Yuan, Jiaqi Wang, Huawen Hu, Sigang Yu, Shu ZhangarXiv 2024

TL;DR

FoME (Foundation Model for EEG) is a massive 745-million-parameter foundation model trained on 1.7TB of diverse scalp and intracranial EEG data. By introducing a novel time-frequency fusion embedding and a topology-agnostic attention mechanism, FoME achieves state-of-the-art performance across multiple downstream tasks, including seizure detection, emotion recognition, and signal forecasting.

What Problem Does This Paper Address?

Electroencephalography (EEG) is invaluable for tracking brain activity, but building robust machine learning models for it is notoriously difficult. EEG data suffers from low signal-to-noise ratios and high heterogeneity: different clinical and research studies use vastly different sampling rates, equipment, and electrode layouts (channel configurations).

Historically, researchers have built small, task-specific models trained from scratch on limited labeled datasets. While foundation models have revolutionized natural language processing and computer vision by pre-training on massive unlabeled datasets, doing the same for EEG requires overcoming these structural data discrepancies and finding a way to optimally balance both temporal and spectral (frequency) information.

Methods

The authors introduce FoME, which processes raw EEG signals through a self-supervised masked signal reconstruction task (predicting 40% of randomly masked signal patches). The architecture consists of three primary components:

  1. Time-Frequency Fusion Module: Instead of relying solely on raw time-domain data, this module extracts the power spectral density (PSD) across eight distinct frequency bands ($\delta, \theta, \alpha, \beta, \gamma_1, \gamma_2, \gamma_3, \gamma_4$). These frequency features are normalized, linearly embedded, and combined with temporal and learnable positional embeddings to form a unified representation.
  2. Temporal Encoder: A stack of dense Transformer encoding layers that captures long-range temporal dependencies along the time dimension.
  3. Adaptive Time-Lateral Attention Scaling (ATLAS) Mechanism: This is the model's core spatial innovation. Implemented within an Adaptive Multi-Channel Encoder, ATLAS decouples the channel dimension from the sample dimension. It learns latent associations between different channels globally, allowing the model to dynamically adapt to varying electrode structures without needing fixed topological maps or custom channel encodings.
Overview of the FoME architecture, pre-training process, and downstream tasks.

Datasets

FoME was pre-trained on a massive, heterogeneous corpus of over 30,000 recordings from more than 15,000 subjects, totaling ~26,000 hours of data (>1.7TB). The corpus combines eight major datasets:

  • Scalp EEG: TUEG, SEED, SEED-IV, CHB-MIT, Sleep-EDFx, and MI-Dataset (sampling rates from 100 Hz to 1024 Hz; 3 to 64 channels).
  • Invasive EEG (iEEG/SEEG): MAYO (32 kHz) and FNUSA (25 kHz), featuring up to 192 channels.

For downstream evaluation, the model was tested on MAYO and FNUSA (seizure detection/classification, forecasting, imputation), SEED (emotion recognition), and SleepEDFx (sleep stage classification).

Left: FoME's pre-training dataset composition. Right: Parameter scale comparison with existing EEG models.

Key Insights and Ideas

  • Topology-Agnostic Modeling: By decoupling temporal and spatial attention, FoME bypasses a major bottleneck in EEG deep learning. It doesn't care how many electrodes were used or where they were placed on the scalp; the ATLAS mechanism learns the spatial relationships dynamically.
  • The Power of Time-Frequency Synergy: Ablation studies showed that omitting the frequency-domain features noticeably degraded performance. Merging spectral power distributions directly into the initial token embedding provides crucial context that transformers struggle to compute from raw waveforms alone.
  • EEG Scaling Laws Hold Up: Mirroring trends in LLMs, the authors observed a clear positive correlation between model parameter size and downstream performance, with the 745M "Large" variant consistently outperforming the 476M "Base" variant.

Key Results

FoME was compared against eight baseline models, including specialized EEG architectures (BrainBERT, Brant, LaBraM, Neuro-GPT) and advanced time-series models (PatchTST, TimesNet).

  • Seizure Tasks: In a challenging three-category seizure classification task (physiological, pathological, artifact), FoME-Large achieved an F2 score of 87.72% on the MAYO dataset, outperforming all baselines.
  • Signal Forecasting & Imputation: FoME demonstrated a massive advantage in predicting future signal trends (both short-term and long-term) and reconstructing missing data. In signal imputation, FoME achieved an average loss reduction of 0.1488 over the previous state-of-the-art model, PatchTST.
Fig. 3. Detailed structural presentation of time-frequency fusion encoding, temporal encoder and adaptive multi-channel encoder.

Limitations and Future Work

Despite its success, the authors note several limitations:

  • Modality Imbalance: The pre-training dataset underrepresents sleep, emotion-related, and motor imagery data compared to clinical/epilepsy recordings.
  • Context Window Constraints: The model is currently limited to an input sequence length of 90 seconds, which may restrict its performance on tasks requiring very long-term context.
  • Unexplored Zero-Shot Capabilities: While fine-tuning performance is excellent, the model's true zero-shot capabilities and its performance on long-term forecasting tasks remain open areas for future exploration.

Summary updated

BibTeX
@misc{shi2024fome,
  author = {Enze Shi and Kui Zhao and Qilong Yuan and Jiaqi Wang and Huawen Hu and Sigang Yu and Shu Zhang},
  title = {{FoME: A Foundation Model for EEG using Adaptive Temporal-Lateral Attention Scaling}},
  year = {2024},
  eprint = {2409.12454},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.12454},
}
Figure