SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1903.02728 · 2019

Graphical Contrastive Losses for Scene Graph Parsing

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1903.02728.json · badge: /api/ran/1903.02728.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
microsoft/scene_graph_benchmark community (classifier label)
classifier basis not recorded on the link
3 ran · 3 no recorded run
FunctionStatusWhere it lives
argsort_desc Ran
ran, honoured the contract we drafted
microsoft/scene_graph_benchmark/scene_graph_benchmark/scene_parser.py
code served (permissive licence) · get_code("7d4002289969a288")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (12, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small numpy array with distinct dimensions for testing
# Using shape (3, 4) to have distinct dimensions
scores = np.array([
    [9.2, 3.1, 7.5, 1.2],
    [4.8, 6.3, 2.1, 8.9],
    [5.4, 1.7, 9.1, 3.6]
], dtype=np.float32)

ARGS = {
    "scores": scores
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (12, 2) — shape (12, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bbox_overlaps_np Ran
ran on a synthesized input
microsoft/scene_graph_benchmark/scene_graph_benchmark/relation_head/contrastive_loss_sample_pairs.py
code served (permissive licence) · get_code("4be5e86a417aaece")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create small sample bounding boxes
# Format: [x1, y1, x2, y2]
anchors = np.array([
    [10, 10, 50, 50],
    [20, 20, 60, 60]
], dtype=np.float32)

gt_boxes = np.array([
    [15, 15, 55, 55],
    [25, 25, 65, 65],
    [5, 5, 30, 30]
], dtype=np.float32)

ARGS = {
    "anchors": anchors,
    "gt_boxes": gt_boxes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rois_union Ran
ran on a synthesized input
microsoft/scene_graph_benchmark/scene_graph_benchmark/relation_head/contrastive_loss_sample_pairs.py
code served (permissive licence) · get_code("d301a0684ba102dc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create two small arrays of ROIs (regions of interest)
# Each ROI is [xmin, ymin, xmax, ymax]
rois1 = np.array([
    [10.0, 20.0, 50.0, 80.0],
    [15.0, 25.0, 60.0, 90.0]
], dtype=np.float32)

rois2 = np.array([
    [12.0, 22.0, 55.0, 85.0],
    [20.0, 30.0, 65.0, 95.0]
], dtype=np.float32)

ARGS = {
    'rois1': rois1,
    'rois2': rois2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
add_rel_blobs Not yet run
unverified (harvested, no recorded run)
microsoft/scene_graph_benchmark/scene_graph_benchmark/relation_head/contrastive_loss_sample_pairs.py
code served (permissive licence) · get_code("f9af1f466aea37e6")
How it ran

no invocation recorded.

make_roi_attribute_feature_extractor Not yet run
unverified (harvested, no recorded run)
microsoft/scene_graph_benchmark/scene_graph_benchmark/attribute_head/roi_attribute_feature_extractors.py
code served (permissive licence) · get_code("9049535f4dffe1d1")
How it ran

no invocation recorded.

make_roi_attribute_predictor Not yet run
unverified (harvested, no recorded run)
microsoft/scene_graph_benchmark/scene_graph_benchmark/attribute_head/roi_attribute_predictors.py
code served (permissive licence) · get_code("786473378508216b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
argsort_desc 5 other papers
5 later
2004.00436 (2020-04)
Exploring Long Tail Visual Relationship Recognition with Large Vocabulary
2403.17709 (2024-03)
Groupwise Query Specialization and Quality-Aware Multi-Assignment for Transformer-based Visual Relationship Detection
2404.02072 (2024-04)
EGTR: Extracting Graph from Transformer for Scene Graph Generation
and 2 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1903.02728")
get_code_for_paper("1903.02728")
have("1903.02728")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1903.02728.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1903.02728.svg)](https://syntology.ai/paper/1903.02728)

Connect an agent — have() is free.