brainnetcnn

Train BrainNetCNN on dense ROI connectivity matrices for neuroimaging classification and regression.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Applying convolutional neural networks to brain connectivity data requires architectures designed for adjacency matrices rather than images. This Skill trains and evaluates BrainNetCNN, which uses edge-to-edge, edge-to-node, and node-to-graph convolutions, on dense ROI-by-ROI functional connectivity matrices for classification or regression tasks. ## Core Features & Use Cases - Connectome-Specific CNN: Applies E2E, E2N, and N2G convolution blocks to dense Fisher-z connectivity matrices with configurable channel sizes, dropout, and learning rate. - Classification and Regression: Supports both categorical targets (e.g., gender classification) and continuous targets (e.g., age regression) with subject-level k-fold cross-validation. - Standardized Input Contract: Consumes per-subject .pt files containing fc_matrix tensors and a CSV label file, with a shared BNT data adapter handling tanh transformation and diagonal zeroing. - Use Case: A researcher with HCP Schaefer-100 atlas connectivity matrices wants to predict subject gender; they run the reference trainer with 5-fold cross-validation on GPU and obtain per-fold checkpoints with best metrics. ## Quick Start Train BrainNetCNN on my Schaefer-100 connectivity matrices using the labels in data/hcp_gender_labels.csv with 5-fold cross-validation on GPU.

Frequently Asked Questions about brainnetcnn

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

FAQPage Schema
How do I train BrainNetCNN on functional connectivity matrices?

Run the reference training script with your atlas name, a CSV label file, and task type. Prepare one .pt file per subject containing an fc_matrix tensor, then specify classification or regression, fold index, epochs, and device such as cuda.

What input format does BrainNetCNN require for connectome data?

Each subject needs a .pt file with subject_id, atlas, and an fc_matrix tensor of shape [n_roi, n_roi] containing Fisher-z values. Labels come from a CSV with subject_id and label columns, and all subjects must share the same atlas and ROI ordering.

Can BrainNetCNN do regression as well as classification?

Yes, BrainNetCNN supports both tasks through the --task flag. Classification outputs class logits with an nclass parameter, while regression outputs a single continuous value, such as predicting age from connectivity matrices.

BrainNetCNN vs BrainGNN for brain network classification?

BrainNetCNN operates on dense connectivity matrices using edge-to-edge and node-to-graph convolutions. BrainGNN and related models like ibgnn or lggnn use sparse PyG graph operations and provide graph-specific explanations, suiting different analysis needs.

Why should I use subject-level cross-validation for connectome CNNs?

Subject-level folds prevent data leakage where the same subject appears in both training and test sets, which inflates accuracy. For multi-site, family, or repeated-visit data, construct group-aware splits before interpreting results.