Papers › LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection

LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection

5 Jun 2024arXiv:2406.03459archive 2025-07-28

Qiang Chen, Xiangbo Su, Xinyu Zhang, Jian Wang, Jiahui Chen, Yunpeng Shen, Chuchu Han, Ziliang Chen, Weixiang Xu, Fanrong Li, Shan Zhang, Kun Yao, Errui Ding, Gang Zhang, Jingdong Wang

In this paper, we present a light-weight detection transformer, LW-DETR, which outperforms YOLOs for real-time object detection. The architecture is a simple stack of a ViT encoder, a projector, and a shallow DETR decoder. Our approach leverages recent advanced techniques, such as training-effective techniques, e.g., improved loss and pretraining, and interleaved window and global attentions for reducing the ViT encoder complexity. We improve the ViT encoder by aggregating multi-level feature maps, and the intermediate and final feature maps in the ViT encoder, forming richer feature maps, and introduce window-major feature map organization for improving the efficiency of interleaved attention computation. Experimental results demonstrate that the proposed approach is superior over existing real-time detectors, e.g., YOLO and its variants, on COCO and other benchmark datasets. Code and models are available at (https://github.com/Atten4Vis/LW-DETR).

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.03459")

Code

Syntology Ran 13 of 16 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · our draft was wrong; 10 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

atten4vis/lw-detr officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
roboflow/rf-detr mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 13 ran; 1 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
2ran · our draft was wrong
10ran
3unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from atten4vis/lw-detr. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

build_o365 atten4vis/lw-detr/datasets/o365.py official repository ran Apache-2.0 (permissive) · 53a9978ad1f02a68 · report
convert_to_xywh atten4vis/lw-detr/datasets/coco_eval.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · f31a58bf6457ced5 · report
convert_to_xywh atten4vis/lw-detr/deploy/benchmark.py official repository ran fingerprinted Apache-2.0 (permissive) · 0cf40c7d0cb18b12 · report
crop atten4vis/lw-detr/datasets/transforms.py official repository ran Apache-2.0 (permissive) · 74f3f5c1bab38c14 · report
evaluate atten4vis/lw-detr/datasets/coco_eval.py official repository ran · our draft was wrong Apache-2.0 (permissive) · fe0ddcc2d420c9a0 · report
gen_encoder_output_proposals atten4vis/lw-detr/models/transformer.py official repository ran Apache-2.0 (permissive) · 515cc5f258dc7853 · report
gen_sineembed_for_position atten4vis/lw-detr/models/transformer.py official repository ran fingerprinted Apache-2.0 (permissive) · dbaf5088c2722765 · report
get_coco_pretrain_from_obj365 atten4vis/lw-detr/util/obj365_to_coco_model.py official repository ran fingerprinted Apache-2.0 (permissive) · dddb7619ec008b7f · report
get_image_list atten4vis/lw-detr/deploy/benchmark.py official repository ran Apache-2.0 (permissive) · aaf8532df82e8e3f · report
hflip atten4vis/lw-detr/datasets/transforms.py official repository ran Apache-2.0 (permissive) · 9be9e658b5bd688a · report
position_supervised_loss atten4vis/lw-detr/models/lwdetr.py official repository ran fingerprinted Apache-2.0 (permissive) · 09ea33b5c4fc4241 · report
sigmoid_focal_loss atten4vis/lw-detr/models/lwdetr.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 5c0711aada67957e · report
sigmoid_varifocal_loss atten4vis/lw-detr/models/lwdetr.py official repository ran fingerprinted Apache-2.0 (permissive) · e1af8817e1aa2d5e · report
build_o365_raw atten4vis/lw-detr/datasets/o365.py official repository unverified Apache-2.0 (permissive) · bb1c621e43ea7529 · report
build_transformer atten4vis/lw-detr/models/transformer.py official repository unverified Apache-2.0 (permissive) · ec7a90cc24d6630d · report
multi_head_attention_forward atten4vis/lw-detr/models/attention.py official repository unverified Apache-2.0 (permissive) · 57e6ba78fde593e0 · report

Tasks

DecoderObject DetectionReal-Time Object Detectionobject-detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDetrDropoutFeedforward NetworkLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections