MAGE: Towards Generalizable Multi-timescale EEG Representations
Authors: Tuan-Kiet Doan, Van-Chien Nguyen, Trung-Hieu Tran, Quang-Hung Pham, Ngoc-Son Vu, Huy Phan, Phi Le Nguyen, Duc-Han Le, Nikola Simidjievski, Van-Tam Nguyen
Organizations: LTCI, Télécom Paris, Institut Polytechnique de Paris, Palaiseau, France · LIST3N, Université de Technologie de Troyes · German Research Center for Artificial Intelligence (DFKI), Germany · Institute for AI Innovation and Societal Impact, Hanoi University of Science and Technology, Vietnam
Electroencephalography (EEG) data plays an important role in understanding human brain activity, with various major applications. While current approaches, which largely build on EEG foundation models, have demonstrated strong performance across datasets and tasks, they typically rely on a fixed temporal scale. This design choice limits their ability to capture characteristics of neural dynamic behavior, often spanning across multiple timescales, which are naturally captured in EEG recordings. To address this limitation, we propose MAGE (Multi-timescale Adaptive Generalization for EEG), a foundation model that dynamically adapts to capture and integrate information across different timescales. Specifically, MAGE combines two key mechanisms: (i) a novel multi-timescale attention mechanism, capable of learning representations across multiple temporal scales and (ii) a trainable aggregation module, that dynamically identifies and adapts to the most informative timescale of the input signal. Experimental results across seven datasets demonstrate that MAGE consistently outperforms existing EEG foundation models while using substantially fewer parameters. Moreover, our results support the hypothesis that different downstream tasks benefit from distinct temporal scales.
Figures & tables
Figure 1: Overview of the MAGE pretraining pipeline. MAGE employs (A) Multi-timescale tokenization and (B) Multi-timescale encoder, optimized with a dual-loss scheme for both semantic and fine-grained learning. (C) Multi-timescale Aggregator dynamically weights each scale for the final reconstruction.
Dataset
Metrics
Medformer
LaBram
BIOT
EEGPT
CBraMod
CSBrain
MAGE
MAGE-froz
1.4M
5.8M
3.2M
25.0M
4.0M
8.9M
0.6M
0.6M
BCIC-IV-2a
bAcc
52.68 ±6.06 ↓
49.75 ±8.73 ↓
49.92 ±11.74
50.49 ±6.38 ↓
46.09 ±6.63 ↓
55.11 ±8.63
56.78 ±6.08
60.81 ±10.05
Kappa
36.91 ±8.08 ↓
33.00 ±11.64 ↓
33.23 ±15.65
33.98 ±8.50 ↓
28.12 ±8.83 ↓
40.14 ±11.50
42.38 ±8.11
47.75 ±13.40
wF1
52.08 ±6.34 ↓
47.64 ±10.12 ↓
48.06 ±13.36
49.61 ±6.77 ↓
45.02 ±6.96 ↓
54.12 ±8.96
55.61 ±6.60
59.30 ±11.72
PhysioNet
bAcc
59.01 ±3.39 ↓
58.82 ±4.40 ↓
55.02 ±3.33 ↓
53.80 ±2.91 ↓
52.22 ±4.01 ↓
60.62 ±3.14 ↓
62.69 ±3.59
64.08 ±3.51
Kappa
45.36 ±4.52 ↓
45.11 ±5.86 ↓
40.05 ±4.43 ↓
38.41 ±3.88 ↓
36.30 ±5.35 ↓
47.52 ±4.18 ↓
50.27 ±4.77
52.12 ±4.66
Table 1: Comparison of MAGE with existing foundation models across various downstream tasks, metrics, and test subjects. Numbers under model names indicate parameter sizes in millions (M). MAGE-froz denotes MAGE where the aggregator is kept frozen during downstream evaluation. MAGE achieves the highest average ranking among all models. Bold indicates the best result, and underlined indicates the second best. The symbol ↓ indicates that the baseline model is significantly worse than MAGE, while ↑ indicates that the baseline model is significantly better than MAGE based on the corrected two-sided paired t-test ( p<0.05 ). The average rank is calculated across all metrics.
Figure 2: Distribution of importance weights across timescales by dataset. It can be shown that each dataset requires a different scale to capture relevant information.
Dataset
Metrics
250ms only
500ms only
1s only
MAGE-router
MAGE
FACED
Balanced Acc
50.93 ±2.82
49.78 ±1.80
46.65 ±1.84
49.87 ±2.45
51.30 ±3.11
Cohen’s Kappa
44.41 ±3.19
43.14 ±1.97
39.79 ±1.98
43.22 ±2.78
44.89 ±3.43
Weighted F1
50.43 ±2.91
49.20 ±1.75
46.36 ±1.53
49.36 ±2.45
50.97 ±2.96
Physionet-MI
Balanced Acc
60.08 ±0.16
60.65 ±0.98
60.55 ±0.96
58.83 ±1.35
61.15 ±0.86
Cohen’s Kappa
46.81 ±0.21
47.58 ±1.30
47.41 ±1.28
45.13 ±1.79
48.23 ±1.15
Weighted F1
60.17 ±0.35
60.66 ±0.96
60.47 ±1.05
58.83 ±1.42
61.16 ±0.90
Table 2: Comparison of different timescales performance. MAGE achieves a better performance than any single timescales, while MAGE-router is able to achieve a fair comparison with the best single scale in some tasks. Bold indicates the best result, and underlined indicates the second best. The average rank is calculated across all metrics. The result ablation is reported on 1 seed.
Dataset
Metrics
MAGE
Inter Attention
Uniform Weight
FACED
Balanced Acc
51.42 ±2.11
50.79 ±3.04
50.85 ±2.48
Cohen’s Kappa
44.97 ±2.31
44.27 ±3.33
44.43 ±2.73
Weighted F1
50.94 ±1.97
50.26 ±2.93
50.52 ±2.38
PhysioNet-MI
Balanced Acc
62.69 ±3.59
60.48 ±0.87
60.90 ±1.02
Cohen’s Kappa
50.27 ±4.77
47.31 ±1.17
47.87 ±1.35
Weighted F1
62.71 ±3.54
60.68 ±0.87
61.09 ±1.05
Table 3: Comparison of MAGE with other multi-timescale methods. MAGE remains competitive with the Inter Attention method, even while utilizing a lightweight aggregator in contrast to a complex attention module. Bold indicates the best result, and underlined indicates the second best. The symbol ↓ indicates that the baseline model is significantly worse than MAGE.
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
Symbol
Space
Meaning
C
N
Number of channels
T
N
Number of timestamps
G
N
Number of patch sizes
pg
N
Patch size at index g
ng
N
Number of segments at index g
D
N
Feature dimension
Appendix
Table 4: Table of notations.
Component
Hyperparameters
Settings
EEG sample
Channels
19
Time points
6000 (30s @ 200Hz)
Patch sizes
50 100 200 (250ms 500ms 1s)
Mask ratio
0.7
Mask token
Constant
Encoder
Layers (depth)
6
Appendix
Table 5: Hyperparameters for MAGE pre-training on a single NVIDIA A100 40GB.
Figure 3: Downstream pipeline of MAGE. Aggregator is adopted to dynamically weight each time scale before adding them together for final prediction.
Dataset
Rate
Number of Channels
Duration
Labels
BCIC-IV-2A
250 Hz
22
4s
4-class
PhysioNet-MI
160 Hz
64
4s
4-class
FACED
250 Hz
32
10s
9-class
Sleep-EDFx
100 Hz
2
30s
5-class
TUAB
250 Hz
16
10s
2-class
KaggleERN
200 Hz
56
2s
2-class
Appendix
Table 6: Overview of evaluation EEG datasets.
Models
Training Paradigm
Sampling rate (Hz)
Params. (M)
Medformer
supervised
200
1.4
LaBraM
self- supervised
200
5.8
BIOT
self- supervised
200
3.2
EEGPT
self- supervised
256
25.0
CBraMod
self- supervised
200
4.0
CSBrain
self- supervised
200
8.9
Appendix
Table 7: The sampling rate and number of parameters of each model.
Figure 4: Histogram of weight distribution of different datasets.
Dataset
Metrics
MAGE
MAGE wo noise
FACED
Balanced Acc
51.30 ±3.11
50.35 ±2.62
Cohen’s Kappa
44.89 ±3.43
43.80 ±3.02
Weighted F1
50.97 ±2.96
49.84 ±2.80
PhysioNet-MI
Balanced Acc
61.15 ±0.86
61.57 ±1.15
Cohen’s Kappa
48.23 ±1.15
48.78 ±1.51
Weighted F1
61.16 ±0.90
61.66 ±1.14
Appendix
Table 8: Effectiveness of Noise Injection on Preventing Granularity Collapse. MAGE pretrained with noise achieves a better performance. Bold indicates the best result. The result is reported on 1 seed.
Figure 5: Impact of multi-timescale patch configurations on representation performance across different datasets. Modifying the patch size configurations results in varying performance levels across multiple datasets. The result is reported on 1 seed.
Dataset
Metrics
MAGE
MAGE-uniform pretrain
PhysioNet-MI
Balanced Acc
61.15 ±0.86
61.15 ±0.27
Cohen’s Kappa
48.23 ±1.15
48.23 ±0.37
Weighted F1
61.16 ±0.90
61.31 ±0.25
FACED
Balanced Acc
51.30 ±3.11
46.92 ±2.13
Cohen’s Kappa
44.89 ±3.43
40.19 ±2.39
Weighted F1
50.97 ±2.96
46.88 ±2.11
Appendix
Table 9: MAGE variant where the Aggregator is used only during downstream adaptation, while pretraining is performed with uniform training. The result is reported on 1 seed.
Figure 6: Balance accuracy of MAGE on two datasets when changing the ratio of λrecon/λalign . Using both types of loss achieves better performance than a single loss. The result is reported on 1 seed.
Dataset
Metrics
Mask 50%
Mask 60%
Mask 70%
Mask 80%
FACED
Balanced Acc
50.83 ±3.84
51.22 ±3.44
51.30 ±3.11
51.30 ±2.21
Cohen’s Kappa
44.31 ±4.24
44.83 ±3.77
44.89 ±3.43
44.80 ±2.49
Weighted F1
50.41 ±3.76
50.79 ±3.24
50.97 ±2.96
50.61 ±2.20
Appendix
Table 10: Balanced accuracy on FACED of different pretraining masking ratio. The overall differences are marginal across different masking ratios. The result is reported on 1 seed.
Dataset
Metrics
Learnable Channel Embedding
RoPE
FACED
Balanced Acc
51.30 ±3.11
50.99 ±3.00
Cohen’s Kappa
44.89 ±3.43
44.43 ±3.26
Weighted F1
50.97 ±2.96
50.34 ±2.85
Appendix
Table 11: Comparison of using learnable channel embedding versus RoPE for channel positional embedding. The result is reported on 1 seed.
Dataset
Metrics
MAGE-500h
MAGE-2500h
PhysioNet-MI
Balanced Acc
61.15 ±0.86
62.57 ±0.73
Cohen’s Kappa
48.23 ±1.15
50.12 ±0.98
Weighted F1
61.16 ±0.90
62.62 ±0.75
FACED
Balanced Acc
51.30 ±3.11
52.02 ±2.22
Cohen’s Kappa
44.89 ±3.43
45.68 ±2.40
Weighted F1
50.97 ±2.96
51.62 ±1.94
Appendix
Table 12: MAGE when pretrained on different training hours of EEG signal. The result is reported on 1 seed.
Electroencephalography (EEG) foundation models learn reusable representations of brain signals for transfer across people, tasks, and recording setups.
Self-supervised foundation models have recently shown strong potential for electroencephalogram (EEG)-based analysis. However, existing approaches struggle to capture the inherently multi-scale temporal structure of EEG signals, where local neural patterns and long-range dependencies jointly encode task-relevant information. This limitation hampers cross-scale representation learning and generalization across diverse downstream tasks. To address this challenge, we propose MSBraM, a Multi-Scale self-supervised Brain foundation Model designed to learn hierarchical EEG representations. MSBraM follows a two-stage pretraining framework. First, a multi-scale neural tokenizer discretizes raw EEG signals into semantic codes at different temporal resolutions via vector-quantized reconstruction. Second, the model is pretrained to predict masked codes using a curriculum multi-scale masking strategy, progressively integrating fine-grained local patterns with global temporal context. We pretrain MSBraM on over 2,400 hours of EEG data and evaluate it across 10 downstream tasks on 12 public datasets. Extensive experiments show that MSBraM achieves superior performance on other state-of-the-art pretrained models, demonstrating strong generalization and transferability. These results indicate that explicitly modeling multi-scale temporal dynamics is critical for effective EEG foundation models.
Foundation models pre-trained on large unlabeled electroencephalography (EEG) corpora have emerged as a transformative paradigm for Brain-Computer Interface (BCI) applications. Recent EEG foundation models have shown that multi-scale representations derived from fixed-length patches can improve EEG representation learning. Existing frameworks commonly construct temporal scales through feature-level operations. However, these operations leave the correspondence between learned features and scale-specific characteristics of the original EEG signals implicit. Moreover, when the self-supervised objective is not aligned with the multi-scale input representations, information at some temporal scales may receive insufficient supervision during pre-training. In light of this, we propose ScaleBrain, a scale-consistent pre-training framework that explicitly coordinates multi-scale representations of EEG from both the model input and optimization objective sides. Specifically, ScaleBrain introduces multi-scale EEG tokenization to represent the same EEG segment through analysis windows with different temporal spans and shared temporal anchors, and pairs these representations with scale-specific reconstruction to align with the multi-scale input structure and provide supervision across temporal resolutions during self-supervised learning. We further develop an axial spatio-temporal attention mechanism to contextualize the fused multi-scale representation along spatial and temporal dimensions. Extensive evaluations on six public BCI benchmarks against 12 representative baselines show that ScaleBrain achieves the highest mean Balanced Accuracy on five datasets and ranks third on the remaining one, with only 5.0M parameters, demonstrating strong performance and favorable parameter efficiency.
Minyu Zhou, Yajing Wu, Yongqiang Tang +2
College of Computer Science, Nankai University, Tianjin 300350, China · State Key Laboratory of Multimodal Artificial Intelligence Systems, Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China · Department of Neurosurgery, Beijing Tiantan Hospital, Capital Medical University, Beijing 100070, China +1
In real-world applications of noninvasive electroencephalography (EEG), specialized decoders often show limited generalizability across diverse tasks under subject-independent settings. One central challenge is that task-relevant EEG signals often follow different temporal organization patterns across tasks, while many existing methods rely on task-tailored architectural designs that introduce task-specific temporal inductive biases. This mismatch makes it difficult to adapt temporal modeling across tasks without changing the model configuration. To address these challenges, we propose DSAINet, an efficient dual-scale attentive interaction network for general EEG decoding. Specifically, DSAINet constructs shared spatiotemporal token representations from raw EEG signals and models diverse temporal dynamics through parallel convolutional branches at fine and coarse scales. The resulting representations are then adaptively refined by intra-branch attention to emphasize salient scale-specific patterns and by inter-branch attention to integrate task-relevant features across scales, followed by adaptive token aggregation to yield a compact representation for prediction. Extensive experiments on five downstream EEG decoding tasks across ten public datasets show that DSAINet consistently outperforms 13 representative baselines under strict subject-independent evaluation. Notably, this performance is achieved using the same architecture hyperparameters across datasets. Moreover, DSAINet achieves a favorable accuracy-efficiency trade-off with only about 77K trainable parameters and provides interpretable neurophysiological insights. The code is publicly available at https://github.com/zy0929/DSAINet.
Zhiyuan Ma, Zeyuan Li, Zihao Qiu +6
School of Biomedical Engineering, Tsinghua Laboratory of Brain and Intelligence, and IDG/McGovern Institute for Brain Research, Tsinghua University, Beijing 100084, China · School of Basic Medical Sciences and Tsinghua Laboratory of Brain and Intelligence, Tsinghua University, Beijing 100084, China · Department of Psychological and Cognitive Sciences, Tsinghua University, Beijing 100084, China +1