Papers › Graphical Contrastive Losses for Scene Graph Parsing

Graphical Contrastive Losses for Scene Graph Parsing

7 Mar 2019CVPR 2019 6arXiv:1903.02728archive 2025-07-28

Ji Zhang, Kevin J. Shih, Ahmed Elgammal, Andrew Tao, Bryan Catanzaro

Most scene graph parsers use a two-stage pipeline to detect visual relationships: the first stage detects entities, and the second predicts the predicate for each entity pair using a softmax distribution. We find that such pipelines, trained with only a cross entropy loss over predicate classes, suffer from two common errors. The first, Entity Instance Confusion, occurs when the model confuses multiple instances of the same type of entity (e.g. multiple cups). The second, Proximal Relationship Ambiguity, arises when multiple subject-predicate-object triplets appear in close proximity with the same predicate, and the model struggles to infer the correct subject-object pairings (e.g. mis-pairing musicians and their instruments). We propose a set of contrastive loss formulations that specifically target these types of errors within the scene graph parsing problem, collectively termed the Graphical Contrastive Losses. These losses explicitly force the model to disambiguate related and unrelated instances through margin constraints specific to each type of confusion. We further construct a relationship detector, called RelDN, using the aforementioned pipeline to demonstrate the efficacy of our proposed losses. Our model outperforms the winning method of the OpenImages Relationship Detection Challenge by 4.7\% (16.5\% relative) on the test set. We also show improved results over the best previous methods on the Visual Genome and Visual Relationship Detection datasets.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1903.02728")

Code

Syntology Ran 0 of 6 code samples harvested from 1 repository linked to this paper; 6 have no recorded run.

By repository: community (archive-listed): 6 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

mcg-nju/trace mentioned on GitHubpytorchNOASSERTION report
microsoft/scene_graph_benchmark mentioned on GitHubpytorchMIT report
dmlc/dgl pytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

6 samples harvested; 0 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6unverified

Licence: 0 of the 6 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from microsoft/scene_graph_benchmark. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

add_rel_blobs microsoft/scene_graph_benchmark/scene_graph_benchmark/relation_head/contrastive_loss_sample_pairs.py community (archive-listed) unverified MIT (permissive) · f9af1f466aea37e6 · report
argsort_desc microsoft/scene_graph_benchmark/scene_graph_benchmark/scene_parser.py community (archive-listed) unverified MIT (permissive) · 7d4002289969a288 · report
bbox_overlaps_np microsoft/scene_graph_benchmark/scene_graph_benchmark/relation_head/contrastive_loss_sample_pairs.py community (archive-listed) unverified MIT (permissive) · 4be5e86a417aaece · report
make_roi_attribute_feature_extractor microsoft/scene_graph_benchmark/scene_graph_benchmark/attribute_head/roi_attribute_feature_extractors.py community (archive-listed) unverified MIT (permissive) · 9049535f4dffe1d1 · report
make_roi_attribute_predictor microsoft/scene_graph_benchmark/scene_graph_benchmark/attribute_head/roi_attribute_predictors.py community (archive-listed) unverified MIT (permissive) · 786473378508216b · report
rois_union microsoft/scene_graph_benchmark/scene_graph_benchmark/relation_head/contrastive_loss_sample_pairs.py community (archive-listed) unverified MIT (permissive) · d301a0684ba102dc · report

Tasks

Relationship DetectionScene Graph GenerationVisual Relationship Detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Softmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections