Skip to content

Video understanding, tracking, generation, and world models · Action recognition · VID015 · Architecture

Spatial Temporal Graph Convolutional Networks (ST-GCN)

Represents a person as joints connected by anatomical edges and temporal links, then learns action features with graph and temporal convolutions.

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Represents a person as joints connected by anatomical edges and temporal links, then learns action features with graph and temporal convolutions. It is useful when pose is available and raw visual appearance is unnecessary or distracting.

Question / objective

Estimate an action label from a clip or video and determine which temporal evidence improves prediction. This is a learning or inference objective, not a test of a statistical null hypothesis.

Method type and supervision

architecture · Action recognition. Usually supervised video-label learning; image/video pretraining may use other supervision.

Architecture / computational structure

Anatomical spatial graph convolutions interleaved with temporal convolutions.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. Accuracy depends on pose quality and consistent joint conventions. Occlusion, viewpoint changes and missing objects limit actions identifiable from skeletons alone.

Formula / computational definition

Hl+1=∑kA^kHlWkH^{l+1}=\sum_k \hat A_kH^lW_k summarizes spatial graph aggregation over partitioned normalized adjacencies A^k\hat A_k, features HH and learned weights WkW_k; temporal convolution links frames.

Parameters and notation

Learned/estimated quantities: Encoder filters or attention/projection weights, normalization parameters and task-head coefficients are learned; architectural dimensions and sampling rules are chosen. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Skeleton definition, graph partitions, coordinate normalization, confidence handling, persons per clip and temporal receptive field matter.

Fitting, fine-tuning, and adaptation

Fit a new classification head and adapt temporal layers first. A changed skeleton layout requires graph and input remapping before fine-tuning; pose-detector bias may require its own adaptation. Use a separate adaptation validation split, monitor the target metric and retention of previously useful behavior, and save the exact preprocessing and training configuration.

How to use and calibrate

Fix the input protocol and target before fitting; choose design settings on held-out source videos, then freeze the evaluation procedure. Use cross-subject and cross-view splits, class accuracy and explicit missing-joint or noisy-pose robustness.

Example application

Classify gestures using tracked body joints.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Use cross-subject and cross-view splits, class accuracy and explicit missing-joint or noisy-pose robustness. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Normalize a joint graph and propagate joint features. Dependencies: NumPy in Python; base R in R; run the shared setup above. Python component: executed successfully. R component: unexecuted. No complete model training or pretrained inference was executed.

Full implementation route — Python: Implement adjacency normalization, graph multiplication and temporal convolutions; preserve joint identity across datasets. R: R matrix operations can demonstrate graph propagation, while R torch or reticulate provides end-to-end training and GPU inference.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — Normalize a joint graph and propagate joint features.

Shared setup for this chapter
import numpy as np

def softmax(x):
    z = np.asarray(x, dtype=float)
    e = np.exp(z - z.max())
    return e / e.sum()
adj = np.array([[1.,1.,0.],[1.,1.,1.],[0.,1.,1.]])
degree = adj.sum(axis=1)
normalized = adj/np.sqrt(degree[:,None]*degree[None,:])
joint_features = np.array([[1.],[0.],[2.]])
print(normalized@joint_features)
R

Component demo, not a trained model — Normalize a joint graph and propagate joint features.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
adj <- matrix(c(1,1,0,1,1,1,0,1,1),3,byrow=TRUE)
d <- rowSums(adj)
normalized <- adj/sqrt(outer(d,d))
print(normalized%*%matrix(c(1,0,2),3))

Sources

From the CodeSplash reference, entry VID015.