SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1912.02252 · 2019

Multiple Anchor Learning for Visual Object Detection

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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 5 have no contract verdict; 2 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/1912.02252.json · badge: /api/ran/1912.02252.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
DeLightCMU/MAL-inference community (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
DeLightCMU/MAL community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
FunctionStatusWhere it lives
box2delta Ran
ran on a synthesized input
DeLightCMU/MAL-inference/retinanet/box.py
code served (permissive licence) · get_code("6693e538e48a84c9")
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 (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 torch

torch.manual_seed(0)

# Create small tensors for boxes and anchors
# boxes and anchors should have shape (batch_size, 4) where 4 represents [x1, y1, x2, y2]
boxes = torch.tensor([
    [10.0, 20.0, 50.0, 80.0],
    [15.0, 25.0, 60.0, 90.0]
], dtype=torch.float32)

anchors = torch.tensor([
    [0.0, 0.0, 40.0, 40.0],
    [10.0, 10.0, 50.0, 50.0]
], dtype=torch.float32)

ARGS = {
    "boxes": boxes,
    "anchors": anchors
}
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 Tensor, 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
convert_fixedbn_model Ran
ran on a synthesized input
DeLightCMU/MAL-inference/retinanet/backbones/layers.py
code served (permissive licence) · get_code("333799a2d6f1a170")
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 Sequential. 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
from torch import nn
import torch.nn.functional as F

torch.manual_seed(0)

class FixedBatchNorm2d(nn.Module):
    """BatchNorm2d where the batch statistics and the affine parameters are fixed"""

    def __init__(self, n):
        super().__init__()
        self.register_buffer('weight', torch.ones(n))
        self.register_buffer('bias', torch.zeros(n))
        self.register_buffer('running_mean', torch.zeros(n))
        self.register_buffer('running_var', torch.ones(n))

    def forward(self, x):
        return F.batch_norm(x, running_mean=self.running_mean, running_var=self.running_var, weight=self.weight, bias=self.bias)

def convert_fixedbn_model(module):
    """Convert batch norm layers to fixed"""
    mod = module
    if isinstance(module, nn.BatchNorm2d):
        mod = FixedBatchNorm2d(module.num_features)
        mod.running_mean = module.running_mean
        mod.running_var = module.running_var
        if module.affine:
            mod.weight.data = module.weight.data.clone().detach()
            mod.bias.data = module.bias.data.clone().detach()
    for name, child in module.named_children():
        mod.add_module(name, convert_fixedbn_model(child))
    return mod

# Create a test module with BatchNorm2d layers
test_module = nn.Sequential(
    nn.Conv2d(3, 8, kernel_size=3, padding=1),
    nn.BatchNorm2d(8),
    nn.ReLU(),
    nn.Conv2d(8, 4, kernel_size=3, padding=1),
    nn.BatchNorm2d(4)
)

# Initialize the BatchNorm layers with some running statistics
for module in test_module.modules():
    if isinstance(module, nn.BatchNorm2d):
        module.running_mean = torch.randn(module.num_features)
        module.running_var = torch.abs(torch.randn(module.num_features)) + 0.1
        if module.affine:
            module.weight.data = torch.randn(module.num_features)
            module.bias.data = torch.randn(module.num_features)

ARGS = {
    'module': test_module
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
delta2box1 Ran
ran on a synthesized input
DeLightCMU/MAL-inference/retinanet/box.py
code served (permissive licence) · get_code("7e0127e0e305eb71")
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 (2, 12) 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

torch.manual_seed(0)

# rel_codes: encoded relative box offsets
# Shape: (batch_size, num_predictions * 4) where each 4 values are [dx, dy, dw, dh]
# Using batch_size=2, num_predictions=3 (so 12 total columns)
rel_codes = torch.randn(2, 12, dtype=torch.float32)

# boxes: reference boxes in format [x1, y1, x2, y2]
# Shape: (batch_size, 4)
boxes = torch.tensor([
    [10.0, 20.0, 50.0, 80.0],
    [5.0, 15.0, 45.0, 75.0]
], dtype=torch.float32)

# weights: scaling factors for [dx, dy, dw, dh]
weights = (10.0, 10.0, 5.0, 5.0)

# bbox_xform_clip: clipping value for dw and dh
bbox_xform_clip = 4.135166556742356

ARGS = {
    "rel_codes": rel_codes,
    "boxes": boxes,
    "weights": weights,
    "bbox_xform_clip": bbox_xform_clip,
}
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 Tensor, ndim 2, dtype family float, shape (2, 12) — shape (2, 12) 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
generate_anchors Ran
ran on a synthesized input
DeLightCMU/MAL-inference/retinanet/box.py
code served (permissive licence) · get_code("df48fc695a8a624c")
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 (6, 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 torch

torch.manual_seed(0)

# Analyze the function:
# - stride: used as a scalar in torch.FloatTensor([stride]) - should be a number
# - ratio_vals: used in len(ratio_vals) and repeated - should be a list/tuple of numbers
# - scales_vals: used in len(scales_vals) and repeated - should be a list/tuple of numbers

ARGS = {
    "stride": 16,
    "ratio_vals": [0.5, 1.0, 2.0],
    "scales_vals": [8, 16],
}
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 Tensor, ndim 2, dtype family float, shape (6, 4) — shape (6, 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
interpolate Ran
ran; our contract draft was wrong, not the code
DeLightCMU/MAL/maskrcnn_benchmark/layers/misc.py
pointer only (licence: MIT); the stored copy get_code serves, from KanghoonYoon/torch-rasgg, is pointer only (licence: NONE) · get_code("2902bf4410253ff7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KanghoonYoon/torch-rasgg, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

show_detections Ran
ran on a synthesized input
DeLightCMU/MAL-inference/retinanet/utils.py
code served (permissive licence) · get_code("deef1b581ac0b1ec")
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 Image. 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 tempfile
import os
from PIL import Image

# Create temporary image file for testing
temp_dir = tempfile.mkdtemp()
test_image_path = os.path.join(temp_dir, 'test_image.png')
test_image = Image.new('RGB', (100, 100), color='red')
test_image.save(test_image_path)

# Construct detections dictionary
detections = {
    test_image_path: [
        {
            'bbox': (10, 10, 50, 50),
            'score': 0.85,
            'class': 'cat'
        },
        {
            'bbox': (55, 55, 90, 90),
            'score': 0.92,
            'class': 'dog'
        }
    ]
}

ARGS = {
    'detections': detections
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
smooth_l1_loss Ran
ran; our contract draft was wrong, not the code
DeLightCMU/MAL/maskrcnn_benchmark/layers/smooth_l1_loss.py
code served (permissive licence) · get_code("e261fa29066b37e5")
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 0, dtype family float, shape () 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

torch.manual_seed(0)

# Create small tensors for input and target
input_tensor = torch.randn(2, 4)
target_tensor = torch.randn(2, 4)

# Create ARGS dict with all parameters
ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "beta": 1.0 / 9,
    "size_average": True,
}
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 Tensor, ndim 0, dtype family float, shape () — shape () 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
build_resnet_backbone Not yet run
unverified (harvested, no recorded run)
DeLightCMU/MAL-inference/retinanet/backbones/backbone.py
code served (permissive licence) · get_code("661727cf46a893a5")
How it ran

no invocation recorded.

build_resnet_fpn_backbone Not yet run
unverified (harvested, no recorded run)
DeLightCMU/MAL-inference/retinanet/backbones/backbone.py
code served (permissive licence) · get_code("b8551d861a720f33")
How it ran

no invocation recorded.

build_resnet_fpn_p3p7_backbone Not yet run
unverified (harvested, no recorded run)
DeLightCMU/MAL-inference/retinanet/backbones/backbone.py
code served (permissive licence) · get_code("81c87c9068bdbd50")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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
interpolate 38 other papers
9 dated earlier, 29 later
1703.06870 (2017-03)
Mask R-CNN
1803.03243 (2018-03)
Domain Adaptive Faster R-CNN for Object Detection in the Wild
1807.08865 (2018-07)
StereoNet: Guided Hierarchical Refinement for Real-Time Edge-Aware Depth Prediction
and 35 more not named here
smooth_l1_loss 16 other papers
4 dated earlier, 12 later
1703.06870 (2017-03)
Mask R-CNN
1903.00241 (2019-03)
Mask Scoring R-CNN
1904.01169 (2019-04)
Res2Net: A New Multi-scale Backbone Architecture
and 13 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

Classification and localization are two pillars of visual object detectors. However, in CNN-based detectors, these two modules are usually optimized under a fixed set of candidate (or anchor) bounding boxes. This configuration significantly limits the possibility to jointly optimize classification and localization. In this paper, we propose a Multiple Instance Learning (MIL) approach that selects anchors and jointly optimizes the two modules of a CNN-based object detector. Our approach, referred to as Multiple Anchor Learning (MAL), constructs anchor bags and selects the most representative anchors from each bag. Such an iterative selection process is potentially NP-hard to optimize. To address this issue, we solve MAL by repetitively depressing the confidence of selected anchors by perturbing their corresponding features. In an adversarial selection-depression manner, MAL not only pursues optimal solutions but also fully leverages multiple anchors/features to learn a detection model. Experiments show that MAL improves the baseline RetinaNet with significant margins on the commonly used MS-COCO object detection benchmark and achieves new state-of-the-art detection performance compared with recent methods.

For agents

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

get_harvested_code_for_paper("1912.02252")
get_code_for_paper("1912.02252")
have("1912.02252")

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

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

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

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

Connect an agent — have() is free.