UFO: A Unified Approach to Fine-grained Visual Perception via Open-ended Language Interface

Hao Tang, Chenwei Xie, Haiyang Wang, Xiaoyi Bao, Tingyu Weng, Pandeng Li, Yun Zheng, Liwei Wang

TL;DR

UFO (Unifies Fine-grained visual perception tasks through an Open-ended language interface) eliminates the need for complex, task-specific decoders in Multimodal Large Language Models (MLLMs). By reformulating pixel-level segmentation as an embedding retrieval problem and using a novel multi-token upsampling strategy, UFO seamlessly unifies object detection, image segmentation, and vision-language reasoning into a single, streamlined architecture.

What Problem Does This Paper Address?

While Multimodal Large Language Models (MLLMs) excel at image-level vision-language tasks like captioning and visual question answering, they traditionally struggle with fine-grained perception tasks like object detection and pixel-level segmentation.

To fix this, existing approaches usually take one of two paths, both of which introduce significant trade-offs:

  1. Task-Specific Decoders: Methods add specialized architectural components (like mask decoders or region proposal networks). This introduces massive architectural complexity, complicates end-to-end training, and makes scaling up the underlying LLM difficult.
  2. Purely Text-Based Representations: Other methods attempt to represent bounding boxes as coordinate tokens and masks as polygon vertices. However, compressing complex, multi-region masks into a limited sequence of polygon coordinates introduces severe quantization errors and fails to capture fine details.

UFO addresses this dilemma by completely removing task-specific decoders while avoiding the detail loss of polygon approximations, creating a truly unified open-ended language interface for all granularities of vision tasks.

Figure 1: Methods to augment MLLMs with fine-grained perception tasks. (a) Relying on task decoders [37, 77], (b) Previous text-based methods represent boxes with location tokens [52] and represent masks with suboptimal polygons [74, 69] or textual classes [69, 38], (c) Ours: predicting open-ended text sequences while using a simple yet effective embedding retrieval approach for masks.

Methods

UFO abstracts multimodal architectures into three standard components: an image tokenizer, a text tokenizer, and a multimodal transformer. It handles fine-grained perception tasks through two core innovations:

1. Bounding Boxes as Textual Numbers

For object detection, continuous coordinates are discretized into integers and wrapped directly in <box> and </box> tokens (e.g., person, <box>465,268,589,344</box>). This cleanly formats detection as an open-ended sequence generation task.

2. Segmentation via Embedding Retrieval

Instead of outputting explicit mask coordinates, UFO introduces a special <MASK> token. The core insight is that the MLLM’s internal image features already contain rich spatial and semantic information. UFO extracts the text embedding ($e_m$) of the generated <MASK> token and computes a scaled dot-product similarity against the MLLM's output image features ($h_v$). High-similarity positions are retrieved to form the binary mask.

To prevent the low-resolution masks typically caused by downsampled image features, the authors introduce Upsampling by Multiple Mask Tokens. The model autoregressively predicts $N^2$ distinct <MASK> tokens (typically 16 tokens for $N=4$). Each token acts as a dynamic, image-customized upsampling parameter for a specific sub-grid position, yielding highly refined, detailed masks.

3. Parallel Decoding for Multi-Object Tasks

To handle tasks with multiple predictions (like detecting many objects at once) without creating sluggishly long text sequences, UFO introduces localized grid features as visual prompts. The image is divided into a grid, and each grid point independently and concurrently decodes its spatially nearest object in parallel.

Figure 2: Overview of our approach. (a) Segmentation modeling: the mask token embedding retrieves similar image features to generate masks (shown with matching colors). (b) Upsampling masks by multiple mask tokens, retrieving more details by more tokens. We use N=2 to illustrate while using N=4 in implementation. (c) We output open-ended text sequences with textual numbers for detection.

Datasets

The authors evaluated UFO across two primary training paradigms:

  • Multi-Task Training: Models were trained on COCO 2017 (object detection and instance segmentation), COCO Caption, RefCOCO/RefCOCO+/RefCOCOg (referring expression comprehension), and ADE20K (semantic segmentation).
  • Fine-Grained Instruction Tuning: To scale up to MLLMs, the dataset was enriched to 2.5 million samples across 6 tasks, incorporating data from LLaVA-v1.5-mix665k, LLaVA-OneVision, Objects365, OpenImages, LVIS, nuImages, COCO-Stuff, and Mapillary Vistas.

Key Insights and Ideas

  • The Mask is Already There: Traditional models assume you need a heavy decoder to build a mask. UFO proves that a well-encoded MLLM image feature space already clusters similar semantics together; you simply need the text interface to retrieve the right cluster center.
  • Embeddings as Dynamic Upsampling Filters: Instead of using static, non-learnable bilinear interpolation or rigid transposed convolutions, UFO uses the model's generated text embeddings as custom, image-specific upsampling parameters. This provides unprecedented flexibility for capturing complex shapes.
  • Unified Vocabulary Promotes Synergy: Because UFO shares a single vocabulary across all tasks (unlike prior generalist models like GiT that isolate task vocabularies), it exhibits a strong multi-task synergy effect—improving performance across tasks when trained jointly.

Key Results

  • Instance & Semantic Segmentation: When evaluated on the GiT benchmark using a lightweight ViT backbone, UFO shattered previous records, outperforming GiT by 12.3 mAP on COCO instance segmentation and 3.3 mIoU on ADE20K semantic segmentation.
  • Reasoning Segmentation: Scaled up to larger MLLM backbones (like InternVL2.5-8B), UFO achieved a new state-of-the-art on the challenging ReasonSeg benchmark, outperforming the previous best method (HiMTok-8B) by 6.2 gIoU without requiring complex Chain-of-Thought segmentation strategies.
  • Preserving Core VQA Abilities: Unlike many perception-extended models that suffer from "catastrophic forgetting" of language skills, UFO maintained or slightly improved its original performance on standard vision-language benchmarks like GQA and MMBench.

Limitations and Future Work

Despite its strong performance, the authors note a few key limitations:

  • Low Visibility Objects: UFO struggles to accurately localize or segment objects that are highly blurry or located at the extreme edges of an image.
  • Highly Clustered/Overlapping Objects: When multiple objects of the same category heavily overlap (e.g., a dense herd of zebras with identical patterns), the model can experience segmentation confusion.
  • Knowledge Constraints: In reasoning segmentation, if the underlying LLM lacks the specific world knowledge required to answer a complex prompt, the resulting mask retrieval will fail.

Summary updated

Abstract

Generalist models have achieved remarkable success in both language and vision-language tasks, showcasing the potential of unified modeling. However, effectively integrating fine-grained perception tasks like detection and segmentation into these models remains a significant challenge. This is primarily because these tasks often rely heavily on task-specific designs and architectures that can complicate the modeling process. To address this challenge, we present \ours, a framework that \textbf{U}nifies \textbf{F}ine-grained visual perception tasks through an \textbf{O}pen-ended language interface. By transforming all perception targets into the language space, \ours unifies object-level detection, pixel-level segmentation, and image-level vision-language tasks into a single model. Additionally, we introduce a novel embedding retrieval approach that relies solely on the language interface to support segmentation tasks. Our framework bridges the gap between fine-grained perception and vision-language tasks, significantly simplifying architectural design and training strategies while achieving comparable or superior performance to methods with intricate task-specific designs. After multi-task training on five standard visual perception datasets, \ours outperforms the previous state-of-the-art generalist models by 12.3 mAP on COCO instance segmentation and 3.3 mIoU on ADE20K semantic segmentation. Furthermore, our method seamlessly integrates with existing MLLMs, effectively combining fine-grained perception capabilities with their advanced language abilities, thereby enabling more challenging tasks such as reasoning segmentation. Code and models are available at https://github.com/nnnth/UFO.
BibTeX
@inproceedings{tang2025ufo,
  author = {Hao Tang and Chenwei Xie and Haiyang Wang and Xiaoyi Bao and Tingyu Weng and Pandeng Li and Yun Zheng and Liwei Wang},
  title = {{UFO: A Unified Approach to Fine-grained Visual Perception via Open-ended Language Interface}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=8omLr8BtjL},
}
Figure