brain-age-modeling

Trains cross-validated brain-age regression models and exports bias-corrected Brain-PAD predictions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Estimating biological brain age from neuroimaging features requires leakage-safe cross-validation and predicted-age bias correction, which are easy to get wrong when done manually. This Skill trains predicted-age models on tabular brain features, fits the age-bias corrector on each training fold only, and exports held-out raw age, corrected age, and Brain-PAD values for downstream group analysis. ## Core Features & Use Cases - Leakage-safe cross-validation: Fits the bias corrector on training folds only and applies it to held-out folds, keeping site, cohort, or family groups intact. - Multiple regressors: Supports ridge, OLS, elastic net, SVR, and optional XGBoost estimators reused from the statistical-ml layer. - Complete provenance: Outputs predictions.csv, fold_assignments.csv, metrics.json, per-fold checkpoints, config.json, and run_manifest.json. - Use Case: Given a CSV of subjects with chronological age and features like cortical thickness and hippocampal volume, train a ridge brain-age model with 5-fold cross-validation and obtain held-out Brain-PAD values for comparing accelerated aging across clinical groups. ## Quick Start Train a ridge brain-age model on my brain_features.csv file with 5-fold cross-validation grouped by site and export the held-out Brain-PAD predictions.

Frequently Asked Questions about brain-age-modeling

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

FAQPage Schema
How do I train a brain-age prediction model from neuroimaging features?

Prepare a CSV with subject IDs, chronological age, and numeric brain features, then run the train_reference.py script with your chosen regressor, fold count, and output directory. The workflow produces held-out raw age, corrected age, and Brain-PAD predictions.

What is Brain-PAD and how is it calculated?

Brain-PAD is the predicted age difference, computed as bias-corrected predicted age minus chronological age. Positive values indicate an older-appearing brain relative to chronological age under the fitted model, but it is not a diagnosis or causal effect.

Which regression models can I use for brain-age prediction?

The workflow supports ridge, OLS, elastic net, SVR, and optional XGBoost regressors reused from the statistical-ml layer. Ridge is the default example and works well for high-dimensional collinear brain features.

Why is age bias correction needed in brain-age models?

Predicted ages regress toward the training mean, biasing Brain-PAD estimates for younger and older subjects. This workflow fits the bias corrector on each training fold only, then applies it to held-out folds to avoid leakage.

Can I keep sites or cohorts together during cross-validation?

Yes, pass a grouping column such as site, cohort, or family via the group-col argument so related subjects stay in the same fold. This prevents optimistic performance estimates from site-specific leakage.

What are the limitations of brain-age gap analysis?

Brain-PAD depends on the training population, feature family, validation design, and correction procedure, so these must always be reported alongside results. Downstream analysis should use only held-out values with prespecified covariates like age, sex, site, and intracranial volume.