Papers › Focal Loss for Dense Object Detection

Focal Loss for Dense Object Detection

7 Aug 2017ICCV 2017 10arXiv:1708.02002archive 2025-07-28

Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, Piotr Dollár

The highest accuracy object detectors to date are based on a two-stage approach popularized by R-CNN, where a classifier is applied to a sparse set of candidate object locations. In contrast, one-stage detectors that are applied over a regular, dense sampling of possible object locations have the potential to be faster and simpler, but have trailed the accuracy of two-stage detectors thus far. In this paper, we investigate why this is the case. We discover that the extreme foreground-background class imbalance encountered during training of dense detectors is the central cause. We propose to address this class imbalance by reshaping the standard cross entropy loss such that it down-weights the loss assigned to well-classified examples. Our novel Focal Loss focuses training on a sparse set of hard examples and prevents the vast number of easy negatives from overwhelming the detector during training. To evaluate the effectiveness of our loss, we design and train a simple dense detector we call RetinaNet. Our results show that when trained with the focal loss, RetinaNet is able to match the speed of previous one-stage detectors while surpassing the accuracy of all existing state-of-the-art two-stage detectors. Code is at: https://github.com/facebookresearch/Detectron.

PaperPDFConference PDFCodeCode 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="1708.02002")

Code

Syntology Ran 11 of 11 code samples harvested from 7 repositories linked to this paper; 0 have no recorded run. Of those that ran: 2 ran · violated contract; 5 ran · our draft was wrong; 4 ran · fixture could not drive it.

By repository: community (archive-listed): 10 samples from 7 repositories, 10 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

234 repositories listed; official and paper-mentioned ones first.

facebookresearch/detectron officialmentioned in papermentioned on GitHubpytorch report
497626895/darknet mentioned on GitHubtf report
AdeelH/pytorch-multi-class-focal-loss mentioned on GitHubpytorch report
AlexeyAB/darknet mentioned on GitHubtfNOASSERTION report
AtlasCoCo/Darknet mentioned on GitHubtf report
CahideSara/deneme mentioned on GitHubtf report
ChristianMarzahl/ObjectDetection mentioned on GitHubpytorch report
DInesh1234-wq/tyredataset mentioned on GitHubpytorch report
DaloroAT/first_break_picking mentioned on GitHubpytorch report
DonCorle0ne/damage_detection mentioned on GitHub report
DrMMZ/RetinaNet mentioned on GitHubtf report
EMsnap/RobotSorting mentioned on GitHub report
FL77N/RetinaNet-Based-on-PPdet mentioned on GitHubpaddle report
GXYM/Focal-loss mentioned on GitHubtf report
Guillem96/efficient-net-tf mentioned on GitHubtf report
Guillem96/efficientdet-tf mentioned on GitHubtfGPL-3.0 report
HongSic/DarknetAI mentioned on GitHubtf report
IPLI/IPLI_Server mentioned on GitHubtf report
IlyaOvodov/AngelinaReader mentioned on GitHubpytorch report
JaryHuang/awesome_SSD_FPN_GIoU mentioned on GitHubpytorch report
Jo-dsa/SemanticSeg mentioned on GitHubpytorch report
KingBoyBIT/yolov3test mentioned on GitHub report
LIU1514/Yolov3- mentioned on GitHubtf report
Lmath11/darknet mentioned on GitHubtf report
MIC-DKFZ/DetectionAndRegression mentioned on GitHubpytorch report
MIC-DKFZ/RegRCNN mentioned on GitHubpytorch report
MariefW/6.-trainingYOLO mentioned on GitHubtf report
Maskify/darknet mentioned on GitHubtf report
NVIDIA/retinanet-examples mentioned on GitHubpytorch report
OFRIN/Tensorflow_RetinaFace mentioned on GitHubtf report
PolarisAlpha/darknet mentioned on GitHub report
Popoooo/darknet_test mentioned on GitHubtf report
RichardMathewsII/YOLBO mentioned on GitHub report
SJTU-Thinklab-Det/r3det-on-mmdetection mentioned on GitHubtfApache-2.0 report
ShaojieJiang/tldr mentioned on GitHubpytorchMIT report
Shraddha2013/customyolo mentioned on GitHubtf report
Shraddha2013/darknett mentioned on GitHubtf report
Shraddha2013/darknetyol mentioned on GitHubtf report
Shraddha2013/darknetyolo mentioned on GitHubtf report
Shraddha2013/darknetyolo3 mentioned on GitHubtf report
Shraddha2013/mydarknetyolo mentioned on GitHubtf report
Shraddha2013/myfileyolo mentioned on GitHubtf report
Stephenfang51/Focal_loss_turtorial mentioned on GitHubpytorch report
Sushma07/dancedarknet mentioned on GitHubtf report
Techyee/darknet_resource mentioned on GitHubtf report
Viveksbawa/SARAS-ESAD-Baseline mentioned on GitHubpytorch report
Wangxy2180/darknetKinectDetect mentioned on GitHubtf report
YIZHE12/fashiontags mentioned on GitHubtf report
YIZHE12/robots mentioned on GitHub report
Yashgh7076/Eluvio-ML-Scene-Segmentation mentioned on GitHubpytorch report
Yonder-OSS/D3M-Primitives mentioned on GitHubtf report
ZTao-z/multiflow-resnet-ssd mentioned on GitHubpytorch report
ZhenJie-Zhang/darknet_shoe mentioned on GitHubtf report
agutuyen-dev/darknet mentioned on GitHubtf report
ahhan02/darknet-alex mentioned on GitHubtf report
aminekha/AI-For-2022 mentioned on GitHubtf report
annabellachen/newDarknet mentioned on GitHubtf report
anookeen/yolo mentioned on GitHub report
artemmavrin/focal-loss mentioned on GitHubtf report
artxtech/darknet-rnn mentioned on GitHubtf report
artynet/darknet-alexeyAB mentioned on GitHubtf report
benihime91/pytorch_retinanet mentioned on GitHubpytorch report
bharatsush/object_detection mentioned on GitHub report
binhdv92/darknet mentioned on GitHubtf report
binhdv92/darknet_kriyeng mentioned on GitHubtf report
cameronchoi/r3det-copy mentioned on GitHubpytorchnot reachable when probed 2026-09-17 — repositories for recent papers often appear after camera-ready report
cloudnine148/PHC_2nd_SPC mentioned on GitHub report
csm-kr/Retinanet_pytorch mentioned on GitHubpytorch report
darshans0200/YOLOTest mentioned on GitHub report
daveboat/pytorch_focal_loss mentioned on GitHubpytorch report
dc17540/darknet mentioned on GitHubtf report
delmalih/MIAS-mammography-obj-detection mentioned on GitHubpytorch report
dishen12/py03 mentioned on GitHubpytorch report
dtthi/darknetAlexeyAB mentioned on GitHubtf report
dwaithe/darknet3AB mentioned on GitHubtf report
e0015274/darknet mentioned on GitHubtf report
edgarrt/custom_darknet mentioned on GitHubtf report
edwardclem/deepscribe mentioned on GitHubpytorch report
eric-erki/darknet mentioned on GitHub report
eric-erki/yolov3 mentioned on GitHub report
ermuur/darknet mentioned on GitHub report
fabiofumarola/ultrayolo mentioned on GitHubtf report
feidfoe/AdjustBnd4Imbalance mentioned on GitHubpytorch report
fizyr/keras-retinanet mentioned on GitHubtfApache-2.0 report
fznsakib/great-ape-behaviour-detector mentioned on GitHubpytorch report
ghadahamed/darknet mentioned on GitHubtf report
ghaniskn/GCorp-Darknet mentioned on GitHub report
haithink/myWindowsDarknet mentioned on GitHub report
hamzaMahdi/darknet mentioned on GitHubtf report
hankpark0706/darknet mentioned on GitHub report
hhuaibo/darknet mentioned on GitHubtf report
hisiter97/darknet mentioned on GitHubtf report
hweersot/darknet-custom mentioned on GitHubtf report
hyang0129/foodclassapp mentioned on GitHubtfApache-2.0 report
iskandari/darknet mentioned on GitHubtf report
istvanmegyeri/audio_tagging mentioned on GitHub report
jfc4050/detect-to-track mentioned on GitHubpytorch report
jiajunhua/facebookresearch-Detectron mentioned on GitHubcaffe2 report
jndeng/DACSDC-DeepZ mentioned on GitHub report
joheras/darknet-colab mentioned on GitHubtf report
jolibrain/caffe mentioned on GitHub report
juergenlandauer/Maya-Challenge mentioned on GitHubpytorch report
kalelpark/ral mentioned on GitHubpytorch report
karan96/NewOne mentioned on GitHubtf report
kawshik8/DL-project mentioned on GitHubpytorch report
khaled2ahmed/k2a mentioned on GitHubtf report
kongzhiyou/darknet-master mentioned on GitHubtf report
kuangliu/pytorch-fpn mentioned on GitHubpytorch report
kyunghwan/darknet_v3 mentioned on GitHub report
lhcezx/Graph-FPN mentioned on GitHubtf report
li-yibing/oceannet mentioned on GitHub report
llsouder/screen-ocr mentioned on GitHub report
lyk19940625/MyRFBNet mentioned on GitHubpytorch report
magnificent1208/r3det-on-mmdetection mentioned on GitHubpytorchApache-2.0 report
mathieuorhan/darknet mentioned on GitHub report
mdv3101/darknet-yolov3 mentioned on GitHub report
mic-dkfz/medicaldetectiontoolkit mentioned on GitHubpytorch report
minhdua/PHONES mentioned on GitHubtf report
mkocabas/focal-loss-keras mentioned on GitHubtf report
neshitov/UNet mentioned on GitHubpytorch report
nguoido/Yolo-alexeyAB mentioned on GitHubtf report
oorrppp2/darknet-pose mentioned on GitHubtf report
patelmiteshn/darknet mentioned on GitHub report
pengrenlai/RetinaNet-tensorflow mentioned on GitHubtf report
pierluigiferrari/ssd_keras mentioned on GitHubtf report
rahowa/catboost_focal_loss mentioned on GitHub report
rainofmine/Face_Attention_Network mentioned on GitHubpytorch report
rebeccagio/object_detection mentioned on GitHub report
rnirdhar/yoloMultiClass mentioned on GitHub report
rnirdhar/yoloTestOneClass mentioned on GitHub report
ruinmessi/RFBNet mentioned on GitHubpytorch report
ryubidragonfire/mydarknet mentioned on GitHub report
saber2011/darknet mentioned on GitHubtf report
saednasir/Helmet_Yolo mentioned on GitHub report
sdu2011/darknet_alexyab mentioned on GitHubtf report
sidify/resnet_focal_loss mentioned on GitHub report
simonlevine/11785-project mentioned on GitHubpytorch report
simonlevine/clinical-longformer mentioned on GitHubpytorch report
skbadhsm/darknet2 mentioned on GitHubtf report
soccergame/darknet mentioned on GitHub report
solapark/da_yolo mentioned on GitHubtf report
solapark/darknet_interpark mentioned on GitHubtf report
solapark/darknet_partdet mentioned on GitHubtf report
solapark/darknet_partdet_tmp mentioned on GitHubtf report
stevenzhou2017/darknet_AlexeyAB mentioned on GitHubtf report
sudharavali/objectDetectionYOLO mentioned on GitHubtf report
tallysprado/myDarknet mentioned on GitHubtf report
teemoeric/projet mentioned on GitHub report
tensorflow/models mentioned on GitHubtf report
tianhai123/yolov3 mentioned on GitHub report
toufiksk/darknet mentioned on GitHub report
trongnghia00/darknet mentioned on GitHub report
tryolabs/luminoth mentioned on GitHubtf report
unsky/RetinaNet mentioned on GitHubmxnet report
unsky/focal-loss mentioned on GitHubmxnet report
vantupham/darknet mentioned on GitHub report
viethungluu/OCRetina mentioned on GitHubtf report
vuongtrannguyenkhoi/darknet mentioned on GitHub report
williamccondori/YOLO-NFPA mentioned on GitHub report
witwickey/darknet mentioned on GitHubtf report
wodyjowski/colab-training mentioned on GitHubtf report
xiamenwcy/extended-caffe mentioned on GitHub report
xuanyuzhou98/SqueezeSeg mentioned on GitHubtfBSD-2-Clause report
xytpai/retinanet mentioned on GitHubpytorch report
yhenon/pytorch-retinanet mentioned on GitHubpytorch report
yijiaceline/Final-Project-Group4 mentioned on GitHubpytorch report
yudie433/darknet mentioned on GitHub report
yuliani29/yolotraining mentioned on GitHub report
yytang2012/darknet mentioned on GitHub report
zhongzisha/object_detection mentioned on GitHubtf report
zj463261929/darknet_mAP mentioned on GitHub report
zzhuolun/IRL mentioned on GitHubpytorch report
open-mmlab/mmdetection pytorchApache-2.0 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

11 samples harvested; 11 ran; 0 honoured the contract we drafted; 0 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.

2ran · violated contract
5ran · our draft was wrong
4ran · fixture could not drive it

Licence: 6 of the 11 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 7 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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.

bb_center RichardMathewsII/YOLBO/look_back.py community (archive-listed) ran · violated contract fingerprinted no licence file found · pointer only · 930423fe062e034a · report
centerBox RichardMathewsII/YOLBO/look_back.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 8cdfe1aec1da011c · report
ciou_loss facebookresearch/detectron2/detectron2/layers/losses.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · cee8870d4fbccc39 · report
diou_loss facebookresearch/detectron2/detectron2/layers/losses.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 26f3066ead0d2eec · report
focal_loss daveboat/pytorch_focal_loss/focalloss.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 6f5a902a2510561a · report
focal_loss AdeelH/pytorch-multi-class-focal-loss/focal_loss.py community (archive-listed) ran · our draft was wrong MIT (permissive) · aa6467d64911f0e4 · report
get_gtboxes_and_label Thinklab-SJTU/CSL_RetinaNet_Tensorflow/tools/multi_gpu_train.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · b07dc7faf9668206 · report
get_loss xytpai/retinanet/detector.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · bafd66dce4d45e2a · report
look_back RichardMathewsII/YOLBO/look_back.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 41f3747438406647 · report
squeeze_last2dims_shape viethungluu/OCRetina/onestage/keras_retinanet/models/retinanet.py community (archive-listed) ran · violated contract fingerprinted no licence file found · pointer only · 7de75ab446b29075 · report
nms identical code first harvested elsewhere ran · fixture could not drive it licence of this copy not recorded · 99d667302be1c9e3 · report

Tasks

2D Object DetectionDense Object DetectionKnowledge DistillationLong-tail LearningObjectObject DetectionPedestrian DetectionReal-Time Object DetectionRegion Proposal

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
2D Object Detection SARDet-100K RetinaNet box mAP 47.4 #11 of 13 Archive leaderboard report
Dense Object Detection SKU-110K RetinaNet AP 45.5 #5 of 5 Archive leaderboard report
Dense Object Detection SKU-110K RetinaNet AP75 .389 #5 of 5 Archive leaderboard report
Face Identification Trillion Pairs Dataset F-Softmax Accuracy 39.80 #5 of 6 Archive leaderboard report
Face Verification Trillion Pairs Dataset F-Softmax Accuracy 37.14 #5 of 6 Archive leaderboard report
Long-tail Learning COCO-MLT Focal Loss(ResNet-50) Average mAP 49.46 #8 of 13 Archive leaderboard report
Long-tail Learning EGTEA Focal loss (3D- ResNeXt101) Average Precision 59.09 #3 of 3 Archive leaderboard report
Long-tail Learning EGTEA Focal loss (3D- ResNeXt101) Average Recall 59.17 #3 of 3 Archive leaderboard report
Long-tail Learning VOC-MLT Focal Loss(ResNet-50) Average mAP 73.88 #10 of 13 Archive leaderboard report
Object Counting CARPK RetinaNet (2018) MAE 24.58 #12 of 15 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) AP50 61.1 #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) AP75 44.1 #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) APL 51.2 #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) APM 44.2 #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) APS 24.1 #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) Hardware Burden 4G #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNeXt-101-FPN) box mAP 40.8 #188 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) AP50 59.1 #208 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) AP75 42.3 #208 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) APL 50.2 #208 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) APM 42.7 #208 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) APS 21.8 #208 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) Hardware Burden 4G #208 of 225 Archive leaderboard report
Object Detection COCO test-dev RetinaNet (ResNet-101-FPN) box mAP 39.1 #208 of 225 Archive leaderboard report
Object Detection COCO-O RetinaNet (ResNet-50) Average mAP 16.6 #39 of 45 Archive leaderboard report
Object Detection COCO-O RetinaNet (ResNet-50) Effective Robustness 0.18 #39 of 45 Archive leaderboard report
Pedestrian Detection TJU-Ped-campus RetinaNet ALL (miss rate) 44.34 #4 of 4 Archive leaderboard report
Pedestrian Detection TJU-Ped-campus RetinaNet HO (miss rate) 71.31 #4 of 4 Archive leaderboard report
Pedestrian Detection TJU-Ped-campus RetinaNet R (miss rate) 34.73 #4 of 4 Archive leaderboard report
Pedestrian Detection TJU-Ped-campus RetinaNet R+HO (miss rate) 42.26 #4 of 4 Archive leaderboard report
Pedestrian Detection TJU-Ped-campus RetinaNet RS (miss rate) 82.99 #4 of 4 Archive leaderboard report
Pedestrian Detection TJU-Ped-traffic RetinaNet ALL (miss rate) 41.40 #5 of 6 Archive leaderboard report
Pedestrian Detection TJU-Ped-traffic RetinaNet HO (miss rate) 61.60 #5 of 6 Archive leaderboard report
Pedestrian Detection TJU-Ped-traffic RetinaNet R (miss rate) 23.89 #5 of 6 Archive leaderboard report
Pedestrian Detection TJU-Ped-traffic RetinaNet R+HO (miss rate) 28.45 #5 of 6 Archive leaderboard report
Pedestrian Detection TJU-Ped-traffic RetinaNet RS (miss rate) 37.92 #5 of 6 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: Focal Loss, RetinaNet

1x1 ConvolutionAverage PoolingBatch NormalizationBottleneck Residual BlockConvolutionFPNFocal LossGlobal Average PoolingGrouped ConvolutionKaiming InitializationMax PoolingRandom Horizontal FlipReLUResNeXtResNeXt BlockResidual BlockResidual ConnectionRetinaNetSGD with MomentumSPEEDWeight Decay

1 archive method tag without a method page not shown.

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