Recognition & Detection

DETR

A transformer-based object detector that predicts a fixed-size set of boxes in parallel and is trained with a one-to-one Hungarian matching loss, so it needs neither anchors nor non-maximum suppression.

advanced

DETR (DEtection TRansformer) is an object detector that treats detection as direct set prediction. Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov and Sergey Zagoruyko of Facebook AI introduced it at ECCV 2020. A convolutional backbone extracts image features, and a transformer encoder–decoder turns them and a fixed set of learned object queries into predictions in one parallel pass, each either a class with a box or “no object”. Training matches predictions one-to-one to the ground-truth objects with the Hungarian algorithm, so DETR needs no anchor boxes and no non-maximum suppression.

Problem Addressed

A detector’s output is a set of boxes and labels. Carion et al. point out that earlier detectors reach it indirectly: they predict relative to proposals, anchors or candidate centers, assign ground truth to these with hand-designed rules, and remove near-duplicates with non-maximum suppression, so accuracy depends on how these pieces are tuned. The closest earlier set-prediction models used bipartite matching losses but decoded objects one at a time with recurrent networks and, the authors note, were not evaluated against modern baselines. DETR pairs the matching loss with a transformer that decodes all objects in parallel.

Architecture

DETR consists of a CNN backbone, a transformer encoder–decoder and shared prediction heads, built from standard components without custom layers.

Backbone

An ImageNet-pretrained ResNet-50 or ResNet-101 maps the image to its last-stage (C5) feature map, typically 2,048 channels at 1/32 of the input resolution. The DC5 variants dilate the last stage and remove one stride, doubling the resolution; the authors report 16 times the cost in the encoder’s self-attention and about twice the cost overall.

Transformer Encoder

A 1×11 \times 1 convolution reduces the channels to d=256d = 256, and the H×WH \times W positions are flattened into HWHW tokens. Each of the 6 encoder layers has 8-head self-attention and a feed-forward network (width 2,048 in the official code), each in a residual connection with layer normalization. Fixed 2D sine positional encodings, d/2d/2 channels for the row and d/2d/2 for the column, are added to the queries and keys of every attention layer rather than once at the input.

Transformer Decoder and Object Queries

The 6 decoder layers apply self-attention among NN object slots, cross-attention from the slots to the encoded image, and a feed-forward network. Unlike the original transformer, the decoder is not autoregressive: all NN outputs are decoded in parallel. Because the decoder is permutation-equivariant, its inputs must differ, so NN learned embeddings, the object queries, are added at every attention layer while the content input starts at zero. The appendix of the arXiv version states that all models use N=100N = 100, well above the number of objects in a typical image. Self-attention among the slots lets each prediction take the others into account, which the authors credit for suppressing duplicates.

Prediction Heads

Shared heads turn each decoder output into a prediction. A three-layer perceptron predicts a box b^=(cx,cy,w,h)∈[0,1]4\hat{b} = (c_x, c_y, w, h) \in [0, 1]^4 normalized by the image size, directly rather than as an offset from an anchor. A linear layer with softmax predicts K+1K + 1 class probabilities; the extra class ∅\varnothing (“no object”) plays the role of the background class in other detectors. With a ResNet-50, the model has 41.3M parameters, 23.5M in the backbone and 17.8M in the transformer.

Training

Set Matching

Let yy be the ground-truth set padded with ∅\varnothing to size NN, with elements yi=(ci,bi)y_i = (c_i, b_i), and y^={y^i}i=1N\hat{y} = \{\hat{y}_i\}_{i=1}^{N} the predictions. Training first finds the permutation of slots with the lowest matching cost, using the Hungarian algorithm:

σ^=arg⁡min⁡σ∈SN∑i=1NLmatch(yi,y^σ(i)),Lmatch=−1{ci≠∅} p^σ(i)(ci)+1{ci≠∅} Lbox(bi,b^σ(i)).\hat{\sigma} = \underset{\sigma \in \mathfrak{S}_N}{\arg\min} \sum_{i=1}^{N} \mathcal{L}_{\text{match}}\big(y_i, \hat{y}_{\sigma(i)}\big), \qquad \mathcal{L}_{\text{match}} = -\mathbf{1}_{\{c_i \neq \varnothing\}}\, \hat{p}_{\sigma(i)}(c_i) + \mathbf{1}_{\{c_i \neq \varnothing\}}\, \mathcal{L}_{\text{box}}\big(b_i, \hat{b}_{\sigma(i)}\big).

Pairing a slot with ∅\varnothing costs nothing, so in practice this is a rectangular assignment between NN slots and the MM objects. Probabilities rather than log-probabilities keep the class term commensurate with the box term, which the authors found worked better. The matching plays the role of the rules that assign anchors or proposals to ground truth in other detectors, except that it is one-to-one.

Hungarian Loss

Given the matching, the loss is

LHungarian(y,y^)=∑i=1N[−log⁡p^σ^(i)(ci)+1{ci≠∅} Lbox(bi,b^σ^(i))],Lbox=λiou(1−GIoU⁡)+λL1∥bi−b^σ^(i)∥1.\mathcal{L}_{\text{Hungarian}}(y, \hat{y}) = \sum_{i=1}^{N} \Big[ -\log \hat{p}_{\hat{\sigma}(i)}(c_i) + \mathbf{1}_{\{c_i \neq \varnothing\}}\, \mathcal{L}_{\text{box}}\big(b_i, \hat{b}_{\hat{\sigma}(i)}\big) \Big], \qquad \mathcal{L}_{\text{box}} = \lambda_{\text{iou}} \big(1 - \operatorname{GIoU}\big) + \lambda_{L1} \lVert b_i - \hat{b}_{\hat{\sigma}(i)} \rVert_1 .

The log-probability term is down-weighted by a factor of 10 for ∅\varnothing targets, to offset the many empty slots, much as Faster R-CNN subsamples negative proposals. Because an ℓ1\ell_1 error has a different meaning for small and large boxes, it is combined with the scale-invariant generalized IoU loss (see intersection over union). The arXiv version gives λL1=5\lambda_{L1} = 5 and λiou=2\lambda_{\text{iou}} = 2 in its appendix and adds a loss ablation: GIoU alone lost only 0.7 AP against the combination, and ℓ1\ell_1 alone 4.8 AP. Box losses are normalized by the number of objects in the batch.

Auxiliary losses. The shared heads are also applied, after a shared layer normalization, to the output of every decoder layer, each with its own Hungarian loss; the authors found this helped the model output the right number of objects per class.

Procedure

DETR was trained on COCO 2017 with AdamW (learning rate 10−410^{-4} for the transformer, 10−510^{-5} for the backbone, weight decay 10−410^{-4}), dropout 0.1 and frozen batch normalization in the backbone, with multi-scale resizing (shorter side 480–800 pixels) and random crops; the arXiv appendix adds gradient clipping at norm 0.1. Ablation models were trained for 300 epochs, 3 days on 16 V100 GPUs; the models compared with Faster R-CNN for 500 epochs, which added 1.5 AP.

Example: Matching on a Synthetic Image

The script below follows DETR’s matcher and loss. A 96×12896 \times 128 image contains a square, a disk and a bar, whose ground-truth boxes are read from the image. Eight slots carry probabilities over the three classes and ∅\varnothing, and normalized boxes; slot 4 is a second, slightly worse detection of the square. The matching cost uses the weights of the official code, −p+5 ℓ1−2 GIoU⁡-p + 5\,\ell_1 - 2\,\operatorname{GIoU}; using −GIoU⁡-\operatorname{GIoU} instead of 1−GIoU⁡1 - \operatorname{GIoU} only adds a constant and does not change the assignment. As in the official code, the classification loss is a weighted mean over all slots with weight 0.1 for ∅\varnothing.

import numpy as np
from scipy.optimize import linear_sum_assignment

# A synthetic 96 x 128 grayscale image with three objects of three classes.
H, W = 96, 128
yy, xx = np.mgrid[:H, :W]
image = np.zeros((H, W))
image[(yy >= 20) & (yy < 50) & (xx >= 12) & (xx < 42)] = 0.9      # square
image[(yy - 60) ** 2 + (xx - 70) ** 2 < 15 ** 2] = 0.6             # disk
image[(yy >= 15) & (yy < 25) & (xx >= 80) & (xx < 120)] = 0.3      # bar
CLASSES = ["square", "disk", "bar", "no object"]
labels = np.array([0, 1, 2])
masks = [image == v for v in (0.9, 0.6, 0.3)]                      # one object per intensity

def box_from_mask(m):
    """Normalized (cx, cy, w, h) of the tightest box around a mask, as DETR's targets are."""
    ys, xs = np.nonzero(m)
    x0, x1, y0, y1 = xs.min(), xs.max() + 1, ys.min(), ys.max() + 1
    return np.array([(x0 + x1) / 2 / W, (y0 + y1) / 2 / H, (x1 - x0) / W, (y1 - y0) / H])

gt_boxes = np.array([box_from_mask(m) for m in masks])

# N = 8 prediction slots: probabilities over [square, disk, bar, no object] and boxes.
probs = np.array([
    [0.05, 0.05, 0.05, 0.85],
    [0.05, 0.80, 0.05, 0.10],   # the disk
    [0.10, 0.05, 0.05, 0.80],
    [0.85, 0.03, 0.02, 0.10],   # the square
    [0.70, 0.05, 0.05, 0.20],   # a second, slightly worse box on the square
    [0.10, 0.05, 0.60, 0.25],   # the bar
    [0.05, 0.10, 0.05, 0.80],
    [0.10, 0.10, 0.10, 0.70],
])
pred_boxes = np.array([
    [0.80, 0.80, 0.20, 0.20],
    [0.55, 0.63, 0.25, 0.30],
    [0.20, 0.85, 0.30, 0.20],
    [0.21, 0.36, 0.24, 0.32],
    [0.24, 0.40, 0.22, 0.28],
    [0.78, 0.21, 0.30, 0.12],
    [0.50, 0.15, 0.40, 0.25],
    [0.90, 0.30, 0.15, 0.30],
])

def to_corners(b):
    return np.stack([b[..., 0] - b[..., 2] / 2, b[..., 1] - b[..., 3] / 2,
                     b[..., 0] + b[..., 2] / 2, b[..., 1] + b[..., 3] / 2], axis=-1)

def giou(a, b):
    """Generalized IoU between every box in a (n, 4) and every box in b (m, 4), cxcywh format."""
    a, b = to_corners(a)[:, None], to_corners(b)[None]
    area = lambda c: (c[..., 2] - c[..., 0]) * (c[..., 3] - c[..., 1])
    iw = np.clip(np.minimum(a[..., 2], b[..., 2]) - np.maximum(a[..., 0], b[..., 0]), 0, None)
    ih = np.clip(np.minimum(a[..., 3], b[..., 3]) - np.maximum(a[..., 1], b[..., 1]), 0, None)
    inter = iw * ih
    union = area(a) + area(b) - inter
    enclose = ((np.maximum(a[..., 2], b[..., 2]) - np.minimum(a[..., 0], b[..., 0]))
               * (np.maximum(a[..., 3], b[..., 3]) - np.minimum(a[..., 1], b[..., 1])))
    return inter / union - (enclose - union) / enclose

# Matching cost, N x M: -p(class) + 5 * L1 + 2 * (-GIoU), as in the official DETR code.
l1 = np.abs(pred_boxes[:, None] - gt_boxes[None]).sum(-1)
cost = -probs[:, labels] + 5 * l1 - 2 * giou(pred_boxes, gt_boxes)
np.set_printoptions(precision=2, suppress=True)
print("GT boxes (cx, cy, w, h):\n", gt_boxes)
print("matching cost (rows: slots, columns: square, disk, bar):\n", cost)

slots, objs = linear_sum_assignment(cost)
target = np.full(len(probs), 3)          # every slot defaults to "no object"
target[slots] = labels[objs]
weight = np.where(target == 3, 0.1, 1.0)
for s in range(len(probs)):
    p_t = probs[s, target[s]]
    print(f"slot {s}: target {CLASSES[target[s]]:9s}  p(target) {p_t:.2f}  "
          f"weighted -log p {weight[s] * -np.log(p_t):.3f}")

def detr_loss(probs, pred_boxes, eos_coef=0.1):
    """Hungarian loss: match, then weighted cross-entropy + 5 * L1 + 2 * (1 - GIoU)."""
    l1 = np.abs(pred_boxes[:, None] - gt_boxes[None]).sum(-1)
    s, o = linear_sum_assignment(-probs[:, labels] + 5 * l1 - 2 * giou(pred_boxes, gt_boxes))
    t = np.full(len(probs), 3)
    t[s] = labels[o]
    w = np.where(t == 3, eos_coef, 1.0)       # "no object" targets weighted by 0.1
    ce = (w * -np.log(probs[np.arange(len(probs)), t])).sum() / w.sum()
    n = len(gt_boxes)
    loss_l1 = l1[s, o].sum() / n
    loss_giou = (1 - np.diag(giou(pred_boxes[s], gt_boxes[o]))).sum() / n
    return ce, loss_l1, loss_giou, ce + 5 * loss_l1 + 2 * loss_giou

ce, ll1, lg, total = detr_loss(probs, pred_boxes)
print(f"CE {ce:.3f}  L1 {ll1:.3f}  GIoU {lg:.3f}  total {total:.3f}")

# The same predictions in a different slot order give the same loss.
perm = np.random.default_rng(0).permutation(len(probs))
print(f"slots shuffled: total {detr_loss(probs[perm], pred_boxes[perm])[3]:.3f}")

# Slot 4 is a duplicate: it is trained toward "no object". If it predicts that, the loss falls.
fixed = probs.copy()
fixed[4] = [0.05, 0.03, 0.02, 0.90]
print(f"slot 4 predicts no object: CE {detr_loss(fixed, pred_boxes)[0]:.3f}  "
      f"total {detr_loss(fixed, pred_boxes)[3]:.3f}")
GT boxes (cx, cy, w, h):
 [[0.21 0.36 0.23 0.31]
 [0.55 0.63 0.23 0.3 ]
 [0.78 0.21 0.31 0.1 ]]
matching cost (rows: slots, columns: square, disk, bar):
 [[ 7.4   3.57  5.42]
 [ 4.22 -2.47  5.83]
 [ 4.07  4.79  8.34]
 [-2.65  4.31  6.33]
 [-1.34  3.86  6.35]
 [ 6.1   5.8  -2.11]
 [ 4.45  4.57  3.12]
 [ 5.43  5.02  3.13]]
slot 0: target no object  p(target) 0.85  weighted -log p 0.016
slot 1: target disk       p(target) 0.80  weighted -log p 0.223
slot 2: target no object  p(target) 0.80  weighted -log p 0.022
slot 3: target square     p(target) 0.85  weighted -log p 0.163
slot 4: target no object  p(target) 0.20  weighted -log p 0.161
slot 5: target bar        p(target) 0.60  weighted -log p 0.511
slot 6: target no object  p(target) 0.80  weighted -log p 0.022
slot 7: target no object  p(target) 0.70  weighted -log p 0.036
CE 0.330  L1 0.025  GIoU 0.106  total 0.670
slots shuffled: total 0.670
slot 4 predicts no object: CE 0.287  total 0.627

Slots 3, 1 and 5 have the lowest costs for the square, disk and bar, and the assignment pairs them. Slot 4 also fits the square (cost −1.34-1.34), but each object is matched only once, so its target is ∅\varnothing: it counts as a false positive and is pushed toward “no object”, contributing 0.161 to the weighted sum of cross-entropy terms. When it predicts ∅\varnothing with probability 0.9, the total loss falls from 0.670 to 0.627. A detector trained with one-to-many assignment would treat both slots as positives and need NMS at test time. Shuffling the slots leaves the loss unchanged, which is what allows parallel decoding.

Inference

One forward pass yields all 100 predictions, with no anchor decoding or NMS. Slots whose most likely class is ∅\varnothing predict nothing; to maximize AP, the authors instead report their second most likely class, which raised AP by 2 points. Applying standard NMS after each decoder layer helped the first layer, which cannot yet compare slots and produces duplicates, but lowered AP after the last layers by removing true positives. Detections are capped at NN; on a synthetic grid of up to 100 copies of one object (arXiv appendix), the model found all instances up to 50, but only about 30 when all 100 were present. The authors measured 28 frames per second with TorchScript for DETR with a ResNet-50 (86 GFLOPs), against 26 for Faster R-CNN with a feature pyramid network (FPN, 180 GFLOPs).

Performance

The authors compared DETR on COCO val2017 with Detectron2 Faster R-CNN baselines retrained with GIoU loss, the same crops and a 9× schedule (about 109 epochs), marked “+” (Carion et al., 2020, Table 1):

Model Backbone GFLOPs/FPS Params AP AP50_{50} APS_S APM_M APL_L
Faster R-CNN-FPN+ ResNet-50 180/26 42M 42.0 62.1 26.6 45.4 53.4
Faster R-CNN-FPN+ ResNet-101 246/20 60M 44.0 63.9 27.2 48.1 56.0
DETR ResNet-50 86/28 41M 42.0 62.4 20.5 45.8 61.1
DETR-DC5 ResNet-50 187/12 41M 43.3 63.1 22.5 47.3 61.1
DETR ResNet-101 152/20 60M 43.5 63.8 21.9 48.0 61.8
DETR-DC5 ResNet-101 253/10 60M 44.9 64.7 23.7 49.5 62.3

With a ResNet-50, DETR matched the enhanced Faster R-CNN in AP with 7.7 points more on large objects and 6.1 fewer on small ones (the paper’s text gives +7.8 and −5.5); the authors attribute the large-object gain to the transformer’s global computation. Removing the encoder cost 3.9 AP, 6.0 on large objects. For panoptic segmentation, DETR with a ResNet-50 reached 43.4 PQ on COCO val against 42.4 for a retrained Panoptic FPN, ahead on stuff classes (36.3 against 32.3) but 6.6 points lower in mask AP on things.

Strengths

  • A simpler pipeline: no anchors, assignment heuristics or NMS threshold.
  • Global context from encoder self-attention, which helps on large objects.
  • Extensibility to panoptic segmentation with a mask head.

Limitations

  • Long training. The main models need 500 epochs; Zhu et al. (2021) measured about 2,000 GPU hours for DETR against 380 for Faster R-CNN with FPN. Li et al. (2022) trace part of the slow convergence to unstable matching early in training, when a slot is matched to different objects in different epochs.
  • Small objects. DETR uses only stride-32 features. Encoder self-attention costs O(d2HW+d(HW)2)O(d^2 HW + d(HW)^2), and Zhu et al. (2021) note that this makes high-resolution feature maps too costly for it; even the DC5 models trail Faster R-CNN on APS_S.
  • A fixed maximum of NN detections per image.

Historical Importance

DETR showed in 2020 that a set loss with learned object queries, without hand-designed duplicate removal, could match a tuned Faster R-CNN on COCO; Zhu et al. (2021) call it the first fully end-to-end object detector. Its authors named training and small objects as open problems; the successors below address these while keeping set prediction and one-to-one matching.

Variants

  • Panoptic DETR (Carion et al., 2020). A mask head predicts a mask for each decoder output and merges them by a pixel-wise argmax, so masks cannot overlap; “stuff” and “thing” classes are handled alike.
  • Deformable DETR (Zhu et al., 2021). Each attention query samples a few points around a reference location across several feature scales. After 50 epochs it reached 43.8 AP (26.4 APS_S) on COCO val2017, against 43.3 (22.5) for DETR-DC5 after 500.
  • Conditional DETR (Meng et al., 2021). A conditional spatial query lets each cross-attention head focus on a distinct region of the object; the authors report 6.7 times faster convergence with ResNet-50 and ResNet-101 and 10 times with the DC5 backbones.
  • DAB-DETR (Liu et al., 2022). Uses box coordinates as queries and refines them layer by layer, like dynamically updated anchor boxes.
  • DN-DETR (Li et al., 2022). Feeds noised ground-truth boxes to the decoder and trains it to reconstruct them, to stabilize matching; applied to Deformable DETR with a ResNet-50 it reached 48.6 AP after 50 epochs.
  • DINO (Zhang et al., 2023). Adds contrastive denoising, mixed query selection and “look forward twice” box refinement; the authors report 49.4 AP after 12 epochs with a ResNet-50 and multi-scale features.
  • RT-DETR (Zhao et al., 2024). A real-time design with an efficient multi-scale encoder: 53.1 AP on COCO val2017 at 108 FPS on a T4 GPU (TensorRT, FP16) with a ResNet-50, without NMS.

Implementations

The official PyTorch code, facebookresearch/detr, is released under the Apache 2.0 license with pretrained models loadable through torch.hub; the repository is archived. The sketch below assembles the architecture from PyTorch modules (run with PyTorch 2.14.1), with a random tensor standing in for the ResNet-50 C5 features of an 800×1088800 \times 1088 image. Unlike DETR, the sketch adds the positional encodings once at the input and feeds the object queries in as the decoder input, since nn.Transformer takes no positional encodings; the shapes are the same.

import math
import torch
from torch import nn

print(f"torch {torch.__version__}")
torch.manual_seed(0)
d, n_queries, n_classes = 256, 100, 91          # COCO category ids go up to 90

def sine_positions(h, w, d):
    """2D sine encoding: d/2 channels for y, d/2 for x, as in DETR's PositionEmbeddingSine."""
    y = torch.arange(1, h + 1, dtype=torch.float32)[:, None].expand(h, w) / h * 2 * math.pi
    x = torch.arange(1, w + 1, dtype=torch.float32)[None, :].expand(h, w) / w * 2 * math.pi
    i = torch.arange(d // 2)
    freq = 10000 ** (2 * (i // 2) / (d // 2))
    def enc(t):
        t = t[..., None] / freq
        return torch.stack((t[..., 0::2].sin(), t[..., 1::2].cos()), dim=-1).flatten(-2)
    return torch.cat((enc(y), enc(x)), dim=-1).flatten(0, 1)        # (h*w, d)

# Stand-in for ResNet-50 C5 features of an 800 x 1088 image: 2048 channels at stride 32.
c5 = torch.randn(1, 2048, 800 // 32, 1088 // 32)

input_proj = nn.Conv2d(2048, d, kernel_size=1)
transformer = nn.Transformer(d_model=d, nhead=8, num_encoder_layers=6, num_decoder_layers=6,
                             dim_feedforward=2048, dropout=0.1, batch_first=True)
query_embed = nn.Embedding(n_queries, d)                          # learned object queries
class_head = nn.Linear(d, n_classes + 1)                          # + "no object"
box_head = nn.Sequential(nn.Linear(d, d), nn.ReLU(), nn.Linear(d, d), nn.ReLU(), nn.Linear(d, 4))

z = input_proj(c5)                                                # (1, 256, 25, 34)
tokens = z.flatten(2).transpose(1, 2)                             # (1, 850, 256)
tokens = tokens + sine_positions(z.shape[2], z.shape[3], d)
queries = query_embed.weight.unsqueeze(0)                         # (1, 100, 256)
transformer.eval()
with torch.no_grad():
    hs = transformer(tokens, queries)                             # (1, 100, 256)
    logits, boxes = class_head(hs), box_head(hs).sigmoid()

print("C5 features   ", tuple(c5.shape))
print("encoder tokens", tuple(tokens.shape))
print("decoder output", tuple(hs.shape))
print("class logits  ", tuple(logits.shape))
print("boxes (cxcywh)", tuple(boxes.shape))
n = lambda *ms: sum(p.numel() for m in ms for p in m.parameters())
print(f"parameters: transformer {n(transformer):,}, "
      f"with projection, queries and heads {n(transformer, input_proj, query_embed, class_head, box_head):,}")
torch 2.14.1
C5 features    (1, 2048, 25, 34)
encoder tokens (1, 850, 256)
decoder output (1, 100, 256)
class logits   (1, 100, 92)
boxes (cxcywh) (1, 100, 4)
parameters: transformer 17,363,968, with projection, queries and heads 18,070,368

The 850 encoder tokens are the 25×3425 \times 34 feature-map positions; each of the 100 query outputs becomes 92 class logits (91 COCO category ids plus ∅\varnothing, as in the official code) and a normalized box.

Related

  • Hungarian Algorithm

    An algorithm that finds the minimum-cost one-to-one matching between two sets, used in computer vision to match detections to tracks and predictions to ground truth.

  • Non-Maximum Suppression

    The post-processing step that removes duplicate detections by repeatedly keeping the highest-scoring box and discarding the boxes that overlap it beyond an IoU threshold, with its soft, distance-aware and learned variants.

  • Anchor Boxes

    Reference boxes of fixed sizes and aspect ratios, tiled at every feature-map position, that a detector classifies and refines, and that decide which of its predictions are trained on which objects.

  • Faster R-CNN

    A two-stage object detector in which a region proposal network, sharing the detector's convolutional features, replaces hand-designed region proposals, making proposal generation nearly free and the whole detector one network.

  • COCO

    Microsoft's Common Objects in Context, a dataset of everyday scenes with per-instance segmentation masks for 80 object categories, plus keypoints, captions, stuff and panoptic labels, whose evaluation protocol became the standard benchmark for object detection.

  • Self-Attention

    An operation in which every token of a set, such as the patches of an image, computes its output as a weighted average of all tokens, with weights given by a softmax over scaled dot products between learned queries and keys.

References

  1. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A. & Zagoruyko, S. (2020). End-to-End Object Detection with Transformers. European Conference on Computer Vision (ECCV), Lecture Notes in Computer Science, 213–229.
  2. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A. & Zagoruyko, S. (2020). End-to-End Object Detection with Transformers. arXiv:2005.12872 (v3, with appendix).
  3. Rezatofighi, H., Tsoi, N., Gwak, J., Sadeghian, A., Reid, I. & Savarese, S. (2019). Generalized Intersection over Union: A Metric and a Loss for Bounding Box Regression. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 658–666.
  4. Zhu, X., Su, W., Lu, L., Li, B., Wang, X. & Dai, J. (2021). Deformable DETR: Deformable Transformers for End-to-End Object Detection. International Conference on Learning Representations (ICLR). arXiv:2010.04159.
  5. Meng, D., Chen, X., Fan, Z., Zeng, G., Li, H., Yuan, Y., Sun, L. & Wang, J. (2021). Conditional DETR for Fast Training Convergence. Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 3631–3640.
  6. Liu, S., Li, F., Zhang, H., Yang, X., Qi, X., Su, H., Zhu, J. & Zhang, L. (2022). DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR. International Conference on Learning Representations (ICLR). arXiv:2201.12329.
  7. Li, F., Zhang, H., Liu, S., Guo, J., Ni, L. M. & Zhang, L. (2022). DN-DETR: Accelerate DETR Training by Introducing Query DeNoising. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 13609–13617.
  8. Zhang, H., Li, F., Liu, S., Zhang, L., Su, H., Zhu, J., Ni, L. M. & Shum, H.-Y. (2023). DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection. International Conference on Learning Representations (ICLR). arXiv:2203.03605.
  9. Zhao, Y., Lv, W., Xu, S., Wei, J., Wang, G., Dang, Q., Liu, Y. & Chen, J. (2024). DETRs Beat YOLOs on Real-time Object Detection. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 16965–16974.