Temporally Efficient Vision Transformer for Video Instance Segmentation

Shusheng Yang, Xinggang Wang, Yu Li, Yuxin Fang, Jiemin Fang, Wenyu Liu, Xun Zhao, Ying Shan

Introduction

Video Instance Segmentation (VIS) represents one of the most challenging tasks in computer vision, requiring the simultaneous detection, segmentation, and tracking of objects across video sequences. While Vision Transformers (ViTs) have set new benchmarks in image-level tasks, their application to video has been hindered by significant computational overhead. Specifically, traditional 3D self-attention mechanisms—which compute relationships across every patch in every frame—suffer from quadratic complexity in both time and space. Furthermore, many existing VIS models rely on "late fusion," where temporal information is only integrated at the final stages of the pipeline, or they introduce a massive number of new parameters that are difficult to optimize without specialized, large-scale video datasets.

To address these challenges, we present the Temporally Efficient Vision Transformer (TeViT), a nearly convolution-free framework designed for high-speed, high-accuracy VIS. TeViT enables early temporal fusion within the backbone itself through a lightweight, parameter-free mechanism, achieving state-of-the-art performance while maintaining real-time inference speeds.

Methodology

TeViT introduces two primary innovations to the standard transformer architecture: the Messenger Shift Transformer (MsgShifT) backbone and the Spatiotemporal Query Interaction (STQI) head.

Messenger Shift Transformer (MsgShifT)

Traditional backbones often process video frames in isolation, missing the opportunity to learn temporal features early in the feature extraction process. TeViT overcomes this by introducing "messenger tokens" into the transformer blocks.

In the intra-frame stage, a set of learnable messenger tokens attends to the patch tokens of a single frame, effectively creating a condensed summary of that frame's context. In the inter-frame stage, these messenger tokens are shifted along the temporal axis to preceding or succeeding frames using varying strides. This "shift" operation allows information from the past and future to be integrated into the current frame's processing at virtually zero computational cost and with zero additional parameters. Consequently, the backbone learns to extract spatiotemporal features from the very first layer.

Spatiotemporal Query Interaction (STQI) Head

For the segmentation and tracking task, TeViT treats each video instance as a single query. To maintain architectural efficiency, the STQI head reuses the parameters of the Multi-Head Self-Attention (MHSA) layers. The head performs two distinct operations:

  1. Spatial Interaction: Analyzing object features within a single frame.
  2. Temporal Interaction: Linking the same object instance across different frames.

By sharing weights between these operations, the model remains lean and can more effectively leverage image-level pre-training (such as COCO), as the temporal components do not have to be learned from scratch independently of spatial features.

Experimental Evaluation

TeViT was evaluated on three major VIS benchmarks to test its accuracy, speed, and robustness:

  • YouTube-VIS-2019: The standard benchmark for evaluating VIS performance.
  • YouTube-VIS-2021: A more complex and larger-scale version of the 2019 dataset.
  • OVIS (Occluded Video Instance Segmentation): A dataset specifically designed to challenge models with heavy object overlap and occlusion.

Results and Discussion

TeViT establishes a new frontier for the trade-off between speed and accuracy in video segmentation. On the YouTube-VIS-2019 benchmark, the model achieved 46.6 AP at an impressive 68.9 FPS. This performance significantly outpaces previous transformer-based leaders; for example, it is both more accurate and faster than VisTR (36.2 AP at 51.1 FPS) and offers a superior accuracy profile compared to IFC (41.2 AP).

On the OVIS dataset, TeViT reached 17.4 AP, outperforming specialized models like CMaskTrack R-CNN (15.4 AP), demonstrating that its early temporal fusion is particularly effective at maintaining object identity through occlusions. Ablation studies confirmed the value of the individual components: the MsgShifT mechanism alone provided a 0.6 AP boost, while the STQI head contributed an additional 2.7 AP.

Conclusion

TeViT demonstrates that efficient temporal modeling does not require complex 3D convolutions or heavy attention mechanisms. By utilizing messenger tokens and parameter-free shifting, the framework achieves early temporal fusion that is both computationally light and highly effective. While the model currently faces challenges with extreme, prolonged occlusions and capturing dependencies across very long video clips (minutes), it provides a robust foundation for real-time video understanding. Future research will explore more complex shifting patterns and the integration of long-term memory banks to further extend the model's temporal reach.

Summary updated

BibTeX
@inproceedings{yang2022temporally,
  author = {Shusheng Yang and Xinggang Wang and Yu Li and Yuxin Fang and Jiemin Fang and Wenyu Liu and Xun Zhao and Ying Shan},
  title = {{Temporally Efficient Vision Transformer for Video Instance Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure