Skip to main content
Back

FlexHook Beats Every One-Stage Tracker at a Fraction of Training Cost

A new sampling-based framework revives two-stage referring multi-object tracking, beating end-to-end methods while training in under two hours on two GPUs.

Pro

  • FlexHook is a new two-stage Referring Multi-Object Tracking framework that outperforms all end-to-end competitors.
  • C-Hook samples target features directly from the backbone using grid sampling with tracker-noise augmentation.
  • Pairwise Correspondence Decoder replaces CLIP cosine similarity with learnable masked cross-attention over pairs.
  • Language-conditioned reference points let the model adapt focus to positional and directional expressions.
  • Reaches 42.53 HOTA on Refer-KITTI-v2, versus iKUN's 10.32 and HFF-Tracker's 36.18.
  • Trains in under two hours on two RTX 4090s; code is open source.

Tracking specific objects in a video based on a natural language description like cars turning left or the man in red is one of the messier problems in computer vision. It sits at the intersection of detection, multi-object tracking, and vision-language grounding, and in the last two years the field has drifted toward heavy end-to-end models that jointly optimize everything at once. A new paper called FlexHook argues that the older, cheaper two-stage approach was abandoned prematurely, and shows that a redesigned version of it can outperform every current state-of-the-art system on the standard benchmarks.

Two paradigms, one lopsided race

Referring Multi-Object Tracking (RMOT) has split into competing designs. One-stage Referring-by-Tracking directly computes matching scores using trajectory queries decoded by MOTR, requiring end-to-end joint optimization of detection, tracking, and referring. Two-stage RBT, proposed by iKUN, fully decouples the tracking and referring processes, leveraging off-the-shelf trackers and then constructing visual features from the tracked boxes.

The two-stage route has obvious appeal for anyone shipping real systems: you can bolt language understanding onto whatever tracker you already run in production, without retraining the detection or association pipeline. But the results have been embarrassing. iKUN achieved only 10.32 HOTA on the Refer-KITTI-v2 dataset, while one-stage methods sit comfortably in the mid-30s.

Diagram comparing Tracking-by-Referring and one-stage Referring-by-Tracking paradigms

Where the old design broke

The authors trace the gap to two specific design mistakes. First, previous two-stage methods re-encoded both the full image and cropped target patches through a shared visual backbone with extra fusion modules. This unnecessarily duplicates backbone computation, forcing the model to relearn semantic relationships through retrained modules rather than leveraging pretrained capabilities. Second, the matching step relied on cosine similarity between CLIP text and image embeddings, which caps performance at whatever alignment CLIP happened to learn during pretraining and breaks the moment you swap in a different backbone.

Sampling instead of re-encoding

FlexHook's first idea is called the Conditioning Hook, or C-Hook. Rather than cropping targets and running a second encoder pass, it reaches directly into the multi-scale feature maps of the visual backbone and samples the features that fall inside each tracked bounding box, using differentiable grid sampling. This preserves the backbone's original spatial context and gradient flow instead of rebuilding it from scratch.

To make the sampled features robust to the noisy boxes a real tracker produces, the authors add three augmentations during training: randomly sampling fragmented trajectory segments to emulate target loss, injecting Gaussian noise to model localization inaccuracies, and re-combining grid sequences within a batch to mimic identity switches.

C-Hook also injects language. A language expression like person on the left implies a spatial focus that a language-agnostic feature grid cannot capture. FlexHook uses a small transformer decoder to turn the text embedding into M reference points decoded from a set of learnable query vectors, which get sampled from the feature map alongside the target grid. These extra points give the model a language-conditioned view of the surrounding scene.

FlexHook architecture with C-Hook, temporal integration, and PCD stages

Learning the match instead of measuring it

The second component is the Pairwise Correspondence Decoder (PCD). Instead of computing cosine similarity between fixed CLIP embeddings, PCD treats every expression-trajectory pair as a query and runs masked cross-attention over the concatenated trajectory features, reference features, and linguistic features. An attention mask ensures each query only sees its own text while sharing the same trajectory features, so the model learns pairwise discrimination through contrastive signal rather than a static distance function.

This is what frees the framework from CLIP. In ablations, PCD improves scores whether the encoders are aligned (CLIP) or not (RoBERTa plus ResNet or a Swin transformer with rotary position embeddings).

Motion cues from grid displacement

Because C-Hook samples on an explicit coordinate grid, optical flow falls out almost for free. FlexHook concatenates the per-frame grid displacements with the sampled features along the channel dimension, then compresses them through an MLP into a single trajectory feature. This gives the model an explicit motion signal for expressions like cars turning left, without a dedicated flow network.

The numbers

FlexHook was evaluated on four RMOT benchmarks: Refer-KITTI and Refer-KITTI-V2, which focus on autonomous driving; Refer-Dance, built on DanceTrack; and LaMOT, which consists of four MOT subsets with new language annotations across TAO, SportsMOT, VisDrone, and MOT17.

Comparison of previous two-stage RBT with CLIP cosine similarity vs FlexHook using PCD matching

The Refer-KITTI-v2 results are striking. iKUN's 10.32 HOTA jumps to 42.53 with FlexHook's best configuration (RoBERTa text encoder plus Swin-T with rotary position embeddings), beating the strongest one-stage system, HFF-Tracker at 36.18. On Refer-Dance, FlexHook hits 32.17 HOTA against iKUN's 29.06. On LaMOT, it reaches 56.77 HOTA versus LaMOTer's 48.45.

Training cost is the other headline. FlexHook achieves the fastest overall inference speed by eliminating the redundant encoding stage and leveraging PCD's parallel processing. Total training runs 1.91 hours on two RTX 4090s, or 0.77 hours with encoders frozen, compared to over 51 hours for TempRMOT. All experiments were run on that same two-GPU box.

When it makes sense to use

FlexHook is most useful when you already have a working detector and tracker and want to add language-conditioned querying without touching them. Because it operates purely on the trajectories a tracker outputs, you can swap in Deformable DETR with StrongSORT, YOLOX with ByteTrack, or whatever else, and FlexHook adapts. The paper reports results across seven different detector-tracker combinations.

The limitations are inherited from the two-stage design. If the upstream tracker misses a target, FlexHook cannot recover it, since it never sees the raw video. The distribution gap between clean training trajectories and noisy inference trajectories is only partially closed by the augmentations. And while the framework escapes CLIP, freezing the text encoder still costs more accuracy than freezing the visual one, hinting that the linguistic side is where domain shift bites hardest.

Code and pretrained checkpoints are available at the official FlexHook repository, along with the pseudocode and hyperparameters needed to reproduce the reported numbers.