Feature Extraction
Transformers
Safetensors
spera
eeg
biosignal
time-series
foundation-model
self-supervised-learning
representation-learning
transformer
jepa
neuroscience
brain-computer-interface
neurips-2026
custom_code
Eval Results (legacy)
Instructions to use sees4321/SPERA_EEG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sees4321/SPERA_EEG with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="sees4321/SPERA_EEG", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sees4321/SPERA_EEG", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 8,851 Bytes
1318c7f 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 640dc77 de05a41 1318c7f 640dc77 2459a5e c405aa5 640dc77 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | ---
license: cc-by-nc-4.0
library_name: transformers
tags:
- eeg
- biosignal
- time-series
- foundation-model
- self-supervised-learning
- representation-learning
- transformer
- jepa
- neuroscience
- brain-computer-interface
- neurips-2026
- arxiv:2610.10571
metrics:
- balanced_accuracy
model-index:
- name: SPERA-Base
results:
- task:
type: time-series-classification
name: Imagined Speech Classification
dataset:
type: BCIC2020-3
name: BCIC2020-3
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.6504
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.502
- task:
type: time-series-classification
name: Motor Imagery Classification
dataset:
type: BCIC-IV-2a
name: BCIC-IV-2a
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.6816
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.560
- task:
type: time-series-classification
name: Motor Imagery Classification
dataset:
type: PhysioNet-MI
name: PhysioNet-MI
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.6726
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.551
- task:
type: time-series-classification
name: Emotion Recognition
dataset:
type: FACED
name: FACED
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.5754
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.478
- task:
type: time-series-classification
name: Mental Stress Detection
dataset:
type: MAT
name: Mental Arithmetic (MAT)
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.7778
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.672
- task:
type: time-series-classification
name: Sleep Staging
dataset:
type: ISRUC
name: ISRUC
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.8137
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.772
- task:
type: time-series-classification
name: Mental Disorder Diagnosis
dataset:
type: Mumtaz
name: Mumtaz
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.9637
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.944
- task:
type: time-series-classification
name: EEG Abnormality Detection
dataset:
type: TUAB
name: TUAB
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.8488
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.821
- task:
type: time-series-classification
name: Event Type Classification
dataset:
type: TUEV
name: TUEV
metrics:
- type: balanced_accuracy
name: Balanced Accuracy - LPFT
value: 0.7684
- type: balanced_accuracy
name: Balanced Accuracy - LP
value: 0.651
---
# SPERA: Spherical Prior EEG Foundation Model with Geometry- and Frequency-Aware Latent Prediction
[](https://arxiv.org/abs/2610.10571)
[](https://github.com/sees4321/SPERA_EEG)
[](https://arxiv.org/abs/2610.10571)
[](https://creativecommons.org/licenses/by-nc/4.0/)
**Minsu Kim, Ye-Sung Kim, Hyeseong Jeon, Wooseok Hyung, Joshua Lee, and Chang-Hwan Im**
Hanyang University, Republic of Korea
- Paper: [arXiv:2610.10571](https://arxiv.org/abs/2610.10571)
- Code: [GitHub Repository](https://github.com/sees4321/SPERA_EEG)
## Model Overview
**SPERA (Spherical Prior EEG Representation Architecture)** is a self-supervised EEG foundation model designed to learn transferable representations across diverse EEG datasets, subjects, and electrode montages.
SPERA adopts a joint-embedding predictive architecture (JEPA) to learn EEG representations through latent-space prediction rather than raw signal reconstruction. Its central contribution is a learnable Legendre-polynomial spherical prior that explicitly incorporates scalp electrode geometry into attention.
This repository provides the pretrained weights of **SPERA-Base (194M parameters)**.
## Pretraining Data
SPERA was pretrained on a large-scale, multi-domain EEG corpus covering clinical, cognitive, and brain-computer interface (BCI) applications.
| Statistic | Value |
|---|---:|
| Total recording hours | ~80,000 |
| Number of subjects | 29,048 |
| Number of datasets | 106 |
| Total channel-hours | 2.67 million |
| Total EEG tokens | 9.60 billion |
The corpus covers a wide range of electrode configurations and recording conditions.
The complete list of pretraining datasets and their associated licenses is provided in Appendix B of the paper.
## How to Use
EEG preprocessing should follow the pipeline used during pretraining:
- Notch filtering at 50 or 60 Hz
- Bandpass filtering between 0.5 and 75 Hz
- Resampling to 200 Hz
- Channel-wise z-score normalization
- Clipping to ±15 standard deviations
SPERA processes non-overlapping 1-second patches (200 samples per patch).
```bash
pip install -r requirements.txt
```
```python
import torch
from transformers import AutoModel
model = AutoModel.from_pretrained(
"sees4321/SPERA_EEG", trust_remote_code=True,
).eval()
# eeg: float32 [B, C, T], sampled at 200 Hz.
# coords: float32 [B, C, 3], in the matching channel order and coordinate frame.
with torch.inference_mode():
outputs = model(eeg=eeg, coords=coords)
tokens = outputs.last_hidden_state # [B, C*P, 896]
features = outputs.pooler_output # [B, 896], token mean
```
## Electrode coordinates
Use channel names in the same order as the EEG tensor. With
`spatial_bias_use_unit_sphere=True`, the encoder normalizes coordinates internally;
manual unit normalization or multiplication by 10 is unnecessary.
Install `mne` only for this example (`pip install mne`).
```python
import mne
import numpy as np
import torch
# channel_names must match eeg[:, channels, :].
kind = "colin27_1005" if "colin27_1005" in mne.channels.get_builtin_montages() else "standard_1005"
pos = mne.channels.make_standard_montage(kind).get_positions()["ch_pos"]
pos = {name.lower(): xyz for name, xyz in pos.items()}
xyz = np.stack([pos[name.strip().lower()] for name in channel_names])
coords = torch.tensor(xyz, dtype=torch.float32, device=eeg.device)
coords = coords.unsqueeze(0).expand(eeg.shape[0], -1, -1) # [B, C, 3]
assert coords.shape[1] == eeg.shape[1]
```
Keep the montage's original coordinate frame and origin; do not subtract the
channel mean. For bipolar channels, use the midpoint of the two original electrode
coordinates before the model's normalization; the example above handles ordinary electrodes.
## Evaluation
SPERA was evaluated on nine downstream EEG classification datasets under two protocols: linear probing (LP) and linear probing followed by fine-tuning (LPFT).
The evaluation results shown on this page are mean balanced accuracies (%) over five random seeds. Please refer to the paper for detailed experimental results and evaluation protocols.
## Citation
If you find SPERA useful in your research, please cite our paper:
```bibtex
@article{kim2026spera,
title={SPERA: Spherical Prior EEG Foundation Model with Geometry- and Frequency-Aware Latent Prediction},
author={Kim, Minsu and Kim, Ye-Sung and Jeon, Hyeseong and Hyung, Wooseok and Lee, Joshua and Im, Chang-Hwan},
journal={arXiv preprint arXiv:2610.10571},
year={2026}
}
```
## Contact
- Minsu Kim (First Author): sees4321@hanyang.ac.kr
- Chang-Hwan Im (Corresponding Author): ich@hanyang.ac.kr
- [GitHub Issues](https://github.com/sees4321/SPERA_EEG/issues) |