How to use from the
Use from the
Transformers library
# 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")
Quick Links

SPERA: Spherical Prior EEG Foundation Model with Geometry- and Frequency-Aware Latent Prediction

Paper GitHub NeurIPS 2026: Accepted Model License

Minsu Kim, Ye-Sung Kim, Hyeseong Jeon, Wooseok Hyung, Joshua Lee, and Chang-Hwan Im

Hanyang University, Republic of Korea

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).

pip install -r requirements.txt
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).

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:

@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

Downloads last month
1
Safetensors
Model size
0.2B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Paper for sees4321/SPERA_EEG

Evaluation results