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-core-brain-network-oodgit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-core-brain-network-ood/SKILL.md---
name: core-brain-network-ood
description: CORE (Confounding Robustness Enhancement) framework for out-of-distribution generalization in brain network analysis. Addresses site effects and covariate confounding via causal decoupling. Use when: building cross-site classifiers, dealing with scanner/site bias, handling spurious correlations in neuroimaging data, conducting multi-center studies, applying graph neural networks to brain connectivity with domain shifts.
category: neuroscience
created: "2026-05-09"
readiness_status: available
dependencies: []
---
# CORE: Confounding Robustness Enhancement for Brain Network Analysis
## Overview
CORE (Confounding Robustness Enhancement) is a framework for achieving out-of-distribution (OOD) generalization in brain network classification. Published on arXiv (2605.06050v1, May 2026), it addresses the critical problem of site effects and covariate confounding in neuroimaging studies.
## Problem Statement
Brain network classification models suffer from poor cross-site generalization because they exploit spurious correlations with non-biological confounders:
- **Scanner/site effects**: Different MRI machines, acquisition protocols, preprocessing pipelines
- **Demographic confounders**: Age, sex, education, socioeconomic status correlated with both labels and features
- **Batch effects**: Systematic differences across study sites in multi-center cohorts
Traditional approaches (ComBat harmonization, adversarial training, data augmentation) only align marginal feature distributions but fail to decouple the confounding pathways at the causal level.
## Key Insight: Confounding Triplet
The core theoretical insight is that confounding follows a triplet structure: **Confounder C → (Features X, Labels Y)**. The confounder creates spurious X-Y correlations that models exploit, leading to poor OOD performance when confounder distributions shift.
## CORE Framework Architecture
### Three-Stage Pipeline
#### Stage 1: Site-Aware Confounder Decoupling
- Learn a disentangled representation that separates biological signal from site-specific confounding
- Uses adversarial objectives to remove site information while preserving task-relevant features
- Implements a site-aware encoder that produces two pathways: task-relevant and site-specific
#### Stage 2: Prior-Guided Confounder Synthesis
- Synthesize diverse confounder variations using domain priors (known scanner parameters, demographic statistics)
- Data augmentation that systematically varies confounder levels to cover the confounder space
- Generates counterfactual training samples to improve robustness
#### Stage 3: Invariant Risk Minimization
- Train the final classifier with invariant prediction objectives across confounder environments
- Enforces that the prediction mechanism remains stable regardless of confounder distribution
- Uses environment-specific risk terms with penalty on environment-dependent gradients
### Technical Details
- **Backbone**: 2-layer Graph Convolutional Network (GCN)
- **Hidden size**: 64
- **Optimizer**: Adam (lr=1e-3, weight decay=5e-4)
- **Graph construction**: Correlation-based functional connectivity matrices
- **Framework**: PyTorch
## Risk Formulation
CORE formalizes OOD risk as:
```
R_OOD(f) = sup_{P_env} E_{(X,Y)~P_env}[L(f(X), Y)]
```
Where the supremum is over all possible environment distributions. The framework bounds this risk by:
1. Decomposing features into invariant (biological) and spurious (confounder-dependent) components
2. Penalizing environment-dependent gradients
3. Synthesizing adversarial confounder environments for training
## Application Workflow
1. **Identify confounders**: List all potential confounding variables (site, scanner, demographics)
2. **Construct brain networks**: Build functional/structural connectivity matrices per subject
3. **Apply CORE Stage 1**: Train site-aware encoder to decouple confounder representations
4. **Apply CORE Stage 2**: Synthesize confounder variations using available priors
5. **Apply CORE Stage 3**: Train invariant classifier across synthesized environments
6. **Evaluate**: Test on held-out sites/domains to verify OOD generalization
## Key Results (from paper)
- Outperforms ComBat, adversarial harmonization, and domain generalization baselines
- Maintains biological interpretability of learned representations
- Robust to unseen sites and scanner types in cross-validation
- Effective on both disease classification (e.g., Alzheimer's, schizophrenia) and cognitive prediction tasks
## When to Use
- Multi-site neuroimaging studies with heterogeneous acquisition protocols
- Brain network classification tasks where cross-site generalization is critical
- Functional connectivity analysis with known or suspected confounders
- Any graph-based neuroimaging ML where spurious correlations threaten validity
## Pitfalls
- Requires sufficient samples per site for effective confounder estimation
- Prior-guided synthesis quality depends on accuracy of domain priors
- May reduce in-distribution accuracy slightly in exchange for OOD robustness
- Graph construction method (correlation, partial correlation, etc.) affects downstream performance
- Not a replacement for proper experimental design and confounder measurement
## References
- arXiv: 2605.06050v1 — "When Brain Networks Travel: Learning Beyond Site"