YOLO: Real-Time Object Detection in One Look

The 2015 paper that treated detection as a single regression, and the family of models it started

Contents

A camera on a doorframe sees a person, a car, a cat and a delivery van, and a program has to draw a box around each and say what it is. That task is object detection, and it is a different job from recognising a photo as “a dog”. The network has to find how many things are in the picture, where each one sits, and what each one is. For years it was also slow. A good detector in 2014 might handle a few images per second on a serious GPU, which made it a tool for analysing photographs after the fact and no use for steering a robot or watching a video feed.

In 2015 four researchers from the University of Washington and Facebook AI Research (Joseph Redmon, Santosh Divvala, Ross Girshick and Ali Farhadi) published a paper with a deliberately cheeky title: “You Only Look Once: Unified, Real-Time Object Detection”. The idea fitted in a sentence. Skip the multi-step pipeline, treat detection as one regression problem from image pixels to boxes and class probabilities, and read the answer off in a single pass of a single network. This post covers how that works, what it cost in accuracy, and how the name YOLO ended up attached to a long chain of models by other people.

The problem with looking twice, thousands of times

To see why YOLO mattered, look at what came before. The leading approach was the R-CNN family. R-CNN, from Ross Girshick and colleagues in 2014, worked in stages: a separate algorithm proposed about two thousand candidate regions that might contain something, a convolutional network extracted features from each region in turn, a classifier labelled each one, and a final step tidied the boxes. Fast R-CNN and Faster R-CNN shared more of the computation and replaced the separate proposal algorithm with a learned one, and each step was a real improvement. Even so the pipeline stayed a chain of components that had to be trained separately, and the classifier still ran on hundreds of regions per image.

Redmon’s observation was that this setup throws away a lot. A convolutional network already builds a rich map of the whole image. Why not have it say where the objects are directly, from that single map?

A pole-mounted detection camera and sensor unit at a pedestrian crossing, seen against the sky.
Roadside detection hardware of this kind is the setting where fast object detection matters: a result is only useful if it arrives in time. Photo: Detekční kamery přechodu u vozovny Střešovice by ŠJů (cs:ŠJů), CC BY-SA 3.0, via Wikimedia Commons.

How YOLO works

Picture a 7 by 7 grid laid over the input image, which the network sees at 448 by 448 pixels.

7 x 7 gridOne networkone forward passPer cell2 boxesx, y, w, h, confidence20 class scores7 x 7 x 30 outputs
YOLO v1 in one picture. The cell containing an object’s centre is responsible for detecting it.

Each grid cell is responsible for any object whose centre falls inside it. For each cell the network predicts:

  • Two bounding boxes. Each box has five numbers: the box centre (x and y, relative to the cell), its width and height (relative to the whole image), and a confidence score, which is meant to encode both whether an object is there and how well the box fits it.
  • One set of class probabilities. Twenty numbers, one for each category in the Pascal VOC dataset, shared by the whole cell.

That gives 7 × 7 × (2 × 5 + 20) = 7 × 7 × 30 numbers, which is the output tensor of the original network. The body of the network is 24 convolutional layers followed by two fully connected layers, with the early layers pre-trained on ImageNet classification. At run time the class probability is multiplied by each box’s confidence to give a class-specific score, low scores are thrown away, and a clean-up step called non-maximum suppression removes duplicate boxes that cover the same object.

The training signal is a single loss function, a sum of squared errors with weights chosen so that the many empty cells do not drown out the few that contain objects. There is no separate proposal stage, so there is one network to train and the whole thing can be optimised end to end. That simplicity is what the title is pointing at.

The numbers

The paper compares YOLO with other detectors on Pascal VOC 2007, reporting accuracy as mean average precision (mAP, the standard detection score) and speed in frames per second on a GPU. Table 1 in the paper reads:

  • Fast YOLO, a smaller network: 52.7 mAP at 155 frames per second.
  • YOLO: 63.4 mAP at 45 frames per second.
  • 100 Hz DPM, a fast classical detector from before deep learning: 16.0 mAP at 100 frames per second.
  • Faster R-CNN with a VGG-16 backbone: 73.2 mAP at 7 frames per second.
  • Fast R-CNN: 70.0 mAP at 0.5 frames per second.
log scaleFast YOLO155 FPSYOLO45 FPS100Hz DPM100 FPSFaster R-CNN VGG-167 FPSFast R-CNN0.5 FPSSource: Redmon et al. 2015, Table 1 (Pascal VOC 2007). mAP: 52.7, 63.4, 16.0,73.2, 70.0.
Speed from Table 1 of the YOLO paper. The log scale is needed because the values span more than two orders of magnitude.

Read the two columns together. YOLO ran at 45 frames per second, which is faster than real time for ordinary video, with a mAP of 63.4. The most accurate system in the table was about ten points better on mAP but roughly six times slower. The older DPM detector was fast but dramatically worse. The trade was a good one for anything that has to react: it was the first detector where “real time” and “deep learning” were comfortably in the same sentence. The paper also noted that YOLO sees the whole image at once when it decides, so it uses context that region-based methods miss.

Where it went wrong

The paper is candid about the weaknesses, and they follow directly from the design.

Localisation errors. The paper’s error analysis found that mislocated boxes accounted for more of YOLO’s errors than all other sources combined. The grid forces coarse predictions: the network sees fairly low-resolution features after many layers of downsampling, and the boxes are regressed directly rather than refined.

Crowds of small things. Because each cell predicts only two boxes and a single class, a flock of birds or a crowd in the distance, where several small objects share one cell, is badly handled. The paper says plainly that YOLO struggles with small objects that appear in groups.

Odd shapes. The network learns box shapes from training data, so objects in unusual aspect ratios generalise poorly.

On the positive side, YOLO made fewer background false positives than Fast R-CNN, which sometimes mistook patches of background for objects. The authors exploited this by combining the two: rescoring Fast R-CNN’s detections with YOLO’s opinion gave a boost on VOC 2007 that neither achieved alone. That ensemble ran slowly, and it showed that the two methods made different mistakes.

The family tree

Redmon kept developing the idea. YOLOv2, published at CVPR 2017 as “YOLO9000: Better, Faster, Stronger” (arXiv December 2016), added batch normalisation, a higher-resolution classifier and anchor boxes, a set of prototype box shapes that the network adjusts rather than predicting boxes from scratch. It reached 76.8 mAP on VOC 2007 at 67 frames per second, or 78.6 mAP at 40 frames per second, putting it ahead of Faster R-CNN on accuracy at much higher speed. The “9000” referred to a technique for training on both detection and classification data so that the system could name more than nine thousand categories.

YOLOv3, from 2018, was written up as “An Incremental Improvement”, a short and informal technical report with a deliberately casual tone. It used a bigger backbone, made predictions at three scales to help with small objects, and adopted a more flexible loss. It remained the reference real-time detector for a couple of years.

Then the story changes. In February 2020 Joseph Redmon announced that he was stepping away from computer vision research, citing worries about military applications and privacy implications of the work. The name was free for others to use, since the code had been released openly (YOLOv2’s repository under the Apache 2.0 licence, and the Darknet framework with it), and the community did.

  • YOLOv4 (April 2020) came from Alexey Bochkovskiy, who had maintained the most popular fork of the Darknet code, with co-authors. It was a collection of training tricks and architectural improvements assembled and measured.
  • YOLOv5 (mid-2020) was released by the company Ultralytics, written in PyTorch rather than Darknet’s C, and without an accompanying paper at launch. Ultralytics has since shipped further versions and an easy-to-use library, under the AGPL-3.0 licence with a commercial option.
  • Later versions have come from different groups, including YOLOv6 and YOLOv7 from Chinese industry labs and research teams, with numbering that reflects marketing as much as lineage. Wikipedia lists releases up to YOLO26 at the time of writing, none of them officially associated with the original authors.

The numbering is a lesson in how open code gets used. “YOLO” now names a design philosophy (single-stage, grid or anchor-free dense prediction, optimised for speed) rather than one model, and comparing version numbers across vendors tells you little. When someone says they use YOLO, ask which one, from whom, and under which licence.

Why detection kept working in real products

The reason you meet YOLO-style models in everyday software is that the economics work. A single forward pass means one cost per frame, predictable and modest, so detectors can run on small devices and on a modest GPU while handling several camera streams. Home surveillance software uses exactly this kind of model: our look at Frigate and local object detection shows how a camera system can decide whether a moving shape is a person, a car or a cat without sending video to the cloud. The same family of models sits behind retail counting systems, sports analytics, agricultural drones and factory inspection.

The sibling task of cutting out an object’s exact outline, as opposed to drawing a box around it, is handled by Segment Anything, and the bigger architectural story that eventually pulled attention into vision is told in the transformer paper. Detectors built on transformers now compete with YOLO-style ones on accuracy, while the single-pass YOLO designs usually win where speed on small hardware is the constraint.

What to take from it

The YOLO paper is a good example of a design choice that looks like a simplification and turns out to be a different way of thinking. R-CNN asked “what is in this region?” many times. YOLO asked “what is in this picture?” once and demanded the whole answer. The price was accuracy on small and crowded objects, and the later versions spent years clawing it back without giving up the speed.

It also shows two less technical lessons. The first is that the honest error analysis in the 2015 paper, which names exactly where the method fails, made the work easier to build on, and every later version reads like a response to one of those listed failure modes. The second is that releasing code openly means you lose control of what your name stands for. Redmon left, and the field kept the word.

Sources: Redmon et al., “You Only Look Once: Unified, Real-Time Object Detection”, 2015 · Redmon and Farhadi, “YOLO9000: Better, Faster, Stronger”, 2016 · Redmon and Farhadi, “YOLOv3: An Incremental Improvement”, 2018 · Bochkovskiy et al., “YOLOv4”, 2020 · Wikipedia, You Only Look Once

Smarc
Written by Smarc

Founder and editor of Aside House. A lifelong tinkerer who self-hosts far more than is sensible, hardens Linux boxes for fun, and prods the latest AI tools to see what they can really do. The how-to guides here are the notes Smarc wishes had existed the first time round.

Smarc is the editor of Aside House. The homelab, the hardware and the opinions are real; the guides are drafted with AI assistance. Infrastructure details are genericised on purpose.