SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.11622 · 2019

Scene Graph Prediction with Limited Labels

arXiv · PDF · Open in the Atlas

Code that ran

4 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; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/1904.11622.json · badge: /api/ran/1904.11622.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
vincentschen/limited-label-scene-graphs community (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
FunctionStatusWhere it lives
count_relationships Ran
ran on a synthesized input
vincentschen/limited-label-scene-graphs/utils/visual_genome.py
code served (permissive licence) · get_code("9820e72cf9b6e4e7")
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 dict. The image it ran in was not recorded. If your copy returns the same type 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 torch
import numpy as np
from collections import defaultdict

# Set random seed for reproducibility
torch.manual_seed(0)

# Construct annotations similar to Visual Genome relationships.json format
annotations = [
    {
        'relationships': [
            {'predicate': 'on'},
            {'predicate': 'near'},
            {'predicate': 'on'},
        ]
    },
    {
        'relationships': [
            {'predicate': 'wearing'},
            {'predicate': 'has'},
            {'predicate': 'near'},
        ]
    },
    {
        'relationships': [
            {'predicate': 'behind'},
        ]
    }
]

# Construct a syns_to_preds mapping that maps synonyms to canonical predicates
syns_to_preds = {
    'on': 'on_canonical',
    'wearing': 'wearing_canonical',
}

ARGS = {
    'annotations': annotations,
    'syns_to_preds': syns_to_preds,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
find_name_in_syns Ran
ran on a synthesized input
vincentschen/limited-label-scene-graphs/utils/primitives.py
code served (permissive licence) · get_code("12476025887456a8")
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 str. The image it ran in was not recorded. If your copy returns the same type 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 torch
import numpy as np

def find_name_in_syns(name, syns):
    for k, v in syns.items():
        if name in v:
            return k
    raise ValueError('%s not found in syns' % name)

# Construct valid arguments
name = "apple"
syns = {
    "fruit": ["apple", "banana", "orange"],
    "vegetable": ["carrot", "broccoli", "spinach"],
    "grain": ["wheat", "rice", "oats"]
}

ARGS = {
    "name": name,
    "syns": syns
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
get_deep_features Ran
ran on a synthesized input
vincentschen/limited-label-scene-graphs/utils/primitives.py
code served (permissive licence) · get_code("87f4060bc7fde4f3")
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 Tensor, ndim 2, dtype family float, shape (3, 2048) 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 torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create mock classes and functions for the deep feature extraction pipeline
class MockBBoxDataset:
    """Mock dataset that returns bounding box data"""
    def __init__(self, data, image_dir='data/VisualGenome/VG_100K', image_size=224):
        self.data = data
        self.image_dir = image_dir
        self.image_size = image_size
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        fn, sub, obj = self.data[idx]
        # Return mock image tensor and bounding boxes
        return torch.randn(3, self.image_size, self.image_size), sub, obj

def mock_extract_resnet_features(data_loader, batch_size=8):
    """Mock function that extracts ResNet features"""
    # Count total items and return features of shape (N, 2048)
    total_items = sum(len(batch) if isinstance(batch, (list, tuple)) else 1 for batch in data_loader)
    return torch.randn(total_items, 2048)

# Patch the imports in the get_deep_features function
import sys
from types import ModuleType

# Create mock utils module
utils_module = ModuleType('utils')
deep_features_module = ModuleType('deep_features')
deep_features_module.BBoxDataset = MockBBoxDataset
deep_features_module.extract_resnet_features = mock_extract_resnet_features
utils_module.deep_features = deep_features_module
sys.modules['utils'] = utils_module
sys.modules['utils.deep_features'] = deep_features_module

# Create minimal test data matching VisualGenome format
relationships = [
    {
        'image_id': 1,
        'relationships': [
            {
                'subject': {'x': 10, 'y': 20, 'w': 50, 'h': 60},
                'object': {'x': 100, 'y': 120, 'w': 40, 'h': 50}
            },
            {
                'subject': {'x': 30, 'y': 40, 'w': 45, 'h': 55},
                'object': {'x': 110, 'y': 130, 'w': 35, 'h': 45}
            }
        ]
    },
    {
        'image_id': 2,
        'relationships': [
            {
                'subject': {'x': 5, 'y': 15, 'w': 55, 'h': 65},
                'object': {'x': 105, 'y': 125, 'w': 45, 'h': 55}
            }
        ]
    }
]

ARGS = {
    'relationships': relationships
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, utils — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (3, 2048) — shape (3, 2048) 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
get_vg_obj_name Ran
ran on a synthesized input
vincentschen/limited-label-scene-graphs/utils/visual_genome.py
code served (permissive licence) · get_code("91671fbfdd04bb80")
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 str. The image it ran in was not recorded. If your copy returns the same type 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 torch

# The function expects an object (dict) from the VG dataset
# It tries to access obj['name'], and if that fails, obj['names'][0]
# We'll create a valid object dict with the 'names' key to test both paths

# Test case 1: object with 'names' key
obj_with_names = {
    'names': ['cat', 'animal'],
    'id': 1
}

ARGS = {
    'obj': obj_with_names
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
filter_relationships Not yet run
unverified (harvested, no recorded run)
vincentschen/limited-label-scene-graphs/utils/visual_genome.py
code served (permissive licence) · get_code("085226903221b138")
How it ran

no invocation recorded.

get_primitive_features Not yet run
unverified (harvested, no recorded run)
vincentschen/limited-label-scene-graphs/utils/primitives.py
code served (permissive licence) · get_code("edc121d156aa7fa2")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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.

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-23.

Repositories linked to this paper

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

Abstract

Visual knowledge bases such as Visual Genome power numerous applications in computer vision, including visual question answering and captioning, but suffer from sparse, incomplete relationships. All scene graph models to date are limited to training on a small set of visual relationships that have thousands of training labels each. Hiring human annotators is expensive, and using textual knowledge base completion methods are incompatible with visual data. In this paper, we introduce a semi-supervised method that assigns probabilistic relationship labels to a large number of unlabeled images using few labeled examples. We analyze visual relationships to suggest two types of image-agnostic features that are used to generate noisy heuristics, whose outputs are aggregated using a factor graph-based generative model. With as few as 10 labeled examples per relationship, the generative model creates enough training data to train any existing state-of-the-art scene graph model. We demonstrate that our method outperforms all baseline approaches on scene graph prediction by 5.16 recall@100 for PREDCLS. In our limited label setting, we define a complexity metric for relationships that serves as an indicator (R^2 = 0.778) for conditions under which our method succeeds over transfer learning, the de-facto approach for training with limited labels.

For agents

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

get_harvested_code_for_paper("1904.11622")
get_code_for_paper("1904.11622")
have("1904.11622")

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

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

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

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

Connect an agent — have() is free.