lggnn

Trains LG-GNN graph neural networks on fMRI brain graphs for phenotype prediction.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Running the LG-GNN (Local-to-Global GNN) model for fMRI-based phenotype prediction requires adapting the original population-graph architecture to single-subject brain graphs, handling PyG 2.7 compatibility issues, and wiring up SABP pooling with mutual-information regularization. This Skill provides a ready NeuroClaw reimplementation with reference training scripts for both classification and regression tasks. ## Core Features & Use Cases - Single-subject LG-GNN adaptation: Retains the Local_GNN with SABP pooling and MI regularization, replacing the population graph with an MLP head so no demographic graph is needed. - Unified classification and regression training: One K-fold CV training script handles both phenotype classification (e.g., gender) and regression (e.g., age prediction) with configurable hyperparameters. - BrainGNN data reuse: Directly consumes the shared PyG NeuroClawFCDataset format (data/braingnn_input/<atlas>/sub-*.pt), so no extra preprocessing is required. - Use Case: A researcher with preprocessed HCP functional connectivity data wants to predict subject age using a Schaefer atlas; they run the reference training script in regression mode and get MAE metrics per fold plus ROI importance from SABP. ## Quick Start Ask the agent to train LG-GNN on the aal_116 atlas with the HCP gender labels CSV for 10 epochs on fold 0 as a smoke test.

Frequently Asked Questions about lggnn

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

FAQPage Schema
How do I train LG-GNN on fMRI data for phenotype prediction?

Run the reference training script with an atlas name and labels CSV, for example train_reference.py with --atlas aal_116 and --fold 0. It loads PyG brain graphs from the shared BrainGNN dataset directory and runs stratified K-fold cross-validation.

How do I run LG-GNN for regression instead of classification?

Pass --task regression with a continuous label column such as age, for example using the HCP age labels CSV. The script automatically sets nclass to 1, switches to plain K-fold splitting, and reports MAE instead of accuracy.

Does LG-GNN work with PyTorch Geometric 2.7?

Yes, the NeuroClaw reimplementation is compatible with PyG 2.7. The removed topk_pool and filter_adj functions are replaced with pool.select.topk and an inline filter_adj implementation.

What input data format does LG-GNN require?

It consumes PyG Data objects with node features x of shape [N, N], edge_index, and edge_attr, stored as sub-*.pt files under data/braingnn_input/<atlas>/. This is the same format BrainGNN uses, so no additional preprocessing is needed.

Why is the mutual information estimate near zero at the start of training?

The MI estimate starts near zero because the joint and marginal distributions are initially similar in the SABP pooling module. It should gradually become positive during training, and the loss subtracts 0.1 times the MI term to encourage maximization.

What are the limitations of the NeuroClaw LG-GNN adaptation?

The adaptation removes the original population graph built from demographic data, so it only performs single-subject prediction with an MLP head. It is intended for research use only and depends on preprocessed connectivity data produced by the fMRI preprocessing pipeline.