Pseudo-Q: Generating Pseudo Language Queries for Visual Grounding

Haojun Jiang, Yuanze Lin, Dongchen Han, Shiji Song, Gao Huang

TL;DR

Pseudo-Q is a novel unsupervised framework for visual grounding that eliminates the need for expensive human-annotated text queries by automatically generating them from unlabeled images. By combining off-the-shelf object detectors with heuristic spatial reasoning and prompt engineering, it matches or outperforms state-of-the-art weakly supervised methods while slashing human annotation costs by up to 31%.

What Problem Does This Paper Address?

Visual grounding (VG) is the task of locating a specific object in an image based on a natural language phrase (e.g., "the brown horse on the left"). While deep learning has driven massive progress in this area, training these models typically requires large datasets of manually labeled image-query or bounding-box-query pairs.

Even "weakly-supervised" methods, which drop the requirement for bounding boxes during training, still rely on humans to write the text queries. Annotating these queries is incredibly tedious because humans must identify objects, isolate their unique attributes, and determine their relationships to surrounding objects on a case-by-case basis. Pseudo-Q tackles this bottleneck by generating both the bounding boxes and the language queries completely automatically from unlabeled images, making the training process entirely free of task-related human annotations.

Figure 1. Comparison with fully and weakly-supervised vi- sual grounding method. (a) Fully-supervised VG utilizes image region-query pairs as supervision signals. (b) Weakly-supervised VG adopts only language queries. (c) Our Pseudo-Q method is free of any task-related annotations.

Methods

The Pseudo-Q framework operates in three main stages:

  1. Pseudo-Query Generation Module: To ground an object, a model needs to understand its category (noun), properties (attributes), and position (relationships). Pseudo-Q extracts these using a multi-step pipeline:
  2. Nouns: An off-the-shelf object detector identifies candidate objects, keeping the top-$N$ most confident, non-tiny proposals.
  3. Attributes: An attribute classifier identifies traits like color, material, or human action states (e.g., "wooden", "standing").
  4. Spatial Relationships: Standard detectors do not explicitly output spatial relationships. The authors introduce a heuristic algorithm that compares bounding box coordinates and area ratios to automatically infer horizontal (left/right/center), vertical (top/bottom), and depth (front/behind) relationships between objects of the same class.
  5. Query Prompt Module: To make raw pseudo-queries (like "left standing man") effective for training, a prompt engineering module wraps them into task-specific templates, such as "find the region that corresponds to the description {pseudo-query}".
  6. Visual-Language Model with ML-CMA: Built on top of a transformer-based visual grounding network (TransVG), the authors introduce a Multi-Level Cross-Modality Attention (ML-CMA) mechanism. Instead of fusing only the final layers of the vision and language encoders, ML-CMA fuses the text embedding with multiple intermediate levels of the visual transformer, capturing both coarse geometric layouts and fine-grained object properties.
Figure 2. Overview of our Pseudo-Q method. Better view in color and zoom in. The proposed approach consists of a pseudo-query generation module, a query prompt module, and a visual-language model. (a) During the training stage, pseudo image region-query pairs are generated to train visual language model. (b) During the inference stage, the test query is filled into the prompt template, and the target object is located by the trained model.

Datasets

The authors evaluated Pseudo-Q on five standard visual grounding benchmarks:

  • RefCOCO
  • RefCOCO+
  • RefCOCOg
  • ReferItGame
  • Flickr30K Entities

To simulate an unsupervised setting, the training sets of these benchmarks were stripped of all human-annotated queries and bounding boxes, utilizing only the raw images.

Key Insights and Ideas

  • Spatial Relationships are the Secret Sauce: Analysis of datasets like RefCOCO shows that nearly 60% of human queries rely on spatial relationships (like "left" or "right") to differentiate objects. By focusing their heuristic generation on these dominant spatial cues, the authors synthesized highly effective training data without needing a complex language model.
  • Prompts Matter for Vision-Language: Just as in pure NLP, framing the task properly via prompt engineering helps unlock the latent knowledge inside pre-trained vision-language models. Simply feeding raw labels to the model performs significantly worse than wrapping them in a localization-focused prompt template.
  • Multi-Level Fusion is Crucial: Fusing text features across multiple visual encoder layers yields a steady performance boost. This is because spatial relations require a coarse layout understanding (found in lower-level features), while attributes require detailed semantic understanding (found in higher-level features).

Key Results

  • Outperforming Weak Supervision: Despite using zero human-annotated queries, Pseudo-Q beats state-of-the-art weakly-supervised methods (which do use human queries) across all five datasets. For example, on the ReferItGame dataset, Pseudo-Q achieved 43.32% top-1 accuracy, outperforming the best weakly-supervised competitor by 4.93%.
  • Massive Margin over Unsupervised Baselines: On RefCOCO, Pseudo-Q achieved 56.02% accuracy (val), crushing the previous unsupervised state-of-the-art baseline (CPT), which sat at 32.20%.
  • Slashing Annotation Costs: In a hybrid setting where human labels containing spatial relationships were replaced with Pseudo-Q's generated samples, manual annotation costs were reduced by 31% on RefCOCO without any degradation in the final model's fully-supervised performance.

Limitations and Future Work

  • Noisy Queries: Because the generation pipeline relies on heuristic rules and imperfect off-the-shelf detectors, it inevitably generates some ungrammatical or incorrect pseudo-queries, which can inject noise into training.
  • Simplistic Language Structure: The generated pseudo-queries follow rigid templates and are structurally simple. The authors note that future work should explore generating more complex, diverse, and natural language expressions, as well as incorporating non-spatial relationships (e.g., actions or interactions between different object classes).

Summary updated

BibTeX
@misc{jiang2022pseudo,
  author = {Haojun Jiang and Yuanze Lin and Dongchen Han and Shiji Song and Gao Huang},
  title = {{Pseudo-Q: Generating Pseudo Language Queries for Visual Grounding}},
  year = {2022},
  eprint = {2203.08481},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.08481},
}
Figure