Part III · Chapter 09

Finding & Outlining Objects

Knowing that a photo contains a car is not enough to cross a street. How machines move from one whole-image label, to tight location boxes, to pixel-hugging silhouettes — and how we grade their aim.

In Chapter 8, our Convolutional Neural Network stared at a single centered picture and cast one vote: "Cat!" or "Bicycle!" That skill — called Classification — is wonderful for sorting a photo album, yet hopelessly incomplete for a self-driving car or a delivery robot.

Imagine glancing down a busy street and only being told "There is a car somewhere in this view." Where is it? Is a cyclist riding beside it? Is a dog stepping off the curb? To act safely in the real world, machines climb three distinct levels of seeing.

Interactive 9.1 The Three Levels of Seeing

Switch between Classification, Object Detection, and Segmentation, then slide the Confidence Threshold to see how strictness trades off missed objects against false alarms.

Mode: Object Detection Objects Shown: 4 of 6 Strictness: Balanced — real objects clear
✦ Key Intuition · Boxes vs. Silhouettes

Try switching back and forth between Object Detection and Segmentation. A rectangle around a tree or a cyclist always scoops up extra sky and road in its corners. Segmentation goes one step further, painting a glowing mask over the exact pixels belonging to each object — so a machine knows precisely where the cyclist ends and the open lane begins.

How Good Is a Box? The Overlap Agreement Game

Suppose a machine draws a cyan box around a car, and a human judge has already marked the true dashed gold box. How should we score the machine's aim?

Here is a surprisingly clever visual test. Paint the region where both boxes agree in bright green (the shared overlap), and look at the entire combined footprint covered by either box. Then ask a simple question: what share of the combined footprint is glowing green?

Vision researchers call this score IoU (short for Intersection over Union), and you don't need a single formula to feel how it works. Drag the cyan box below — or pull its four corner handles — and watch the green overlap share respond live.

Interactive 9.2 Overlap Agreement Game (IoU Intuition)

Drag inside the cyan Machine Guess Box to move it, or drag any of its 4 corner handles to resize it. Try to push the green Overlap Share above 80%!

Overlap Share (IoU): 0% Verdict: — Balance: —
⇄ Visual Relationship · Why Oversized Boxes Fail

Click Too Big (Sloppy) and notice what happens: the cyan box covers every single pixel of the car, yet the Overlap Share drops! Because the box spills far outside the target, the wasted blue area balloons — shrinking the green share of the combined footprint. A high score demands both covering the object and staying tight to its edges.

? Pause & Think

Go back to the street scene above and imagine you are designing the vision system for an automatic emergency braking system. Would you set the Confidence Threshold very high (say, 90%) or moderately low (say, 55%) when looking for pedestrians and dogs near the road?

For safety-critical obstacles like pedestrians or dogs, engineers bias toward a lower threshold — because missing a real person stepping into the street is far more dangerous than briefly slowing down for a suspicious shadow. On the other hand, a photo-tagging app uses a higher threshold, because tagging a shadow as a "Dog" is embarrassing while skipping a blurry background dog is harmless. The right threshold always depends on which mistake costs more!

Chapter 9 Takeaways

  • Three levels of vision: Classification gives one label, Object Detection adds boxes and confidence, and Segmentation paints exact pixel-hugging masks.
  • Confidence thresholds control the trade-off: Raising the bar cuts false alarms but risks hiding real, harder-to-see objects.
  • Overlap Share (IoU) grades aim fairly: Comparing the shared green overlap to the full combined footprint rewards boxes that are both centered and snug.
  • Every task chooses its own precision: Counting cars needs boxes; steering around a cyclist needs pixel-accurate masks.