Visual Relationship Detection Using Part-and-Sum Transformers with Composite Queries

Qi Dong, Zhuowen Tu, Haofu Liao, Yuting Zhang, Vijay Mahadevan, Stefano Soatto

Abstract

Computer vision applications such as visual relationship detection and human object interaction can be formulated as a composite (structured) set detection problem in which both the parts (subject, object, and predicate) and the sum (triplet as a whole) are to be detected in a hierarchical fashion. In this paper, we present a new approach, denoted Part-and-Sum detection Transformer (PST), to perform end-to-end visual composite set detection. Different from existing Transformers in which queries are at a single level, we simultaneously model the joint part and sum hypotheses/interactions with composite queries and attention modules. We explicitly incorporate sum queries to enable better modeling of the part-and-sum relations that are absent in the standard Transformers. Our approach also uses novel tensor-based part queries and vector-based sum queries, and models their joint interaction. We report experiments on two vision tasks, visual relationship detection and human object interaction and demonstrate that PST achieves state of the art results among single-stage models, while nearly matching the results of custom designed two-stage models.

Introduction

Understanding a visual scene requires more than just identifying individual objects; it necessitates recognizing the complex relationships between them. Visual Relationship Detection (VRD) and Human-Object Interaction (HOI) aim to identify triplets consisting of a subject, an object, and a predicate (e.g., "person-riding-horse"). Traditional approaches often rely on two-stage pipelines—detecting objects first and then classifying their relationships—which can be computationally inefficient and fail to capture global context. While single-stage Transformer-based models like DETR have emerged, they often struggle to represent both fine-grained entity details and holistic interaction context using a single flat vector.

Methodology: The Part-and-Sum Transformer

The Part-and-Sum Transformer (PST) addresses these limitations by treating relationship detection as a hierarchical set-matching problem. The core innovation lies in the use of Composite Queries.

Overview of the PST pipeline and composite query structure.

Composite Queries

Unlike standard Transformers that use a single list of queries, PST employs structured units called composite queries. Each unit consists of:

  1. Part Queries: Three distinct sub-queries representing the Subject, Object, and Predicate.
  2. Sum Query: A global query representing the triplet as a unified whole.

Specialized Decoder Architecture

The PST decoder is designed to process these hierarchical queries through two primary mechanisms:

  • Factorized Self-Attention: This module separates attention into intra-relation (ensuring consistency within a triplet, such as a person being more likely to "ride" a horse than a building) and inter-relation (modeling how different relationships in a scene interact).
  • Part-Sum Interaction: This layer facilitates information exchange between the detailed "parts" and the holistic "sum," allowing the model to refine predictions using both local and global cues.

Training is guided by Composite Bipartite Matching, ensuring that predicted triplets are matched against ground truth as complete, structured units.

Experimental Results

The PST model was evaluated on the VRD and HICO-DET datasets. On the VRD dataset, PST achieved a Recall@50 of 23.57% for relationship detection, significantly outperforming other end-to-end methods such as Zoom-Net and KL-Distillation.

Performance comparison on the VRD dataset.

On the HICO-DET dataset, PST reached a Mean Average Precision (mAP) of 23.93, surpassing contemporary models like HoiT. Qualitative analysis demonstrates PST's strength in detecting small-entity relationships and resolving instance ambiguity in crowded scenes.

Conclusion

PST demonstrates that a single-stage Transformer architecture, when equipped with hierarchical composite queries, can achieve state-of-the-art performance in visual relationship detection. By explicitly modeling the "sum" of a relationship alongside its "parts," the model captures both fine-grained details and global context. Future work may explore extending this hierarchical logic to more complex scene structures and integrating deeper linguistic priors to enhance common-sense reasoning in relationship detection.

Summary updated

BibTeX
@inproceedings{dong2021visual,
  author = {Qi Dong and Zhuowen Tu and Haofu Liao and Yuting Zhang and Vijay Mahadevan and Stefano Soatto},
  title = {{Visual Relationship Detection Using Part-and-Sum Transformers with Composite Queries}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  url = {https://openreview.net/forum?id=DdLHgxI-D0},
}
Figure