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
Update README.md
Browse files123---license: cc-by-nc-4.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268---license: cc-by-nc-4.0library_name: transformerstags:- eeg- biosignal- time-series- foundation-model- self-supervised-learning- representation-learning- transformer- jepa- neuroscience- brain-computer-interface- neurips-2026- arxiv:2610.10571metrics:- balanced_accuracymodel-index:- name: SPERA-Baseresults:- task:type: time-series-classificationname: Imagined Speech Classificationdataset:type: BCIC2020-3name: BCIC2020-3metrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 65.04- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 50.2- task:type: time-series-classificationname: Motor Imagery Classificationdataset:type: BCIC-IV-2aname: BCIC-IV-2ametrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 68.16- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 56.0- task:type: time-series-classificationname: Motor Imagery Classificationdataset:type: PhysioNet-MIname: PhysioNet-MImetrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 67.26- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 55.1- task:type: time-series-classificationname: Emotion Recognitiondataset:type: FACEDname: FACEDmetrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 57.54- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 47.8- task:type: time-series-classificationname: Mental Stress Detectiondataset:type: MATname: Mental Arithmetic (MAT)metrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 77.78- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 67.2- task:type: time-series-classificationname: Sleep Stagingdataset:type: ISRUCname: ISRUCmetrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 81.37- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 77.2- task:type: time-series-classificationname: Mental Disorder Diagnosisdataset:type: Mumtazname: Mumtazmetrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 96.37- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 94.4- task:type: time-series-classificationname: EEG Abnormality Detectiondataset:type: TUABname: TUABmetrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 84.88- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 82.1- task:type: time-series-classificationname: Event Type Classificationdataset:type: TUEVname: TUEVmetrics:- type: balanced_accuracyname: Balanced Accuracy - LPFT (%)value: 76.84- type: balanced_accuracyname: Balanced Accuracy - LP (%)value: 65.1---# SPERA: Spherical Prior EEG Foundation Model with Geometry- and Frequency-Aware Latent Prediction**Accepted at NeurIPS 2026 (Poster)**[](https://arxiv.org/abs/2610.10571)[](https://github.com/sees4321/SPERA_EEG)[](https://neurips.cc/)**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 DataSPERA 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 UseEEG 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 deviationsSPERA processes non-overlapping 1-second patches (200 samples per patch).```bashpip install -r requirements.txt``````pythonimport torchfrom transformers import AutoModelmodel = 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 coordinatesUse 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`).```pythonimport mneimport numpy as npimport 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 thechannel mean. For bipolar channels, use the midpoint of the two original electrodecoordinates before the model's normalization; the example above handles ordinary electrodes.## EvaluationSPERA 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.## CitationIf 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)
README.md+265