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-alignment-patterns-analysisgit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-brain-alignment-patterns-analysis/SKILL.md---
name: brain-alignment-patterns-analysis
description: "Alignment Pattern Analysis (APA) methodology for brain-model alignment evaluation using cross-region alignment patterns as second-order structural consistency tests."
version: "1.0"
paper_id: "2604.21780"
arxiv_url: "https://arxiv.org/abs/2604.21780"
authors: "Larissa Höfling, Matthias Tangemann, Lotta Piefke, Susanne Keller"
published: "2026-04-23"
categories:
- q-bio.NC
tags:
- brain-model-alignment
- alignment-patterns
- cross-region-analysis
- representational-similarity
- fMRI
- vision-models
---
# Brain Alignment Patterns Analysis
> Alignment Pattern Analysis (APA) for brain-model alignment evaluation using cross-region alignment patterns as second-order structural consistency tests.
## Metadata
- **Source**: arXiv:2604.21780
- **Authors**: Larissa Höfling, Matthias Tangemann, Lotta Piefke, Susanne Keller
- **Published**: 2026-04-23
## Core Methodology
### Key Innovation
Traditional brain-model alignment benchmarks rank models based on alignment measures (representational similarity, neural predictability) but lack discriminative power and robustness. **Alignment Pattern Analysis (APA)** introduces a second-order structural consistency test: models aligned to a given brain region should reproduce that region's characteristic cross-region alignment profile.
### Technical Framework
**Step 1: Standard Benchmarking Pipeline**
- Apply to diverse vision models on BOLD Moments video fMRI dataset
- Evaluate across visual regions of interest (ROIs)
- Compute conventional alignment measures
**Step 2: Alignment Pattern Definition**
- Alignment patterns = characteristic functional relationship profiles of each brain region to all others
- Captures second-order relational structure across the visual hierarchy
- Highly stable across different subjects
**Step 3: APA Evaluation**
- Test if models reproduce cross-region alignment profiles of brain ROIs
- Models aligned to a given ROI should match its alignment pattern
- Evaluate consistency across brain regions
**Step 4: Discriminative Analysis**
- Conventional measures: diverse models appear equivalent
- APA: reveals which models actually capture relational structure
- Distinguish neural predictors from true computational models
## Implementation Guide
### Prerequisites
- fMRI data (e.g., BOLD Moments dataset)
- Pre-trained vision models for comparison
- Representational similarity analysis (RSA) tools
### Step-by-Step
```python
# 1. Compute conventional alignment scores
alignment_scores = {}
for model in vision_models:
for roi in brain_rois:
alignment_scores[model, roi] = compute_rsa_alignment(
model_features[model],
brain_responses[roi]
)
# 2. Compute alignment patterns (cross-region profiles)
alignment_patterns = {}
for roi in brain_rois:
# Profile of this ROI's alignment to all other ROIs
profile = [alignment_scores[ref_roi] for ref_roi in brain_rois]
alignment_patterns[roi] = normalize(profile)
# 3. Model alignment pattern evaluation
model_patterns = {}
for model in vision_models:
for roi in brain_rois:
model_patterns[model, roi] = compute_model_alignment_pattern(
model, roi, brain_rois
)
# 4. APA consistency test
apa_scores = {}
for model in vision_models:
for roi in brain_rois:
apa_scores[model, roi] = correlation(
alignment_patterns[roi],
model_patterns[model, roi]
)
# 5. Overall model quality
model_quality = {}
for model in vision_models:
model_quality[model] = mean([
apa_scores[model, roi] for roi in brain_rois
])
```
### Code Example
```python
import numpy as np
from scipy.stats import pearsonr
def compute_alignment_pattern_analysis(
model_features, # Dict: model_name -> features
brain_responses, # Dict: roi_name -> neural responses
stimuli # Stimulus set
):
"""
Compute Alignment Pattern Analysis (APA) for model evaluation.
Parameters:
-----------
model_features : dict
Mapping from model names to feature matrices
brain_responses : dict
Mapping from ROI names to neural response matrices
stimuli : array
Stimulus identifiers
Returns:
--------
results : dict
Contains alignment scores and APA scores for all models
"""
rois = list(brain_responses.keys())
models = list(model_features.keys())
# Step 1: Conventional alignment scores
alignment_matrix = {}
for model in models:
alignment_matrix[model] = {}
for roi in rois:
rdm_model = compute_rdm(model_features[model])
rdm_brain = compute_rdm(brain_responses[roi])
alignment_matrix[model][roi] = correlate_rdms(rdm_model, rdm_brain)
# Step 2: Brain alignment patterns (reference)
brain_patterns = {}
for roi in rois:
pattern = [alignment_matrix[ref_model][ref_roi]
for ref_model in models
for ref_roi in rois]
brain_patterns[roi] = np.array(pattern)
# Step 3: Model alignment patterns
model_patterns = {}
for model in models:
model_patterns[model] = {}
for roi in rois:
# Model's alignment to all ROIs
pattern = [alignment_matrix[model][ref_roi] for ref_roi in rois]
model_patterns[model][roi] = np.array(pattern)
# Step 4: APA scores
apa_scores = {}
for model in models:
apa_scores[model] = {}
for roi in rois:
r, _ = pearsonr(brain_patterns[roi], model_patterns[model][roi])
apa_scores[model][roi] = r
return {
'conventional_alignment': alignment_matrix,
'apa_scores': apa_scores,
'brain_patterns': brain_patterns,
'model_patterns': model_patterns
}
def compute_rdm(features):
"""Compute representational dissimilarity matrix."""
from scipy.spatial.distance import pdist, squareform
return squareform(pdist(features, metric='correlation'))
def correlate_rdms(rdm1, rdm2):
"""Correlate two RDMs (upper triangle only)."""
from scipy.stats import spearmanr
mask = np.triu_indices_from(rdm1, k=1)
return spearmanr(rdm1[mask], rdm2[mask])[0]
```
## Applications
### Brain-Model Alignment Evaluation
- Distinguish true brain models from mere neural predictors
- Evaluate computational and algorithmic similarity claims
- Beyond correlation: assess structural consistency
### Vision Model Benchmarking
- Identify models that capture relational structure
- Rank models by cross-region alignment fidelity
- Test generalization across different brain regions
### Neural Representation Analysis
- Study stability of alignment patterns across subjects
- Investigate hierarchical organization in visual cortex
- Map model-brain correspondence at multiple scales
### Model Selection for Neuroscience
- Choose models based on APA scores for specific research questions
- Balance conventional alignment with structural consistency
- Validate models before making computational claims
## Pitfalls
- **Data requirements**: APA requires multi-region fMRI data; single-region studies cannot apply this method
- **Interpretation caution**: Low APA scores don't necessarily mean models are "wrong"—they may just be different kinds of tools
- **Subject variability**: While patterns are stable, individual differences exist and should be considered
- **Computational vs. tool distinction**: APA helps distinguish but doesn't replace careful theoretical analysis
## Related Skills
- `umwelt-representation-hypothesis` - Ecological constraint perspective on alignment
- `neural-encoding-evaluation-meeg` - Neural encoding model evaluation
- `cross-modal-convergence` - Multi-modal representational convergence
- `rsa-representational-similarity` - Representational similarity analysis methods