Skip to content
Road to Intelligence

Concept · Chapter 5: Vision, Speech & Reinforcement Learning

Detection and Segmentation

Should knowUnderstand9 minDifficulty

Detection finds and boxes every object in an image; segmentation labels every pixel.

The problem

Real applications need to know where things are and how many, not just one label for the whole picture.

The solution

Reuse a CNN backbone and add heads that predict boxes and classes (detection) or an upsampling decoder that predicts a class per pixel (segmentation).

The consequence

Vision moved from tagging photos to measuring scenes: self-driving perception, medical imaging, photo editing.

Three questions about one image

TaskOutputExample
Classificationone label"cat"
Detectiona box + label per object"cat at (40, 60, 180, 200); dog at …"
Segmentationa label for every pixela cat-shaped mask

Detection

A detector must output a variable number of boxes. Two-stage detectors such as Faster R-CNN (2015) first propose candidate regions with a small network that shares the backbone's feature maps, then classify and refine each proposal Established. One-stage detectors (YOLO, SSD and successors) predict boxes and classes directly on a grid of positions, trading a little accuracy for speed. Both are trained with a classification loss plus a regression loss on box coordinates.

Segmentation

Pooling threw away resolution; segmentation needs it back. U-Net (2015) pairs a contracting encoder with an expanding decoder and copies high-resolution encoder features across to the matching decoder stage Established. The encoder works out what is in the image; the skip connections remember where. The same U shape later became the denoising network inside many diffusion image generators (Chapter 15).

What to remember

  • Classification: one label per image. Detection: a box and label per object. Segmentation: a label per pixel.
  • Two-stage detectors (Faster R-CNN) propose regions then classify them; one-stage detectors (YOLO, SSD) predict boxes directly.
  • U-Net: shrink to understand, grow back to localise, with skip connections carrying fine detail.

Key papers

Optional

U-Net: Convolutional Networks for Biomedical Image Segmentation

Olaf Ronneberger, Philipp Fischer, Thomas Brox · 2015 · MICCAI 2015

A labelling for every pixel: an encoder that shrinks the image and a decoder that grows it back, with skip connections carrying fine detail across. The U shape later became the backbone of many diffusion image generators.

~30 min readarXiv:1505.04597✓ verified 2026-09-26