Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

CodeBrain: Bridging Decoupled Tokenizer and Multi-Scale Architecture for EEG Foundation Model

About

Electroencephalography (EEG) provides real-time insights into brain activity and supports diverse applications in neuroscience. While EEG foundation models (EFMs) have emerged to address the scalability issues of task-specific models, current approaches still yield clinically uninterpretable and weakly discriminative representations, inefficiently capturing global dependencies and neglecting important local neural events. We present CodeBrain, a two-stage EFM designed to fill this gap. In the first stage, we introduce the TFDual-Tokenizer, which decouples heterogeneous temporal and frequency EEG signals into discrete tokens, quadratically expanding the representation space to enhance discriminative power and offering domain-specific representation-level interpretability by suggesting potential links to neural events and spectral rhythms. In the second stage, we propose the multi-scale EEGSSM architecture, which combines structured global convolution with sliding window attention to efficiently capture both sparse long-range and local dependencies, reflecting the brain's small-world topology. Pretrained on the largest public EEG corpus, CodeBrain achieves strong generalization across eight downstream tasks and ten datasets under distribution shifts, supported by comprehensive ablations, scaling-law analyzes, and interpretability evaluations. The code and the pretrained weights are available at https://github.com/jingyingma01/CodeBrain.

Jingying Ma, Feng Wu, Qika Lin, Yucheng Xing, Chenyu Liu, Ziyu Jia, Mengling Feng• 2025

Related benchmarks

TaskDatasetResultRank
Binary classification of normal versus abnormal EEG signalsTUAB
Balanced Accuracy82.94
113
EEG ClassificationSEED
AUPRC64.3
32
EEG ClassificationISRUC
Kappa58.46
32
EEG ClassificationMental Arithmetic
AUPRC47.1
32
Six-class classification of EEG eventsTUEV
Balanced Accuracy64.28
27
EEG ClassificationTUEV (test)
Balanced Accuracy64.28
24
Binary ClassificationCHB_MIT 2-Class (test)
AUROC0.8961
20
Binary ClassificationMental Arithmetic 2-Class (test)
AUROC87.07
10
EEG ClassificationISRUC_S1 5-Class
Cohen's Kappa0.7476
10
Motor Imagery ClassificationSHU-MI 2-Class
Balanced Accuracy64.31
10
Showing 10 of 19 rows

Other info

Follow for update