jamie33 commited on
Commit
b491e88
·
verified ·
1 Parent(s): ed9c3b2

Add IEEE Access server runbook

Browse files
Files changed (3) hide show
  1. README.md +4 -41
  2. SERVER_RUN.md +183 -0
  3. confirm_swap_power.py +51 -0
README.md CHANGED
@@ -1,44 +1,7 @@
1
- ---
2
- license: mit
3
- language: en
4
- tags:
5
- - eeg
6
- - brain-decoding
7
- - 3d
8
- - brainbits-3d
9
- - ieee-access
10
- - reproducibility
11
- ---
12
 
13
- # jamie33/923 — BrainBits-3D IEEE Access Reproducibility & To-Run Package
14
 
15
- This public repository holds the **to-run experiment specifications and launcher scripts** for the IEEE Access long-form version of *BrainBits-3D: Auditing Instance Geometry and a Set-Valued Decision Rule for EEG-to-3D Decoding* (Tseng & Yuan, Tsinghua University).
16
 
17
- It is the companion to the paper source package in `jamie33/July` and the private workspace `jamie33/jmtseng-work-backup`.
18
-
19
- ## What lives where
20
-
21
- | Asset | Location | Access |
22
- |---|---|---|
23
- | Paper TeX (IEEE Access long form, 10pp skeleton) | local working dir `IEEE_Access_BrainBits3D/` + this repo `paper/` | public |
24
- | Code & data supplement (analysis scripts, experiment summaries) | `jamie33/July` → `AAAI_SUPPLEMENT/BrainBits3D_code_and_data.zip` | public |
25
- | Technical appendix | `jamie33/July` → `AAAI_SUPPLEMENT/BrainBits3D_technical_appendix.pdf` | public |
26
- | Priority checkpoints / model families / paper sources | `jamie33/jmtseng-work-backup` | **private** (server-side, via token) |
27
- | Lower-priority intermediate artifacts | `jamie33/jmtseng-work-backup-public` | public |
28
- | **To-run experiment specs & launchers (this repo)** | `jamie33/923` | public |
29
-
30
- ## How to use this repo (server side)
31
-
32
- 1. Read `EXPERIMENTS_TO_RUN.md` — the master instruction. It lists every experiment that is still **missing / to-run** to thicken the paper to a full IEEE Access long-form contribution, with exact commands, expected outputs, and where to write results back.
33
- 2. Each experiment has a launcher under `run/` (e.g. `run/run_cross_generator_audit.sh`). Launchers are environment-agnostic stubs that expect the private workspace to be mounted.
34
- 3. Write results back into `results/<exp_name>/` in this repo (JSON + a short MD summary). The paper's `\textsc{To-Run}` placeholders will then be filled.
35
-
36
- ## Status
37
-
38
- - Paper skeleton: **built** (10 pages, IEEE Access `ieeeaccess.cls`, compiles cleanly).
39
- - Main-body experiments (Sec. 5): **already completed** (numbers from `jamie33/July`).
40
- - Extension experiments (Sec. 5.x "Extensions Underway"): **to-run** — see `EXPERIMENTS_TO_RUN.md`.
41
-
42
- ## License
43
-
44
- MIT.
 
1
+ # 923
 
 
 
 
 
 
 
 
 
 
2
 
3
+ Public runbook for the IEEE Access extension of BrainBits-3D.
4
 
5
+ The long instruction is `SERVER_RUN.md`. It tells a server which existing files to read under `jamie33/July` (`brain3d_refs/`) and which JSON files to write back into this dataset under `results/`.
6
 
7
+ Do not commit access tokens. Do not start a new generator training run. Historical numbers already in the paper stay fixed.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
SERVER_RUN.md ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IEEE Access 长文:服务器实验指令
2
+
3
+ 把本文件交给服务器上的代理。目标不是再训一个新模型,而是把 IEEE Access 长文里标成 **To-Run** 的空表填上,或者明确写出“跑不了以及原因”。不要发明数字。不要把 Hugging Face token 写进任何文件、日志或 git。
4
+
5
+ ## 0. 文章要写成多厚
6
+
7
+ IEEE Access 没有硬页数上限,官方建议正文控制在 **20 页以内**(不含补充材料)。超过 20 页要先写信问主编。
8
+
9
+ 当前骨架用 IEEE Access 双栏模板,已经能编译,**现在是 10 页**。完成稿的目标区间是 **14–18 页**。空表和错类别那一列补上之后会变厚;不要为了凑页数加新的训练,也不要超过 20 页。已经写进正文的数字不要改。空表(TBD)只有在本文件的 Job 写出对应 JSON 之后才能填。
10
+
11
+ 正文位置(本机):
12
+
13
+ `/Users/iiis33/Desktop/投稿工作/IEEE_Access_BrainBits3D/main.tex`
14
+
15
+ 待填的表:
16
+
17
+ | 论文位置 | 表 | 对应 Job | 现在的状态 |
18
+ |---|---|---|---|
19
+ | Extensions, Table placeholder | 第二生成器的配对 Δ | Job 6 | 不要开训。先写阻塞说明 |
20
+ | Table ece | S=1 与 S=12 的类别 ECE | Job 3 | 空 |
21
+ | Table conformal | K=3,5,10 的覆盖率与集合 Chamfer | Job 4 | 空 |
22
+ | 正文第 4 点 | swap 的 80% power 阈值 0.0044 | Job 1 | 正文是正态近似,要用被试级 Δ 复核 |
23
+ | Appendix fmri-set | fMRI 余弦距离集合 | 已完成 | 不要改成 Chamfer |
24
+ | Job 5 | fMRI 的 Chamfer 中位体集合 | Job 5 | 没有中位体就保持空 |
25
+ | Fig. qualitative | 错类别一列 | Job 2 | 200k 的 npy 里没有 wrong_category_mean |
26
+
27
+ ## 1. 仓库与路径
28
+
29
+ Token 只用环境变量 `HF_TOKEN`。本指令不包含 token。该 token 对 `jamie33` 有写权限,公有和私有数据集都能读。
30
+
31
+ | 仓库 | 可见性 | 用途 |
32
+ |---|---|---|
33
+ | `https://huggingface.co/datasets/jamie33/July` | 公开 | 代码、结果、EEG/fMRI 数据快照。主目录是 `brain3d_refs/` |
34
+ | `https://huggingface.co/datasets/jamie33/jmtseng-work-backup` | 私有 | 只有 July 里缺文件时才查 |
35
+ | `https://huggingface.co/datasets/jamie33/923` | 公开 | **只往这里回传本次 Job 的结果** |
36
+
37
+ 服务器上如果已经有活目录,优先用它,不要整库重下:
38
+
39
+ `/public/interns/hubin/jmtseng/brain3d_refs`
40
+
41
+ 脚本里的 `ROOT` 写死了这个路径。若活目录不存在,再下载快照,并把脚本里的 `ROOT` 改成下载后的 `brain3d_refs`。
42
+
43
+ ```bash
44
+ export HF_TOKEN="$HF_TOKEN" # 已在环境里则不要覆盖
45
+ pip install -U huggingface_hub
46
+ # 不要下载 .venv,那是两套虚拟环境,体积大且不可移植
47
+ huggingface-cli download jamie33/July \
48
+ --repo-type dataset \
49
+ --local-dir "$WORK/July" \
50
+ --exclude ".venv-*/**" "**/.venv*/**"
51
+ export BRAIN3D="${BRAIN3D:-/public/interns/hubin/jmtseng/brain3d_refs}"
52
+ if [ ! -d "$BRAIN3D/scripts" ]; then
53
+ export BRAIN3D="$WORK/July/brain3d_refs"
54
+ fi
55
+ cd "$BRAIN3D"
56
+ ```
57
+
58
+ 数据在 `$BRAIN3D/data/EEG-3D` 和 `$BRAIN3D/data/fMRI-Shape`。第三方代码在 `$BRAIN3D/third_party/neuro-3D`。
59
+
60
+ 每个 Job 结束把结果放到 `$BRAIN3D/results/ieee_access_923/`,再上传:
61
+
62
+ ```bash
63
+ huggingface-cli upload jamie33/923 \
64
+ "$BRAIN3D/results/ieee_access_923" results \
65
+ --repo-type dataset \
66
+ --commit-message "IEEE Access open measurements"
67
+ ```
68
+
69
+ ## 2. 已经完成、不要重跑的部分
70
+
71
+ 这些数字已经在 `main.tex` 里,来自 July 的结果文件。重跑只在文件缺失时做。
72
+
73
+ - 高斯同一类别对调:Δ = +0.0028,95% CI 含 0,SD = 0.0054,12 名被试。
74
+ - 目标类别训练均值:Δ = −0.0309。错类别均值:Δ = +0.0346。
75
+ - 点扩散 200k / 200 step:paired Chamfer-L1 0.440,swap 0.444,类别均值 0.312,错类别 0.475。
76
+ - 集合解码 K=10 的 8+2:召回 31.94%,Chamfer 0.0439。随机填充做不到这一点。
77
+ - 十二人汇合类别 Top-5:10.8% → 25.0%。
78
+ - fMRI 类别 Top-5:63.1% → 79.8%(四人汇合)。
79
+ - fMRI 集合的余弦距离三种子均值已经写入附录。K=5 从概率 top-5 换成 4+1 后,召回 79.8%→79.2%,风险 0.172→0.175。这不是 Chamfer,不能写成“几何变好了”。
80
+
81
+ ## 3. Job 1 — 用被试级差值复核功效
82
+
83
+ 位置:`$BRAIN3D/results/` 下文件名含 `benchmark_causal` 或 `causal` 的 json / md。入口参考 `$BRAIN3D/scripts/evaluate_geometry_risk_per_subject_power.py`,但那个脚本是几何风险功效,不是 swap 功效。不要把它的输出直接填进 swap 那一句。
84
+
85
+ 做法:找出 12 名被试在 cross-attention Gaussian、三种子上的 same-category swap 减 paired 的 Δ。计算均值、标准差,以及双侧 α=0.05、功效 80% 的可检测效应:
86
+
87
+ `delta80 = (1.95996 + 0.84162) * sd / sqrt(12)`
88
+
89
+ 预期文件:`results/ieee_access_923/swap_power.json`
90
+
91
+ ```json
92
+ {
93
+ "n_subjects": 12,
94
+ "mean_delta": 0.0028,
95
+ "sd_delta": 0.0054,
96
+ "delta80": 0.0044,
97
+ "source_files": ["列出实际读到的路径"]
98
+ }
99
+ ```
100
+
101
+ 预期���`delta80` 接近 0.0044。若差超过 0.0005,在 json 里写明用的是哪一个文件,不要改正文里其他表。若找不到 12 个被试级 Δ,json 里写 `"status": "summary_sd_only"`,正文保持现在的正态近似。
102
+
103
+ ## 4. Job 2 — 错类别定性图
104
+
105
+ 这是正文图还缺的一列。定量错类别已经有了(扩散 Chamfer-L1 0.475,12/12 更差)。
106
+
107
+ 脚本:`$BRAIN3D/scripts/generate_qualitative_pointclouds.py`
108
+
109
+ 它现在的条件列表是 `real, category_mean, same_category_swap, zero`。`evaluate_shape_diffusion_controls.py` 里的 `condition_batch` 已经实现 `wrong_category_mean`(类别标签 +1 再取训练均值)。只加这一个条件,不要改物体,不要改种子。
110
+
111
+ 物体与已有 200k 包一致,正文图用其中四类:
112
+
113
+ `15_chair_08 27_guitar_08 29_helicopter_08 21_elephant_08`
114
+
115
+ 种子:`20260716`。推理步数:`200`。
116
+
117
+ 检查点必须是 **200k**,不是脚本默认的 `checkpoint-20000.pth`。在下面位置找 200000 的权重:
118
+
119
+ `$BRAIN3D/data/EEG-3D/model/point_generate/shape/`
120
+
121
+ 先对 `sub01` 重跑 `real`,和已有文件比较:
122
+
123
+ `$BRAIN3D/results/qualitative_pointclouds_200k/15_chair_08__real.npy`
124
+
125
+ 最大绝对误差应接近 0。对不上就停,不要换种子凑图。对得上再保存 `wrong_category_mean`。
126
+
127
+ 预期:
128
+
129
+ - `results/ieee_access_923/qualitative_wrong_category/*.npy`
130
+ - 一张四行接触图 `wrong_category_column.png`,列顺序与正文图一致,最后加 Wrong-category mean
131
+ - `qualitative_match.json`:`real` 与旧 npy 的最大绝对误差
132
+
133
+ 不要把这张图写成重建效果展示。错类别应该比类别均值更不像该类别。
134
+
135
+ ## 5. Job 3 — 类别后验校准
136
+
137
+ `results/reliability_v4/` 是逐点 σ 的可靠性,不是 72 类后验的 ECE。不要把 H2 Spearman 填进 Table ece。
138
+
139
+ 找已经存好的类别概率。优先:
140
+
141
+ - `$BRAIN3D/results/encoder_validation_safe/`
142
+ - `$BRAIN3D/results/subject_ensemble_validation_safe/`
143
+ - 文件名含 `s12` 或 `probs` 的 npy/json
144
+
145
+ 若只有准确率、没有概率向量:写 `category_ece.json`,内容为 `{"status":"probabilities_not_stored"}`,**不要为了 ECE 重新训练编码器**。
146
+
147
+ 若有概率:对 S=1(12 人平均)和 S=12(算术平均概率)计算 72 类 ECE,分箱 10。Top-5 必须仍是 10.8% 与 25.0% 这一对读数;若对不上,说明用错了 split,停。
148
+
149
+ 预期:`category_ece.json` 含 `ece_s1`、`ece_s12`,以及 `reliability_s12.png`。
150
+
151
+ ## 6. Job 4 — 与证据匹配集合对照的 split conformal
152
+
153
+ 只有 Job 3 找到了同一套概率才跑。用验证物体 06–07 选阈值,在 08–09 上评估。预算仍是 K∈{3,5,10}。报告经验覆盖率和 best-of-set Chamfer。
154
+
155
+ 这张表是对照,不是把本文的集合改称 conformal。证据匹配集合没有覆盖率保证。若验证集概率不存在,写 `{"status":"no_calibration_split"}`。
156
+
157
+ 预期:`conformal_vs_set.json`。
158
+
159
+ ## 7. Job 5 — fMRI 的 Chamfer 集合
160
+
161
+ 余弦距离的三种子表已经进附录,不要重算后覆盖它。
162
+
163
+ 只在下面情况补 Chamfer:`$BRAIN3D/data/fMRI-Shape` 里能找到训练物体的类别中位体,且测试标签与 104 个测试样本对齐。集合规则与 EEG 相同:概率 top-m,其余槽位用训练中位体的 Chamfer 做 facility location,测试几何不进构造。
164
+
165
+ 没有中位体就写 `fmri_chamfer_set.json`:
166
+
167
+ ```json
168
+ {"status":"medoids_absent","note":"cosine table already in the appendix; do not relabel it as Chamfer"}
169
+ ```
170
+
171
+ 预期若能跑:K=3 和 K=5 的召回与 Chamfer,三种子均值。不要期待它复现 EEG 的 8+2。
172
+
173
+ ## 8. Job 6 — 不要启动第二个生成器的训练
174
+
175
+ `third_party/EEG2Gaussian` 和 `gaussian-splatting` 在库里,但和 Neuro-3D 的 08–09 划分、Chamfer 定义没有对齐。正文里的第二解码器家族已经是 cross-attention Gaussian point head,结果在正文和附录。
176
+
177
+ 本作业只写 `second_generator_status.md`,三行:没有对齐的 3DGS 检查点;今天不训练;Table placeholder 继续保持 TBD。不要填假的 Δ。
178
+
179
+ ## 9. 跑完之后
180
+
181
+ 上传 `results/ieee_access_923/` 到 `jamie33/923` 的 `results/`。在 `RUN_STATUS.md` 里按 Job 1–6 各写:status(filled / blocked)、输出路径、一个预期是否达到。
182
+
183
+ 不要上传 token、虚拟环境、EEG 原始大文件。不要修改 July 里的历史结果。
confirm_swap_power.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Recompute the 80% power threshold for the same-category swap.
3
+
4
+ Reads subject-level deltas if a JSON list is passed. Otherwise checks that
5
+ the normal approximation used in the IEEE Access draft is reproducible from
6
+ the published mean and SD. Does not train anything.
7
+ """
8
+ import json
9
+ import math
10
+ import sys
11
+ from pathlib import Path
12
+
13
+ ZA = 1.959963984540054
14
+ ZB = 0.8416212335729143
15
+
16
+
17
+ def delta80(sd: float, n: int) -> float:
18
+ return (ZA + ZB) * sd / math.sqrt(n)
19
+
20
+
21
+ def main() -> None:
22
+ out = Path(sys.argv[1] if len(sys.argv) > 1 else "swap_power.json")
23
+ published = {"mean_delta": 0.0028, "sd_delta": 0.0054, "n_subjects": 12}
24
+ payload = {
25
+ "status": "summary_sd_only",
26
+ **published,
27
+ "delta80": round(delta80(published["sd_delta"], published["n_subjects"]), 4),
28
+ "source_files": ["IEEE Access draft Gaussian three-seed summary"],
29
+ }
30
+ if len(sys.argv) > 2:
31
+ deltas = json.loads(Path(sys.argv[2]).read_text())
32
+ values = [float(x) for x in deltas]
33
+ n = len(values)
34
+ mean = sum(values) / n
35
+ var = sum((x - mean) ** 2 for x in values) / (n - 1)
36
+ sd = math.sqrt(var)
37
+ payload = {
38
+ "status": "subject_level",
39
+ "n_subjects": n,
40
+ "mean_delta": mean,
41
+ "sd_delta": sd,
42
+ "delta80": delta80(sd, n),
43
+ "source_files": [sys.argv[2]],
44
+ }
45
+ out.parent.mkdir(parents=True, exist_ok=True)
46
+ out.write_text(json.dumps(payload, indent=2) + "\n")
47
+ print(out)
48
+
49
+
50
+ if __name__ == "__main__":
51
+ main()