Foundation model

CodeBrain: results on public EEG datasets

CodeBrain is a pretrained EEG encoder whose paper lists the Temple University EEG corpus (TUEG) as its only pretraining source. BCI Report ran the released checkpoint frozen, pooled as the published CBraMod rows are, and adapted it on EEGMAT, where its LoRA in effect adapts only the attention value projection.

Measured on: ds003810; EEGMAT; BETA; ds006593; TMNRED / ds005383; EESM19 scalp subset; ds005342 · Protocols: Motor imagery & rest; Arithmetic & rest; SSVEP · 8 channels; SSVEP · 4 channels; P300 target ERP; Semantic target ERP; Sleep staging; Idle & command

Also known as YjMajy/CodeBrain

Reference CodeBrain, arXiv:2506.09110 ↗

Directory status: Evaluated · Description sources arxiv.org

Published results

Grouped by dataset. Compare figures within a group only: across groups the task, cohort, chance level and electrode layout all change.

ds003810 · v9 foundation encoders, frozen · motor imagery & rest

Read with its protocol: Core-matrix protocol: Motor imagery & rest · Chance level 50.0% · foundation-models-mi-rest.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy58.8%54.5%–62.6%10

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

EEGMAT · v9 foundation encoders, frozen · arithmetic & rest

Read with its protocol: Core-matrix protocol: Arithmetic & rest · Chance level 50.0% · foundation-models-arithmetic-rest.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy63.0%59.5%–66.5%36

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

EEGMAT · Model adaptation, v9 · new people, same task, one fixed recipe (not a ranking)

Read with its protocol: Core-matrix protocol: Arithmetic & rest · Chance level 50.0% · foundation-models-update.json

CodeBrain · Frozen encoder + trained head
66.5% (62.3%–70.6%)
CodeBrain · LoRA rank 4 + head
67.1% (62.6%–71.6%)
Balanced accuracy, 2 configurations. Dot: the estimate; line: 95% interval; dashed line: chance level where the payload records one.
MethodConditionMetricValuePeople
CodeBrainFrozen encoder + trained headBalanced accuracy66.5%62.3%–70.6%7,602 trainable parameters.36
CodeBrainLoRA rank 4 + headBalanced accuracy67.1%62.6%–71.6%58,802 trainable parameters.36
CodeBrainLoRA minus frozen + head, same people and foldsPaired difference+0.6 pp−0.7 pp–+1.9 pp18 people improved, 14 got worse, 4 unchanged. The interval includes zero: no change is established.36

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

BETA · v9 foundation encoders, frozen · SSVEP, 8 channels

Read with its protocol: Core-matrix protocol: SSVEP · 8 channels · Chance level 2.5% · foundation-models-beta-8ch.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy11.9%10.5%–13.3%70

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

BETA · v9 foundation encoders, frozen · SSVEP, 4 channels

Read with its protocol: Core-matrix protocol: SSVEP · 4 channels · Chance level 2.5% · foundation-models-beta-4ch.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy11.2%9.8%–12.7%70

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

ds006593 · v9 foundation encoders, frozen · P300 target ERP

Read with its protocol: Core-matrix protocol: P300 target ERP · Chance level 50.0% · foundation-models-p300-target.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy50.8%49.3%–52.2%21

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

TMNRED / ds005383 · v9 foundation encoders, frozen · semantic target ERP

Read with its protocol: Core-matrix protocol: Semantic target ERP · Chance level 50.0% · foundation-models-semantic-target.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy54.7%53.0%–56.6%30

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

EESM19 scalp subset · v9 foundation encoders, frozen · sleep staging

Read with its protocol: Core-matrix protocol: Sleep staging · Chance level 20.0% · foundation-models-sleep-scalp.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + ridge headBalanced accuracy70.7%68.8%–72.7%20

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

ds005342 · v9 foundation encoders, frozen · idle & command

Read with its protocol: Core-matrix protocol: Idle & command · foundation-models-idle.csv

MethodConditionMetricValuePeople
CodeBrainFrozen encoder + linear headCommands detected ≤3 s10 / 601 of 4 people always abstained.4
CodeBrainFrozen encoder + linear headIdle false activations1 / 604

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. Every weights licence and its terms →

All methods → · All datasets →

Checkpoints, inputs and terms

What was run, as the v9 release records it: each checkpoint’s revision and SHA-256, its encoder parameters, the footnote its rows carry and its weights licence. No weights, adapted weights or LoRA deltas were kept or shared, and no endorsement by the model’s authors is implied.

CodeBrain

Panel
A row beside the core matrix on every protocol page
Encoder parameters
13.53M
Revision
YjMajy/CodeBrain @ bef08d2f
Checkpoint SHA-256
d9714b8732c9883a04d022ee66254cd578ae1fa27f5458e6ab7f1aa96e9a7352
Paper
paper ↗
Weights licence
Apache-2.0
Rights review
Permissive weights licence; aggregate scores only, no weights redistributed.
Row footnote
Published CBraMod pooling (patch mean, channels kept); LoRA effectively adapts only the V projection (1-token attention window upstream).
EEGMAT adaptation
Run: a head trained on the frozen encoder against LoRA rank 4, three seeds.

Pretraining exposure, by dataset

Whether each core dataset is in the model authors’ published pretraining list, checked on 2026-10-04 and linked to the source. A dataset absent from the list is not proof that its recordings were never seen; recording-level audits were not done.

DatasetProtocolsStatementSource
ds003810 Motor Imagery vs Rest (low-cost EEG; Peterson et al.)Motor imagery & restnot in the authors' published pretraining list (checked 2026-10-04)source ↗
EEGMAT (PhysioNet EEG During Mental Arithmetic Tasks; Zyma et al. 2019)Arithmetic & restnot in the authors' published pretraining list (checked 2026-10-04)source ↗
ds006593 cBCI Matrix Multimodal Dataset (Celik et al.)P300 target ERPnot in the authors' published pretraining list (checked 2026-10-04)source ↗
ds005383 TMNRED (Bai et al. 2025, Sci. Data 12:701)Semantic target ERPnot in the authors' published pretraining list (checked 2026-10-04)source ↗
EESM19 Ear-EEG Sleep Monitoring 2019 (OpenNeuro ds005185; Mikkelsen et al.)Sleep stagingnot in the authors' published pretraining list (checked 2026-10-04)source ↗
BETA 40-target SSVEP (Liu et al. 2020, Front. Neurosci. 14:627)SSVEP · 8 channels · SSVEP · 4 channelsnot in the authors' published pretraining list (checked 2026-10-04)source ↗
ds005342 EEG offline/online MI for standing and sitting (Triana-Guzman et al.)Idle & commandnot in the authors' published pretraining list (checked 2026-10-04)source ↗

Cite this page

BCI Report (2026). CodeBrain: results on public EEG datasets. https://bci.report/methods/codebrain/

Figures from release foundation-models-update-20261004 (2026-10-04). Cite the upstream datasets as well: each dataset’s page gives its credit.

Every release is archived on Zenodo: doi:10.5281/zenodo.23123296. BibTeX for the site and its releases → · CITATION.cff ↗