Zero-shot Visual Relation Detection via Composite Visual Cues from Large Language Models

Lin Li, Jun Xiao, Guikun Chen, Jian Shao, Yueting Zhuang, Long Chen

TL;DR

RECODE is a novel framework that significantly improves zero-shot visual relation detection by using Large Language Models (LLMs) to decompose abstract relationships into concrete "visual cues." By breaking down a relation like "riding" into specific descriptions for the subject, object, and their spatial arrangement, and then weighting these cues via Chain-of-Thought reasoning, RECODE helps models like CLIP distinguish between subtle, fine-grained interactions that traditional methods miss.

What Problem Does This Paper Address?

Visual Relation Detection (VRD) involves identifying interacting triplets in an image, such as <man, riding, horse>. While vision-language models like CLIP are excellent at zero-shot object recognition, they struggle with understanding complex relations between objects.

The authors identify three core challenges in applying CLIP to zero-shot VRD:

  1. Relation Sensitivity: Naive prompts like "a photo of [holding]" and "a photo of [carrying]" are semantically too similar for CLIP to distinguish reliably.
  2. Spatial Discriminability: Standard class-based prompts ignore the relative positioning of objects. For example, "holding" and "carrying" often look similar but involve different spatial heights and postures.
  3. Computational Efficiency: Naively cropping every possible object pair in an image to feed into CLIP is computationally expensive ($N^2$ crops for $N$ objects).

Methods

To overcome these limitations, the authors propose RECODE (RElation detection via COmposite DEscription prompts). The framework operates in three main stages:

The RECODE framework pipeline
  • Visual and Semantic Decomposition: Instead of looking at a relationship as a single abstract concept, RECODE decomposes it into three distinct components: the subject, the object, and their spatial relationship. For the spatial component, rather than using raw image crops (which is slow), they simulate spatial relationships using a finite set of "simulated spatial images" based on bounding box properties (shape, size, position, distance).
  • Guided Visual Cues from LLMs: The researchers use GPT-3.5 to generate detailed descriptions for each component. Crucially, they use Guided Relation Component Descriptions. For instance, if the object is an "animal," the LLM generates cues like "has a saddle"; if it's a "product" (like a bike), it generates "has wheels." This prevents the model from looking for a saddle on a bicycle.
  • Chain-of-Thought (CoT) Weighting: Not all visual cues are equally important. To determine the weight of each cue, they use a CoT prompt ("Let's think step by step!") to ask the LLM which components are most discriminative for a specific relation. For "looking at," the LLM might correctly reason that the subject's eye direction is more important (weight 0.6) than the object's appearance (weight 0.3).

Datasets

The model was evaluated on four major benchmarks:

  • Visual Genome (VG): A standard for scene graph generation.
  • GQA: A large-scale dataset for visual reasoning and scene graphs.
  • HICO-DET: Focused on Human-Object Interaction (HOI).
  • V-COCO: A smaller, common benchmark for HOI.

Key Insights and Ideas

  • Decomposition is Key: Abstract predicates are hard for CLIP, but concrete descriptions (e.g., "arms stretched out," "subject above object") are much easier for the model to "see" and match.
  • LLMs as Reasoning Engines, not just Labelers: Instead of just using LLMs to provide synonyms, RECODE uses them to perform a "common sense" analysis of what a relationship actually looks like physically.
  • Spatial Simulation: By using simulated red/green bounding box images to represent spatial relations, the authors bypass the need for expensive union-region cropping, improving both accuracy and efficiency.
  • Filtering Unreasonable Triplets: The authors found that using LLMs to filter out "common sense" impossibilities (like <kid, eating, house>) significantly cleans up the model's predictions.

Key Results

RECODE consistently outperformed the baseline CLIP (which uses simple class-based prompts) across all datasets:

  • Visual Genome: RECODE achieved a 10.6% R@20, a significant jump from the baseline's 7.2%.
  • GQA: Performance improved from 5.6% to 7.0% R@20.
  • Architecture Agnostic: The authors showed that RECODE provides gains regardless of the underlying CLIP backbone (ViT-B/32, ViT-L/14, etc.).
Interpretability and performance of CLIP with Visual Cues
  • Interpretability: Because the model relies on specific descriptions, users can see why the model made a specific choice. For example, the model chooses "riding" over "mounted on" because specific visual cues like "seated on the back of the animal" or "with a saddle" yield the highest similarity scores.

Limitations and Future Work

  • Fine-grained Appearance: While RECODE is better at distinguishing relations, it still struggles when two actions are visually almost identical, such as "throwing a ball" vs. "catching a ball."
  • Subject Similarity in HOI: In datasets like HICO-DET, the subject is always a human. This makes the "subject description" component less useful because the visual features of the human don't change enough between different interactions to be the primary differentiator.
  • Future Direction: The authors suggest that integrating more dynamic temporal cues (for video) or even more granular part-level descriptions (like finger positions) could further refine the model's accuracy.

Summary updated

BibTeX
@inproceedings{li2023zero,
  author = {Lin Li and Jun Xiao and Guikun Chen and Jian Shao and Yueting Zhuang and Long Chen},
  title = {{Zero-shot Visual Relation Detection via Composite Visual Cues from Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=wiv21EJ0Vd},
}
Figure