# CodeBrain：在公开 EEG 数据集上的结果

基础模型

CodeBrain 是一个预训练 EEG 编码器，论文列出的唯一预训练来源是天普大学 EEG 语料（TUEG）。本站把发布的检查点冻结运行，池化方式与已发布的 CBraMod 行相同，并在 EEGMAT 上做了适配；在那里，它的 LoRA 实际上只适配了注意力的 V 投影。

测量所用数据集： [ds003810](https://bci.report/zh/datasets/ds003810/)、[EEGMAT](https://bci.report/zh/datasets/eegmat/)、[BETA](https://bci.report/zh/datasets/beta/)、[ds006593](https://bci.report/zh/datasets/ds006593/)、[TMNRED / ds005383](https://bci.report/zh/datasets/tmnred/)、[EESM19 scalp subset](https://bci.report/zh/datasets/eesm19/)、[ds005342](https://bci.report/zh/datasets/ds005342/) · 协议： [运动想象与静息](https://bci.report/zh/protocols/mi-rest/)、[心算与静息](https://bci.report/zh/protocols/arithmetic-rest/)、[SSVEP · 8 通道](https://bci.report/zh/protocols/beta-8ch/)、[SSVEP · 4 通道](https://bci.report/zh/protocols/beta-4ch/)、[P300 目标 ERP](https://bci.report/zh/protocols/p300-target/)、[语义目标 ERP](https://bci.report/zh/protocols/semantic-target/)、[睡眠分期](https://bci.report/zh/protocols/sleep-scalp/)、[空闲与指令](https://bci.report/zh/protocols/idle/)

**又称** YjMajy/CodeBrain

**参考文献** [CodeBrain, arXiv:2506.09110 ↗](https://arxiv.org/abs/2506.09110)

目录状态：已评测 · 简介来源 [arxiv.org](https://arxiv.org/abs/2506.09110)

## 已发布的结果

按数据集分组。只在组内比较：跨组时任务、队列、随机水平与电极布局都会变。

### [ds003810](https://bci.report/zh/datasets/ds003810/) · 第九轮基础模型（编码器冻结）· 运动想象与静息

连同协议阅读： [核心矩阵协议：运动想象与静息](https://bci.report/zh/protocols/mi-rest/#foundation-v9) · 随机水平 50.0% · [foundation-models-mi-rest.csv](https://bci.report/data/foundation-models-mi-rest.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 58.8% (54.5%–62.6%) | 10 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/mi-rest/#v9-licences)

### [EEGMAT](https://bci.report/zh/datasets/eegmat/) · 第九轮基础模型（编码器冻结）· 心算与静息

连同协议阅读： [核心矩阵协议：心算与静息](https://bci.report/zh/protocols/arithmetic-rest/#foundation-v9) · 随机水平 50.0% · [foundation-models-arithmetic-rest.csv](https://bci.report/data/foundation-models-arithmetic-rest.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 63.0% (59.5%–66.5%) | 36 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/arithmetic-rest/#v9-licences)

### [EEGMAT](https://bci.report/zh/datasets/eegmat/) · 模型适配（第九轮）· 新被试、同一任务、一个固定方案（不是排名）

连同协议阅读： [核心矩阵协议：心算与静息](https://bci.report/zh/protocols/arithmetic-rest/#v9-adaptation) · 随机水平 50.0% · [foundation-models-update.json](https://bci.report/data/foundation-models-update.json)

**平衡准确率，2 个配置。** 点为估计值，横线为 95% 区间，虚线为随机水平（发布数据中有记录时）。

- CodeBrain · 冻结编码器 + 训练的分类头: 66.5% (62.3%–70.6%)
- CodeBrain · 秩为 4 的 LoRA + 分类头: 67.1% (62.6%–71.6%)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 训练的分类头 | 平衡准确率 | 66.5% (62.3%–70.6%) — 7,602 个可训练参数。 | 36 |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 秩为 4 的 LoRA + 分类头 | 平衡准确率 | 67.1% (62.6%–71.6%) — 58,802 个可训练参数。 | 36 |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | LoRA 减冻结 + 分类头，相同被试与折 | 配对差值（百分点） | +0.6 pp (−0.7 pp–+1.9 pp) — 18 人提升、14 人变差、4 人不变。区间包含零：不能认定有变化。 | 36 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/arithmetic-rest/#v9-licences)

### [BETA](https://bci.report/zh/datasets/beta/) · 第九轮基础模型（编码器冻结）· SSVEP，8 通道

连同协议阅读： [核心矩阵协议：SSVEP · 8 通道](https://bci.report/zh/protocols/beta-8ch/#foundation-v9) · 随机水平 2.5% · [foundation-models-beta-8ch.csv](https://bci.report/data/foundation-models-beta-8ch.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 11.9% (10.5%–13.3%) | 70 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/beta-8ch/#v9-licences)

### [BETA](https://bci.report/zh/datasets/beta/) · 第九轮基础模型（编码器冻结）· SSVEP，4 通道

连同协议阅读： [核心矩阵协议：SSVEP · 4 通道](https://bci.report/zh/protocols/beta-4ch/#foundation-v9) · 随机水平 2.5% · [foundation-models-beta-4ch.csv](https://bci.report/data/foundation-models-beta-4ch.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 11.2% (9.8%–12.7%) | 70 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/beta-4ch/#v9-licences)

### [ds006593](https://bci.report/zh/datasets/ds006593/) · 第九轮基础模型（编码器冻结）· P300 目标 ERP

连同协议阅读： [核心矩阵协议：P300 目标 ERP](https://bci.report/zh/protocols/p300-target/#foundation-v9) · 随机水平 50.0% · [foundation-models-p300-target.csv](https://bci.report/data/foundation-models-p300-target.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 50.8% (49.3%–52.2%) | 21 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/p300-target/#v9-licences)

### [TMNRED / ds005383](https://bci.report/zh/datasets/tmnred/) · 第九轮基础模型（编码器冻结）· 语义目标 ERP

连同协议阅读： [核心矩阵协议：语义目标 ERP](https://bci.report/zh/protocols/semantic-target/#foundation-v9) · 随机水平 50.0% · [foundation-models-semantic-target.csv](https://bci.report/data/foundation-models-semantic-target.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 54.7% (53.0%–56.6%) | 30 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/semantic-target/#v9-licences)

### [EESM19 scalp subset](https://bci.report/zh/datasets/eesm19/) · 第九轮基础模型（编码器冻结）· 睡眠分期

连同协议阅读： [核心矩阵协议：睡眠分期](https://bci.report/zh/protocols/sleep-scalp/#foundation-v9) · 随机水平 20.0% · [foundation-models-sleep-scalp.csv](https://bci.report/data/foundation-models-sleep-scalp.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 岭回归分类头 | 平衡准确率 | 70.7% (68.8%–72.7%) | 20 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/sleep-scalp/#v9-licences)

### [ds005342](https://bci.report/zh/datasets/ds005342/) · 第九轮基础模型（编码器冻结）· 空闲与指令

连同协议阅读： [核心矩阵协议：空闲与指令](https://bci.report/zh/protocols/idle/#foundation-v9) · [foundation-models-idle.csv](https://bci.report/data/foundation-models-idle.csv)

| 方法 | 条件 | 指标 | 数值 | 被试 |
| --- | --- | --- | --- | --- |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 线性分类头 | 检出的指令 ≤3 秒 | 10 / 60 — 1 名始终拒识（共 4 名被试）。 | 4 |
| [CodeBrain](https://bci.report/zh/methods/codebrain/) | 冻结编码器 + 线性分类头 | 空闲误触发 | 1 / 60 | 4 |

权重条款：CodeBrain 采用 Apache-2.0。任何模型的作者都没有为这些结果背书。 [全部权重许可与条款 →](https://bci.report/zh/protocols/idle/#v9-licences)

[全部方法 →](https://bci.report/zh/methods/) · [全部数据集 →](https://bci.report/zh/datasets/)

## 检查点、输入与条款

按第九轮发布的记录列出运行了什么：每个检查点的版本与 SHA-256、编码器参数量、它的各行附带的脚注，以及权重许可。没有保留或分享任何权重、适配后的权重或 LoRA 增量，也不代表模型作者的认可。

### CodeBrain

- 所在面板: 在每个协议页面上，列在核心矩阵旁边的一行
- 编码器参数量: 13.53M
- 版本: `YjMajy/CodeBrain @ bef08d2f`
- 检查点 SHA-256: `d9714b8732c9883a04d022ee66254cd578ae1fa27f5458e6ab7f1aa96e9a7352`
- 论文: [论文 ↗](https://arxiv.org/abs/2506.09110)
- 权重许可: Apache-2.0
- 权利审查: 宽松的权重许可；只发布聚合分数，不转发权重。Permissive weights licence; aggregate scores only, no weights redistributed.
- 各行脚注: 沿用已发布的 CBraMod 池化方式（对片段取均值，保留通道）；上游的注意力窗口只有 1 个 token，所以 LoRA 实际上只适配了 V 投影。Published CBraMod pooling (patch mean, channels kept); LoRA effectively adapts only the V projection (1-token attention window upstream).
- EEGMAT 适配: 已运行：在冻结编码器上训练分类头，对比秩为 4 的 LoRA，3 个随机种子。

## 是否出现在预训练数据中（按数据集）

每个核心数据集是否在模型作者公开的预训练数据清单中，于 2026-10-04 核查并附来源。不在清单中并不证明它的记录从未被模型见过；核查只到数据集一级，没有核对到具体记录。

| 数据集 | 协议 | 情况 | 来源 |
| --- | --- | --- | --- |
| [ds003810 Motor Imagery vs Rest (low-cost EEG; Peterson et al.)](https://doi.org/10.18112/openneuro.ds003810.v2.0.2) | [运动想象与静息](https://bci.report/zh/protocols/mi-rest/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](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/) | [心算与静息](https://bci.report/zh/protocols/arithmetic-rest/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](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 目标 ERP](https://bci.report/zh/protocols/p300-target/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](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) | [语义目标 ERP](https://bci.report/zh/protocols/semantic-target/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](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) | [睡眠分期](https://bci.report/zh/protocols/sleep-scalp/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](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 通道](https://bci.report/zh/protocols/beta-8ch/) · [SSVEP · 4 通道](https://bci.report/zh/protocols/beta-4ch/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](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) | [空闲与指令](https://bci.report/zh/protocols/idle/) | 不在作者公开的预训练数据清单中（2026-10-04 核查） | [来源 ↗](https://arxiv.org/abs/2506.09110) |

## 引用本页

BCI Report. *CodeBrain：在公开 EEG 数据集上的结果*[EB/OL]. (2026-10-04). https://bci.report/zh/methods/codebrain/

数字来自发布 [`foundation-models-update-20261004`](https://bci.report/zh/releases/#foundation-models-update-20261004)（2026-10-04）。也请同时引用上游数据集：每个数据集页面都写明了署名。

每个发布版本都在 Zenodo 存档：[doi:10.5281/zenodo.23123296](https://doi.org/10.5281/zenodo.23123296)。 [本站及各次发布的 BibTeX →](https://bci.report/zh/api/#cite-heading) · [CITATION.cff ↗](https://raw.githubusercontent.com/twu3202/bci-report/main/CITATION.cff)（英文）

---
本文是 https://bci.report/zh/methods/codebrain/ 的 Markdown 版本，由已发布的网页生成。数字均为聚合结果；使用条款见 https://bci.report/data-use/（英文）。
