Seeing More Than Labels
Object Detection
9 min+85 XPStep 1/11
Boxes out of a classifier
Detection has an awkward output shape: a variable number of objects, each needing a box (x, y, width, height), a class, and a confidence. Zero objects or fifty — the output size changes per image.
The standard trick is to impose a grid over the image. Each grid cell is responsible for any object whose center lands inside it, and predicts its box as an offset from preset anchor boxes — a tall anchor for standing people, a wide anchor for cars, a square one for faces. Instead of predicting a box from nothing, the network nudges a reasonable starting shape.
analogy
Anchors are like coat hooks of fixed shapes. Each cell asks: does the object here hang better on the tall hook or the wide hook — then adjusts the fit.