Paper commentary
TSM: Temporal Shift Module for Efficient Video Understanding
TSM shifts channels across frames to add temporal modeling to 2D CNNs
- Problem 2D CNNs process each frame alone, so they miss temporal order, while 3D CNNs capture motion but cost too much for edge devices and real-time video.
- Method TSM shifts part of the channels one frame back and part one frame forward inside each residual block. The 2D convolution that follows then mixes in temporal context at no extra computation or parameters.
- Results On Something-Something V1, TSM reaches Acc1 47.3 against 20.5 for the TSN 2D baseline, using ResNet-50 with 8 frames.
Why 2D CNNs miss temporal order
A model that reads each frame separately cannot tell opening a box from closing one, because the two actions differ only in the order of their frames. Video is also served under tight budgets: long uploads have to be processed in the cloud, and private footage has to be handled on edge devices, so the cost of temporal modeling matters as much as its accuracy.
3D CNNs capture motion by convolving over time, but their computation and parameter counts are high, which makes them hard to deploy on edge hardware and impossible to run on real-time streams.
The question is whether temporal mixing can be added to a 2D CNN without adding computation, and whether the same idea can run in an online setting where future frames have not arrived yet.
Shift as the first half of a convolution
The method starts from an observation about convolution: a 1-D convolution with kernel size 3 can be split into a shift of the input by −1, 0 and +1 followed by a weighted sum, written as \(Y = w_1 X^{-1} + w_2 X^{0} + w_3 X^{+1}\). The shift step involves no multiplications, so moving data along the time axis is cheap in arithmetic terms, and the weighted sum can be folded into the 2D convolution that already follows the shift.
For a video activation shaped as N, C, T, H, W, TSM moves a portion of the channels one frame back and another portion one frame forward along T, and leaves the remaining channels in place. Because each shifted channel now carries information from a neighboring frame, the 2D convolution that follows mixes spatial features with temporal context, and the frames are still processed by the same 2D kernels.
The offline version shifts in both directions, while the online version shifts only from past frames to the current frame, since future frames cannot be used when predicting in real time. The residual placement relies on the identity path to keep the original activation of the current frame reachable after the shift, which is the assumption the placement choice depends on.
Partial shift and residual placement
Shifting every channel naively adds real cost: the shift is free in FLOPs but moves a 5D activation through memory, and the authors measured a 13.7% rise in CPU latency and a 12.4% rise in GPU latency. The naive version also hurts accuracy, with a 2.6% drop against the 2D TSN baseline, because the shifted channels no longer carry the current frame's spatial content.
Latency measurements on ResNet-50 with 8-frame input show that shifting one eighth of the channels keeps the CPU overhead near 3%, while shifting all channels reaches 13.7% on CPU. The measurements were taken on a Tesla P100 GPU, a Jetson TX2 and an Intel Xeon CPU, and the authors observed the same overhead trend on each device.
The in-place placement puts the shift before a convolution or a residual block, so it overwrites channels that the current frame still needs, which weakens spatial feature learning as more channels are shifted. The residual placement puts the shift inside the residual branch, so the identity path still passes the original activation forward.
On Kinetics, residual shift beats in-place shift at every shift proportion that was tested, and even shifting all channels in the residual form stays above the 2D baseline. Accuracy peaks when 1/4 of the channels are shifted, with 1/8 for each direction, which is why this proportion is the default for the rest of the paper.
Offline and online model construction
The offline model samples T frames from a video, runs the 2D backbone on each frame separately, and averages the per-frame logits, so its parameters and computation match the 2D model. Each inserted shift extends the temporal receptive field by 2, which is the same reach as a kernel of size 3 along time, so the stacked shifts across residual blocks give a large temporal reach.
The online model keeps the first 1/8 of the feature maps of each residual block in a cache, replaces the first 1/8 of the next frame's features with the cached values, and passes the combined 7/8 and 1/8 features onward. Because only this small portion is cached, the memory needed is small, and the authors state 0.9MB of cache for ResNet-50.
Unlike late or mid-level fusion, the online shift is applied at every residual block, so temporal information is mixed at all levels of the network. Because the shift only needs operations that 2D CNN frameworks already support, the same model can be converted from an off-the-shelf 2D CNN and run through existing compilers.
Accuracy against the 2D baseline and against prior video models
Under a shared protocol with ResNet-50, 8 frames, 10 clips for Kinetics and 2 clips for the other datasets at full resolution, TSM raises Kinetics Acc1 from 70.6 to 74.1 and UCF101 from 91.7 to 95.9. On Something-Something V1, Acc1 rises from 20.5 for TSN to 47.3 for TSM, and on Something-Something V2 from 30.4 to 61.7, while Jester moves from 83.9 to 97.0.
The efficiency comparisons use a different protocol, with one clip per video and a center 224 by 224 crop, so these numbers are not interchangeable with the multi-clip numbers in the first table. Under that protocol, the 8-frame TSM reaches 45.6 Val top-1 at 33G FLOPs, which the text reports as 4.2 above the 16-frame ECO entry, and ECO at 16 frames needs 64G with 41.4 Val top-1.
The Non-local I3D + GCN entry is not compared directly, because its region proposal network was trained on MSCOCO, so the authors compare TSM with the CNN part of that model instead.
Adding an optical flow branch raises Something-Something V1 and V2 results by 5.4% and 2.6% top-1, which the authors present as a separate two-stream setting.
Latency, throughput and edge devices
Replacing the 1x1 inflation of I3D with the 2D-friendly design gave 1.5 times higher latency and 55% of the throughput relative to TSM, with the authors attributing the gap to TSM's use of only 2D convolution.
The online model with a MobileNet-V2 backbone reaches 69.5% accuracy on Kinetics and runs with 13 ms latency on Jetson Nano and 35 ms on Galaxy Note8 for online video recognition. Power was measured with a power meter, with the static power subtracted, and the models were compiled with TVM for the edge devices.
Online recognition, early prediction and detection
Predictions averaged over all frames were used to compare the online and offline models on the same footing, and the online model matches or slightly exceeds offline accuracy on Kinetics, UCF101 and HMDB51. On Something-Something V1 the online model reaches 46.3 against 47.3 for the offline model, while the TSN baseline reaches 20.5.
Per-frame latency for TSN is 4.7 ms and for the online TSM 4.8 ms, and the online shift adds less than 0.1 ms per frame. Compared with the 2D baseline, the online model brings up to 25% accuracy improvement on the datasets in that comparison.
In early recognition on UCF101, TSM reaches 90% accuracy after the first 10% of the frames, which the authors state is 6.6% above the best ECO model in the same plot.
In video object detection on ImageNet-VID, R-FCN with a ResNet-101 backbone reaches 74.7 overall mAP, and inserting uni-directional TSM into the backbone raises it to 76.3. On fast-moving objects, mAP moves from 51.4 to 56.0, an increase of 4.6%, and the authors compare this with FGFA, which uses optical flow over 21 frames, 10 past and 10 future.
Limitations
The online model is 1.0% below the offline model on Something-Something, although it remains well above the 2D baseline. The online results for Kinetics, UCF101 and HMDB51 are compared with offline numbers using the averaged predictions from all frames, which is not the same as a streaming score at each step.
Early recognition was measured only on UCF101, and online detection only with R-FCN on ImageNet-VID with a ResNet-101 backbone. The FGFA comparison uses an offline model with optical flow and future frames, so the two are not run under the same conditions.
The non-local combination was not tested, although the authors note that Non-local modules could be added to boost results.
Paper info
- Authors
- Lin, Ji, Gan, Chuang, Han, Song
- Venue
- arXiv · Preprint
- First published
- 2018-11-20
- Added
- 2026-11-12
- Updated
- 2019-8-22
- Version
- v3
- arXiv
- 1811.08383
- Category
- cs.CV
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Lin, Ji, Gan, Chuang, Han, Song (2018). TSM: Temporal Shift Module for Efficient Video Understanding. arXiv:1811.08383v3. https://arxiv.org/abs/1811.08383v3
BibTeX
@misc{ji2018temporal,
title = {{TSM: Temporal Shift Module for Efficient Video Understanding}},
author = {Lin, Ji and Gan, Chuang and Han, Song},
year = {2018},
eprint = {1811.08383},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1811.08383v3}
}