Instructions to use Neuralace-AI/eeg-encoder-41ch-120hz with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Neuralace-AI/eeg-encoder-41ch-120hz with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Neuralace-AI/eeg-encoder-41ch-120hz", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Neuralace-AI/eeg-encoder-41ch-120hz", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
EEG Encoder 41ch-120Hz
A 114M-parameter EEG foundation model that beats models 3Γ its size. It reads EEG through the frozen EEG Codec 41ch-120Hz (compress first, then learn) and was pretrained HuBERT-style on 5,996 hours from 172 public datasets, with no labels. It works on any montage, keeps working when sites are missing, and runs at a fraction of the compute of other EEG foundation models.
Highlights
| Best frozen features | .722 mean over 8 tasks, against .677 for REVE-large (390M), .629 EEGPT, .618 CBraMod, .617 LaBraM |
| Best fine-tuned | .755 against .724 for REVE-base and .720 for REVE-large, with one recipe for every model |
| Video decoding from EEG | 13.3% single-trial 40-way video-concept accuracy on SEED-DV (5Γ chance) against 10.8% for EEGPT, better on all 7 held-out blocks, reading only 41 central sites |
| BCI decoding | .694 on 3-class PROTEUS mental commands for 10 unseen people (PROTEUS was not used in pretraining), against .614 for FBCNet and .569 for Riemannian tangent space |
| Robust to missing sites | .652 with 40% of a scalp region missing, against .509 for REVE-large |
| Efficient | 78 GFLOPs per 10 s window against 374 for REVE-large; about 2,300 windows/s on one H100 |
| Input | [B, 41, T] Β΅V at 120 Hz (EEGFeatureExtractor makes it from any recording) |
| Output | [B, T/4, 768] per frame (30 frames/s); hidden_states: embeddings + 16 layers |
| Parameters | 114.0M transformer + 9.4M codec (frozen, included) |
| Window | trained on 4β12 s crops; longer inputs are encoded in ~10 s chunks and joined in time |
Usage
import mne
import torch
from transformers import AutoFeatureExtractor, AutoModel
repo = "Neuralace-AI/eeg-encoder-41ch-120hz"
fe = AutoFeatureExtractor.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval()
raw = mne.io.read_raw_edf(mne.datasets.eegbci.load_data(1, [4])[0], preload=True)
inputs = fe(raw, return_tensors="pt") # input_values [1, 41, T] Β΅V @ 120 Hz
with torch.no_grad():
out = model(inputs["input_values"][..., : 120 * 10], output_hidden_states=True) # a 10 s window
feats = out.last_hidden_state # [1, 300, 768]
layers = torch.stack(out.hidden_states[1:]) # [16, 1, 300, 768]: the middle-to-late layers are usually best for tasks
Classification head
AutoModelForSequenceClassification adds a learned softmax mix of the 16 layers, mean pooling over frames, LayerNorm, dropout and a
linear layer. Use num_labels=1 for regression (MSE).
from transformers import AutoModelForSequenceClassification
clf = AutoModelForSequenceClassification.from_pretrained(repo, num_labels=4, trust_remote_code=True)
clf.freeze_encoder() # frozen probe; skip this line to fine-tune end to end
out = clf(inputs["input_values"][..., : 120 * 10], labels=torch.tensor([2]))
out.loss.backward()
The codec inside is always frozen; freeze_encoder() also freezes the transformer. For end-to-end fine-tuning we used a small encoder
learning rate (5e-5 at the top layer, decaying to 0.1Γ at the bottom) and 3e-4 for the head.
The feature extractor is the codec's: notch 50/60 Hz, band-pass 0.1β75 Hz, resample to 120 Hz, map channel names onto 41 sites (see the EEG Codec 41ch-120Hz card for the site list and details). No re-referencing or normalization is needed.
Results
Against EEG foundation models (one protocol for every model)
Eight tasks: motor execution, oddball ERPs, reward, SSVEP, 13-way task paradigm, eyes open/closed, age and sex. Each model gets a small head trained per task. Frozen and fine-tuned use one recipe for every model. External models get microvolts at their own input rate, and for frozen features we report each one's better feature variant, chosen on the test set, which favours them.
| Model | Params | Frozen | Fine-tuned | People unseen in our pretraining (6 tasks) |
|---|---|---|---|---|
| EEG Encoder 41ch-120Hz | 114M | .722 | .755 | .733 |
| REVE-large | 390M | .677 | .720 | .706 |
| REVE-base | 69M | .661 | .724 | .687 |
| LaBraM-Base | 5.8M | .617 | .706 | .642 |
| EEGPT (large) | 25M | .629 | .639 | .675 |
| CBraMod | 4.9M | .618 | .621 | .650 |
| BIOT | 3.2M | .561 | .555 | .606 |
Per-task frozen scores
Balanced accuracy (age: Pearson r); SE over test people in brackets.
| Model | Params | Motor exec. (HGD, 4) | Oddball (3) | Reward (2) | SSVEP (9) | M3CV task (13) | Eyes open/closed | Age (r) | Sex | Mean (8) |
|---|---|---|---|---|---|---|---|---|---|---|
| EEG Encoder 41ch-120Hz | 114M | .829 (.016) | .696 | .724 | .284 | .662 | .849 | .838 | .895 | .722 |
| REVE-large | 390M | .780 (.017) | .612 | .696 | .324 | .546 | .821 | .744 | .892 | .677 |
| REVE-base | 69M | .778 (.021) | .606 | .693 | .259 | .510 | .819 | .726 | .900 | .661 |
| EEGPT (large) | 25M | .637 (.019) | .577 | .665 | .300 | .491 | .813 | .758 | .789 | .629 |
| CBraMod | 4.9M | .691 (.015) | .568 | .668 | .301 | .426 | .754 | .682 | .855 | .618 |
| LaBraM-Base | 5.8M | .643 (.016) | .553 | .638 | .280 | .402 | .780 | .750 | .886 | .617 |
| BIOT | 3.2M | .412 (.011) | .407 | .556 | .462 | .405 | .809 | .674 | .762 | .561 |
| EEG Codec 41ch-120Hz latent alone | 3.6M | .595 (.027) | .526 | .645 | .159 | .257 | .728 | .592 | .811 | .539 |
| chance | .250 | .333 | .500 | .111 | .077 | .500 | 0 | .500 | ||
| test people | 14 | 146 | 282 | 100 | 95 | 608 | 608 | 608 |
Video decoding: SEED-DV
20 people watched 1,400 two-second video clips per session (40 concepts Γ 5 clips Γ 7 blocks). The task is to name the clip's concept from one 2 s trial (40-way, chance 2.5%). 7-fold leave-one-block-out: train on 5 blocks, select on 1, test on the held-out block. Every encoder gets the same head. SEED-DV was never in our pretraining.
| Encoder | Channels read | Fine-tuned top-1 | Frozen top-1 | Top-5 |
|---|---|---|---|---|
| EEG Encoder 41ch-120Hz | 41 central | 13.3% | 11.4% | 37.7% |
| EEGPT | all 62 | 10.8% | 5.7% | 33.6% |
| EEGPT | same 41 | 9.5% | 5.5% | 30.8% |
| Compact CNN-transformer, trained on SEED-DV only | 62 | 8.8% | β | 29.2% |
| EEG2Video GLMNet (published, same split) | 62 | 6.2% | β | β |
- Better than EEGPT on every held-out block: +2.6 points (SE 0.3), 7/7.
- Frozen beats fine-tuned EEGPT. Training only a head on our frozen features (11.4%) beats fully fine-tuned EEGPT (10.8%).
- Without the visual cortex. The model reads only 41 central sites, with no occipital channels. On the same 41 sites EEGPT drops to 9.5%, so on equal input the lead is 3.8 points.
- Worth about twice the labelled data: it performs like a from-scratch model trained on about 2Γ as much labelled SEED-DV data (a rough, extrapolated estimate).
BCI decoding: PROTEUS mental commands
Three cued commands (motor imagery, mental subtraction, word generation) from the 41-channel PROTEUS dataset
(NEMAR nm000290). 10 people held out in turn; the score is balanced accuracy averaged over
participant Γ session cells (chance .333). Fine-tuned: first 8 layers plus a small transformer head, causal per-session
standardisation; 3 fine-tuning seeds.
Data separation. PROTEUS was not used in pretraining: the codec and encoders were pretrained without labels on 172 other
public EEG datasets; PROTEUS (NEMAR nm000290) is excluded by name in the data pipeline and absent from the corpus manifest, and none
of its 112 recordings matches any corpus recording on length and amplitude. The numbers below are downstream results: the pretrained
encoder is fine-tuned on PROTEUS and scored on people held out from that fine-tuning.
| Model | Unseen people |
|---|---|
| EEG Encoder 41ch-120Hz, fine-tuned | .694 |
| EEG Encoder 41ch-120Hz (raw), fine-tuned | .654 |
| FBCNet | .614 |
| Riemannian tangent space + Euclidean alignment | .569 |
| REVE-base, fine-tuned | .497 |
| EEGNet | .406 |
Against the tangent-space baseline it is better for 10 of 10 people (+.125, SE .020); against FBCNet for 9/10 (+.079, SE .024).
Missing sites
Heads trained on the full montage, then scored with sites removed at test time (mean of 4 tasks):
| Model | Clean | 40% of a region removed | 40% scattered |
|---|---|---|---|
| EEG Encoder 41ch-120Hz | .729 | .652 | .671 |
| EEG Encoder 41ch-120Hz (raw) | .722 | .482 | .593 |
| REVE-large | .629 | .509 | .555 |
With 40% of a region removed it loses .077, against .240 for the raw-signal encoder.
Efficiency
The transformer runs on 30 codec frames/s instead of 41 sites Γ raw samples, so it is cheap for its size. Per 10 s window on one H100:
| Model | Params | GFLOPs | Windows/s |
|---|---|---|---|
| EEG Encoder 41ch-120Hz (codec + transformer) | 118M | 78 | ~2,300 |
| REVE-large | 390M | 374 | 105β338 |
| REVE-base | 69M | 72 | 327β589 |
| EEGPT (large) | 25M | 92 | 284β571 |
Throughput is for this architecture (768-d, 16 layers, with the codec); external ranges are fp32βbf16.
Training
| Data | the codec's corpus: 172 public scalp-EEG datasets (CC0, CC BY 4.0, ODC-By 1.0), 5,996 h for training, all at 41 sites / 120 Hz; no labels |
| Input | the frozen EEG Codec 41ch-120Hz's continuous latent (before quantization), 30 frames/s, 256-d |
| Objective | HuBERT-style masked prediction: 50% of frames hidden in 15-frame spans (zeroed in the raw signal before the codec, so nothing leaks through its context); predict 500 k-means cluster IDs of the layer-6 features of a first-iteration model (trained only to make these targets; not released) at hidden frames. Site hiding: whole scalp regions are also removed from the student's input (the codec's recipe), while targets come from the full montage |
| Architecture | 768-d, 16 layers, 12 heads, FF 3072, bidirectional, learned positions (512 frames) |
| Optimisation | 200k steps on 8 GPUs, batch 32 crops of 4, 8 or 12 s, 4 masked clones per crop; AdamW 3e-4, 8k warm-up |
| Checkpoint | last (step 200k) |
Limitations
- Seeds. One pretraining seed and no hyperparameter search. The SEED-DV row is one fine-tuning seed.
- Exposure. Pretraining saw, unlabelled, recordings of some people in the 8-task benchmark; the unseen-people column removes them.
- Montage and band. Inherited from the codec: 41 central sites (no Fp, F7/8, T7/8, P7/8, O1/2) and 0.1β75 Hz. SSVEP above ~15 Hz is its weakest task (BIOT, REVE and CBraMod score higher there).
- Person identity. The features identify people well. Treat them as identifying data.
- Precision. With TF32 off (
torch.backends.cudnn.allow_tf32 = False,torch.backends.cuda.matmul.allow_tf32 = False) outputs match the training code to 1e-4 relative; with TF32 they differ slightly.
Responsible use
EEG is sensitive personal data: it can reveal who a person is and information about their health. This model is released for research.
Intended use. Research on EEG representation learning, brain-computer interfaces and EEG benchmarks, on recordings made with the participants' informed consent and handled under the applicable data-protection law.
Not a medical device. The model has not been clinically validated. Do not use it for medical diagnosis, screening, treatment or any other clinical decision. Benchmark results on labels such as age or sex are research measurements, not medical assessments.
Do not use it to identify people. Its outputs identify individuals well (see Limitations). Do not use the model to identify, re-identify, track or profile people, to link EEG recordings to identities, or to infer health conditions or other sensitive attributes of a person without their explicit consent.
Other uses we do not support. Monitoring or surveillance of people without their informed consent; decisions about employment, education, insurance, credit or access to services; law enforcement, interrogation or lie detection.
Outputs are personal data. Features, codes and reconstructions computed from a person's EEG remain that person's data; protect them as you would the recording.
Files
| File | What it is |
|---|---|
model.safetensors, config.json, preprocessor_config.json, *.py |
The model in transformers format (AutoModel, AutoFeatureExtractor, AutoModelForSequenceClassification) for inference and fine-tuning, with the frozen codec included. The masked-prediction heads used only in pretraining are removed |
original/checkpoint.pt |
The same model as saved by our training code, for continuing training with it. It keeps the masked-prediction heads. It holds the transformer only; the codec it reads is original/checkpoint.pt in EEG Codec 41ch-120Hz |
training_checkpoint.json |
Training step and the sha256 of original/checkpoint.pt |
pretraining_datasets.csv |
Every pretraining dataset with its source and licence |
original/checkpoint.pt is a PyTorch dictionary with model (the state dict), conf (the training configuration) and step:
ck = torch.load("original/checkpoint.pt", map_location="cpu", weights_only=True)
Code and paper
The pretraining code is available on request. We will open-source all of our models, training and evaluation code, benchmarks and a research paper.
Licence
The model weights and code in this repository are licensed under
CC BY-NC 4.0 (attribution, non-commercial); the full text is in LICENSE.
Copyright 2026 Sabi. For commercial licensing, contact Sabi (sabi.com). The pretraining data are public datasets licensed CC0, CC BY 4.0
or ODC-By 1.0; every dataset, its source and licence are listed in pretraining_datasets.csv.
- Downloads last month
- 33