Detecting Unseen Visual Relations Using Analogies

Julia Peyre, Josef Sivic, Ivan Laptev, Cordelia Schmid

Abstract

We seek to detect visual relations in images of the form of triplets $t = (subject, predicate, object)$, such as “person riding dog”, where training examples of the individual entities are available but their combinations are unseen at training. This is an important set-up due to the combinatorial nature of visual relations: collecting sufficient training data for all possible triplets would be very hard. The contributions of this work are three-fold. First, we learn a representation of visual relations that combines (i) individual embeddings for subject, object and predicate together with (ii) a visual phrase embedding that represents the relation triplet. Second, we learn how to transfer visual phrase embeddings from existing training triplets to unseen test triplets using analogies between relations that involve similar objects. Third, we demonstrate the benefits of our approach on three challenging datasets: on HICO-DET, our model achieves significant improvement over a strong baseline for both frequent and unseen triplets, and we observe similar improvement for the retrieval of unseen triplets with out-of-vocabulary predicates on the COCO-a dataset as well as the challenging unusual triplets in the UnRel dataset.

Introduction

Modern computer vision systems excel at identifying individual objects, yet they often struggle to interpret the complex interactions between them. Understanding these interactions, represented as (subject, predicate, object) triplets, is critical for higher-level scene understanding. However, the field faces a "combinatorial explosion": while the number of common objects and predicates is manageable, their possible combinations run into the millions.

Existing research typically follows one of two paradigms. Compositional models train generic detectors for predicates (e.g., "ride"). These often fail because the visual appearance of a predicate varies wildly depending on the object (e.g., "riding a horse" vs. "riding a surfboard"). Conversely, Visual Phrase models treat each triplet as a unique entity. While this captures specific visual nuances, it requires an impractical amount of training data for every possible combination, leaving rare or unseen relations undetectable. This paper proposes a middle ground: leveraging analogies to "hallucinate" the appearance of unseen relations based on known ones.

Methodology

The proposed framework operates in a joint visual-semantic embedding space, utilizing a hybrid approach to represent relations.

Multi-Level Embeddings

The model learns a multi-level representation consisting of unigram embeddings for subjects ($s$), objects ($o$), and predicates ($p$), alongside a dedicated Visual Phrase (trigram) embedding space ($vp$) that represents the interaction as a whole.

The full architecture showing (a) training of multi-level embeddings and (b) inference for unseen relations using analogy transformations.

This dual representation allows the model to maintain the flexibility of individual components while capturing the specific visual context of the entire interaction. By using pre-trained Word2vec embeddings as a semantic prior, the model maps linguistic relationships onto visual features.

Transfer by Analogy

The core innovation is the ability to detect "unseen" relations by analogy. If the model encounters a query for "person ride dog" but has only seen "person ride horse," it uses a transformation function, $\Gamma$, to bridge the gap.

Conceptual overview of the analogy-based transfer mechanism.

Inspired by linguistic analogies (e.g., $King - Man + Woman = Queen$), the model calculates the semantic difference between the known object ("horse") and the target object ("dog"). It then applies this "correction term" to the known visual phrase embedding of "person ride horse" to estimate the visual representation of "person ride dog." To ensure robustness, a similarity weighting function is employed, ensuring that knowledge is only transferred from relevant source triplets.

Experimental Evaluation

The model was evaluated across three diverse benchmarks to test its generalization capabilities:

  • HICO-DET (Zero-Shot): On a custom zero-shot split where 25 common triplets were excluded from training, the analogy-based model improved mean Average Precision (mAP) from 23.2 (compositional baseline) to 28.6.
  • COCO-a (Out-of-Vocabulary): This task tested predicates never seen during training. The model achieved a 60% relative improvement over the baseline for unseen triplets and over 70% for entirely new predicates.
  • UnRel (Unusual Relations): The model outperformed previous state-of-the-art methods on this dataset of rare, "common-sense defying" relations (e.g., "car on top of building"), proving the robustness of the analogy mechanism.

Discussion and Conclusion

This research demonstrates that visual phrases are essential for handling the polysemy of predicates—where the same action looks different depending on the context. By combining these phrases with an analogy-based transfer mechanism, the model effectively leverages linguistic priors to expand its visual vocabulary. While the model remains dependent on the accuracy of underlying object detectors, the success of analogy-based transfer marks a significant step toward scalable and flexible visual relation detection.

Summary updated

BibTeX
@inproceedings{peyre2019detecting,
  author = {Julia Peyre and Josef Sivic and Ivan Laptev and Cordelia Schmid},
  title = {{Detecting Unseen Visual Relations Using Analogies}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  url = {https://openreview.net/forum?id=Ez9NO7cv2W},
}
Figure