combraintf

Trains a two-level community-aware Transformer on dense fMRI connectivity matrices for phenotype prediction.

89|5|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill combraintf-cuhk-aim-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: combraintf
Source: https://github.com/CUHK-AIM-Group/NeuroDiscovery/tree/main/skills/combraintf
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill combraintf-cuhk-aim-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, numpy, scikit-learn, and includes scripts (resource) components.

What problem does it solve? Running the Com-BrainTF model for fMRI phenotype prediction normally requires adapting hydra-based configs and hardcoded community maps; this Skill provides a NeuroClaw reimplementation that auto-derives community partitions from atlas naming and trains the model with a unified classification/regression interface. ## Core Features & Use Cases - Two-level Transformer architecture: Per-community local Transformers with independent CLS tokens feed a global Transformer with DEC pooling for fMRI connectome prediction. - Automatic community partitioning: Derives Yeo 7-network groups for Schaefer atlases, lobe-based groups for AAL/Destrieux/DK/Harvard-Oxford, and hash-based fallback groups for other atlases. - Unified training pipeline: Supports classification and regression with stratified K-fold cross-validation, reusing the BNT dataset format and collate functions. - Use Case: Train Com-BrainTF on Schaefer-200 functional connectivity matrices to predict HCP subject gender, or run regression on AAL-116 data to predict subject age. ## Quick Start Run the training reference script with the schaefer_200_7net atlas, a labels CSV, fold 0, 10 epochs, and batch size 8 to smoke-test Com-BrainTF classification.

Frequently Asked Questions about combraintf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train Com-BrainTF on fMRI connectivity data?

Run the train_reference.py script with an atlas name, a labels CSV, and training hyperparameters such as fold, epochs, and batch size. The script auto-derives community partitions from the atlas and supports both classification and regression with K-fold cross-validation.

What input data format does Com-BrainTF require?

Com-BrainTF takes dense functional connectivity matrices of shape [B, N, N], loaded from per-subject .pt files under data/braingnn_input/<atlas>/. It reuses the BNT dataset and collate functions, converting Fisher-z FC values to Pearson correlation with a zeroed diagonal.

Which brain atlases work best with Com-BrainTF?

Schaefer 200 or 400 with Yeo 7-network naming gives the cleanest community grouping. AAL atlases work via lobe-based grouping, while atlases without semantic ROI names fall back to MD5 hash-based partitioning, which may reduce performance.

Why does Com-BrainTF fail with certain ROI counts?

The number of attention heads must divide the model dimension, which equals the number of ROIs. Atlases with odd ROI counts like cc200 require adjusting nhead; the training script automatically decrements nhead until it divides n_roi.

How can I reduce GPU memory usage when training Com-BrainTF?

Lower the hidden size to 512 and the batch size to 4, since memory scales with the number of local transformers times hidden size times the squared model dimension. Large atlases like glasser_360 with hidden size 1024 can easily exhaust GPU memory.