NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Single-Stage Visual Relationship Learning using Conditional Queries

Alakh Desai, Tz-Ying Wu, Subarna Tripathi, Nuno Vasconcelos

TL;DR

TraCQ (Transformers with Conditional Queries) is a lean, single-stage model for Scene Graph Generation (SGG) that flips the traditional script: it predicts relationships first to guide object detection. By using "conditional queries" to decouple these tasks, it achieves state-of-the-art performance on the Visual Genome dataset with 20% fewer parameters and significantly faster inference than previous single-stage approaches.

What Problem Does This Paper Address?

Scene Graph Generation (SGG) aims to turn an image into a structured graph of (subject, predicate, object) triplets—for example, [man] - [riding] - [bicycle].

Historically, this has been a two-stage process: first, detect all objects; second, look at every possible pair of objects and guess their relationship. This is computationally expensive ($O(N^2)$ pairs) and slow. Recent single-stage models try to predict everything at once using Transformers, but they run into "feature entanglement." Object detection and relationship classification require very different types of visual features. When a single model tries to learn both simultaneously in the same feature space, performance usually suffers.

Methods

The authors introduce TraCQ, a DETR-based architecture that introduces a "weak coupling" between predicates and entities to solve the entanglement problem.

Architecture of the TraCQ model showing the Predicate Decoder and Entity Refinement modules.
  1. Predicate-First Decoding: Instead of finding objects first, the Predicate Decoder ($\mathcal{H}$) predicts a set of triplets consisting of a predicate label and two "loose" bounding boxes for the subject and object.
  2. Conditional Entity Refinement: These loose boxes and the predicted predicate label are transformed into Conditional Queries.
  3. The "Aha" Moment: These queries are fed into an Entity Refinement module ($\mathcal{C}$). Because the query already "knows" the predicate (e.g., "riding"), it provides a massive hint about what the entities should be (e.g., a person and a vehicle) and where to look. This significantly narrows the search space for the final, high-accuracy object detection.
  4. Disentangled Learning: By separating the tasks into two decoders with distinct loss functions, the model allows the feature extractor to specialize without the "entanglement" that plagues other single-stage models.

Key Insights and Ideas

Comparison of Single Decoder (SD), Dual Decoders (DD), and Dual DETR (DDTR) architectures.
  • The "Goldilocks" Disentanglement: The authors found that while complete separation of tasks (Dual DETR) is too disjointed and a single decoder (Single Decoder) is too entangled, TraCQ’s conditional approach (Dual Decoders) provides the perfect "weak coupling" needed for end-to-end optimization.
  • Predicates as Context: In many SGG models, predicates are the "afterthought." TraCQ argues that the relationship provides the strongest context for identifying the objects involved. Knowing a "riding" action is happening makes identifying the "rider" and the "bike" much easier.
  • Avoiding the Combinatorial Explosion: By predicting triplets directly rather than pairing every detected object, TraCQ avoids the $O(N^2)$ complexity that slows down two-stage models.

Key Results

The model was trained and evaluated on the Visual Genome (VG) dataset, specifically the VG150 subset (150 most frequent object classes and 50 most frequent predicate classes).

  • Superior Accuracy: On the Visual Genome benchmark, TraCQ achieved a mean Recall (mR@20) of 12.0, more than doubling the performance of previous single-stage models like RelTR (5.8) and Relationformer (4.6).
  • Efficiency: It uses 20% fewer parameters (51.2M) than the previous state-of-the-art single-stage model.
  • Speed: It is roughly 1.5x faster during inference than a "Dual DETR" baseline, making it much more viable for real-time applications.
  • Beating the Giants: TraCQ actually outperforms several well-established two-stage models (like MOTIFS and VCTree) in mean Recall, despite being a simpler, single-stage architecture.

Limitations and Future Work

  • Long-Tail Distribution: Like most SGG models, TraCQ still struggles with the "long-tail" problem where a few relationships (like "on" or "near") are very common, while others are extremely rare. Future work could integrate unbiased training techniques (like reweighting or resampling) to help with these rare classes.
  • Refinement Iterations: The current model uses a single refinement step for entities; exploring iterative refinement could potentially push accuracy even higher at the cost of some speed.

Summary updated

BibTeX
@inproceedings{desai2022single,
  author = {Alakh Desai and Tz-Ying Wu and Subarna Tripathi and Nuno Vasconcelos},
  title = {{Single-Stage Visual Relationship Learning using Conditional Queries}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure