Spend Temporal Attention Where Coarse Features Stop Agreeing

Video segmentation models track objects by letting each location in one frame look at matching locations in neighboring frames, a step called temporal attention. The strongest models do this at every resolution of a feature pyramid, the stack of the same frame's features at coarse, medium, and fine detail. Fine levels hold most of the tokens, so they also account for most of the cost. We propose to run temporal attention densely only at the coarse level. Coarse features change little as an object moves, rotates, or blurs, which makes them reliable for matching. Fine-level tokens would join temporal attention only where the coarse level signals trouble: the coarse features of a region stop agreeing across frames, or an object is too small or too deformed for coarse features to describe.

The underlying argument comes from an old problem in vision, the tradeoff between invariance and discriminability. A feature that stays the same under nuisance changes such as pose, scale, or lighting must throw away information, and that discarded information is often exactly what separates two similar things. In a feature pyramid, coarse levels sit toward the invariant end and fine levels toward the discriminative end. Matching across frames mostly needs invariance. Drawing exact mask boundaries and separating touching instances needs discriminability. A model that pays fine-scale temporal cost everywhere is therefore buying discriminability for temporal matching in places where it is not needed.

Core Claim

We claim that in multi-scale video instance segmentation, nearly all of the benefit of temporal attention at fine scales comes from a small, predictable fraction of tokens. We also claim that a learned gate, driven by how much the coarse-level features disagree across frames, can find those tokens. If both hold, a model with dense coarse temporal attention and sparse, gated fine temporal attention should roughly match dense all-scale accuracy while cutting temporal-attention compute by a large factor. It should also clearly beat both coarse-only temporal attention and query-level tracking on small and deforming objects.

The cost argument is simple. Let pyramid level $l$ have $N_l$ tokens per frame, with each finer level holding about four times the tokens of the next coarser one (doubling height and width quadruples pixels). Temporal attention over $T$ frames at level $l$ then costs about $N_l T^2$. Admitting only a fraction $\rho$ of fine-level tokens gives

$$ C(\rho) \approx T^2\left(N_{\text{coarse}} + \rho \sum_{l\,\text{fine}} N_l\right), $$

so with three levels the dense cost is about $21\,N_{\text{coarse}}T^2$, and $\rho = 0.1$ cuts it roughly fivefold. The open question is empirical: does accuracy hold at such $\rho$, and does it hold only when the tokens are chosen well?

What Prior Work Does and Leaves Open

The method we extend is MS-STS VIS. It splits temporal attention into an intra-scale part, which attends across frames within each pyramid level, and an inter-scale part, which passes information between adjacent levels across frames. It reports 50.1% mask AP on YouTube-VIS 2019 with a ResNet-50 backbone and 61.0% with Swin, at 10 FPS. That result motivates our proposal, because it shows that cross-scale temporal interaction helps with deforming objects. It also constrains our proposal, because any cheaper design must be measured against it. MS-STS applies this attention uniformly to every token at every level. We keep its structure and make the fine-level part sparse and conditional.

At the other end of the cost spectrum, DVIS freezes a per-frame segmenter and performs all temporal reasoning on compact per-instance query vectors. It reports a 7.3 AP gain over prior methods on OVIS while adding only 1.69% to the segmenter's FLOPs. ClipVID similarly aggregates across frames at the object-query level. DVIS is our strongest efficiency competitor. Our contrast with it is that query-level reasoning cannot revise pixel-level boundaries in a frame where the frozen segmenter failed. Gated fine-scale attention can, but only where the gate is needed.

Two lines of work supply the selection idea. LISRD shows that choosing the invariance level of local descriptors per region at runtime beats one fixed level, reaching 0.626 precision on HPatches viewpoint changes against 0.598 for SOSNet. It does this on static image pairs, using a hand-made 3×3 grid and four descriptor heads that are all evaluated before selection. HRDA learns a per-pixel mask that fuses a low-resolution context crop with a high-resolution detail crop, reaching 73.8 mIoU on GTA5→Cityscapes, but it still runs both branches everywhere. We carry the per-region selection of both papers into the temporal axis. We also make it a compute decision: unselected fine tokens skip temporal attention entirely rather than being computed and then down-weighted.

Three further papers shape the design. TS2-Net keeps only the top-$K$ "informative" tokens per frame and reports that a hand-tuned $K$ varies by dataset. It also finds that temporal mixing in shallow layers harms spatial features, which constrains where our gated attention can sit. Sparse Video-Gen shows that sparse spatio-temporal attention gives real speedups only when selected tokens are gathered into contiguous memory, and it reports that early denoising steps cannot be sparsified. We reuse its layout idea and treat the early-stage finding as a warning that our gate may also need a dense warm-up.

Research Program

The first step is a measurement we expect to be useful even if the method fails. We will measure, at each pyramid level of a trained MS-STS model, how invariant and how discriminative features are across time. Invariance is the similarity of the same instance's pooled features between frames $t$ and $t+k$. Discriminability is the margin of that similarity over the nearest different instance. We expect invariance to rise and discriminability to fall from fine to coarse levels. We also expect the cases where coarse discriminability collapses (touching same-class instances, small objects, fast deformation) to be spatially concentrated. Two further measurements test this. First, we will compute per-token attribution of the fine-level temporal attention's contribution to mask quality and check whether it is heavy-tailed. Second, we will check whether frame-to-frame disagreement of coarse features predicts where that contribution is large.

The second step is the model. Coarse-level temporal attention stays dense. For each fine-level region, a small gate network sees two inputs: the coarse feature's residual against its temporally attended version, an inconsistency signal in the spirit of the frame-residual block in D² Transformer, and the region's current mask-boundary density. The gate selects a fixed fraction $\rho$ of fine tokens using a differentiable top-$k$ relaxation during training. Only selected tokens are gathered into a contiguous buffer and run intra- and inter-scale temporal attention, while the rest keep per-frame features plus an upsampled copy of the coarse temporal output. Gating applies only in the later encoder layers, following TS2-Net's finding about shallow temporal mixing. We sweep $\rho$ to trace an accuracy-versus-compute curve rather than reporting a single point.

Baselines

The naive reference point is the per-frame segmenter with no temporal attention in the encoder, linked across frames by the tracker alone. This shows how much temporal attention buys at all.

The strongest accuracy competitor is dense MS-STS VIS, which reports 50.1% mask AP (ResNet-50) and 61.0% (Swin) on YouTube-VIS 2019 val. We will retrain it in our codebase with the same backbone, schedule, clip length, and augmentation so that any gap reflects the gate rather than training differences. "Beating" it here means staying within 0.5 AP overall while using at most one third of its measured temporal-attention FLOPs and wall-clock time, with no loss in AP75.

The strongest efficiency competitor is DVIS. It reports a 7.3 AP gain on OVIS and a 1.69% FLOPs overhead, but no absolute YouTube-VIS AP is given in our sources, so we will report our own retrained numbers. We will run it with the same per-frame segmenter backbone and training data, and it will also serve as the tracker on top of our model. Beating it means higher AP on OVIS and on small objects at a total compute cost reported side by side.

Three ablations isolate the key ingredient. Coarse-only temporal attention ($\rho = 0$) tests whether fine-scale temporal attention matters at all. Random selection at matched $\rho$ tests whether the gate's choices matter. Informativeness-based top-$K$ selection in the style of TS2-Net, at matched $\rho$, tests whether coarse disagreement is the right signal rather than mere token salience. All runs share data, schedule, and a fixed hyperparameter-tuning budget of equal trial count per method.

Why not just…?

Why not just run temporal attention only at the coarse level? This is the most serious threat, because our own invariance argument predicts that coarse features do most of the matching work. If coarse-only attention comes within noise of dense MS-STS on OVIS and on AP for small objects, then the gate adds nothing. In that case the contribution shrinks to the per-scale measurement and a recommendation to drop fine temporal attention. We would report exactly that. The $\rho = 0$ ablation, broken down by object size and occlusion level, settles it. MS-STS's reported gain from inter-scale temporal attention on deforming objects (+4.8 at AP75) is the main evidence that fine detail matters somewhere.

Why not just do temporal reasoning on instance queries, as DVIS does? It is far cheaper, and its OVIS gain shows that association does not need dense features. But queries cannot fix a mask boundary that the frozen per-frame segmenter got wrong under blur or partial occlusion. The ClipVID ablation, where removing cross-frame aggregation drops mAP from 84.7 to 83.3, suggests that temporal evidence matters most on hard frames. Comparing AP75 and boundary accuracy on OVIS's heavily occluded subset will show whether pixel-level temporal context buys anything beyond queries.

Why not just prune tokens by informativeness, as TS2-Net does? Salient tokens are not the same as tokens whose temporal correspondence is ambiguous: a high-texture background patch is salient but trivially matchable. The matched-$\rho$ comparison against informativeness-based selection tests this directly. If it ties our disagreement gate, the specific signal is not the contribution.

Proposed Experiments

We will train on YouTube-VIS 2019 and 2021 and on OVIS, evaluating mask AP, AP50, AP75, and AP broken down by object size. Computational measurements will be encoder temporal-attention FLOPs, end-to-end FPS, and peak memory on a single GPU at fixed clip length. Each method is plotted on an AP-versus-FLOPs curve across $\rho \in \{0, 0.05, 0.1, 0.2, 0.5, 1\}$. VIPSeg video panoptic quality serves as a check that the gate does not starve background "stuff" classes.

Three checks decide the project. First, the gated model at $\rho \le 0.2$ must sit on or above the curve joining coarse-only and dense MS-STS. Second, it must beat random selection at the same $\rho$ by a margin larger than seed variance across three seeds. Third, the regions the gate selects must overlap the regions where the per-scale analysis found coarse discriminability collapsing, which tests whether the model is spending fine-scale computation exactly where invariant features run out of information. A secondary check examines whether, as in Sparse Video-Gen's early-step finding, the gate needs dense fine attention in the first training epochs or first gated layer. We will report the minimum warm-up required.