fm_app

Runs the FM-APP multi-stage pipeline for phenotype prediction from fMRI and sMRI ROI features.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Predicting phenotypes from neuroimaging data requires coordinating fMRI connectivity features, sMRI structural features, and a multi-stage deep learning pipeline, which is error-prone to set up manually. This Skill provides model-level guidance for running FM-APP, a foundation model for phenotype prediction via fMRI-to-sMRI knowledge transfer. ## Core Features & Use Cases - Staged Pipeline Guidance: Walks through Stage 0 (data preparation), Stage 1 (fMRI training), Stage 2 (fMRI-T1w alignment via Sinkhorn-RPM), and Stage 3 (decoder and zero-shot inference) with exact script names and expected artifacts. - Delegation to Preprocessing Skills: Routes fMRI ROI extraction to fmri-skill, sMRI feature extraction to smri-skill, and HCP data orchestration to hcpya-skill, keeping model execution separate from preprocessing. - Use Case: A researcher with HCP Young Adult data wants to predict cognitive phenotypes. The Skill instructs them to prepare ROI connectivity features, run the four stages in order, and verify checkpoints like stage1_fmri_best_*.pth before proceeding. ## Quick Start Ask the assistant to run the FM-APP pipeline on your HCP dataset, starting with fMRI ROI feature preparation and proceeding through Stage 1 training, Stage 2 alignment, and Stage 3 zero-shot phenotype inference.

Frequently Asked Questions about fm_app

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

FAQPage Schema
How do I run FM-APP for phenotype prediction on HCP data?

Run the four stages in order: Stage 0 data preparation scripts (00-*, 01-*, 02-*), Stage 1 fMRI training (101-main_stage1_fmri_HCP.py), Stage 2 fMRI-T1w alignment (102-main_stage2_fmri_t1w_HCP.py), and Stage 3 decoder inference (103-main_stage3_t1w_HCP.py). fMRI and sMRI ROI features must be prepared first via fmri-skill and smri-skill.

What input features does FM-APP require?

FM-APP requires fMRI ROI connectivity features (corr/pcorr) as primary input and sMRI ROI structural features (e.g., 333x9 per subject) for Stage 2 alignment. It also needs phenotype CSV files and pre-encoded phenotype text feature tensors in the data/ directory.

Does FM-APP require a GPU for training?

A CUDA-capable GPU is strongly recommended for FM-APP training. You should install CUDA-compatible PyTorch and graph-related packages before running the pipeline, especially since Stage 2 Sinkhorn matching has higher runtime than Stage 1.

Why does FM-APP Stage 2 fail or produce errors?

Stage 2 fails when Stage 1 artifacts are missing or invalid, since it depends on frozen Stage 1 model checkpoints and features. It also requires valid sMRI ROI features per subject, so verify smri-skill outputs and subject ID alignment before running.

What are the limitations of FM-APP zero-shot phenotype inference?

Stage 3 zero-shot inference depends on the stage1_dataset_*.pt feature package and proper masking setup. Results are for research use only, and strict train/val/test splits must be maintained to avoid data leakage across stages.