Video understanding, tracking, generation, and world models · Action recognition · VID001 · Architecture
Two-Stream Convolutional Networks
Separates appearance from motion: an RGB network recognizes objects and scenes, while a second network consumes stacked optical-flow fields. Fuse the two predictions for clip-level action classification.
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 here in one language.
- 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
Separates appearance from motion: an RGB network recognizes objects and scenes, while a second network consumes stacked optical-flow fields. Fuse the two predictions for clip-level action classification. This is a useful historical baseline for deciding whether motion adds information beyond appearance.
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
Separate RGB and stacked-flow convolutional encoders followed by score fusion.
Assumptions
Inputs must satisfy the temporal, modality and annotation protocol described below. Requires labeled actions and sufficiently reliable flow. Camera motion, cuts and lighting changes can contaminate the motion stream; cached flow can dominate storage and preprocessing cost.
Formula / computational definition
combines class scores; controls fusion. Each stream commonly minimizes cross-entropy for labeled class .
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: Flow-stack length, optical-flow algorithm, frame spacing, crop policy, fusion weight and pretraining all affect results.
Fitting, fine-tuning, and adaptation
Freeze both encoders first and fit the task heads; then unfreeze late layers with a smaller learning rate. Retune fusion on held-out videos. Optical-flow preprocessing is fixed unless explicitly replaced. 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 class accuracy, per-class recall and total runtime including flow extraction; compare against RGB-only with the same split.
Example application
Distinguish running from standing when clothing and scenery are similar.
Interpretation / pitfalls
Watch out
An optimized training objective or a favorable example does not establish generalization. Report class accuracy, per-class recall and total runtime including flow extraction; compare against RGB-only with the same split. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.
Python and R code examples
Component: Fuse RGB and flow class probabilities. 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: Build two classifiers and explicit flow preprocessing in PyTorch; preserve flow-vector scaling during resizing. R: Prototype score fusion with matrices; use reticulate for neural encoders and return probabilities to R.
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.
Component demo, not a trained model — Fuse RGB and flow class probabilities.
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()
rgb = np.array([0.70, 0.20, 0.10])
flow = np.array([0.20, 0.65, 0.15])
alpha = 0.4
fused = alpha * rgb + (1-alpha) * flow
print(fused, "class", fused.argmax())
Component demo, not a trained model — Fuse RGB and flow class probabilities.
Shared setup for this chapter
softmax <- function(x) {
e <- exp(x - max(x))
e / sum(e)
}
rgb <- c(.70,.20,.10); flow <- c(.20,.65,.15)
alpha <- .4
fused <- alpha*rgb + (1-alpha)*flow
print(fused); print(which.max(fused))
Sources
- Source 1arxiv.org
From the CodeSplash reference, entry VID001.