All models

darknet_yolov4

The one-GPU real-time detector: CSPDarknet53, SPP and PAN under a YOLOv3 head.

Detection and tracking · 179 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (50 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
1.3M
Operations
179
Framework
PyTorch
Recurrent
No
Published
2020
Cited by
23,668 (as of 18 November 2026)
Authors
Alexey Bochkovskiy, Chien-Yao Wang, Hong-Yuan Mark Liao
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m4078
Graph hash
82fee4464b733ae3aeb6addbbe9d4e8cc72cf6cd74efeda05bb7b421b9f073af
Skeleton hash
5fd79afb464fed3369f68ffa03fb4b3c2fe052f73e9c67fa325e1e68f906ae73
Architecture hash
75f33f92ae1fa53abb45bce1bb6c3afb4ecefff193125312e428ae0b2912e209
Diagram SHA-256
09fb279177039bff5e3c55fe881d00d661902eac082dd786cc12d7e70021087b
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

YOLOv4 is the real-time object detector that set out to be trainable by anyone with a single conventional GPU. The authors frame the goal as building a CNN that runs in real time on a conventional GPU and whose training needs only one such GPU. The headline number is 43.5% AP (65.7% AP50) on MS COCO at roughly 65 FPS on a Tesla V100. Against its predecessor, the paper reports a 10% improvement in AP and 12% in FPS over YOLOv3.

The architecture itself is a deliberate assembly of existing parts: a CSPDarknet53 backbone, an SPP block, a PANet path-aggregation neck and the anchor-based YOLOv3 head. CSPDarknet53 was chosen over CSPResNeXt50 because, although the latter classifies better on ImageNet, CSPDarknet53 detects better on MS COCO. The SPP block sits on top of the backbone because it enlarges the receptive field at almost no cost in speed. Two of the borrowed modules were altered along the way: SAM was changed from spatial-wise to point-wise attention, and the shortcut connection in PAN was replaced by concatenation.

The paper's lasting vocabulary is its split between a bag of freebies and a bag of specials. Freebies are training-side methods that raise accuracy without increasing inference cost, and specials are plug-in modules and post-processing steps that cost a little inference time for a significant accuracy gain. New freebies include Mosaic augmentation, which mixes four training images, and Self-Adversarial Training, where the network first alters the input image rather than its own weights. Cross mini-Batch Normalization collects statistics only across the mini-batches inside a single batch. One quirk worth knowing: the authors credit Glenn Jocher for the ideas of Mosaic augmentation, genetic-algorithm hyper-parameter selection and the fix for grid sensitivity.

Key idea. YOLOv4 combines a CSPDarknet53 backbone, SPP, PANet and a YOLOv3 head with a verified set of training-time freebies and low-cost specials to reach 43.5% AP on MS COCO at real-time speed on one conventional GPU.

  • yolov4
  • yolo v4
  • yolo
  • darknet
  • cspdarknet53
  • real-time object detector
  • object detection
  • bag of freebies
  • bag of specials
  • coco

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{bochkovskiy2020yolov4optimalspeedaccuracy,
      title={YOLOv4: Optimal Speed and Accuracy of Object Detection}, 
      author={Alexey Bochkovskiy and Chien-Yao Wang and Hong-Yuan Mark Liao},
      year={2020},
      eprint={2004.10934},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2004.10934}, 
}