Visual Relationship Detection with Internal and External Linguistic Knowledge Distillation

Ruichi Yu, Ang Li, Vlad I. Morariu, Larry S. Davis

Abstract

Understanding the visual relationship between two objects involves identifying the subject, the object, and a predicate relating them. We leverage the strong correlations between the predicate and the (subject, object) pair—both semantically and spatially—to predict predicates conditioned on the subjects and the objects. Modeling these three entities jointly more accurately reflects their relationships compared to independent modeling. However, joint modeling complicates learning because the semantic space of visual relationships is vast and training data is limited, particularly for "long-tail" relationships with few instances. To overcome this, we use linguistic statistics to regularize visual model learning. We obtain linguistic knowledge (LK) by mining from both training annotations (internal knowledge) and publicly available text, such as Wikipedia (external knowledge), to compute the conditional probability distribution of a predicate given a (subject, object) pair. During training, we distill this knowledge into a deep model to achieve better generalization. Our experimental results on the Visual Relationship Detection (VRD) and Visual Genome datasets demonstrate that this distillation significantly outperforms state-of-the-art methods, especially in predicting unseen relationships, where recall improved from 8.45% to 19.17% on the VRD zero-shot testing set.

Introduction

Detecting visual relationships involves identifying a triplet: <subject, predicate, object> (e.g., person riding horse). While modern computer vision systems excel at identifying individual objects, identifying the interaction between them remains a significant challenge. The core difficulty is the combinatorial explosion of possibilities; even with a limited number of object categories and predicates, there are thousands of potential triplets. Most of these appear rarely in datasets—the "long tail"—and many never appear during training at all, despite being common in the real world. Previous methods often predicted objects and predicates independently, ignoring the fact that language provides a strong "common sense" prior (e.g., a person is likely to wear a shirt, but a shirt is unlikely to wear a person).

Methodology: The Teacher-Student Framework

To incorporate linguistic common sense into a visual model, we propose a Teacher-Student framework. This approach allows the model to learn not just from labeled images, but from the inherent structure of language itself.

Overview of the proposed framework for linguistic knowledge distillation in visual relationship detection.

The Student Network

The Student Network is the primary deep learning model. It processes three distinct types of input to make a prediction:

  • Visual Features: Pixels extracted from the union of the subject and object bounding boxes.
  • Semantic Features: Word embeddings (e.g., word2vec) of the subject and object category names.
  • Spatial Features: The relative positions and sizes of the two bounding boxes.

The Teacher Network and Distillation

The Teacher Network is constructed using linguistic statistics to calculate the conditional probability $P(predicate | subject, object)$. During training, the Student network is optimized to match both the ground-truth labels and the "soft" probability distribution provided by the Teacher. This process, known as Knowledge Distillation, regularizes the learning process and forces the visual model to align with linguistic reality.

We utilize dual knowledge sources for the Teacher:

  1. Internal LK: Statistics mined directly from the training annotations of datasets like VRD or Visual Genome.
  2. External LK: Statistics mined from a massive crawl of Wikipedia (approximately 4 billion words). This external source provides the necessary common sense to handle relationships that do not appear in the specific image training set, bridging the gap for zero-shot learning.

Experimental Results

The model was evaluated on two major benchmarks: the VRD dataset and the larger Visual Genome (VG) dataset. The results were particularly striking in the zero-shot scenario, where the model must predict relationships it has never seen in the training data.

A qualitative example of relationship detection involving a person and a surfboard.

On the VRD dataset, our model improved Recall@100 for zero-shot testing from the previous state-of-the-art of 8.45% to 19.17%. On the full VRD test set, the model achieved a Recall@50 of 55.16% for predicate detection, a significant improvement over baselines that lacked linguistic distillation. These improvements held steady on the larger Visual Genome dataset, proving that linguistic priors are a robust way to handle data sparsity at scale.

Conclusion

By "baking" linguistic common sense into the weights of a visual neural network through distillation, we can significantly improve the detection of rare and unseen visual relationships. This approach moves beyond treating predicates as isolated labels and instead treats them as part of a joint spatial-semantic structure. While the system currently depends on the accuracy of pre-trained object detectors and can be affected by noise in external text data, it represents a major step forward in bridging the gap between computer vision and natural language understanding.

Summary updated

BibTeX
@inproceedings{yu2017visual,
  author = {Ruichi Yu and Ang Li and Vlad I. Morariu and Larry S. Davis},
  title = {{Visual Relationship Detection with Internal and External Linguistic Knowledge Distillation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2017},
  url = {https://openreview.net/forum?id=yq61p_593p},
}
Figure