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-dast-gcn-fmrigit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-dast-gcn-fmri/SKILL.md---
name: dast-gcn-dynamic-adaptive-spatio-temporal-graph-co
description: **Source:** arXiv:2109.12517 (MLCN 2021)
---
# DAST-GCN: Dynamic Adaptive Spatio-temporal Graph Convolution for fMRI
**Source:** arXiv:2109.12517 (MLCN 2021)
**Utility:** 0.94
**Created:** 2026-03-25
## Activation Keywords
- DAST-GCN
- dynamic adaptive graph convolution
- spatio-temporal fMRI
- graph structure learning
- dynamic brain connectivity
- fMRI graph neural network
## Description
A graph convolution model that learns dynamic connections between brain regions via layer-wise graph structure learning, overcoming limitations of pre-defined static correlation-based graphs for fMRI analysis.
## Core Methodology
### 1. Problem: Static Graph Limitations
**Challenges with static correlation-based graphs:**
- Oversimplifies complex dynamic spatio-temporal nature
- Pre-defined structures may not capture true connectivity
- Hiders advanced non-linear feature extraction
**Solution:** Learn dynamic graph structure end-to-end
### 2. DAST-GCN Architecture
**Key Components:**
1. **Graph Structure Learning Module**
- Layer-wise dynamic connection inference
- Adapts to supervised learning targets
- Captures task-relevant connectivity
2. **Spatio-temporal Graph Convolution**
- Captures spatial relationships between regions
- Models temporal dynamics
- End-to-end trainable
3. **Supervised Learning Framework**
- Maps connectivity to phenotypes
- Identifies potential biomarkers
- Leverages data and targets
### 3. Key Innovations
- **Dynamic connections** - Not pre-defined, learned from data
- **Task-adaptive** - Graph structure optimizes for prediction target
- **Transferable** - Pre-trained graphs generalize across datasets
## Implementation Framework
```python
# Conceptual DAST-GCN architecture
import torch
import torch.nn as nn
import torch.nn.functional as F
class GraphStructureLearning(nn.Module):
"""
Learns dynamic graph structure layer-wise
"""
def __init__(self, num_nodes, hidden_dim):
super().__init__()
# Learnable adjacency parameters
self.node_embed = nn.Parameter(torch.randn(num_nodes, hidden_dim))
self.graph_generator = nn.Sequential(
nn.Linear(hidden_dim * 2, hidden_dim),
nn.ReLU(),
nn.Linear(hidden_dim, 1),
nn.Sigmoid()
)
def forward(self):
"""Generate dynamic adjacency matrix"""
# Compute pairwise node similarities
n = self.node_embed.shape[0]
pairs = torch.cat([
self.node_embed.unsqueeze(1).expand(-1, n, -1),
self.node_embed.unsqueeze(0).expand(n, -1, -1)
], dim=-1)
adj = self.graph_generator(pairs).squeeze(-1)
return adj
class SpatioTemporalGCN(nn.Module):
"""
Spatio-temporal graph convolution layer
"""
def __init__(self, in_features, out_features, num_nodes):
super().__init__()
self.spatial_conv = nn.Linear(in_features * num_nodes, out_features * num_nodes)
self.temporal_conv = nn.Conv1d(out_features, out_features, kernel_size=3, padding=1)
def forward(self, x, adj):
"""
Args:
x: [batch, time, nodes, features]
adj: [nodes, nodes] - dynamic adjacency
Returns:
[batch, time, nodes, out_features]
"""
batch, time, nodes, features = x.shape
# Spatial convolution with dynamic adjacency
x_spatial = torch.einsum('btnf,nm->btmf', x, adj)
x_spatial = x_spatial.reshape(batch, time, -1)
x_spatial = self.spatial_conv(x_spatial)
x_spatial = x_spatial.reshape(batch, time, nodes, -1)
# Temporal convolution
x_temporal = x_spatial.permute(0, 3, 1, 2).reshape(batch * -1, -1, time)
x_temporal = self.temporal_conv(x_temporal)
return x_spatial
class DASTGCN(nn.Module):
"""
Dynamic Adaptive Spatio-temporal Graph Convolutional Network
"""
def __init__(self, num_nodes, num_timepoints, in_features, hidden_dim, num_classes):
super().__init__()
# Layer-wise graph structure learning
self.graph_learners = nn.ModuleList([
GraphStructureLearning(num_nodes, hidden_dim)
for _ in range(3) # 3 layers
])
# Spatio-temporal GCN layers
self.st_gcn_layers = nn.ModuleList([
SpatioTemporalGCN(in_features, hidden_dim, num_nodes),
SpatioTemporalGCN(hidden_dim, hidden_dim, num_nodes),
SpatioTemporalGCN(hidden_dim, hidden_dim, num_nodes)
])
# Classifier
self.classifier = nn.Sequential(
nn.Linear(hidden_dim * num_nodes, hidden_dim),
nn.ReLU(),
nn.Dropout(0.5),
nn.Linear(hidden_dim, num_classes)
)
def forward(self, x):
"""
Args:
x: [batch, time, nodes, features] - fMRI time series
Returns:
logits: [batch, num_classes]
learned_graphs: List of dynamic adjacency matrices
"""
learned_graphs = []
for graph_learner, st_gcn in zip(self.graph_learners, self.st_gcn_layers):
# Learn dynamic graph structure
adj = graph_learner()
learned_graphs.append(adj)
# Apply spatio-temporal convolution
x = st_gcn(x, adj)
# Global pooling and classification
x = x.reshape(x.shape[0], -1)
logits = self.classifier(x)
return logits, learned_graphs
```
## Applications
### 1. Age and Gender Classification
- UK Biobank resting-state fMRI
- Outperforms linear and non-linear methods
### 2. Biomarker Discovery
- Task-specific connectivity patterns
- Potential clinical markers
### 3. Cross-Dataset Transfer
- Pre-trained graphs generalize
- Robust to scanning parameters
- Demographics transfer
## Experimental Results
| Method | Task | Performance |
|--------|------|-------------|
| DAST-GCN | Age classification | Best |
| DAST-GCN | Gender classification | Best |
| Static GCN | Age/Gender | Lower |
| Linear methods | Age/Gender | Lower |
**Transfer Learning:**
- Pre-trained graph transfers to independent datasets
- Robust across scanning parameters
- Maintains performance across demographics
## When to Use
- fMRI analysis with dynamic connectivity
- When pre-defined graphs are insufficient
- Phenotype prediction from functional scans
- Biomarker identification
- Cross-site transfer learning
## Tools Used
- `read` - Read documentation and references
- `web_search` - Search for related information
- `web_fetch` - Fetch paper or documentation
## Instructions for Agents
Follow these steps when applying this skill:
### Step 1: Graph Structure Learning Module
### Step 2: Spatio-temporal Graph Convolution
### Step 3: Supervised Learning Framework
### Step 4: Understand the Request
### Step 5: Search for Information
### When to Apply
- fMRI analysis with dynamic connectivity
- When pre-defined graphs are insufficient
- Phenotype prediction from functional scans
## Examples
### Example 1: Basic Application
**User:** I need to apply DAST-GCN: Dynamic Adaptive Spatio-temporal Graph Convolution for fMRI to my analysis.
**Agent:** I'll help you apply dast-gcn-fmri. First, let me understand your specific use case...
**Context:** Problem: Static Graph Limitations
### Example 2: Advanced Scenario
**User:** fMRI analysis with dynamic connectivity
**Agent:** Based on the methodology, I'll guide you through the advanced application...
### Example 2: Advanced Application
**User:** What are the key considerations for dast-gcn-fmri?
**Agent:** Let me search for the latest research and best practices...
## Related Skills
- `gnn-transformer-fusion` - GNN architectures for brain data
- `time-varying-brain-connectivity` - Dynamic connectivity analysis
- `ptgb-brain-network-pretraining` - Pre-training for brain networks
## References
- El Gazzar, A., et al. "Dynamic Adaptive Spatio-temporal Graph Convolution for fMRI Modelling." MLCN 2021.
- Graph structure learning literature
- Spatio-temporal graph neural networks