跳转到内容

Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity

Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity

Section titled “Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity”

⚠️ AI 生成 · 建议对照原文 本页为自动整理的学习笔记;关键数据与引用如需引用,请回查 PDF / 官方版本。

学习档位 中文笔记

类型 文献 · 更新 2026-07-19

所属 模型部署与推理优化 · 端到端学习

中文学习笔记(自动生成,需核验)

Section titled “中文学习笔记(自动生成,需核验)”

Topic: foundations · Tier: recent · Year: 2021 · Venue:
Evidence level: partial · 本地全文: 是 · 建议阅读: ~45 分钟
Paper: https://arxiv.org/abs/2111.14330
Code:
Generator: grok

Sparse DETR针对DETR/Deformable DETR编码器在多尺度特征下token数量暴增导致的计算瓶颈,提出可学习的编码器token稀疏化,显著降低计算量同时保持或提升检测性能,是端到端检测器效率优化的代表性工作,适合学习query/key稀疏化、辅助损失与可学习选择机制。

通过可学习的解码器交叉注意力图(DAM)预测选择仅更新少量编码器token,并在其上施加辅助检测损失,使Sparse DETR在仅用10%编码器token时仍优于Deformable DETR,总计算量降低约38%、FPS提升约42%。

DETR因计算开销无法有效使用多尺度特征,小物体检测弱;Deformable DETR用可变形注意力实现线性复杂度并支持多尺度,但多尺度使编码器token数约增20倍,编码器注意力仍是瓶颈。自然图像中大量背景token冗余,需选择性更新对解码器有用的token以降低复杂度。

DETR端到端检测与Hungarian匹配损失;Transformer编码器-解码器与注意力机制;Deformable DETR的可变形注意力(key稀疏化);多尺度特征与特征金字塔;辅助损失与二部匹配;COCO目标检测基准基础。

  • 提出编码器token稀疏化方法,仅更新预期被解码器引用的token,降低编码器注意力复杂度,使能在同等计算预算下堆叠更多编码器层以提升性能。
  • 提出两种稀疏化标准:Objectness Score(OS)与Decoder cross-Attention Map(DAM);基于DAM的稀疏化模型在仅用全部token的10%时仍能保持检测性能。
  • 对选定token施加编码器辅助检测损失,稳定更深编码器训练并提升性能,训练时间仅轻微增加。

骨干网络提取特征xfeat → 打分网络g计算各token显著性(基于OS或DAM)→ 按保持比例ρ选取top-ρ%显著token集合Ωρs → 编码器层仅对Ωρs中token进行可变形自注意力+FFN更新(未选token原样传递,仍可作为key)→ 编码器输出后用辅助头选top-k作为解码器object queries → 解码器进行检测,全程用Hungarian损失;训练时用二值化DAM监督打分网络(BCE),并对选定编码器token加辅助检测头。

1)可学习打分网络(预测DAM或OS):DAM通过聚合解码器各层交叉注意力得到,二值化后作伪标签,BCE训练;OS用额外检测头+Hungarian损失得类别分数。取舍:DAM更显式对齐解码器需求,性能更优;OS简单但次优。2)编码器稀疏更新:仅更新选定query,未选token可作key,复杂度从O(NK)进一步降为O(SK)(S≪N)。3)编码器辅助损失:仅对稀疏token加检测头+Hungarian,缓解梯度消失、稳定深编码器。4)top-k解码器query选择。取舍:保留2D空间结构以兼容可变形注意力;稀疏化与辅助损失结合兼顾效率与性能。

主要在COCO 2017基准上验证;指标包括AP(及不同设置下的计算成本、FPS);对比基线为Deformable DETR,骨干含Swin-T等;保持比例ρ(如10%)控制稀疏度。具体超参与完整实验设置待来源核验。

在COCO上,Sparse DETR仅用10%编码器token时性能仍优于Deformable DETR;总计算成本降低38%,FPS提升42%。使用Swin-T骨干时:48.2 AP且总计算降低38%(对比基线48.0 AP),或49.2 AP且降低23%;10% token设置下编码器块计算约降82%。更细粒度消融与其他骨干结果待来源核验。

提取中未系统讨论失败场景与边界;依赖解码器交叉注意力质量(早期训练可能不准,但文中称经验上稳定);稀疏化主要针对编码器token(query侧),key侧依赖可变形注意力;与非可变形框架的集成及极端稀疏度下小物体/密集场景表现待来源核验。

与前序 / 同期 / 后续方法的关系

Section titled “与前序 / 同期 / 后续方法的关系”

前序:DETR(首个端到端Transformer检测器,密集注意力二次复杂度);Deformable DETR(可变形注意力key稀疏化,支持多尺度但token数大增)。同期/相关:DynamicViT/IA-RED2等输入依赖token稀疏化(多针对分类骨干);PnP-DETR(采样前景+压缩背景,但破坏2D结构难与可变形注意力结合)。Sparse DETR保留2D结构、兼容可变形注意力,并给选择网络显式目标(DAM/OS),区别于仅靠最终检测损失的方法。后续关系待来源核验。

官方代码:https://github.com/kakaobrain/sparse-detr。复现建议:基于Deformable DETR实现;注意打分网络、DAM构造(可变形情况下按offset累积注意力权重)、ρ选择、编码器辅助头仅作用于选定token、top-k query选择;使用COCO2017;关注不同ρ下AP与FLOPs/FPS权衡。完整训练脚本与环境待来源核验。

先读Abstract与Introduction(问题与动机)→ Preliminary(DETR/Deformable DETR回顾)→ Approach 3.2-3.3(稀疏化方案与OS/DAM标准)→ 3.4(辅助损失与top-k)→ Related Work(定位)→ 实验部分(结果,摘录中有限)→ 附录细节(DAM实现等,若可得)。重点精读Fig.1-3与公式(1)(2)。

  1. Q: Sparse DETR为何能进一步降低Deformable DETR的编码器复杂度? A: Deformable DETR已做key稀疏化(O(NK)),Sparse DETR再做query稀疏化,仅对选定S个显著token做注意力更新,复杂度变为O(SK)(S≪N),未选token仍可作key但自身不更新。
  2. Q: 两种显著性标准OS与DAM的区别是什么?哪种更优? A: OS用骨干特征上的额外检测头得objectness分数选top-ρ%;DAM聚合解码器交叉注意力图并二值化后监督打分网络。DAM更显式考虑解码器需求,经验上性能更好,即使10% token仍保持竞争力。
  3. Q: 编码器辅助损失如何施加?有何好处? A: 仅对选定(稀疏)编码器token加辅助检测头与Hungarian损失。好处:缓解深层梯度消失、稳定更深编码器训练、提升最终检测性能,且因token已稀疏,计算开销小。
  4. Q: 未选中的编码器token在前向中如何处理? A: 其值原样穿过编码器层不变(不经过自注意力与FFN更新),但仍可作为key被选定token引用,从而传递信息且节省计算。
  5. Q: 文中报告的关键效率-性能结果是什么? A: 仅用10%编码器token时仍优于Deformable DETR;总计算成本降38%、FPS升42%;Swin-T下可达48.2 AP(降38%)或49.2 AP(降23%),10%时编码器块计算约降82%。
  • Abstract (page 1): We validate that Sparse DETR achieves better performance than Deformable DETR even with only 10% encoder tokens on the COCO dataset. Albeit only the encoder tokens are sparsified, the total computation cost decreases by 38% and the frames per second (FPS) increases by 42% compared to Deformable DETR.
  • Introduction contributions (page 2): We propose encoder token sparsification method for an efficient end-to-end object detector, by which we lighten the attention complexity in the encoder. … We propose two novel sparsification criteria to sample the informative subset from the entire token set: Objectness Score (OS) and Decoder cross-Attention Map (DAM). Based on the decoder cross-attention map criterion, the sparsified model preserves detection performance even when using only 10% of the whole tokens. … We adopt an encoder auxiliary loss only for the selected tokens.
  • Introduction results (page 2): Sparse DETR using Swin-T backbone achieves 48.2 AP with 38% reduction of the entire computational cost compared to the 48.0 AP baseline and 49.2 AP with 23% reduction. In the case of the experiment that achieves 48.2 AP using only 10% of encoder tokens, the computational cost of the transformer encoder block is reduced by approximately 82%.
  • Section 3.2 Encoder Token Sparsification (page 4): the i-th encoder layer updates the features xi−1 by: (xji−1 if j ∉ Ωρs; LN(FFN(zji)+zji) if j ∈ Ωρs, where zji=LN(DefAttn(…)+…)). Even in the case of unselected tokens, the values are still passed through the encoder layer, so they can be referenced as keys…
  • Section 3.3 DAM (page 5): we binarize DAM so that the top-ρ% … of encoder tokens is only retained. … the network is trained by minimizing the binary cross entropy (BCE) loss between the binarized DAM and prediction: Ldam = −(1/N)∑ BCE(g(xfeat)i , DAMbin_i)
  • Section 3.4 Encoder Auxiliary Loss (page 6): applying an auxiliary detection head along with Hungarian loss on the selected tokens stabilizes the convergence of deeper encoders by alleviating the vanishing gradient issue and even improves the detection performance.
  • Abstract / Code (page 1): Code is available at https://github.com/kakaobrain/sparse-detr.
  • topic: foundations
  • sources: arxiv, openalex
  • retrieved_at: 2026-07-20
  • query: End-to-End Object Detection with Transformers DETR
  • arxiv: 2111.14330
  • doi: 10.48550/arxiv.2111.14330
  • score_total: 67
  • suggested_tier: recent

(no prose relevance explanation — numeric score only or HTTP source)

(no snippet evidence in candidate pool)

生成:2026-07-21 · 来源条数 2 · 模型 heuristic · 需人工核验数字

围绕「Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity」的核心问题与动机(待结合全文核验)。

  • 见原文方法章节;以下为基于摘要/摘录的要点提示。
  • Published as a conference paper at ICLR 2022 S PARSE DETR: E FFICIENT E ND - TO -E ND O BJECT D E - …

与相近工作的关系待核验;请对照 related work。

  • 勿仅凭摘要推断未给出的数值指标。
  1. 这篇工作的输入/输出表示是什么?(Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity)
  2. 训练目标与评测协议各是什么?
  3. 主要失败模式或局限是什么?
flowchart LR
A["输入 / 观测"] --> B["表示 / 编码"]
B --> C["推理 / 解码"]
C --> D["输出 / 动作或检测"]
%% method sketch for: Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity

方法结构示意(重绘;细节以原论文为准,待 PDF 核验)。

Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity arch p.3

来源:原论文约 p.3(arch);学习用途摘录。

Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity table p.7

来源:原论文约 p.7(table);学习用途摘录。

展开英文 Paper Card / AI deep analysis
Field Content
Year 2021
Authors Byungseok Roh, JaeWoong Shin, Wuhyun Shin, Saehoon Kim
arXiv 2111.14330
DOI 10.48550/arxiv.2111.14330
Topics foundations, deployment-inference, end-to-end-learning
Paper https://arxiv.org/abs/2111.14330
展开 Extract / Selections / Local assets
  • foundations: tier=recent rank=1 score=67 — auto refresh 2026-07-19 sources=arxiv,openalex
  • deployment-inference: tier=recent rank=5 score=51 — cross-topic assign from registry title match=1 keywords; 2026-07-19
  • end-to-end-learning: tier=watch rank=5 score=57 — cross-topic assign from registry title match=2 keywords; 2026-07-19
Published as a conference paper at ICLR 2022
S PARSE DETR: E FFICIENT E ND - TO -E ND O BJECT D E -
TECTION WITH L EARNABLE S PARSITY
Byungseok Roh1∗† , JaeWoong Shin2∗ ‡ , Wuhyun Shin1∗ , Saehoon Kim1
1
KakaoBrain
2
Lunit
{peter.roh,aiden.hsin,sam.kim}@kakaobrain.com
jwoong.shin@lunit.io
arXiv:2111.14330v2 [cs.CV] 4 Mar 2022
A BSTRACT
DETR is the first end-to-end object detector using a transformer encoder-decoder
architecture and demonstrates competitive performance but low computational
efficiency on high resolution feature maps. The subsequent work, Deformable
DETR, enhances the efficiency of DETR by replacing dense attention with de-
formable attention, which achieves 10× faster convergence and improved perfor-
mance. Deformable DETR uses the multiscale feature to ameliorate performance,
however, the number of encoder tokens increases by 20× compared to DETR, and
the computation cost of the encoder attention remains a bottleneck. In our prelim-
inary experiment, we observe that the detection performance hardly deteriorates
even if only a part of the encoder token is updated. Inspired by this observation,
we propose Sparse DETR that selectively updates only the tokens expected to
be referenced by the decoder, thus help the model effectively detect objects. In ad-