01From "what" to "what and where"
Classification outputs one label per image. Object detection outputs a list of objects, each with:
- a class ("car", "person"),
- a confidence score (0–1),
- a bounding box, as (x1, y1, x2, y2) corners or (x, y, w, h).
Detectors are trained with two losses at once: a classification loss for each predicted box and a regression loss (e.g. smooth L1 or IoU-based) for the box coordinates. Many detectors predict boxes relative to predefined anchor boxes of several shapes and sizes placed across the image.