Problem

Detection libraries make object detection a one-line call. Our team set out to re-implement YOLOv1 (Redmon et al., CVPR 2016) with no detection libraries and no pretrained weights, and get it to train on a free GPU.

Approach

  • Network: the full 24-conv + 2-FC architecture, about 270M parameters, output 7 × 7 × 20.
  • Data: a 10-class subset of COCO val2017 (2,000 images), resized to 448 × 448, each object encoded into the grid cell that holds its centre. Seeded 80/20 split.
  • My part, the loss and training: the paper’s multi-part loss with √width/√height box error (λcoord = 5), IoU-targeted confidence with down-weighted empty cells (λnoobj = 0.5), and class loss on object cells only. The predictor with the higher IoU is “responsible” for each object. SGD with momentum 0.9, weight decay 5e-4 and a linear warm-up.

Result

After 15 epochs on 1,600 images: train loss 23.2 → 7.6, test loss 24.6 → 8.0, and test class accuracy 8.6% → 71.9%. Train and test curves track each other, so there’s no sign of overfitting at this scale.

Train and test loss falling from about 24 to 8, and class accuracy rising from about 9% to 72%, over 15 epochs.
fig_01 — training_curves.pngLoss and class accuracy over 15 epochs.
A held-out image with red predicted boxes landing on a person and a dashed green ground-truth box.
fig_02 — detection_example.wYx7QJ_f.pngPredicted boxes (red) vs ground truth (dashed green) on a held-out image.

What I’d do next

  • Add per-class accuracy, a majority-class baseline and mAP@0.5 with pycocotools.
  • Train on COCO train2017 with a pretrained backbone and the paper’s augmentation.