Towards Robust Video Instance Segmentation with Temporal-Aware Transformer

Zhenghao Zhang, Fangtao Shao, Zuozhuo Dai, Siyu Zhu

Towards Robust Video Instance Segmentation with Temporal-Aware Transformer

Abstract Video Instance Segmentation (VIS) is a complex task requiring simultaneous object detection, segmentation, and tracking across video sequences. While Transformer-based architectures have advanced the state-of-the-art, they often struggle with "temporal blindness" during feature extraction and identity confusion among visually similar objects. This paper introduces TAFormer (Temporal-Aware Transformer), a novel architecture that embeds temporal context directly into the transformer's encoder and decoder. By utilizing Spatio-Temporal Joint Multi-Scale Deformable Attention (STJ-MSDA) and an instance-level contrastive loss, TAFormer achieves superior robustness in challenging scenarios such as rapid motion and heavy occlusion. Experimental results on YouTube-VIS datasets demonstrate that TAFormer sets new performance benchmarks, achieving 61.2% AP on YTVIS-19 with a Swin-L backbone.

Introduction The core challenge in Video Instance Segmentation (VIS) lies in maintaining consistent object identities across frames while handling dynamic variations in appearance and motion. Existing methods, such as SeqFormer, typically extract features on a per-frame basis. This independent processing ignores the temporal continuity inherent in video, making models susceptible to errors during fast motion or when objects are partially obscured. Furthermore, standard classification objectives often fail to distinguish between multiple instances of the same category, leading to identity swaps.

TAFormer addresses these limitations by making the entire pipeline "temporally aware." By integrating temporal information at the feature extraction stage and enforcing identity consistency through contrastive learning, the model provides a more holistic and robust solution for video-based instance tracking.

Methodology The TAFormer architecture introduces three primary innovations to the standard Transformer-based VIS framework:

  1. Spatio-Temporal Joint Multi-Scale Deformable Attention (STJ-MSDA): The encoder is enhanced to sample features not just from the current frame $F_t$, but also from neighboring frames $F_{t-1}$ and $F_{t+1}$. A Dynamic Attention Fusion (DAF) module adaptively balances these spatial and temporal features, allowing the model to leverage context from adjacent frames to resolve ambiguities caused by motion blur or occlusion in the current frame.
  2. Temporal Augmented Decoder: The decoder utilizes a Temporal Self-Attention (TSA) layer. This mechanism allows instance queries to communicate across the temporal dimension, ensuring that predicted object trajectories are physically plausible and contextually consistent over time.
  3. Instance-Level Contrastive Loss: To mitigate identity confusion, an InfoNCE-based contrastive loss is applied. This objective functions as a "tug-of-war," pulling embeddings of the same instance closer together across frames while pushing embeddings of different instances (even those belonging to the same class) apart.
The TAFormer architecture overview, highlighting the Spatio-temporal Encoder with STJ-MSDA and the Temporal Augmented Decoder.

Experiments and Results TAFormer was rigorously evaluated on the YouTube-VIS 2019 and 2021 benchmarks. These datasets present significant challenges, including high object density and frequent occlusions.

  • Quantitative Performance: On YTVIS-19, TAFormer with a ResNet-50 backbone achieved 48.1% AP, outperforming SeqFormer (45.1%) and Mask2Former (46.4%). Scaling to a Swin-L backbone further improved performance to 61.2% AP. On the more difficult YTVIS-21 dataset, the model achieved 42.1% AP, establishing a new state-of-the-art.
  • Qualitative Robustness: Visual analysis confirms that TAFormer is significantly more resilient than previous models. It successfully maintains the identity of individual animals in crowded scenes and tracks objects through rapid scale changes where frame-by-frame methods typically fail.
Qualitative comparison between SeqFormer and TAFormer. TAFormer demonstrates superior tracking and segmentation in complex scenes involving occlusions and similar-looking objects.

Discussion and Conclusion The success of TAFormer underscores the importance of integrating temporal information early in the vision pipeline. Rather than treating temporal aggregation as a post-processing or late-stage decoding step, embedding it into the encoder provides a more robust foundation for feature representation. The use of dynamic weighting via DAF allows the model to intelligently switch between spatial and temporal cues depending on image quality.

While TAFormer demonstrates significant gains, future work could address the computational complexity of joint spatio-temporal attention and explore more flexible temporal windows to handle long-term occlusions. Nevertheless, TAFormer represents a substantial step forward in achieving robust and accurate video instance segmentation.

Summary updated

BibTeX
@misc{zhang2023towards,
  author = {Zhenghao Zhang and Fangtao Shao and Zuozhuo Dai and Siyu Zhu},
  title = {{Towards Robust Video Instance Segmentation with Temporal-Aware Transformer}},
  year = {2023},
  eprint = {2301.09416},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.09416},
}
Figure