Adapting Short-Term Transformers for Action Detection in Untrimmed Videos

Min Yang, Huan Gao, Ping Guo, Limin WangCVPR 2023 · DOI

Abstract

Vision Transformer (ViT) has shown high potential in video recognition, owing to its flexible design, adaptable self-attention mechanisms, and the efficacy of masked pre-training. Yet, it remains unclear how to adapt these pre-trained short-term ViTs for temporal action detection (TAD) in untrimmed videos. Existing works treat them as off-the-shelf feature extractors for each short-trimmed snippet without capturing the fine-grained relation among different snippets in a broader temporal context. To mitigate this issue, this paper focuses on designing a new mechanism for adapting these pre-trained ViT models as a unified long-form video transformer to fully unleash its modeling power in capturing inter-snippet relations, while still keeping low computation overhead and memory consumption for efficient TAD. To this end, we design effective cross-snippet propagation modules to gradually exchange short-term video information among different snippets from two levels: inner-backbone and post-backbone. With the plain ViT-B pre-trained with VideoMAE, our end-to-end temporal action detector (ViT-TAD) yields very competitive performance, reaching up to 69.5 average mAP on THUMOS14, 37.40 average mAP on ActivityNet-1.3, and 17.20 average mAP on FineAction.

Introduction: The "Off-the-Shelf" Bottleneck

Temporal Action Detection (TAD) is a challenging task that requires identifying the start, end, and category of actions within long, untrimmed videos. Most current methodologies follow a two-step approach: they utilize a pre-trained model (like a ViT trained on short 2-second clips) to extract features for every snippet independently, then feed these features into a separate detection head.

Comparison between the baseline independent snippet processing and the proposed ViT-TAD with cross-snippet propagation.

The primary limitation of this approach is that the backbone never observes the global context. Because snippets are processed in isolation, the model misses critical fine-grained temporal relations during the feature learning stage. ViT-TAD aims to break this bottleneck by creating an end-to-end system where the backbone itself learns to model relationships across the entire video.

The ViT-TAD Framework

ViT-TAD adapts a plain, non-hierarchical ViT for long-form video through three main architectural innovations designed for efficient information exchange.

1. Inner-backbone Information Propagation

Instead of running the ViT on each snippet separately, ViT-TAD inserts propagation blocks between standard transformer layers. These blocks utilize two strategies:

  • Local Propagation: Employs 3D convolutions to share information between adjacent snippets.
  • Global Propagation: Uses temporal-only self-attention. By flattening spatial dimensions and attending only across the temporal axis, the model captures long-range dependencies without the prohibitive memory cost of full spatiotemporal attention.
The overall architecture of ViT-TAD, highlighting the inner-backbone and post-backbone information propagation modules.

2. Clip-level Positional Encoding

Standard ViTs are typically aware of frame order only within a short snippet. ViT-TAD introduces a learnable "clip-level" encoding. This ensures the model understands the global chronological order of the entire video sequence, which is vital for detecting actions that span multiple snippets.

3. Post-backbone Refinement

Following the backbone, additional temporal transformer layers are used to further aggregate global context. This refined data is then passed to the final TAD head for predicting action boundaries and classes. Crucially, the entire system is trained end-to-end, allowing the backbone weights to be optimized specifically for the TAD task.

Experimental Results and Insights

ViT-TAD was evaluated on three major benchmarks: THUMOS14, ActivityNet-1.3, and FineAction.

  • State-of-the-Art Performance: On THUMOS14, the model reached 69.5% average mAP, outperforming previous end-to-end methods. On ActivityNet-1.3, it achieved 37.40% average mAP, setting a new benchmark for end-to-end detectors.
  • Efficiency of 1D Attention: A key finding was that 1D temporal-only global propagation performed nearly as well as full 3D spatiotemporal propagation while requiring significantly less memory (9.3GB vs 27GB). This optimization makes long-form video modeling feasible on standard hardware.
  • Placement Matters: The authors observed that placing global propagation blocks in the later stages of the backbone is more effective, as early layers focus on local textures while deeper layers handle high-level temporal reasoning.

Conclusion

ViT-TAD demonstrates that plain Vision Transformers, when augmented with cross-snippet communication, are highly effective for long-form video tasks. By allowing the backbone to "look across" neighboring snippets during feature extraction, the model achieves superior performance while maintaining the efficiency required for real-world temporal action detection.

Summary updated

BibTeX
@inproceedings{yang2023adapting,
  author = {Min Yang and Huan Gao and Ping Guo and Limin Wang},
  title = {{Adapting Short-Term Transformers for Action Detection in Untrimmed Videos}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  doi = {10.1109/cvpr52733.2024.01757},
}
Figure