Abstract
Recently, query-based object detection frameworks have achieved performance levels comparable to previous state-of-the-art detectors. However, effectively leveraging these frameworks for instance segmentation remains an open challenge. In this paper, we present QueryInst (Instances as Queries), a query-based instance segmentation method driven by parallel supervision on dynamic mask heads. The key insight of QueryInst is to exploit the intrinsic one-to-one correspondence in object queries across different stages, as well as the correspondence between mask RoI features and object queries within the same stage. This approach eliminates the need for explicit multi-stage mask head connections and resolves proposal distribution inconsistency issues common in non-query-based multi-stage methods. We evaluate QueryInst on COCO, Cityscapes, and YouTube-VIS benchmarks. Using a ResNet-101-FPN backbone, QueryInst achieves 48.1 box AP and 42.8 mask AP on COCO test-dev—outperforming Hybrid Task Cascade (HTC) by 2 points in both metrics while running 2.4 times faster.
Introduction
The landscape of object detection has been transformed by query-based frameworks like DETR and Sparse R-CNN. These models reformulate detection as a direct set-prediction problem, matching the performance of highly optimized traditional detectors such as Faster R-CNN. Despite this success, extending query-based architectures to instance segmentation has been difficult.
Historically, top-tier instance segmentation models, such as Cascade Mask R-CNN and Hybrid Task Cascade (HTC), have relied on multi-stage paradigms. To produce high-quality masks, these models explicitly connect mask features across successive stages. However, naively applying these traditional multi-stage mask heads to query-based detectors leads to inefficient training, slow inference, and statistical mismatches in proposal distributions. QueryInst addresses these issues by introducing a native, efficient instance segmentation head specifically tailored for query-based architectures.
The QueryInst Framework
QueryInst builds upon the multi-stage query-based detector Sparse R-CNN but introduces a novel mechanism for mask generation that leverages the unique properties of object queries.
Parallel Dynamic Mask Heads
Unlike traditional approaches that explicitly pass mask features from one stage to the next, QueryInst utilizes Parallel Dynamic Mask Heads. It employs dynamic mask convolutions (DynConv_mask) in parallel across all stages of the network. This parallel structure simplifies the architecture while maintaining high performance.
Queries as Memory
A core innovation of QueryInst is the use of object queries as a form of memory. Because a specific query slot corresponds to the same object across all stages, the query naturally accumulates multi-stage information. During training, mask gradients flow back into the object queries, allowing them to refine their representation of the instance's geometry and appearance. This eliminates the need for the clunky, explicit feature connections found in models like HTC.
Shared Representation and Task Synergy
QueryInst shares the query and Multi-Head Self-Attention (MSA) modules between the bounding box detection and mask segmentation branches. This design forces the network to learn a joint representation where the two tasks act as mutually beneficial regularizers. This synergy not only saves parameters but actually improves the performance of the detection branch by providing richer instance-level supervision.
Inference Efficiency
Because the queries implicitly carry refined information across stages, QueryInst can discard the intermediate dynamic mask heads during inference. By only utilizing the final stage for prediction, the model drastically reduces computational overhead without sacrificing accuracy.
Experimental Results
COCO Benchmark
On the COCO test-dev benchmark, QueryInst demonstrates a superior speed-accuracy trade-off. With a ResNet-101-FPN backbone, it achieves 48.1 box AP and 42.8 mask AP. Compared to the state-of-the-art HTC model, QueryInst is approximately 2 points higher in both metrics while operating at 6.1 FPS (2.4× faster than HTC's 2.5 FPS). When scaled with a Swin-L transformer backbone, QueryInst reaches 56.1 box AP and 49.1 mask AP, setting a new benchmark for end-to-end query-based frameworks.
Cityscapes and YouTube-VIS
QueryInst generalizes well to other domains:
- Cityscapes: The model achieves a competitive 39.4 AP on the validation set, outperforming strong dynamic-convolution baselines like CondInst.
- Video Instance Segmentation (VIS): By adding a vanilla tracking head, "QueryInst-VIS" achieves 36.2 AP on YouTube-VIS. It outperforms established methods like MaskTrack R-CNN and VisTR while maintaining real-time performance at 32.3 FPS.
Conclusion and Future Work
QueryInst demonstrates that the intrinsic properties of query-based detectors—specifically the one-to-one correspondence of queries across stages—can be leveraged to create a highly efficient and accurate instance segmentation framework. By treating instances as queries, the model bypasses the proposal inconsistency and computational heavy-lifting required by previous multi-stage architectures.
While QueryInst is highly effective, it is also data-hungry, requiring stronger data augmentations and longer training schedules (e.g., 3× to 6× schedules) to reach peak performance. Future research will focus on optimizing these training requirements and exploring the application of query-based architectures to a broader range of instance-level recognition tasks.
Summary updated