- Introduced by
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A.
- Year
- 2016
- Type
- Single-shot convolutional object detector
What does it do?
YOLO (You Only Look Once) is a single-shot, end-to-end convolutional object detector introduced by Redmon, Divvala, Girshick, and Farhadi at CVPR 2016.
It frames object detection as a single regression problem, predicting bounding-box coordinates and class probabilities directly from the full image in one evaluation. The original paper reports real-time speed (45 frames per second for the base model), which prior two-stage methods such as R-CNN could not match, and a family of successors (YOLOv2 through v11) followed.
The intuition behind the method
Before YOLO, dominant detectors worked in two stages: first propose candidate regions, then classify each one separately. This pipeline was too slow for real-time use. YOLO divides the image into a coarse grid and asks each grid cell, in one pass through a convolutional network, to predict both where objects are and what they are. Because the whole image is processed at once, the model sees global context, and the paper reports that YOLO is less likely than state-of-the-art detection systems of the time to predict false positives on background. The trade-off is that the grid imposes spatial constraints, and the paper reports more localisation errors than state-of-the-art systems, which makes small or tightly clustered objects harder to detect.
History
Joseph Redmon and colleagues presented YOLO at CVPR 2016, showing that a single convolutional network could predict bounding boxes and class probabilities across an image in one evaluation. The base model runs at 45 frames per second in the reported experiments, and the paper reports competitive accuracy on PASCAL VOC. The paper's comparisons include DPM and R-CNN, and it offers a different speed–accuracy trade-off from the two-stage detectors of that period, such as R-CNN, Fast R-CNN, and Faster R-CNN. YOLOv2 (YOLO9000, 2017) introduced anchor boxes and multi-scale training, and YOLOv3 (2018) added multi-scale prediction. Later versions (v4 onward) were developed by other groups, and Ultralytics released widely used v5, v8, and v11 implementations.
When to use it
Choose YOLO or a successor when detection must run at real-time rates, for example in live surveillance, driving, drone imagery, or robotic perception, or when one network must localise and classify several object categories at once. The method assumes objects are large enough to be resolved by the grid. Avoid it, or test it carefully, for very small or densely clustered objects, since the original design limits the number of objects each cell can predict. Achievable speed depends on model size, input resolution, hardware and numerical precision. The 45 frames per second reported in the original paper is specific to that experimental setup, so benchmark on the target device. When detection latency is not critical and localisation accuracy matters more, a two-stage detector such as Faster R-CNN remains a sensible comparison. Supervised training also requires a labelled dataset with bounding-box annotations.
Limitations and considerations
- The S×S grid limits detection density. In YOLOv1 each cell predicts only B boxes (B=2), so several small objects whose centres fall in the same cell can be missed.
- Boxes are regressed directly rather than refined from anchor-box priors, as in the anchor-based versions introduced from YOLOv2 onward, which can make unusual object shapes and aspect ratios harder to fit.
- The original paper reports more localisation errors than state-of-the-art detection systems, although it is less likely than those systems to predict false positives on background. Localisation accuracy is therefore the main cost of the single-pass design, and this cost is most likely to affect small and tightly packed objects.
- Supervised training needs bounding-box annotations for every object class, and performance depends strongly on how much labelled data is available.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Processes the full image in a single forward pass, which is what allows the real-time speed reported in the original paper (45 frames per second for the base model).
- Trained end-to-end on a detection loss, so the network is optimised for the detection objective itself rather than for an intermediate proxy task.
- Because the whole image is seen at once, the original paper reports fewer false positives on background than state-of-the-art systems, at the cost of more localisation errors.
- The architecture has been revised repeatedly: anchor boxes appear in YOLOv2 and multi-scale prediction in YOLOv3, so later versions extend the same grid-based design.
- No separate proposal stage: a single network followed by one post-processing step (NMS) is simpler to integrate into embedded and edge systems than a multi-stage pipeline.
Applications
- Real-time video surveillance and security systems that need frame-rate object detection.
- Perception pipelines for autonomous and semi-autonomous vehicles, for pedestrian, vehicle, and obstacle detection.
- Drone and satellite imagery analysis, for example crop monitoring or land-use mapping.
- Industrial inspection, where defects must be localised on a moving production line.
- Robotics and augmented reality, where low-latency detection supports interaction. Medical image uses, such as localising lesions or landmarks, would need task-specific training and validation.
How it works
How it works
The input image is divided into an S×S grid (7×7 in the original paper). Each grid cell is responsible for detecting objects whose centre falls within that cell. This spatial decomposition allows all predictions to be computed simultaneously by a single convolutional forward pass, rather than running a classifier on hundreds of region proposals.
Each grid cell predicts B bounding boxes (B=2 in YOLOv1). Every bounding box is parameterised by five values: the centre coordinates (x, y) normalised relative to the cell, width and height (w, h) normalised relative to the full image, and a confidence score. These are regressed directly from the final convolutional feature map.
Formula
\text{Each cell predicts } B \text{ boxes: } (x, y, w, h, \text{confidence})The confidence score encodes both how likely the box contains an object and how accurately the box is localised. Formally it equals the probability that an object is present multiplied by the Intersection over Union (IoU) between the predicted box and the ground-truth box. During training, cells with no ground-truth object are penalised lightly for non-zero confidence via a λ_noobj weight.
Formula
\text{confidence} = \Pr(\text{Object}) \times \text{IoU}^{\text{truth}}_{\text{pred}}Independently of the bounding box predictions, each grid cell also predicts C conditional class probabilities, the probability that the object belongs to class i given that some object is present. In YOLOv1 these probabilities are shared across all B boxes in the same cell.
Formula
\Pr(\text{Class}_i \mid \text{Object})At test time, class-specific confidence scores are computed by multiplying each conditional class probability by the corresponding box confidence. This single scalar encodes both class identity and localisation quality, and it is the quantity used for ranking and filtering detections.
Formula
\Pr(\text{Class}_i \mid \text{Object}) \times \Pr(\text{Object}) \times \text{IoU}^{\text{truth}}_{\text{pred}} = \Pr(\text{Class}_i) \times \text{IoU}^{\text{truth}}_{\text{pred}}Training minimises a multi-part sum-of-squares loss. A coordinate term (weighted by λ_coord=5) penalises errors in box centre and in the square roots of width and height; the square-root transformation reduces the penalty for errors on large boxes relative to small ones. Separate terms handle confidence for responsible and non-responsible boxes, and class probability errors. The loss is summed only over cells and boxes that are responsible for a given ground-truth object. The formula in the mechanics section is abridged and omits the confidence and class terms.
Formula
\mathcal{L} = \lambda_{\text{coord}}\sum_{i,j}\mathbf{1}^{\text{obj}}_{ij}\left[(x_i-\hat{x}_i)^2+(y_i-\hat{y}_i)^2+(\sqrt{w_i}-\sqrt{\hat{w}_i})^2+(\sqrt{h_i}-\sqrt{\hat{h}_i})^2\right] + \text{confidence and class terms}After inference, several overlapping boxes may predict the same object. Non-maximum suppression (NMS) keeps the highest-scoring box for each class and discards overlapping boxes whose IoU with the kept box exceeds a chosen threshold. The threshold is a tuning parameter: its setting changes how many duplicate detections and how many valid detections remain.
Common pitfalls
- Using YOLOv1 on a modern benchmark without acknowledgement that later versions (v5, v8, v11) differ substantially in architecture and should be cited separately.
- Evaluating on mean Average Precision (mAP) at a single IoU threshold (e.g. 0.5) and omitting COCO-style mAP@[0.5:0.95], which penalises poor localisation more severely.
- Neglecting Non-Maximum Suppression tuning: an overly permissive IoU threshold produces duplicate detections; an overly strict threshold drops valid ones.
- Training at one input resolution and inferring at another without validation or fine-tuning. The scale the network learned may then no longer match the input, which can reduce accuracy.
- Reporting inference speed without specifying hardware (GPU model, batch size, precision), making results non-comparable across studies.
Frequently asked questions
How does YOLO differ from Faster R-CNN?
Faster R-CNN uses a two-stage pipeline: a first stage proposes candidate object regions, which a second stage classifies and refines. YOLO combines these steps into a single forward pass over a grid, trading some localisation accuracy for higher throughput. The original YOLO paper reports more localisation errors than state-of-the-art systems but fewer false positives on background, and later YOLO versions aim to narrow the accuracy gap.
Which YOLO version should I use for a new project?
For most practical applications, a recent version from an actively maintained repository is more useful than the original YOLOv1, which is mainly of historical and educational interest. Newer versions, such as v8 and v11, differ substantially in architecture from YOLOv1, so results should be reported against the version actually used.
What dataset and annotation format does YOLO training require?
YOLO training requires images paired with bounding-box annotations in (class, x_centre, y_centre, width, height) format normalised to [0, 1]. Popular training sets include PASCAL VOC and MS COCO. Transfer learning from a COCO-pretrained checkpoint is standard practice when labelled data are limited.
How is detection performance measured?
The standard metric is mean Average Precision (mAP), computed as the area under the precision–recall curve averaged over object classes. The COCO benchmark reports mAP averaged across IoU thresholds from 0.50 to 0.95 (mAP@[0.5:0.95]), which is more demanding than the single-threshold PASCAL VOC metric ([email protected]). Inference speed is reported as frames per second (fps) on a specified GPU.
Related methods
Sources
Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2016). You Only Look Once: Unified, Real-Time Object Detection. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 779–788.
Open DOI referenceGoodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
ISBN: 978-0-262-03561-3