# CodeBrain: results on public EEG datasets

Foundation model

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](https://bci.report/datasets/ds003810/); [EEGMAT](https://bci.report/datasets/eegmat/); [BETA](https://bci.report/datasets/beta/); [ds006593](https://bci.report/datasets/ds006593/); [TMNRED / ds005383](https://bci.report/datasets/tmnred/); [EESM19 scalp subset](https://bci.report/datasets/eesm19/); [ds005342](https://bci.report/datasets/ds005342/) · Protocols: [Motor imagery & rest](https://bci.report/protocols/mi-rest/); [Arithmetic & rest](https://bci.report/protocols/arithmetic-rest/); [SSVEP · 8 channels](https://bci.report/protocols/beta-8ch/); [SSVEP · 4 channels](https://bci.report/protocols/beta-4ch/); [P300 target ERP](https://bci.report/protocols/p300-target/); [Semantic target ERP](https://bci.report/protocols/semantic-target/); [Sleep staging](https://bci.report/protocols/sleep-scalp/); [Idle & command](https://bci.report/protocols/idle/)

**Also known as** YjMajy/CodeBrain

**Reference** [CodeBrain, arXiv:2506.09110 ↗](https://arxiv.org/abs/2506.09110)

Directory status: Evaluated · Description sources [arxiv.org](https://arxiv.org/abs/2506.09110)

## Published results

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

### [ds003810](https://bci.report/datasets/ds003810/) · v9 foundation encoders, frozen · motor imagery & rest

Read with its protocol: [Core-matrix protocol: Motor imagery & rest](https://bci.report/protocols/mi-rest/#foundation-v9) · Chance level 50.0% · [foundation-models-mi-rest.csv](https://bci.report/data/foundation-models-mi-rest.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 58.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 →](https://bci.report/protocols/mi-rest/#v9-licences)

### [EEGMAT](https://bci.report/datasets/eegmat/) · v9 foundation encoders, frozen · arithmetic & rest

Read with its protocol: [Core-matrix protocol: Arithmetic & rest](https://bci.report/protocols/arithmetic-rest/#foundation-v9) · Chance level 50.0% · [foundation-models-arithmetic-rest.csv](https://bci.report/data/foundation-models-arithmetic-rest.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 63.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 →](https://bci.report/protocols/arithmetic-rest/#v9-licences)

### [EEGMAT](https://bci.report/datasets/eegmat/) · Model adaptation, v9 · new people, same task, one fixed recipe (not a ranking)

Read with its protocol: [Core-matrix protocol: Arithmetic & rest](https://bci.report/protocols/arithmetic-rest/#v9-adaptation) · Chance level 50.0% · [foundation-models-update.json](https://bci.report/data/foundation-models-update.json)

**Balanced accuracy, 2 configurations.** Dot: the estimate; line: 95% interval; dashed line: chance level where the payload records one.

- CodeBrain · Frozen encoder + trained head: 66.5% (62.3%–70.6%)
- CodeBrain · LoRA rank 4 + head: 67.1% (62.6%–71.6%)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + trained head | Balanced accuracy | 66.5% (62.3%–70.6%) — 7,602 trainable parameters. | 36 |
| [CodeBrain](https://bci.report/methods/codebrain/) | LoRA rank 4 + head | Balanced accuracy | 67.1% (62.6%–71.6%) — 58,802 trainable parameters. | 36 |
| [CodeBrain](https://bci.report/methods/codebrain/) | LoRA minus frozen + head, same people and folds | Paired difference | +0.6 pp (−0.7 pp–+1.9 pp) — 18 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 →](https://bci.report/protocols/arithmetic-rest/#v9-licences)

### [BETA](https://bci.report/datasets/beta/) · v9 foundation encoders, frozen · SSVEP, 8 channels

Read with its protocol: [Core-matrix protocol: SSVEP · 8 channels](https://bci.report/protocols/beta-8ch/#foundation-v9) · Chance level 2.5% · [foundation-models-beta-8ch.csv](https://bci.report/data/foundation-models-beta-8ch.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 11.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 →](https://bci.report/protocols/beta-8ch/#v9-licences)

### [BETA](https://bci.report/datasets/beta/) · v9 foundation encoders, frozen · SSVEP, 4 channels

Read with its protocol: [Core-matrix protocol: SSVEP · 4 channels](https://bci.report/protocols/beta-4ch/#foundation-v9) · Chance level 2.5% · [foundation-models-beta-4ch.csv](https://bci.report/data/foundation-models-beta-4ch.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 11.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 →](https://bci.report/protocols/beta-4ch/#v9-licences)

### [ds006593](https://bci.report/datasets/ds006593/) · v9 foundation encoders, frozen · P300 target ERP

Read with its protocol: [Core-matrix protocol: P300 target ERP](https://bci.report/protocols/p300-target/#foundation-v9) · Chance level 50.0% · [foundation-models-p300-target.csv](https://bci.report/data/foundation-models-p300-target.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 50.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 →](https://bci.report/protocols/p300-target/#v9-licences)

### [TMNRED / ds005383](https://bci.report/datasets/tmnred/) · v9 foundation encoders, frozen · semantic target ERP

Read with its protocol: [Core-matrix protocol: Semantic target ERP](https://bci.report/protocols/semantic-target/#foundation-v9) · Chance level 50.0% · [foundation-models-semantic-target.csv](https://bci.report/data/foundation-models-semantic-target.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 54.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 →](https://bci.report/protocols/semantic-target/#v9-licences)

### [EESM19 scalp subset](https://bci.report/datasets/eesm19/) · v9 foundation encoders, frozen · sleep staging

Read with its protocol: [Core-matrix protocol: Sleep staging](https://bci.report/protocols/sleep-scalp/#foundation-v9) · Chance level 20.0% · [foundation-models-sleep-scalp.csv](https://bci.report/data/foundation-models-sleep-scalp.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + ridge head | Balanced accuracy | 70.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 →](https://bci.report/protocols/sleep-scalp/#v9-licences)

### [ds005342](https://bci.report/datasets/ds005342/) · v9 foundation encoders, frozen · idle & command

Read with its protocol: [Core-matrix protocol: Idle & command](https://bci.report/protocols/idle/#foundation-v9) · [foundation-models-idle.csv](https://bci.report/data/foundation-models-idle.csv)

| Method | Condition | Metric | Value | People |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + linear head | Commands detected ≤3 s | 10 / 60 — 1 of 4 people always abstained. | 4 |
| [CodeBrain](https://bci.report/methods/codebrain/) | Frozen encoder + linear head | Idle false activations | 1 / 60 | 4 |

Weights terms: CodeBrain under Apache-2.0. No model’s authors endorse these results. [Every weights licence and its terms →](https://bci.report/protocols/idle/#v9-licences)

[All methods →](https://bci.report/methods/) · [All datasets →](https://bci.report/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 ↗](https://arxiv.org/abs/2506.09110)
- 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.

| Dataset | Protocols | Statement | Source |
| --- | --- | --- | --- |
| [ds003810 Motor Imagery vs Rest (low-cost EEG; Peterson et al.)](https://doi.org/10.18112/openneuro.ds003810.v2.0.2) | [Motor imagery & rest](https://bci.report/protocols/mi-rest/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |
| [EEGMAT (PhysioNet EEG During Mental Arithmetic Tasks; Zyma et al. 2019)](https://physionet.org/content/eegmat/1.0.0/) | [Arithmetic & rest](https://bci.report/protocols/arithmetic-rest/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |
| [ds006593 cBCI Matrix Multimodal Dataset (Celik et al.)](https://doi.org/10.18112/openneuro.ds006593.v1.0.0) | [P300 target ERP](https://bci.report/protocols/p300-target/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |
| [ds005383 TMNRED (Bai et al. 2025, Sci. Data 12:701)](https://doi.org/10.18112/openneuro.ds005383.v1.0.0) | [Semantic target ERP](https://bci.report/protocols/semantic-target/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |
| [EESM19 Ear-EEG Sleep Monitoring 2019 (OpenNeuro ds005185; Mikkelsen et al.)](https://doi.org/10.18112/openneuro.ds005185.v1.0.2) | [Sleep staging](https://bci.report/protocols/sleep-scalp/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |
| [BETA 40-target SSVEP (Liu et al. 2020, Front. Neurosci. 14:627)](https://figshare.com/articles/dataset/The_BETA_database/12264401) | [SSVEP · 8 channels](https://bci.report/protocols/beta-8ch/) · [SSVEP · 4 channels](https://bci.report/protocols/beta-4ch/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |
| [ds005342 EEG offline/online MI for standing and sitting (Triana-Guzman et al.)](https://doi.org/10.18112/openneuro.ds005342.v1.0.3) | [Idle & command](https://bci.report/protocols/idle/) | not in the authors' published pretraining list (checked 2026-10-04) | [source ↗](https://arxiv.org/abs/2506.09110) |

## Cite this page

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

Figures from release [`foundation-models-update-20261004`](https://bci.report/releases/#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](https://doi.org/10.5281/zenodo.23123296). [BibTeX for the site and its releases →](https://bci.report/api/#cite-heading) · [CITATION.cff ↗](https://raw.githubusercontent.com/twu3202/bci-report/main/CITATION.cff)

---
Markdown copy of https://bci.report/methods/codebrain/, generated from the published page. Figures are aggregate results; terms of use: https://bci.report/data-use/
