Abstract
Computer vision tasks have traditionally relied on specialized architectural heads for different objectives such as object detection, classification, and pose estimation. Obj2Seq introduces a unified framework that reformulates these object-level tasks as sequence generation problems. By decoupling object recognition from attribute description through a "Prompted Visual Indicator" and a "General Sequence Predictor," Obj2Seq achieves competitive performance across multiple benchmarks using a single, flexible architecture. This object-centric approach ensures scalability and target-awareness, overcoming the limitations of previous image-to-sequence models that struggle with complex scenes.
Introduction
The field of computer vision is often fragmented by task-specific requirements. Object detection requires bounding box coordinates, human pose estimation necessitates keypoint locations, and multi-label classification focuses on category presence. While recent attempts like Pix2Seq have tried to unify these by treating the entire image as a single sequence, they face scalability issues in complex scenes where sequence lengths become unmanageable. Furthermore, these models are often "blind" to specific targets until the entire sequence is generated.
Obj2Seq addresses these challenges by adopting an object-centric, target-aware approach. Instead of generating a global sequence, it prompts the model with specific categories of interest and generates task-specific attribute sequences for each detected instance. This allows the model to focus its computational resources on relevant objects, mimicking the way human visual systems tune themselves to specific targets.
Methodology
The Obj2Seq framework consists of a two-step pipeline designed to decouple recognition from description:
Prompted Visual Indicator (PVI)
The PVI module takes "class prompts"—embeddings of category names—as input. It employs cross-attention between these prompts and image features to determine the existence of a category and initialize "object queries." This mechanism allows the model to be flexible; users can specify exactly which categories to look for, effectively acting as a visual prior.
Object Transformer Decoder and General Sequence Predictor (GSP)
Once object queries are initialized, they are refined by a standard transformer decoder using image features. The core of the unification lies in the General Sequence Predictor (GSP). For every detected object, the GSP generates a sequence of attributes. For detection, this sequence is $[x, y, w, h]$; for pose estimation, it extends to a longer sequence of keypoint offsets. As an autoregressive decoder, the GSP naturally handles varying sequence lengths across different tasks.
The system is trained end-to-end using a bipartite matching loss, similar to DETR, which matches predicted sequences to ground-truth targets without needing post-processing like Non-Maximum Suppression (NMS).
Experimental Results
The model was evaluated on the MS COCO dataset across three primary tasks: object detection, multi-label classification, and human pose estimation.
- Object Detection: Using a ResNet-50 backbone, Obj2Seq achieved 45.7% AP, outperforming the Deformable DETR baseline by 1.2% AP.
- Multi-label Classification: The model reached 89.0% mAP, matching the performance of specialized state-of-the-art classification models.
- Human Pose Estimation: Obj2Seq achieved 65.0% AP, demonstrating that sequence generation is effective even for high-dimensional keypoint data.
The model also demonstrated stability when the number of prompted classes changed during inference, proving its robustness and flexibility.
Discussion and Conclusion
Obj2Seq demonstrates that a unified, object-centric approach is both scalable and effective. By generating sequences per object, it avoids the memory and gradient issues associated with long image-level sequences. Furthermore, the use of class prompts mimics human visual attention, leading to more efficient detection.
Key insights from the study suggest that predicting attributes sequentially (e.g., box center before scale) improves accuracy by leveraging internal geometric dependencies. While the current implementation uses a standard ResNet backbone, future work could explore specialized feature extractors and extend the framework to tasks like instance segmentation or relationship detection. Obj2Seq represents a significant step toward a truly generalist visual perception system.
Summary updated