braingnn
Use this model doc whenever the user wants to run BrainGNN for fMRI phenotype prediction, including graph construction, training, and evaluation. This document focuses on model-level usage and delegates upstream preprocessing to fmri-skill (and optionally hcpya-skill for HCP data).
npx skills add BioTender-max/awesome-bio-agent-skills --skill brain_gnn --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# BrainGNN Model Doc ## Overview BrainGNN is an interpretable graph neural network for fMRI analysis and phenotype prediction. - Paper: Li et al., 2020, BrainGNN - Official code: https://github.com/xxlya/BrainGNN_Pytorch/tree/main - NeuroClaw reimplementation: `models/braingnn/` (Windows-compatible, 无需 torch_sparse) - Primary input: ROI-level fMRI connectivity matrices (per-subject .pt files) - Primary output: phenotype prediction (classification/regression) + interpretable pooling scores **Research use only.** --- ## NeuroClaw 实现要点 NeuroClaw 版本对原始 BrainGNN 做了以下关键改动: 1. **去除 torch_sparse 依赖**:`augment_adj` 不再使用 `spspmm` 做邻接矩阵平方,改用 `add_self_loops + remove_self_loops`,在 Windows 上可直接运行。 2. **全连接输入图**:data_adapter 构建 FULL graph(所有 i!=j 对),edge_attr = |Pearson r|。TopKPooling 负责选择,不在输入端做稀疏化。 3. **Fisher-z 反变换**:存储的 fc_matrix 是 Fisher-z,加载时用 `torch.tanh()` 还原为 Pearson r,对角线置零。 4. **支持 classification + regression 双任务**:通过 `--task` 参数切换,regression 时 nclass=1,输出 raw scalar,用 MSELoss。 5. **PyG >=2.3 兼容**:TopKPooling.weight 可能在 `pool.select.weight`,forward 中做了兼容处理。 6. **可选 T1 GM volume 融合**:`--include-t1` 将 z-scored GM volume 作为额外 1 维 node feature 拼接。 --- ## Quick Start (NeuroClaw 内部) ### 前置条
- Overview
- NeuroClaw 实现要点
- Quick Start (NeuroClaw 内部)
- 前置条件
- 训练(分类)
- 训练(回归)
- Atlas Sweep(快速对比)
- Dry Run(验证数据加载)
- 核心文件
- 数据格式约定
- 输入文件 (data/braingnninput/<atlas>/sub-<id>.pt)
- 可选 T1 文件 (data/t1volume/<atlas>/sub-<id>.npz)
- 输出 checkpoint (models/braingnn/checkpoints/<atlas>/fold<N>.pt)
- 关键训练参数
python models/braingnn/scripts/train.py \ python models/braingnn/scripts/sweep_atlases.py python models/braingnn/scripts/train.py --atlas aal_116 --dry-run
What does the braingnn skill do?
Use this model doc whenever the user wants to run BrainGNN for fMRI phenotype prediction, including graph construction, training, and evaluation. This document focuses on model-level usage and delegates upstream preprocessing to fmri-skill (and optionally hcpya-skill for HCP data).
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill brain_gnn --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
