Track Targets by Dense Spatio-Temporal Position Encoding

Jinkun Cao, Hao Wu, Kris Kitani

Abstract

In this work, we propose a novel paradigm to encode the position of targets for target tracking in videos using transformers. The proposed paradigm, Dense Spatio-Temporal (DST) position encoding, encodes spatio-temporal position information in a pixel-wise dense fashion. The provided position encoding provides location information to associate targets across frames beyond appearance matching by comparing objects in two bounding boxes. Compared to the typical transformer positional encoding, our proposed encoding is applied to the 2D CNN features instead of the projected feature vectors to avoid losing positional information. Moreover, the designed DST encoding can represent the location of a single-frame object and the evolution of the location of the trajectory among frames uniformly. Integrated with the DST encoding, we build a transformer-based multi-object tracking model. The model takes a video clip as input and conducts the target association in the clip. It can also perform online inference by associating existing trajectories with objects from the new-coming frames. Experiments on video multi-object tracking (MOT) and multi-object tracking and segmentation (MOTS) datasets demonstrate the effectiveness of the proposed DST position encoding.

Introduction

Multi-object tracking (MOT) is the task of following several targets, such as pedestrians or vehicles, across video sequences. While Transformers have revolutionized sequence processing in various domains, they have historically struggled with MOT. A primary reason is the limitation of standard positional encoding. In language models, 1D encoding denotes word order; in vision, researchers often migrate this by adding encoding to flattened feature vectors. However, this flattening often destroys rich spatial relationships. Consequently, many Transformer-based trackers rely heavily on appearance matching (Re-ID), which fails when targets look similar or lighting conditions change drastically.

Methodology

To address these limitations, this paper introduces Dense Spatio-Temporal (DST) position encoding, which treats spatial information as a first-class citizen in the tracking pipeline.

Overview of the proposed tracking model architecture using Dense Spatio-Temporal (DST) encoding.

As shown in Figure 1, the architecture integrates several key innovations:

  1. Pixel-Wise Encoding: Instead of a single vector for an entire object, a sinusoidal encoding is applied to every pixel $(x, y)$ on the 2D CNN feature map. This preserves the internal geometry of the object within its bounding box.
  2. Early Integration: The encoding is added to the features before they are processed by the Transformer, ensuring spatial information is not lost during projection.
  3. Trajectory as a Fourier Series: By leveraging the linear properties of trigonometric functions, the path of an object (its trajectory) is represented by summing the positional encodings across previous frames. This creates a uniform representation for matching new detections to existing tracks.
Illustration of the trajectory-detection association mechanism for online inference.

For online inference (Figure 2), the model associates existing trajectories with new detections using a Transformer decoder. Additionally, Attention Masking is used to focus the model on target-specific pixels, preventing background noise from interfering with the tracking process.

Experimental Evaluation

The model was evaluated on three major benchmarks: MOT17 (standard pedestrian tracking), DanceTrack (challenging motion with similar appearances), and MOTS20 (tracking and segmentation).

  • DanceTrack: The model achieved a HOTA of 51.9, significantly outperforming other Transformer-based methods like GTR (48.0) and MOTR (48.4). This demonstrates DST's effectiveness when appearance cues are unreliable.
  • MOTS20: On segmentation-based tracking, the method reached 60.0 sMOTSA, a substantial jump over previous leaders like TrackFormer (54.9).
  • MOT17: The method achieved a HOTA of 60.1, showing superior association performance compared to other global tracking Transformers.

Discussion and Future Work

A key insight from this research is that "classic" Transformer positional encoding can actually decrease performance if not implemented correctly, as it acts as noise. In contrast, the dense, linear properties of DST allow for a mathematically elegant way to accumulate motion information over time. Representing objects by the encoding of every pixel in their Region of Interest (RoI) allows the model to implicitly understand shape and pose changes.

Currently, the system relies on a sliding window approach, which may limit its ability to handle extremely long-term occlusions. Future work could involve developing end-to-end learning for attention masks and exploring more complex motion models to further improve tracking in highly crowded or complex scenes.

Summary updated

Abstract

In this work, we propose a novel paradigm to encode the position of targets for target tracking in videos using transformers. The proposed paradigm, Dense Spatio-Temporal (DST) position encoding, encodes spatio-temporal position information in a pixel-wise dense fashion. The provided position encoding provides location information to associate targets across frames beyond appearance matching by comparing objects in two bounding boxes. Compared to the typical transformer positional encoding, our proposed encoding is applied to the 2D CNN features instead of the projected feature vectors to avoid losing positional information. Moreover, the designed DST encoding can represent the location of a single-frame object and the evolution of the location of the trajectory among frames uniformly. Integrated with the DST encoding, we build a transformer-based multi-object tracking model. The model takes a video clip as input and conducts the target association in the clip. It can also perform online inference by associating existing trajectories with objects from the new-coming frames. Experiments on video multi-object tracking (MOT) and multi-object tracking and segmentation (MOTS) datasets demonstrate the effectiveness of the proposed DST position encoding.
BibTeX
@inproceedings{cao2022track,
  author = {Jinkun Cao and Hao Wu and Kris Kitani},
  title = {{Track Targets by Dense Spatio-Temporal Position Encoding}},
  booktitle = {BMVC},
  year = {2022},
  url = {https://openreview.net/forum?id=XC-cgErpXF4},
}
Figure