In short
This is a from-scratch reimplementation of YOLOv1 on Pascal VOC 2007, rebuilt so that its numbers can be trusted. The loss follows the paper, evaluation reads every annotation, and train, validation and test never mix.
I wanted to answer two questions. First, how much does the one-object-per-cell grid cost? On VOC 2007, 1,745 of 24,640 objects cannot become a training target, and for bottles the share reaches 15.8 %. Second, does it matter whether the confidence score learns the box’s IoU, as in the paper, or a constant one? That experiment is running, so this page reports no new mAP yet.
What a cell has to say
YOLOv1 reads a 448×448 image once and outputs a 7×7×30 tensor. Each of the 49 cells gives 20 class probabilities and two candidate boxes, each box a centre (relative to the cell), a width and height (relative to the image) and a confidence [1].
During training, each object goes to the cell that contains its centre, and only that cell learns to find it. Hover a cell to see the target it receives.
The grid’s blind spot, measured
The paper admits this limitation: the model struggles with small objects that appear in groups. With the encoder, it can be counted. Over the official train, validation and test lists, 1,141 of 9,963 images contain at least one object that loses its cell.
Some classes are hit much harder than others. Bottles, people and chairs come in clusters and lose their cell far more often than trains or cats, which tend to be large and alone.
What should confidence learn?
Each box also predicts a confidence. In the paper, its target is the IoU between the predicted box and the object it is responsible for, so a sloppy box should learn to be unsure. A simpler alternative trains it towards 1 wherever there is an object. The experiment keeps that one as a control.
This shows up at test time. Detections are ranked by class probability times confidence, and average precision rewards putting good boxes above bad ones. Drag the box and compare the two targets.
Drag the box to move it; drag its corner to resize.
Cleaning up: non-maximum suppression
With two boxes in each of 49 cells, it is common for several cells to fire on the same object. Non-maximum suppression keeps the highest-scoring box and removes any other box that overlaps it by more than a threshold. Because it runs per class, a rider never suppresses her horse.
The experiment
I froze the protocol before training. The four conditions differ only in the confidence target and the augmentation; architecture, optimiser, schedule and image order are the same. Each one runs with three seeds.
The confidence target effect is read from B − A and D − C, the augmentation effect from C − A and D − B. Each is reported with its seeds, even if it comes out zero or negative. Checkpoints are picked on validation mAP, and the test set is evaluated once, with VOC 2007’s 11-point interpolated AP at IoU 0.5 [2].
Status: training. Results will go here, along with per-class AP, seeds, selected checkpoints and raw detections.
What this does not claim
- This is not an exact reproduction of the paper. The network trains from scratch with BatchNorm and a 496-unit head, where the paper used ImageNet pretraining and a 4,096-unit head, so the published 63.4 mAP is not the target.
- The “1” condition is a deliberate control, not a faithful baseline. All conditions use the corrected loss, masks and coordinate units.
- The grid audit does not measure an AP loss. That would require evaluating the trained model on a defined subset.
- There is no speed comparison with newer YOLO versions. A fair one would need the same images, hardware and preprocessing.
The original course project
The first version of this project trained a YOLOv1 and compared it with newer YOLO releases on videos. Its curves are kept below as training diagnostics. They were produced by code that had several bugs, since fixed, and they are measured on training data, so they say nothing about generalisation.


Run it yourself
Everything below runs on a CPU except training. The download script checks the official archives against MD5 and SHA-256 hashes, then writes the grid audit shown in Figure 2.
python -m pip install -r requirements-test.txt
python -m pytest tests -q
python download_voc.py --data-dir data
python train.py --voc-root data/VOCdevkit --out outputs/iou_aug_seed123
python evaluate.py --checkpoint outputs/iou_aug_seed123/best.pt --manifest data/manifests/test.json --voc-root data/VOCdevkit --out outputs/iou_aug_seed123_test
- Experiment protocolThe frozen comparisons, written before training.
- Reproduction guideColab, a one-epoch check, exact resumption.
- Primary sourcesWhat the paper and the authors’ code actually specify.
- site.jsonThe grid audit and example annotations used on this page.
References
- Joseph Redmon, Santosh Divvala, Ross Girshick, Ali Farhadi. You Only Look Once: Unified, Real-Time Object Detection. CVPR 2016.
- Mark Everingham, Luc Van Gool, Christopher K. I. Williams, John Winn, Andrew Zisserman. The PASCAL Visual Object Classes (VOC) Challenge. IJCV, 2010.