SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.03989 · CVPR · 2024

MS-DETR: Efficient DETR Training with Mixed Supervision

Yi Yang, Errui Ding, Jingdong Wang, Wenhao Wang, Yifan Sun, Qiang Chen, Chuyang Zhao

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 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/2401.03989.json · badge: /api/ran/2401.03989.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
atten4vis/ms-detr canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
Atten4Vis/MS-DETR community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_to_xywh Ran
ran, honoured the contract we drafted
atten4vis/ms-detr/datasets/coco_eval.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yuhangzang/contextdet, is pointer only (licence: NOASSERTION) · get_code("f31a58bf6457ced5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from yuhangzang/contextdet, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

dice_loss Ran
ran, violated the contract we drafted
atten4vis/ms-detr/models/segmentation.py
code served (permissive licence) · get_code("ac8fe530cdad4d8c")
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
import torch.nn as nn

torch.manual_seed(0)

# Create sample inputs and targets tensors
# The function expects tensors that can be flattened and have sigmoid applied
# Shape: batch_size=2, spatial_dims flattened to create predictions
batch_size = 2
num_spatial = 4

# inputs: predictions before sigmoid, shape (batch_size, num_spatial)
inputs = torch.randn(batch_size, num_spatial)

# targets: binary labels matching inputs shape, values 0 or 1
targets = torch.randint(0, 2, (batch_size, num_spatial), dtype=torch.float32)

# num_boxes: number of boxes for normalization
num_boxes = 2

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "num_boxes": num_boxes,
}
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
evaluate Ran
ran; our contract draft was wrong, not the code
atten4vis/ms-detr/datasets/coco_eval.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yuhangzang/contextdet, is pointer only (licence: NOASSERTION) · get_code("fe0ddcc2d420c9a0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from yuhangzang/contextdet, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

measure_average_inference_time Ran
ran; our contract draft was wrong, not the code
atten4vis/ms-detr/benchmark.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from CAMMA-public/OR_anonymization, is pointer only (licence: NOASSERTION) · get_code("3e5d34f155e97585")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from CAMMA-public/OR_anonymization, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

nonzero_tuple Ran
ran; our contract draft was wrong, not the code
atten4vis/ms-detr/models/matcher_o2m.py
code served (permissive licence) · get_code("d28e238107e0aa1b")
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 tuple, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 a small tensor with some zero and non-zero values
# Using a 2D tensor to test the function's handling of different dimensions
x = torch.tensor([
    [1, 0, 2],
    [0, 3, 0],
    [4, 0, 5]
], dtype=torch.float32)

ARGS = {
    "x": x
}
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 tuple, ndim 2, dtype family int — a tuple output has no array shape of its own; none is stated
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
sample_topk_per_gt Ran
ran; our contract draft was wrong, not the code
atten4vis/ms-detr/models/matcher_o2m.py
code served (permissive licence) · get_code("0860cd732b6fa70d")
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 tuple, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# pr_inds: tensor of shape (M,) - prediction indices
# gt_inds: tensor of shape (M,) - ground truth indices
# cost_matrix: tensor of shape (num_targets, num_queries)
# k: number of top-k samples per ground truth

# Create small example tensors
num_targets = 3
num_queries = 4
M = 5
k = 2

# pr_inds: indices into queries, shape (M,)
pr_inds = torch.tensor([0, 1, 2, 3, 1])

# gt_inds: indices into targets, shape (M,)
gt_inds = torch.tensor([0, 0, 1, 2, 1])

# cost_matrix: shape (num_targets, num_queries)
# Each row represents costs for a target against all queries
cost_matrix = torch.randn(num_targets, num_queries)

ARGS = {
    "pr_inds": pr_inds,
    "gt_inds": gt_inds,
    "cost_matrix": cost_matrix,
    "k": k,
}
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 tuple, ndim 2, dtype family int — a tuple output has no array shape of its own; none is stated
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
sigmoid_focal_loss Ran
ran; our contract draft was wrong, not the code
atten4vis/ms-detr/models/segmentation.py
code served (permissive licence) · get_code("5c0711aada67957e")
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) 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: predictions (logits) - shape (2, 4) for batch_size=2, num_predictions=4
inputs = torch.randn(2, 4, requires_grad=True)

# targets: binary labels - shape (2, 4) matching inputs
targets = torch.randint(0, 2, (2, 4), dtype=torch.float32)

# num_boxes: number of boxes for normalization
num_boxes = 2

# alpha and gamma are already float parameters with defaults
alpha = 0.25
gamma = 2.0

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "num_boxes": num_boxes,
    "alpha": alpha,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
subsample_labels Ran
ran; our contract draft was wrong, not the code
atten4vis/ms-detr/models/matcher_o2m.py
code served (permissive licence) · get_code("19a04bf3d341cedb")
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 tuple, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 a labels tensor with a mix of:
# -1 (ignore), bg_label (0, background/negative), and positive classes (1, 2)
labels = torch.tensor([-1, 0, 1, 2, 0, 1, -1, 0], dtype=torch.long)

ARGS = {
    "labels": labels,
    "num_samples": 4,
    "positive_fraction": 0.5,
    "bg_label": 0,
}
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 tuple, ndim 2, dtype family int — a tuple output has no array shape of its own; none is stated
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
DeformableDETR Not yet run
unverified (harvested, no recorded run)
Atten4Vis/MS-DETR/models/deformable_detr.py
code served (permissive licence) · get_code("e4520db8ba29f9f4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 7 later) and 2 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
sigmoid_focal_loss 56 other papers
39 dated earlier, 1 the same month, 16 later · 1 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 53 more not named here
dice_loss 40 other papers
27 dated earlier, 13 later · 1 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.12115 (2021-03)
End-to-End Trainable Multi-Instance Pose Estimation with Transformers
and 37 more not named here
convert_to_xywh 24 other papers
17 dated earlier, 1 the same month, 5 later, 1 same year, order not determinable
1512.02325 (2015-12)
SSD: Single Shot MultiBox Detector
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 21 more not named here
evaluate 23 other papers
16 dated earlier, 1 the same month, 5 later, 1 same year, order not determinable
1512.02325 (2015-12)
SSD: Single Shot MultiBox Detector
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 20 more not named here
measure_average_inference_time 10 other papers
8 dated earlier, 1 later, 1 same year, order not determinable
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2106.04550 (2021-06)
DETReg: Unsupervised Pretraining with Region Priors for Object Detection
and 7 more not named here
nonzero_tuple 2 other papers
1 dated earlier, 1 later
2203.15175 (2022-03)
Unified Transformer Tracker for Object Tracking
2504.13181 (2025-04)
Perception Encoder: The best visual embeddings are not at the output of the network
subsample_labels 1 other paper
1 later
2504.13181 (2025-04)
Perception Encoder: The best visual embeddings are not at the output of the network

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

DETR accomplishes end-to-end object detection through iteratively generating multiple object candidates based on image features and promoting one candidate for each ground-truth object. The traditional training procedure using one-to-one supervision in the original DETR lacks direct supervision for the object detection candidates. We aim at improving the DETR training efficiency by explicitly supervising the candidate generation procedure through mixing one-to-one supervision and one-to-many supervision. Our approach, namely MS-DETR, is simple, and places one-to-many supervision to the object queries of the primary decoder that is used for inference. In comparison to existing DETR variants with one-to-many supervision, such as Group DETR and Hybrid DETR, our approach does not need additional decoder branches or object queries; the object queries of the primary decoder in our approach directly benefit from one-to-many supervision and thus are superior in object candidate prediction. Experimental results show that our approach outperforms related DETR variants, such as DN-DETR, Hybrid DETR, and Group DETR, and the combination with related DETR variants further improves the performance. Code is available at: https://github.com/Atten4Vis/MS-DETR.

For agents

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

get_harvested_code_for_paper("2401.03989")
get_code_for_paper("2401.03989")
have("2401.03989")

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

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

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

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

Connect an agent — have() is free.