Object Detection

Locate and classify multiple objects per image with bounding boxes, using detectors such as YOLO and Faster R-CNN.

Advanced · about 10 hours · difficulty 4/5

Learn first: Transfer Learning and Fine-Tuning

Classification answers what is in the image; detection answers what and where, for every object. It powers retail shelf analysis, traffic monitoring, document layout parsing and much more.

Core concepts

  • Bounding boxes in formats like xyxy, xywh or normalized YOLO format. Mixing formats is the most common bug.
  • Intersection over Union (IoU) measures box overlap and decides whether a prediction counts as correct.
  • Anchors and anchor-free heads: older detectors predict offsets from preset boxes; newer ones predict box centres directly.
  • Non-maximum suppression (NMS) removes duplicate boxes around the same object.
  • mAP (mean average precision, often at IoU 0.5 and averaged over 0.5 to 0.95) is the standard metric.

Model families

  • Two-stage (Faster R-CNN): propose regions, then classify them. Accurate, slower.
  • One-stage (YOLO family, RetinaNet, SSD): predict boxes in a single pass. The usual choice for real time.
  • Transformer based (DETR and successors) and open-vocabulary detectors that find objects from a text prompt.

Practical workflow

Label data in a tool such as CVAT or Label Studio, export to COCO or YOLO format, fine-tune a pretrained detector, and inspect false positives and misses per class. Small objects and class imbalance are the typical weak spots.

Good enough to move on when you can fine-tune a detector on a custom dataset, compute mAP, and explain what NMS does.

Key concepts

  • Bounding box formats
  • IoU
  • Non-maximum suppression
  • mAP evaluation
  • YOLO one-stage detectors
  • Faster R-CNN
  • COCO dataset format
  • Open-vocabulary detection

Mini project

Label 150 images of two object types in Label Studio or CVAT, fine-tune a small YOLO model, report mAP@0.5, and write up the three most common failure patterns you see.

Check yourself

Two predicted boxes overlap the same object with IoU 0.8 and confidences 0.9 and 0.6. What does NMS do with them, and how would a lower IoU threshold change the result?

Free resources