BrainRVQ: A High-Fidelity EEG Foundation Model via Dual-Domain Residual Quantization and Hierarchical Autoregression
Organizations: State Key Laboratory of Industrial Control Technology, Zhejiang University, Hangzhou, China · Department of Electronics, Information and Bioengineering, Politecnico di Milano, Milan, Italy · Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences, Shenzhen, China
Abstract
Developing foundation models for electroencephalography (EEG) remains challenging due to the signal's low signal-to-noise ratio and complex spectro-temporal non-stationarity. Existing approaches often overlook the hierarchical latent structure inherent in neural dynamics, leading to suboptimal reconstruction of fine-grained information. In this work, we propose BrainRVQ, a general-purpose EEG foundation model pre-trained on a large-scale corpus of clinical EEG data. Unlike standard masked modeling, BrainRVQ features a Dual-Domain Residual Vector Quantization (DD-RVQ) tokenizer that disentangles temporal waveforms and spectral patterns into hierarchical discrete codes. We further introduce a hierarchical autoregressive pre-training objective that learns to reconstruct these codes in a coarse-to-fine manner, utilizing an importance-guided curriculum masking strategy to prioritize information-rich neural events over background noise. Extensive experiments across 8 diverse downstream datasets demonstrate that BrainRVQ consistently outperforms state-of-the-art baselines, validating its effectiveness in learning robust and generalizable neural representations. Our code and model weights are available:https://github.com/keqicmz/BrainRVQ
Figures & tables
| Task | Dataset | #Ch | Win(s) | #Samps | Type |
|---|---|---|---|---|---|
| Abnormal Det. | TUAB ( Obeid and Picone, 2016 ) | 16 | 10 | 409,455 | Binary |
| Event Class. | TUEV ( Obeid and Picone, 2016 ) | 16 | 5 | 112,491 | 6-Class |
| Seizure Det. | CHB-MIT ( Shoeb, 2009 ) | 16 | 10 | 326,993 | Binary |
| Emotion Rec. | SEED-V ( Liu et al., 2021 ) | 62 | 1 | 117,744 | 5-Class |
| Motor Imagery | PhysioNet ( Schalk et al., 2004 ) | 64 | 4 | 9,837 | 4-Class |
| SHU-MI ( Ma et al., ) | 32 | 4 | 11,988 | Binary |
| Method | Mental Workload | CHB-MIT | ||||
|---|---|---|---|---|---|---|
| Bal. Acc | AUC-PR | AUROC | Bal. Acc | AUC-PR | AUROC | |
| EEGNet | 0.677 0.012 | 0.576 0.010 | 0.732 0.011 | 0.566 0.011 | 0.191 0.018 | 0.805 0.014 |
| ST-Transformer | 0.663 0.017 | 0.567 0.026 | 0.713 0.017 | 0.592 0.020 | 0.142 0.009 | 0.824 0.049 |
| BENDR | 0.568 0.045 | 0.366 0.067 | 0.568 0.045 | 0.561 0.043 | 0.307 0.124 | 0.863 0.053 |
| BIOT | 0.688 0.019 | 0.600 0.020 | 0.754 0.014 | 0.707 0.046 | 0.328 0.046 | 0.876 0.028 |
| LaBraM | 0.691 0.013 | 0.600 0.016 | 0.772 0.009 | 0.708 0.036 | 0.329 0.040 | 0.868 0.020 |
| Configuration | Binary (AUROC ) | Multi-class (Kappa ) | ||
|---|---|---|---|---|
| Mental | CHB-MIT | TUEV | BCICIV-2a | |
| Full Model | 0.862 | 0.928 | 0.690 | 0.388 |
| (a) Dual-Domain Token. | ||||
| w/o Freq codebook | 0.845 | 0.887 | 0.639 | 0.373 |
| w/o Time codebook | 0.857 | 0.896 | 0.655 | 0.374 |
| (b) Residual Quant. | ||||
Appendix figures & tables28 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameters | Tokenizer | Pre-training |
|---|---|---|
| EEG Sample | ||
| Channels | 19 | |
| Time points | 6000 (30 seconds @ 200 Hz) | |
| Patch dimension | 200 (1 second) | |
| Sequence length | ||
| Mask ratio | – | 0.5 |
| Codebook | Norm. Entropy | Gini Coef. | Top-10% Contrib. |
|---|---|---|---|
| Temporal Layer-0 | 0.994 | 0.174 | 18.1% |
| Temporal Layer-1 | 0.996 | 0.151 | 15.4% |
| Temporal Layer-2 | 0.998 | 0.104 | 13.8% |
| Frequency Layer-0 | 0.994 | 0.174 | 18.1% |
| Frequency Layer-1 | 0.996 | 0.151 | 15.5% |
| Frequency Layer-2 | 0.998 | 0.104 | 13.7% |
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW |
| Adam | (0.9, 0.999) |
| Adam | |
| Learning rate | |
| Weight decay | |
| Layer decay | 0.65 |
| Method | Bal. Acc | AUC-PR | AUROC |
|---|---|---|---|
| EEGNet | 0.589 0.018 | 0.631 0.014 | 0.628 0.015 |
| ST-Transformer | 0.599 0.021 | 0.639 0.012 | 0.643 0.011 |
| BENDR | 0.557 0.023 | 0.585 0.027 | 0.586 0.028 |
| BIOT | 0.618 0.018 | 0.677 0.012 | 0.661 0.013 |
| LaBraM | 0.617 0.019 | 0.676 0.008 | 0.660 0.009 |
| CBraMod | 0.637 0.015 | 0.714 0.009 | 0.699 0.007 |
| Method | Bal. Acc | Kappa | W-F1 |
|---|---|---|---|
| EEGNet | 0.581 0.013 | 0.447 0.020 | 0.580 0.012 |
| ST-Transformer | 0.604 0.008 | 0.471 0.020 | 0.605 0.008 |
| BENDR | 0.422 0.022 | 0.401 0.025 | 0.408 0.024 |
| BIOT | 0.615 0.015 | 0.488 0.027 | 0.616 0.020 |
| LaBraM | 0.617 0.012 | 0.491 0.019 | 0.618 0.014 |
| CBraMod | 0.642 0.009 | 0.522 0.017 | 0.643 0.010 |
| Method | Bal. Acc | Kappa | W-F1 |
|---|---|---|---|
| EEGNet | 0.296 0.010 | 0.101 0.014 | 0.275 0.010 |
| ST-Transformer | 0.305 0.007 | 0.108 0.012 | 0.283 0.011 |
| BENDR | 0.223 0.006 | 0.034 0.006 | 0.203 0.033 |
| BIOT | 0.384 0.019 | 0.226 0.026 | 0.386 0.020 |
| LaBraM | 0.398 0.014 | 0.239 0.021 | 0.397 0.011 |
| CBraMod | 0.409 0.010 | 0.257 0.014 | 0.410 0.011 |
| Method | Bal. Acc | AUC-PR | AUROC |
|---|---|---|---|
| EEGNet | 0.764 0.004 | 0.830 0.004 | 0.841 0.003 |
| ST-Transformer | 0.797 0.002 | 0.852 0.003 | 0.871 0.002 |
| BENDR | 0.771 0.025 | 0.841 0.022 | 0.843 0.024 |
| BIOT | 0.796 0.006 | 0.879 0.002 | 0.882 0.004 |
| LaBraM | 0.814 0.002 | 0.897 0.002 | 0.902 0.001 |
| CBraMod | 0.829 0.002 | 0.926 0.001 | 0.923 0.001 |
| Mental Workload, 2-class | BCICIV-2a, 4-class | |||||
|---|---|---|---|---|---|---|
| RVQ Layers | Bal. Acc | AUC-PR | AUROC | Bal. Acc | Kappa | W-F1 |
| 1 | 0.740 0.010 | 0.756 0.010 | 0.860 0.012 | 0.491 0.011 | 0.322 0.008 | 0.480 0.013 |
| 2 | 0.741 0.015 | 0.761 0.013 | 0.863 0.010 | 0.534 0.015 | 0.383 0.010 | 0.551 0.016 |
| 3 (Ours) | 0.747 0.011 | 0.758 0.012 | 0.862 0.010 | 0.541 0.008 | 0.388 0.008 | 0.533 0.012 |
| 5 | 0.724 0.016 | 0.721 0.018 | 0.816 0.014 | 0.536 0.014 | 0.382 0.013 | 0.528 0.015 |
| 7 | 0.701 0.012 | 0.692 0.018 | 0.824 0.016 | 0.503 0.012 | 0.337 0.014 | 0.489 0.013 |
| Mask Ratio | Balanced Accuracy | AUC-PR | AUROC |
|---|---|---|---|
| 0.2 | 0.718 0.010 | 0.725 0.014 | 0.831 0.012 |
| 0.3 | 0.734 0.012 | 0.742 0.012 | 0.848 0.011 |
| 0.4 | 0.744 0.009 | 0.754 0.012 | 0.859 0.010 |
| 0.5 | 0.747 0.011 | 0.758 0.012 | 0.862 0.010 |
| 0.6 | 0.741 0.010 | 0.758 0.013 | 0.857 0.013 |
| 0.7 | 0.730 0.011 | 0.755 0.014 | 0.850 0.012 |
| Mask Ratio | Balanced Accuracy | Cohen’s Kappa | Weighted F1 |
|---|---|---|---|
| 0.2 | 0.509 0.010 | 0.352 0.010 | 0.501 0.014 |
| 0.3 | 0.526 0.011 | 0.371 0.012 | 0.518 0.013 |
| 0.4 | 0.537 0.008 | 0.384 0.008 | 0.529 0.012 |
| 0.5 | 0.541 0.010 | 0.388 0.008 | 0.533 0.012 |
| 0.6 | 0.540 0.012 | 0.390 0.010 | 0.534 0.012 |
| 0.7 | 0.522 0.009 | 0.368 0.010 | 0.515 0.013 |
| Metric | Time Domain | Amplitude | Phase |
|---|---|---|---|
| MSE ( ) | 178.62 50.63 | 64.49 17.51 | 653.32 49.92 |
| Correlation | 0.904 0.030 | 0.956 0.016 | 0.577 0.042 |
| SNR (dB) | 8.1 1.2 | 11.2 1.2 | 2.0 0.5 |
| RVQ Layers | MSE ( ) | Correlation | SNR (dB) |
|---|---|---|---|
| 1 layer | 348.69 | 0.807 | 4.6 |
| 2 layers | 224.59 | 0.880 | 6.5 |
| 3 layers | 157.18 | 0.918 | 8.0 |
| 5 layers | 129.82 | 0.932 | 8.8 |
| 7 layers | 139.04 | 0.928 | 8.5 |
| Data Volume | Balanced Accuracy | AUC-PR | AUROC |
|---|---|---|---|
| 1k hours | 0.695 0.012 | 0.702 0.013 | 0.810 0.010 |
| 2k hours | 0.710 0.013 | 0.718 0.015 | 0.825 0.012 |
| 3k hours | 0.722 0.008 | 0.730 0.014 | 0.838 0.013 |
| 5k hours | 0.732 0.011 | 0.741 0.010 | 0.848 0.005 |
| 7k hours | 0.740 0.010 | 0.750 0.012 | 0.856 0.011 |
| 9k hours | 0.747 0.011 | 0.758 0.012 | 0.862 0.010 |
| Data Volume | Balanced Accuracy | Cohen’s Kappa | Weighted F1 |
|---|---|---|---|
| 1k hours | 0.485 0.010 | 0.318 0.015 | 0.478 0.016 |
| 2k hours | 0.502 0.010 | 0.338 0.015 | 0.495 0.011 |
| 3k hours | 0.515 0.011 | 0.354 0.020 | 0.508 0.013 |
| 5k hours | 0.525 0.009 | 0.368 0.011 | 0.518 0.008 |
| 7k hours | 0.534 0.009 | 0.379 0.005 | 0.527 0.015 |
| 9k hours | 0.541 0.008 | 0.388 0.008 | 0.533 0.012 |
| Layers | Parameters | Balanced Accuracy | AUC-PR | AUROC |
|---|---|---|---|---|
| 4 | 1.96M | 0.720 0.012 | 0.728 0.014 | 0.835 0.013 |
| 6 | 2.93M | 0.730 0.011 | 0.738 0.010 | 0.845 0.015 |
| 8 | 3.89M | 0.738 0.015 | 0.747 0.016 | 0.853 0.011 |
| 10 | 4.86M | 0.743 0.023 | 0.753 0.018 | 0.858 0.018 |
| 12 | 5.82M | 0.747 0.011 | 0.758 0.012 | 0.862 0.010 |
| Layers | Parameters | Balanced Accuracy | Cohen’s Kappa | Weighted F1 |
|---|---|---|---|---|
| 4 | 1.96M | 0.508 0.012 | 0.345 0.013 | 0.501 0.014 |
| 6 | 2.93M | 0.520 0.006 | 0.360 0.008 | 0.513 0.010 |
| 8 | 3.89M | 0.530 0.015 | 0.372 0.010 | 0.523 0.012 |
| 10 | 4.86M | 0.536 0.015 | 0.381 0.012 | 0.529 0.015 |
| 12 | 5.82M | 0.541 0.008 | 0.388 0.008 | 0.533 0.012 |
| SEED-V, 5-class | SHU-MI, 2-class | |||||
| Methods | Bal. Acc | Kappa | W-F1 | Bal. Acc | AUC-PR | AUROC |
| CBraMod (full data) | 0.409 0.010 | 0.257 0.014 | 0.410 0.011 | 0.637 0.015 | 0.714 0.009 | 0.699 0.007 |
| Ours (full data) | 0.407 0.008 | 0.260 0.010 | 0.414 0.011 | 0.637 0.018 | 0.723 0.011 | 0.717 0.007 |
| BIOT (30%) | 0.351 0.038 | 0.178 0.043 | 0.349 0.042 | 0.542 0.035 | 0.626 0.027 | 0.602 0.030 |
| LaBraM (30%) | 0.369 0.031 | 0.204 0.038 | 0.370 0.032 | 0.564 0.029 | 0.652 0.023 | 0.647 0.027 |
| CBraMod (30%) | 0.388 0.024 | 0.229 0.025 | 0.389 0.026 | 0.623 0.020 | 0.690 0.013 | 0.675 0.011 |
EEG Foundation Models
Electroencephalography (EEG) foundation models learn reusable representations of brain signals for transfer across people, tasks, and recording setups.
See all 100 papers