Skip to content

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

R(2+1)D

Factorizes a 3D convolution into a spatial convolution followed by a temporal convolution, with a nonlinearity between them.

Needs a data type CodeSplash doesn't load yet Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Running this needs images, audio, video, graphs or another data type CodeSplash doesn't load yet.

Availability
Needs a data type CodeSplash doesn't load yet
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

Factorizes a 3D convolution into a spatial convolution followed by a temporal convolution, with a nonlinearity between them. This makes the separation of appearance and motion explicit inside the network and changes optimization while retaining a spatiotemporal receptive field.

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

Residual network using spatial convolution, activation and temporal convolution in place of full 3D filters.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. Parameter matching alone does not match latency or memory. Sparse sampling can alias rapid motion, and clip supervision permits learning background shortcuts.

Formula / computational definition

h=σ(Wt∗tσ(Ws∗xyx))h=\sigma(W_t *_t \sigma(W_s *_{xy}x)), where ∗xy*_{xy} is spatial convolution and ∗t*_t temporal convolution. The intermediate channel count can be chosen to approximately match a full 3D layer's parameter budget.

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: Select temporal/spatial kernel widths, intermediate channels, residual depth, frame spacing and clip duration.

Fitting, fine-tuning, and adaptation

Compare tuning only the temporal filters against tuning all blocks. Freeze early spatial layers when appearance transfers well; unfreeze them if the new domain changes imaging conditions. 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. Report matched-budget comparisons against 2D and 3D convolutions, video accuracy, throughput and temporal sensitivity.

Example application

Recognize hand movements at a constrained inference budget.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Report matched-budget comparisons against 2D and 3D convolutions, video accuracy, throughput and temporal sensitivity. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Separate spatial aggregation from temporal filtering. 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: Construct sequential spatial and temporal Conv3d operations; pretrained implementations must use their prescribed transforms. R: Implement the factorized block with R torch or bridge a Python video model; native R checkpoint parity is not assumed.

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 — Separate spatial aggregation from temporal filtering.

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()
clip = np.arange(12.,dtype=float).reshape(3,2,2)-4
spatial = np.maximum(clip.mean(axis=(1,2)),0)
temporal_kernel = np.array([0.25,0.5,0.25])
print(spatial, "factorized response", spatial@temporal_kernel)
R

Component demo, not a trained model — Separate spatial aggregation from temporal filtering.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
clip <- array(0,c(3,2,2))
for(t in 1:3) clip[t,,] <- ((t-1)*4+0:3)-4
spatial <- pmax(apply(clip,1,mean),0)
print(spatial); print(sum(spatial*c(.25,.5,.25)))

Sources

From the CodeSplash reference, entry VID004.