SpecMoE: Spectral Mixture-of-Experts Foundation Model for Cross-Species EEG Decoding
Organizations: Univ. Grenoble Alpes, CNRS, Grenoble INP, LJK 38000 Grenoble, France · SynapCell SAS, ZAC ISIPARC, 38330 Saint-Ismier, France
Abstract
Decoding the orchestration of neural activity in electroencephalography (EEG) signals is a central challenge in bridging neuroscience with artificial intelligence. Foundation models have made strides in generalized EEG decoding, yet many existing frameworks primarily relying on separate temporal and spectral masking of raw signals during self-supervised pretraining. Such strategies often tend to bias learning toward high-frequency oscillations, as low-frequency rhythmic patterns can be easily inferred from the unmasked signal. We introduce a foundation model that utilizes a novel Gaussian-smoothed masking scheme applied to short-time Fourier transform (STFT) maps. By jointly applying time, frequency, and time-frequency Gaussian masks, we make the reconstruction task much more challenging, forcing the model to learn intricate neural patterns across both high- and low-frequency domains. To effectively recover signals under this aggressive masking strategy, we design SpecHi-Net, a U-shaped hierarchical architecture with multiple encoding and decoding stages. To accelerate large-scale pretraining, we partition the data into three subsets, each used to train an independent expert model. We then combine these models through SpecMoE, a mixture of experts framework guided by a learned spectral gating mechanism. SpecMoE achieves state-of-the-art performance across a diverse set of EEG decoding tasks, including sleep staging, emotion recognition, motor imagery classification, abnormal signal detection, and drug effect prediction. Importantly, the model demonstrates strong cross-species and cross-subject generalization, maintaining high accuracy on both human and murine EEG datasets.
Figures & tables
| Task | Dataset | Spec. | S.Freq | #Ch. | Len | #Samples | #Subj. | Label |
|---|---|---|---|---|---|---|---|---|
| Motor Imagery | PhysioNet-MI | H | 160 Hz | 64 | 4s | 9,837 | 109 | 4-class |
| Emotion Recognition | SEED-V | H | 1000 Hz | 62 | 1s | 117,744 | 16 | 5-class |
| Sleep Staging | HMC | H | 256 Hz | 4 | 30s | 137,243 | 151 | 4-class |
| Therapeutic Area | MACO | M | 1024 Hz | 2 | 60s | 61,900 | 336 | 5-class |
| Drug Effect | DA-Pharmaco | M | 1000 Hz | 5 | 60s | 2,800 | 10 | 5-class |
| Imagined Speech | BCIC2020-3 | H | 256 Hz | 64 | 3s | 6,000 | 15 | 5-class |
| Task-Specific Models | Foundation Models | ||||||
|---|---|---|---|---|---|---|---|
| Dataset | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE |
| PhysioNet-MI | 0.5814 | 0.6049 | 0.5726 | 0.6173 | 0.6174 | 0.6304 | 0.6444 |
| 0.0125 | 0.0104 | 0.0092 | 0.0122 | 0.0036 | 0.0090 | 0.0109 | |
| SEED-V | 0.2961 | 0.3537 | 0.3641 | 0.3976 | 0.4091 | 0.4197 | 0.4033 |
| 0.0102 | 0.0112 | 0.0092 | 0.0138 | 0.0097 | 0.0033 | 0.0084 | |
| HMC | 0.6534 | 0.7149 | 0.4427 | 0.7277 | 0.7269 | 0.7345 | 0.7479 |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Setting |
|---|---|
| Input EEG Data | |
| Channels ( ) | 19 |
| Sampling Frequency | 200 Hz |
| Sample Duration ( ) | 30s (6000 points) |
| Amplitude Normalization | Unit 100 V |
| Signal Transformation (STFT) |
| Category | Setting |
|---|---|
| Architecture Setup | |
| Number of Experts | 3 (Pretrained SpecHi-Net encoders) |
| Expert Backbone State | Unfrozen (Full-parameter finetuning) |
| Embedding Dimension ( ) | 128 (per expert) |
| Fused Representation Dim | 384 ( ) |
| Spectral Gating (PSD) |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 34.2 M | 38.2 M | 4.3 M |
| Bal. Acc | Mean | 0.5814 | 0.6049 | 0.5726 | 0.6173 | 0.6174 | 0.6304 | 0.6444 |
| Std Dev | 0.0125 | 0.0104 | 0.0092 | 0.0122 | 0.0036 | 0.0090 | 0.0109 | |
| Weighted F1 | Mean | 0.5796 | 0.6062 | 0.5701 | 0.6177 | 0.6179 | 0.6308 | 0.6476 |
| Std Dev | 0.0115 | 0.0095 | 0.0079 | 0.0141 | 0.0035 | 0.0095 | 0.0082 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 14.3 M | 18.3 M | 4.3 M |
| Bal. Acc | Mean | 0.2961 | 0.3537 | 0.3641 | 0.3976 | 0.4091 | 0.4197 | 0.4033 |
| Std Dev | 0.0102 | 0.0112 | 0.0092 | 0.0138 | 0.0097 | 0.0033 | 0.0084 | |
| Weighted F1 | Mean | 0.2749 | 0.3487 | 0.3645 | 0.3974 | 0.4101 | 0.4280 | 0.4142 |
| Std Dev | 0.0098 | 0.0136 | 0.0132 | 0.0111 | 0.0108 | 0.0023 | 0.0091 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 20.3 M | 24.3 M | 4.3 M |
| Bal. Acc | Mean | 0.6534 | 0.7149 | 0.4427 | 0.7277 | 0.7269 | 0.7345 | 0.7479 |
| Std Dev | 0.0122 | 0.0086 | 0.0702 | 0.0101 | 0.0041 | 0.0047 | 0.0086 | |
| Weighted F1 | Mean | 0.6536 | 0.7080 | 0.2902 | 0.7454 | 0.7395 | 0.7506 | 0.7503 |
| Std Dev | 0.0168 | 0.0039 | 0.0485 | 0.0027 | 0.0089 | 0.0042 | 0.0024 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 20.3 M | 24.3 M | 4.3 M |
| Bal. Acc | Mean | 0.6659 | 0.6119 | 0.4325 | 0.6250 | 0.7645 | 0.6926 | 0.8527 |
| Std Dev | 0.0166 | 0.0218 | 0.0105 | 0.0272 | 0.0119 | 0.0117 | 0.0033 | |
| Weighted F1 | Mean | 0.6828 | 0.6585 | 0.4190 | 0.6736 | 0.8013 | 0.7292 | 0.8499 |
| Std Dev | 0.0182 | 0.0192 | 0.0935 | 0.0388 | 0.0044 | 0.0189 | 0.0083 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 38.7 M | 42.7 M | 4.3 M |
| Bal. Acc | Mean | 0.4816 | 0.5597 | 0.3074 | 0.4601 | 0.5344 | 0.4526 | 0.6230 |
| Std Dev | 0.0159 | 0.0345 | 0.0336 | 0.0487 | 0.0210 | 0.0142 | 0.0231 | |
| Weighted F1 | Mean | 0.4658 | 0.5309 | 0.3080 | 0.4583 | 0.5389 | 0.4575 | 0.6329 |
| Std Dev | 0.0127 | 0.0520 | 0.0403 | 0.0710 | 0.0288 | 0.0155 | 0.0206 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 27.7 M | 31.7 M | 4.3 M |
| Bal. Acc | Mean | 0.4413 | 0.4506 | 0.4678 | 0.5060 | 0.5373 | 0.6004 | 0.6262 |
| Std Dev | 0.0096 | 0.0133 | 0.0197 | 0.0155 | 0.0108 | 0.0187 | 0.0166 | |
| Weighted F1 | Mean | 0.4413 | 0.4488 | 0.4689 | 0.5054 | 0.5383 | 0.6003 | 0.6264 |
| Std Dev | 0.0102 | 0.0154 | 0.0205 | 0.0205 | 0.0096 | 0.0192 | 0.0158 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 24.4 M | 28.4 M | 4.3 M |
| Bal. Acc | Mean | 0.7642 | 0.7758 | 0.7848 | 0.8140 | 0.7891 | 0.8172 | 0.7742 |
| Std Dev | 0.0036 | 0.0049 | 0.0038 | 0.0019 | 0.0030 | 0.0043 | 0.0070 | |
| AUPRC | Mean | 0.8299 | 0.8427 | 0.8448 | 0.8965 | 0.8636 | 0.9005 | 0.8548 |
| Std Dev | 0.0043 | 0.0054 | 0.0065 | 0.0016 | 0.0063 | 0.0066 | 0.0092 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 37.7 M | 41.7 M | 4.3 M |
| Bal. Acc | Mean | 0.7487 | 0.7556 | 0.6616 | 0.7082 | 0.7317 | 0.7662 | 0.8655 |
| Std Dev | 0.0521 | 0.0210 | 0.0391 | 0.0329 | 0.0647 | 0.0471 | 0.0038 | |
| AUPRC | Mean | 0.3753 | 0.2091 | 0.3938 | 0.3122 | 0.4107 | 0.4871 | 0.9906 |
| Std Dev | 0.0867 | 0.0786 | 0.0903 | 0.0976 | 0.0720 | 0.0343 | 0.0008 | |
| Task-Specific Models | Foundation Models | |||||||
| Sub-metric | EEGNet | EEGConf | FFCL | LaBraM | CBramod | CSBrain | SpecMoE | |
| # Params | — | — | — | — | 5.8 M | 21.9 M | 25.9 M | 4.3 M |
| Pearson’s corr | Mean | 0.5127 | 0.5800 | 0.4923 | 0.6347 | 0.5502 | 0.6314 | 0.5168 |
| Std Dev | 0.0357 | 0.0174 | 0.0313 | 0.0135 | 0.0115 | 0.0356 | 0.0218 | |
| Score | Mean | 0.1960 | 0.2065 | 0.1740 | 0.1808 | 0.0737 | 0.2363 | 0.2454 |
| Std Dev | 0.0427 | 0.0230 | 0.0530 | 0.0958 | 0.0167 | 0.0519 | 0.0289 | |
EEG Decoding
Electroencephalography (EEG) decoding maps brain-signal patterns to mental states, stimuli, speech, or intended actions.
See all 208 papers