Knowledge-augmented Few-shot Visual Relation Detection

Tianyu Yu, Yangning Li, Jiaoyan Chen, Yinghui Li, Hai-Tao Zheng, Xi Chen, Qingbin Liu, Wenqiang Liu, Dongxiao Huang, Bei Wu, Yexin WangarXiv 2023 · DOI

Introduction

Visual Relation Detection (VRD) is a fundamental computer vision task that involves identifying Subject-Predicate-Object triplets within an image. While modern deep learning models excel at detecting common relationships like "person riding bike" when provided with thousands of training instances, they struggle with the "long tail" of rare or novel interactions. For example, a model might fail to recognize a "dog eating apple" simply because it hasn't seen enough specific examples of that triplet.

The primary challenge in few-shot VRD is semantic diversity. A single predicate like "eating" can manifest in vastly different visual forms—compare a horse grazing on grass to a child eating a hotdog. Humans overcome this by leveraging prior knowledge: we understand the linguistic concept of "eating" and know which objects are typically edible. This paper introduces the KFV (Knowledge-augmented Few-shot Visual relation detection) framework to equip AI with similar "common sense" capabilities.

Overview of the KFV framework integrating textual and visual relation knowledge for few-shot detection.

The KFV Framework

The KFV framework addresses the generalization gap by fusing visual features with external knowledge. The architecture consists of three primary modules:

1. Visual Feature Encoding

The system utilizes a pre-trained object detector to extract both appearance and spatial features from pairs of objects. This provides the raw visual evidence for potential relationships.

2. Textual Knowledge Acquisition

To capture the stable linguistic meaning of relationships, KFV queries a Pre-trained Language Model (PLM). Unlike static word embeddings, KFV uses a "Triplet" prompt (e.g., "[Subject] is [Predicate] [Object]") to generate dynamic, context-aware representations. This approach preserves the directionality of the relationship, ensuring the model distinguishes between "dog chasing cat" and "cat chasing dog."

3. Visual Relation Knowledge

The authors constructed a Visual Relation Knowledge Graph from thousands of image captions to model real-world object interactions. By encoding this graph with a fine-tuned BERT model, the framework can estimate the likelihood of specific triplets based on patterns observed in large-scale text data.

Detailed architecture of the KFV framework, illustrating the fusion of visual features, textual prompts, and knowledge graph encoding.

Knowledge Fusion

A Mixture-of-Experts (MoE) module intelligently weighs these diverse information sources—visual, textual, and graph-based—to produce a final prediction.

Evaluation and Benchmarking

The KFV framework was evaluated on the Visual Genome dataset across three benchmarks:

  • 50-way: The most frequent relationships.
  • 25-way: A challenging set excluding the top 25 relationships to test low-resource performance.
  • 20-way: A cleaned schema removing redundant synonyms.

The researchers also introduced Seen/Unseen Recall metrics to measure how effectively the model generalizes to object pairs that were not present in the few-shot training set.

Key Insights and Results

The KFV framework demonstrated significant performance improvements over existing state-of-the-art (SOTA) methods:

  • Performance Gains: On the 25-way benchmark (5-shot), KFV achieved a 40.3% Recall@50, nearly doubling the 22.0% achieved by the previous SOTA, LKMN.
  • Efficiency: KFV outperformed much larger vision-language models like CLIP and VinVL, suggesting that explicit knowledge augmentation is more effective for few-shot tasks than simply increasing pre-training data.
  • Graph Optimization: The study found that "1-hop" neighbors in the knowledge graph provided the best balance of context, whereas including the entire global graph introduced noise that degraded performance.

Conclusion

By anchoring visual tasks in language and structured knowledge, KFV bridges the gap between diverse visual appearances and stable semantic concepts. This approach allows models to identify rare relationships with minimal examples, marking a significant step toward more robust and "common-sense" visual understanding.

Summary updated

BibTeX
@misc{yu2023knowledge,
  author = {Tianyu Yu and Yangning Li and Jiaoyan Chen and Yinghui Li and Hai-Tao Zheng and Xi Chen and Qingbin Liu and Wenqiang Liu and Dongxiao Huang and Bei Wu and Yexin Wang},
  title = {{Knowledge-augmented Few-shot Visual Relation Detection}},
  year = {2023},
  eprint = {2303.05342},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.05342},
}
Figure