Groupwise Query Specialization and Quality-Aware Multi-Assignment for Transformer-based Visual Relationship Detection

Jongha Kim, Jihwan Park, Jinyoung Park, Jinyoung Kim, Sehyung Kim, Hyunwoo J. Kim

TL;DR

Researchers from Korea University have introduced SpeaQ, a novel training strategy for Transformer-based Visual Relationship Detection (VRD). By forcing decoder queries to specialize in specific groups of relations and allowing a single ground-truth to match multiple high-quality predictions, SpeaQ significantly boosts performance across common and rare relations with zero additional inference cost.

What Problem Does This Paper Address?

Visual Relationship Detection (VRD) involves identifying triplets in an image: a subject, an object, and the predicate (relation) connecting them (e.g., "man—riding—bicycle"). Modern models often use Transformer architectures where a set of "queries" learns to predict these triplets.

The authors identify two major bottlenecks in how these models are currently trained using standard label assignment (like the Hungarian matching algorithm):

  1. Unspecialized Queries: In standard training, every query is expected to potentially detect every type of relation. This "jack-of-all-trades" approach makes it hard for queries to specialize, especially given the "long-tail" nature of datasets where some relations are extremely rare compared to others.
  2. Insufficient Training Signals: Standard assignment is one-to-one; one ground-truth (GT) matches exactly one prediction. This means "near-correct" predictions—which might have the right boxes but a slightly different predicate—are penalized as "no relation," providing confusing negative signals to the model.

Methods

The proposed solution, SpeaQ, consists of two main components:

1. Groupwise Query Specialization

Instead of letting every query learn everything, the authors divide predicates into disjoint groups based on their frequency. They then partition the decoder queries into corresponding groups. A query in a specific group is only allowed to match predicates from its assigned relation group during training. This is enforced by adding a "grouping cost" ($H_{group}$) to the matching loss, which becomes infinite if a query tries to match a GT from the wrong group.

2. Quality-Aware Multi-Assignment

To provide richer training signals, SpeaQ moves from one-to-one to one-to-many assignment. It adaptively determines how many predictions ($d_i$) a single GT should be assigned to based on the "triplet-level quality"—a combination of how well the predicted subject/object boxes overlap with the GT and how high the predicate classification score is. This ensures that promising, high-quality predictions are encouraged rather than suppressed.

Overview of the SpeaQ framework comparing previous assignment methods to the proposed specialization and multi-assignment solutions.

Datasets

The authors evaluated SpeaQ on two primary benchmarks:

  • Visual Genome (VG150): A massive dataset with 150 object categories and 50 predicate categories, notorious for its long-tailed distribution.
  • HICO-DET: A standard benchmark for Human-Object Interaction (HOI) detection, containing 600 triplet classes.

Key Insights and Ideas

  • Specialization Beats Generalization: By narrowing a query's focus, the model better utilizes its total capacity. Figure 2 in the paper shows that SpeaQ brings the model's output frequency distribution much closer to the actual ground-truth distribution compared to the baseline.
  • Proportional Grouping is Essential: The authors found that assigning the number of queries to a group proportional to the total frequency of predicates in that group (rather than an equal split) yields the best results.
  • Triplets are More Than Boxes: Unlike standard object detection, VRD requires high quality across three components (subject, object, predicate). SpeaQ's multi-assignment specifically looks at this "triplet-level" quality to decide which predictions deserve positive reinforcement.

Key Results

SpeaQ achieved state-of-the-art results on both VG150 and HICO-DET across multiple base architectures (ISG, HOTR, GEN-VLKT).

  • Simultaneous Gains: Remarkably, SpeaQ improved both Recall@100 (which favors common relations) and mean Recall@100 (which favors rare relations). Usually, there is a trade-off between these two. On VG150, applying SpeaQ to the ISG model resulted in a gain of 5.4 in R@100 and 1.0 in mR@100.
  • Rare Relation Boost: On HICO-DET, SpeaQ improved the mAP for "rare" classes by 3.08 points, demonstrating its effectiveness in handling long-tailed data.
  • Efficiency: Because these changes only affect the training phase (the loss function and label assignment), the resulting model has the exact same architecture and inference speed as the baseline.
Qualitative results showing SpeaQ correctly identifying challenging relations like "behind" or "in front of" where the baseline model fails or chooses more generic predicates.

Limitations and Future Work

The authors noted that even with SpeaQ, some "failures" occur due to inherent ambiguities in the datasets themselves. For example, a model might predict "man on table" while the GT is "man sitting on table." Both are technically correct, but the model is penalized. The authors suggest that developing more accurate evaluation metrics or annotations that address linguistic and visual ambiguity is a vital direction for future research.

Summary updated

BibTeX
@misc{kim2024groupwise,
  author = {Jongha Kim and Jihwan Park and Jinyoung Park and Jinyoung Kim and Sehyung Kim and Hyunwoo J. Kim},
  title = {{Groupwise Query Specialization and Quality-Aware Multi-Assignment for Transformer-based Visual Relationship Detection}},
  year = {2024},
  eprint = {2403.17709},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.17709},
}
Figure