Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install hiyenwong-ai-collection-collection-skills-brain-network-coregit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-brain-network-core/SKILL.md--- name: brain-network-core description: CORE framework for out-of-distribution generalization in brain network analysis via site-aware confounder decoupling category: neuroscience created: "2026-05-09" readiness_status: available dependencies: [] --- # CORE: Confounded Representation Elimination for Brain Network Analysis ## Overview This methodology presents the CORE framework for out-of-distribution (OOD) generalization in brain network analysis. Published on arXiv (2605.06050v1, May 2026), it addresses the critical challenge of site-specific confounders that degrade model performance when brain network models are deployed across different scanning sites, populations, or protocols. ## Key Innovation ### Site-Aware Confounder Decoupling - Identifies and separates site-specific artifacts from biologically meaningful brain network patterns - Uses a disentanglement approach that explicitly models the confounding structure - Enables models to learn site-invariant representations while preserving diagnostic signal ### Prior-Guided Disentanglement - Incorporates neuroscientific priors to guide the separation of confounded vs. clean representations - Uses structural information about brain networks to constrain the disentanglement process - Ensures that biologically implausible patterns are not learned as "confounders" ### OOD Risk Formulation - Formalizes the problem as minimizing worst-case risk across unseen sites - Uses a distributionally robust optimization approach - Provides theoretical guarantees on generalization bounds ## Architecture ### Input Representation - **Brain Networks**: Functional connectivity matrices (FC) from fMRI data - **Site Labels**: Metadata indicating acquisition site/scanner/protocol - **Graph Structure**: Nodes represent brain regions, edges represent functional connectivity ### CORE Framework Components 1. **Confounded Encoder**: Maps brain networks to a latent representation that may contain site-specific artifacts 2. **Site Predictor**: Attempts to predict site labels from the latent representation 3. **Disentanglement Module**: Separates the representation into: - Site-invariant component (biologically meaningful) - Site-specific component (confounders) 4. **Classifier**: Makes predictions using only the site-invariant representation 5. **Prior-Guided Regularizer**: Ensures biological plausibility of the disentanglement ### Training Objective - Minimize classification loss on site-invariant features - Minimize site predictability from invariant features (adversarial objective) - Maximize site predictability from site-specific features - Apply prior-guided regularization to maintain biological consistency ## Implementation Details ### PyTorch Implementation - **Backbone**: 2-layer Graph Convolutional Network (GCN) - **Hidden Size**: 64 dimensions - **Optimizer**: Adam with learning rate 1e-3, weight decay 5e-4 - **Batch Size**: Configurable based on dataset size - **Epochs**: Typically 100-200 with early stopping ### Dataset Requirements - Multi-site fMRI datasets with site labels - Examples: ABIDE, ADHD-200, UK Biobank, HCP - Preprocessed functional connectivity matrices (e.g., using atlas-based parcellation) ### Baselines for Comparison - Standard GCN without confounder handling - Domain adversarial neural networks (DANN) - Invariant risk minimization (IRM) - Site-specific fine-tuning ## Application Workflow 1. **Data Preparation**: Collect multi-site brain network data with site labels 2. **Preprocessing**: Compute functional connectivity matrices using standard pipelines 3. **Model Training**: Train CORE framework with confounder decoupling 4. **Validation**: Evaluate OOD generalization on held-out sites 5. **Deployment**: Use site-invariant model for cross-site predictions ## Key Advantages - **Robustness**: Maintains performance across different scanning sites and protocols - **Interpretability**: Disentangled representations provide insights into confounding structure - **Theoretical Guarantees**: Formal bounds on OOD generalization performance - **Flexibility**: Applicable to various brain network analysis tasks (classification, regression, etc.) ## When to Use - Multi-site fMRI studies where data comes from different scanners/protocols - Brain disorder diagnostic models that need to generalize across populations - Research into confounder-aware machine learning for neuroscience - Building robust biomarkers that are not site-specific - Domain generalization in neuroimaging applications ## Pitfalls - Requires multi-site data with site labels for training - Disentanglement quality depends on the strength of site-specific confounders - May reduce in-distribution performance slightly in exchange for OOD robustness - Prior selection is critical — incorrect priors can harm disentanglement - Computational overhead from adversarial training components - Not suitable for single-site studies without domain shift concerns ## References - arXiv: 2605.06050v1 — "When Brain Networks Travel: Learning Beyond Site" - Domain generalization literature: DANN, IRM, CORAL - Brain network analysis: functional connectivity, graph neural networks - Confounder handling: causal inference, disentanglement learning