Devil's on the Edges: Selective Quad Attention for Scene Graph Generation

Deunsol Jung, Sanghyun Kim, Won Hwa Kim, Minsu ChoCVPR 2023

Abstract

Scene graph generation aims to construct a semantic graph structure from an image such that its nodes and edges respectively represent objects and their relationships. One of the major challenges for the task lies in the presence of distracting objects and relationships in images; contextual reasoning is strongly distracted by irrelevant objects or backgrounds and, more importantly, a vast number of irrelevant candidate relations. To tackle the issue, we propose the Selective Quad Attention Network (SQUAT) that learns to select relevant object pairs and disambiguate them via diverse contextual interactions. SQUAT consists of two main components: edge selection and quad attention. The edge selection module selects relevant object pairs, i.e., edges in the scene graph, which helps contextual reasoning, and the quad attention module then updates the edge features using both edge-to-node and edge-to-edge cross-attentions to capture contextual information between objects and object pairs. Experiments demonstrate the strong performance and robustness of SQUAT, achieving the state of the art on the Visual Genome and Open Images v6 benchmarks.

Introduction

Scene Graph Generation (SGG) is the task of transforming a visual scene into a structured representation where nodes represent objects and edges represent their semantic relationships (e.g., "man-riding-bicycle"). While object detection has seen significant progress, SGG remains difficult due to the "quadratic explosion" of potential relationships. In a typical image with dozens of detected objects, the number of possible pairs can reach into the thousands. However, in reality, only a tiny fraction (often less than 1%) of these pairs constitute meaningful relationships.

Most existing SGG models suffer from this noise, as their message-passing or self-attention mechanisms attempt to process all possible pairs. This results in the model's reasoning being distracted by irrelevant context—such as relationships between an object and a background element. To address this, we introduce the Selective Quad Attention Network (SQUAT), which focuses on pruning irrelevant edges and enriching the remaining ones through multi-faceted contextual attention.

The SQUAT Framework

SQUAT introduces two primary architectural innovations designed to filter noise and enhance relational reasoning: the Edge Selection Module and the Quad Attention Module.

Edge Selection Module (ESM)

Rather than allowing every possible object pair to participate in the reasoning process, SQUAT employs an Edge Selection Module. This module uses a lightweight Multi-Layer Perceptron (MLP) to assign a "relatedness" score to every potential object pair. The model then performs "hard pruning," retaining only the top $\rho\%$ of edges. By removing these distracting outliers early, the model can focus its computational resources and attention bandwidth on the most likely candidates for meaningful relationships.

Quad Attention Module

Standard Transformer-based models in SGG typically focus on Node-to-Node (N2N) interactions. SQUAT expands this paradigm by treating edges as first-class citizens. The Quad Attention mechanism facilitates four distinct types of contextual interactions:

  • Node-to-Node (N2N): Captures how objects relate to other objects.
  • Node-to-Edge (N2E): Allows object features to inform the identity of a relationship.
  • Edge-to-Node (E2N): Allows relationship features to refine the identity of the involved objects.
  • Edge-to-Edge (E2E): Enables relationships to provide context for other relationships (e.g., knowing a "man is holding a bucket" helps the model identify that the "man is feeding a horse").

By updating both node and edge features through these four channels, SQUAT achieves a holistic understanding of the scene's structure.

Experimental Evaluation

We evaluated SQUAT on two primary benchmarks: Visual Genome (VG), which contains 108k images with 150 object classes, and Open Images v6, a larger dataset with 126k training images and 301 object classes.

Key Results

  • Visual Genome: SQUAT achieved a Mean Recall (mR@100) of 16.5 in the Scene Graph Detection (SGDet) setting. This is a significant 3.9-point improvement over the previous state-of-the-art model, BGNN. This gain is particularly noteworthy because SGDet is the most realistic and challenging setting, requiring the model to detect objects and relationships simultaneously.
  • Open Images v6: The model achieved a competitive weighted score (score_wtd) of 43.5, matching or exceeding existing top-tier models like RU-Net.
  • Ablation Studies: Our experiments confirmed that the Edge Selection Module is critical; removing it led to a performance drop of nearly 9% in mR@100. This supports the hypothesis that "less is more"—sparsifying the graph allows for more effective reasoning.

Discussion and Insights

The success of SQUAT highlights that the "devil" in SGG is indeed in the edges—specifically, the overwhelming number of irrelevant ones. We found that "hard" pruning is more effective than soft gating because it completely removes the influence of noisy pairs from the attention mechanism. Furthermore, the inclusion of Edge-to-Edge (E2E) attention proved vital. In many complex scenes, relationships are not independent; they form a semantic context that helps disambiguate nearby interactions.

Conclusion and Future Work

SQUAT sets a new standard for Scene Graph Generation by prioritizing edge selection and complex quad-directional attention. While the model shows superior performance, especially in realistic detection scenarios, challenges remain. The current ESM uses a non-differentiable top-k selection, and the model still faces the common SGG hurdle of the "long-tail" distribution, where rare predicates are harder to predict than common ones like "on" or "near." Future work will explore making the selection process end-to-end differentiable and improving performance on rare relationship classes.

Summary updated

BibTeX
@inproceedings{jung2023devil,
  author = {Deunsol Jung and Sanghyun Kim and Won Hwa Kim and Minsu Cho},
  title = {{Devil's on the Edges: Selective Quad Attention for Scene Graph Generation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=8oBH2pgUHF},
}
Figure