The last chapter scored a detection once it already existed. It never asked how a network decides, in the first place, which of the thousands of possible boxes in an image are even worth scoring. Two entirely different answers to that question became two families of detector — and the difference between them isn't just architecture, it's a straight speed-versus-precision trade.
Six candidate boxes, one shared ground truth per box. Toggle between scoring every box in a single pass and scoring them through a cheap filter followed by a careful second look — watch which boxes get flagged as detected change.
A one-stage detector (e.g. YOLO) evaluates every candidate box exactly once, in a single dense pass — fast, but every score shares whatever precision that one pass can afford. A two-stage detector (e.g. Faster R-CNN) runs a cheap region proposal pass over every box first, then spends a second, expensive classifier only on the boxes that clear a proposal threshold:
- — the total number of candidate boxes considered.
- — the number of boxes that survive the proposal filter and reach the expensive second pass ().
- , , — the compute cost of one one-stage evaluation, one cheap proposal, and one expensive refine, respectively.
- One-stage pays a flat cost for every box, once
There's no filtering step — every one of the boxes gets the same single, cheap-per-box evaluation.
- Two-stage trades one expensive pass for two cheaper ones
Even though per box, only boxes ever reach it — but when isn't small enough, or is large enough, the total can still exceed one-stage's flat cost.
- The extra pass buys precision the coarse pass didn't have
A box near the decision boundary can flip its final call depending on how much refinement it got — that's the accuracy two-stage is paying its extra compute for.
The same six boxes, scored both ways side by side, plus the total compute each pipeline actually spent getting there. One box's final call depends on which pipeline scored it.
Six boxes with true objectness confidence (boxes A–F), a detection threshold of :
- One-stage rounds every box onto a coarse 0.1 grid
Box C's true confidence rounds to — right at the threshold, so one-stage calls it detected.
- Two-stage's proposal pass is coarser still, but only decides pass/fail
On a grid, rounds to too, clearing the proposal threshold — so box C proceeds to the expensive second pass with its exact confidence, , restored.
- The refine pass flips the call
: two-stage calls box C not detected. One-stage and two-stage disagree on this one box — everywhere else, both pipelines agree.
- But two-stage still cost more overall
Rounding every box's confidence to the nearest -grid value to check the proposal threshold:
- A: , passes
- B: , passes
- C: , passes
- D: , fails
- E: , passes
- F: , passes
Five of six boxes clear it, so . One-stage: boxes cost units. Two-stage: — over the compute, entirely to correct one boundary case.
Pick the one box where one-stage and two-stage disagree about whether it's detected.
One-stage detectors spend a fixed, cheap budget on every box and accept whatever precision that buys; two-stage detectors spend far more, but only on the boxes worth a second look, and can correct calls the coarse pass got wrong. Neither is strictly better — it's a speed-for-precision trade, tuned by how expensive a wrong call actually is. The next chapter moves from boxes to something finer-grained still: labeling every individual pixel.