TT Lab
Blog

한국어 English 日本語 中文

Get started
Blog

Blog

Video Models: 3D Convolutions, Two-Stream (SlowFast), Attention (TimeSformer) — and Masked Video Modeling (VideoMAE)

Status: Draft (2026-10-13). Paper metrics were verified against the original sources along with their conditions. Hands-on experiments use a numpy example on a notebook CPU (code/06_video_cost.py, under 1 second). These video models have not been tested on table tennis footage (unmeasured). Series "Reading Vision Models 2", Part 6. Previous part: Optical Flow and RAFT. For 2D convolutions and ViT, see Reading Vision Models 1.

Table of Contents

1. Intuition: What a Single Image Misses

A single still image can tell you that there is a "player holding a racket," but it cannot tell you whether the player is in the middle of hitting, has just finished hitting, or is preparing to hit. "Opening a door" and "closing a door" look identical in a single photo. Video models aim to learn this difference—namely, information contained in temporal order.

There are broadly three approaches.

시간을 다루는 세 방식 ① 3D 합성곱 C3D · I3D 필터가 가로·세로·시간을 함께 훑는다(3×3×3) I3D: 2D 필터를 시간으로 N번 복사 ÷ N 으로 출발 → 멈춘 영상에서 2D 와 같은 답 값싼 변형: TSM(채널 일부를 앞뒤 프레임으로 밀기) ② 두 갈래 Two-stream · SlowFast 느린 길: 프레임 드문드문, 채널 많음 빠른 길: 프레임 8배 촘촘, 채널 ⅛ 느린 길 = 모양, 빠른 길 = 움직임(계산은 약 20%) ③ 주의(attention) TimeSformer · ViViT a) 시간: 같은 자리의 다른 프레임과 비교 (프레임 4장의 같은 칸) b) 공간: 같은 프레임의 다른 자리와 비교 (한 프레임 안의 이웃 칸) 한 블록에서 a → b 순서. 한꺼번에보다 훨씬 싸다
Figure: 3D Convolution, Two-Stream, Space-Time Attention
  1. 3D Convolution: Extends filters from height and width to also cover the temporal dimension.
  2. Two-Stream: Separates the pathway that looks at appearance from the pathway that looks at motion.
  3. Attention: Tokens cross space and time to reference one another.

Regardless of the approach, training is mostly supervised. Classification is learned using video-level labels like "This clip is 'playing table tennis'." A representative dataset is Kinetics (approx. 240k training videos, 400 action classes). Only VideoMAE in the final section uses unsupervised pre-training.

2. 3D Convolutions: C3D and I3D

C3D: Three Temporal Frames

C3D (2015) extended convolution filters from 3×3 to 3×3×3. Taking 16-frame × 112×112 clips and testing temporal depths of 1, 3, 5, and 7, it found 3 to be the best (the paper notes that this was compared over a narrow range). It was trained from scratch on 1.1 million sports videos (Sports-1M, 487 classes).

I3D: Starting by Inflating an Image Model

The weakness of 3D convolutions is that they must learn everything from scratch. While images have well-trained weights from ImageNet, videos lacked a comparable starting point. I3D (2017) introduced a simple trick to convert 2D weights into 3D.

Replicate 2D filters N times along the temporal dimension and divide by N.

3D filters constructed this way produce the exact same answers as the original 2D filters on a "boring video" where frames never change. Training starts by inheriting what the image model already knows, while motion is learned along the way.

Cheap Alternative: Temporal Shift Module (TSM)

3D convolutions triple parameters and compute costs. TSM (2019) keeps the 2D convolutional network intact, simply shifting ⅛ of the feature channels forward by one frame and ⅛ backward by one frame. This introduces information from neighboring frames without adding a single multiplication. By restricting shifts backward only (using past frames only), it can be used for real-time streaming (paper). GSM, used by E2E-Spot in Part 10, is a variant that learns "what to shift and by how much."

3. Two-Stream: Two-Stream and SlowFast

Two-Stream (2014) trains a pathway looking at a single image (spatial stream) and a pathway looking at a stack of 10 optical flow frames from Part 5 (temporal stream) separately, averaging their scores at the end. The temporal stream alone was more accurate than the spatial stream (UCF-101 83.7% vs. 73.0%, paper). This indicates how crucial motion is for action recognition, but it is slow because optical flow must be pre-computed.

SlowFast (2019) builds two streams without optical flow.

The authors note this was inspired by the primate visual system, where shape-processing and motion-processing cells are separate. Above all, it was trained from scratch using only Kinetics, without ImageNet pre-training . Even with pre-training, the difference was within ±0.3%p (paper).

4. Attention: TimeSformer

When applying ViT to video, tokens multiply by "number of frames × patches per frame." For 8 frames × 196 patches, that is 1,568 tokens. Joint attention, where every token attends to every token, scales quadratically with the number of tokens.

TimeSformer (2021) divides attention into two steps within a single block (divided attention).

  1. Temporal attention: Each patch attends only to patches at the same spatial locationin other frames.
  2. Spatial attention: Using that result, each patch attends only to other patches in the same frame.

Dividing it this way dramatically cuts computation while slightly improving accuracy (table below). It starts from an ImageNet pre-trained ViT and fine-tunes on video labels.

5. Hands-on Experiments

code/06_video_cost.py output fromcode/06_video_cost.out.txt).

I3D Inflation. On a "boring video" where a single 12×12 image is repeated 5 times, we applied a 3×3×3 filter created by replicating a 3×3 filter 3 times and dividing by 3.

멈춘 영상에서 3D 출력과 2D 출력의 최대 차이: 1.33e-15
움직이는 영상에서는 차이가 생긴다(평균 절댓값 1.644) — 이 차이를 학습이 키워 움직임 필터가 된다

A difference of 10⁻¹⁵ simply reflects floating-point rounding error. They are identical.

Attention Computation Cost. We counted the number of token pair comparisons in a single layer (16×16 patches, 224 resolution means 196 patches per frame).

Input Tokens Joint Space-Time Divided Ratio
8 frames 1,568 2.5M 0.32M 7.7x
16 frames 3,136 9.8M 0.66M 14.8x
96 frames 18,816 354.0M 5.49M 64.4x

The gap widens as frame count increases. This factorization is why TimeSformer-L can process 96 frames.

6. How They Are Trained: Self-Supervised Masked Video Modeling

VideoMAE: 90% Masking with Tubes

VideoMAE (2022) adapts Part 3's MAE for video. There are two main differences.

We measured why tube masking is necessary. In a 16-frame × 196-patch setup, we looked at the ratio of masked patches where the exact same locationis visible in the immediately preceding or succeeding frame.

가림 75% · 프레임마다 따로        : 0.415
가림 90% · 프레임마다 따로        : 0.180
가림 95% · 프레임마다 따로        : 0.092
가림 75–95% · 튜브(모든 프레임 같은 자리): 0.000
옆 프레임 같은 자리를 그대로 베낀 오차 0.0120  (아무것도 모르고 0 으로 채우면 1.0009)

If you mask frames independently, even with 90% masking, 18% of the patches can be guessed almost perfectly (error 0.012, vs. 1.0 for random guesses) simply by copying from the same spot in the neighboring frame. The model learns the lazy shortcut of "copying" rather than learning motion or structure. Tube masking blocks this shortcut entirely.

The loss function is identical to MAE: predicting the (normalized) pixels of the masked cubes using mean squared error. The encoder processes only the visible ~10% of tokens.

V-JEPA: Predicting Features Instead of Pixels

V-JEPA (2024) replaces pixel prediction for masked regions with features produced for those regions by a slowly lagging teacher encoder (Part 2's EMA teacher), optimized via L1 loss. The idea is to avoid wasting capacity on trivial pixel-level details (connecting to the limitations discussed in Part 3). It uses no pre-trained image models, text, negative examples, or pixel reconstruction (paper). features, optimized via L1 loss. The idea is to avoid wasting capacity on trivial pixel-level details (connecting to the limitations discussed in Part 3). It uses no pre-trained image models, text, negative examples, or pixel reconstruction (paper).

7. Paper Metrics

Top-1 accuracy on Kinetics-400. "Views" refers to (number of clips sampled per video during evaluation) × (spatial crops per clip).

Model Accuracy Conditions (Paper)
I3D (ImageNet + Optical Flow Two-Stream) 71.6 → 74.2 Without ImageNet inflation → With inflation. Training input 64 frames, 224px
TSM (ResNet-50) 74.1 8 frames, 10 clips. 2D baseline (TSN) 70.6
SlowFast 16×8 R101+NL 79.8 No pre-training, 30 views, 234 GFLOPs per view
TimeSformer / -L 78.0 / 80.7 ImageNet-21K pre-training, 8×224² / 96×224², 3 views. Compute 0.59 / 7.14 TFLOPs
VideoMAE ViT-L / ViT-H 85.2 / 86.6 Unsupervised pre-training for 1,600 epochs followed by fine-tuning, 16 frames, 5×3 views. ViT-H with 320px and 32 frames achieves 87.4
V-JEPA ViT-H/16 82.0 Freezing the encoder and training linear probes only (not fine-tuning)

A comparison of attention designs in TimeSformer (with ImageNet-21K pre-training) is shown below (paper).

Attention Type Kinetics-400 Something-Something v2
Space-only (ignoring time) 76.9 36.6
Joint 77.4 58.5
Space-Time Divided 78.0 59.5

Note that on Kinetics, even when ignoring time, accuracy is 76.9% . Many actions in Kinetics can be recognized just from the scene (swimming pool, ping-pong table). In contrast, Something-Something requires understanding motion itself(e.g., "pushing something from left to right"), so ignoring time causes accuracy to collapse to 36.6%. Table tennis classification definitely leans toward the latter.

Training Costalso varies. Under ImageNet-1K pre-training conditions, training on Kinetics took 416 GPU hours for TimeSformer, 3,840 hours for SlowFast R50, and 1,440 hours for I3D (on datacenter-class GPUs, TimeSformer paper).

VideoMAE Data Efficiency. Results when pre-training the same ViT-B using only the training videos of each dataset (paper).

Dataset (Number of Training Videos) Supervised from Scratch Contrastive Learning (MoCo v3) VideoMAE
UCF101 (9.5k) 51.4 81.7 91.3
HMDB51 (3.5k) 18.0 39.2 62.6
Something-Something v2 32.6 54.2 69.6

The difference is most pronounced on small datasets with only a few thousand videos (the UCF101 and HMDB51 experiments were pre-trained with 75% masking). Also, the version pre-trained on 42k Something-Something videos (68.7) performed better on Something-Something than the version pre-trained on 240k Kinetics videos (68.5). The paper cites this as evidence that "for pre-training data, the degree of similarity to the target domain is more important than sheer volume."

8. Limitations

9. Connection to Our Project

A word from TT. "Before the hit" and "after the hit" look identical in a single photo. However, if you mask frames individually and ask the model to guess, it learns the trick of copying adjacent frames instead. Tube masking is a mechanism to prevent that shortcut.

References

Sign in to like

Comments

No comments yet.

Sign in to leave a comment