Machine Learning

Object Detection: R-CNN, YOLO, SSD, and DETR

Object detection turns image recognition into a set of localized class predictions: boxes, scores, duplicates, and matches.

status: reviewimportance: importantdifficulty 4/5math: graduateread: 20mlive demo

Concept Structure

Object Detection: R-CNN, YOLO, SSD, and DETR

01Intuition

Start with the picture, metaphor, or geometric mechanism.

02Math

Make the objects explicit and connect them with notation.

03Code

Mirror the equations with runnable implementation details.

04Interactive Demo

Manipulate the mechanism and watch the idea respond.

3prerequisites
1next concepts
4related links

Learner Contract

What this page should let you do.

You are here becauseObject detection turns image recognition into a set of localized class predictions: boxes, scores, duplicates, and matches.

This Machine Learning concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.

By the end4/4 sections ready | runnable code expected | live demo

Explain the mechanism, trace the main notation, and test one prediction in the live demo.

Do this firstIntuition

Read the intuition before the notation; the math should name a mechanism you already felt.

Test the linkManipulate one control and predict the visible change.Then continue to Segmentation: FCN, U-Net, Mask R-CNN, and Panoptic Maps (review)

Claim/source review status

Substantive review recorded

2/2 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.
Claims2/2 reviewed
Sources5 cited
Codeattached
Demolive
Reviewed2026-07-04
Updatedpage 2026-07-04

Learning item flow

4/4 sections readyAsk about thisResearch room
ConceptObject Detection: R-CNN, YOLO, SSD, and DETRMachine Learning
5 sources attachedLocal snapshot ready
concept:machine-learning/object-detection-rcnn-yolo-ssd-detr
01

01

Intuition

Build the mental picture first so the rest of the page has something to attach to.

Section prompt

Image classification asks, "what is in this image?" Object detection asks a harder question: "what objects are here, where are they, and which predictions describe the same object?"

That one extra word, where, changes the whole contract. A detector does not return one class label. It returns a set of hypotheses:

  • a class such as dog, bicycle, or car,
  • a bounding box around the object,
  • a score that says how confident the detector is,
  • and a rule for removing duplicates or assigning predictions to real objects.

The architecture families mostly differ in how they create and reconcile those hypotheses.

R-CNN-style systems start from region proposals: first hypothesize possible object regions, then classify and refine them. Faster R-CNN makes that proposal step learnable with a Region Proposal Network. YOLO and SSD-style systems skip a separate proposal stage and predict from dense grid or default-box candidates in one pass. DETR changes the framing again: predict a fixed-size set of object slots and train them with one-to-one matching, with unused slots becoming no-object.

The shared mental model is not the family name. It is candidate boxes becoming a final object set.

02

02

Math

Translate the story into symbols, assumptions, and a derivation you can inspect.

Section prompt

Represent a bounding box by its top-left corner and size:

b=(x,y,w,h).b=(x,y,w,h).

For two boxes aa and bb, localization quality is commonly measured by intersection over union:

IoU(a,b)=area(ab)area(ab).\operatorname{IoU}(a,b)=\frac{\operatorname{area}(a\cap b)}{\operatorname{area}(a\cup b)}.

A detection usually needs both class confidence and box overlap. A high class score with a poor box is not a good detection.

Duplicate predictions create another problem. If two boxes claim the same dog, a non-maximum suppression pass keeps the higher-scoring box and suppresses the lower-scoring box when their overlap is high enough:

IoU(bi,bj)>τ.\operatorname{IoU}(b_i,b_j)>\tau.

DETR-style set prediction replaces that duplicate-suppression habit with a matching habit. If there are NN prediction slots and MM real objects, training chooses a one-to-one assignment:

σ^=argminσj=1MLmatch(yj,y^σ(j)).\hat\sigma=\arg\min_\sigma \sum_{j=1}^{M} \mathcal L_{\text{match}}(y_j,\hat y_{\sigma(j)}).

Extra slots are trained as no-object. The point is not that one route is always better. The point is that proposal, dense-candidate, and set-prediction detectors solve the same box-and-set problem with different candidate machinery.

03

03

Code

Keep the implementation aligned with the notation so the algorithm is legible.

Section prompt
def box_iou(a, b):
    ax1, ay1, aw, ah = a
    bx1, by1, bw, bh = b
    ax2, ay2 = ax1 + aw, ay1 + ah
    bx2, by2 = bx1 + bw, by1 + bh

    ix1, iy1 = max(ax1, bx1), max(ay1, by1)
    ix2, iy2 = min(ax2, bx2), min(ay2, by2)
    intersection = max(0, ix2 - ix1) * max(0, iy2 - iy1)
    union = aw * ah + bw * bh - intersection
    return 0 if union == 0 else intersection / union

def nms(predictions, threshold=0.5):
    kept = []
    for pred in sorted(predictions, key=lambda p: p["score"], reverse=True):
        duplicate = any(
            pred["class"] == kept_pred["class"]
            and box_iou(pred["box"], kept_pred["box"]) > threshold
            for kept_pred in kept
        )
        if not duplicate:
            kept.append(pred)
    return kept

This is a small box-set witness, not a detector implementation. Its job is to expose the bookkeeping that every detector family has to solve: overlap, confidence, duplicates, and final assignment.

04

04

Interactive Demo

Use direct manipulation to connect the explanation to a moving system.

Section prompt

Use the Assignment Lab as a reveal-gated check:

  • Localization: predict what IoU actually measures.
  • Duplicates: predict what NMS does when two high-scoring boxes describe the same object.
  • Set matching: predict why a DETR-style detector includes no-object slots.

Before reveal, the matched boxes, duplicate decision, and set assignment stay locked. After reveal, compare the proposal route, dense grid route, and set prediction route on the same three-object scene.

Live Concept Demo

Explore Object Detection: R-CNN, YOLO, SSD, and DETR

The stage is code-native and interactive. Use it to test the explanation against the mechanism.

difficulty 4/5graduatecode-aligned
Demo Prediction Checkpoint

Manipulate one control and predict the visible change.

Commit to what Object Detection: R-CNN, YOLO, SSD, and DETR should make visible before reading the result.

After The First Pass

Turn the concept into an inspected object.

Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.

Mechanism Storyboard

See the idea move before the page explains it

Object detection turns image recognition into a set of localized class predictions: boxes, scores, duplicates, and matches.

Prediction open01 / Intuition
Prediction lens

Start with the picture, metaphor, or geometric mechanism.

Commit first

Before reading further, choose the kind of change Object Detection: R-CNN, YOLO, SSD, and DETR should make visible.

Visual Inquiry

Make the image answer a mathematical question

Object detection turns image recognition into a set of localized class predictions: boxes, scores, duplicates, and matches.

4/4 stages readyLive demo connected
Prediction

Which visible object should carry the first intuition?

Commit first

Pick the cue that should make Object Detection: R-CNN, YOLO, SSD, and DETR easier to reason about before the page gives the answer.

Source Grounding

Canonical references for the mechanism on this page.

paper · 2014Rich Feature Hierarchies for Accurate Object Detection and Semantic SegmentationGirshick, Donahue, Darrell, and Malik

Primary R-CNN source for combining region proposals with CNN features for object localization and classification.

Open source
paper · 2015Faster R-CNN: Towards Real-Time Object Detection with Region Proposal NetworksRen, He, Girshick, and Sun

Primary source for Region Proposal Networks, objectness scores, proposal boxes, and shared convolutional features.

Open source
paper · 2016You Only Look Once: Unified, Real-Time Object DetectionRedmon, Divvala, Girshick, and Farhadi

Primary source for one-stage detection that predicts bounding boxes and class probabilities from full images in one evaluation.

Open source
paper · 2016SSD: Single Shot MultiBox DetectorLiu et al.

Primary source for default boxes over multiple aspect ratios/scales and per-box class/object predictions in a single-shot detector.

Open source
paper · 2020End-to-End Object Detection with TransformersCarion et al.

Primary source for viewing detection as direct set prediction with object queries, bipartite matching, and no anchor/NMS requirement in the basic DETR design.

Open source

Claim Review

Object detection turns image recognition into a set of localized class predictions: boxes, scores, duplicates, and matches.

Status2 substantive reviews recorded

Claims without a substantive review badge still need exact source-support review.

Sources5 references

girshick-2014-rcnn, ren-2015-faster-rcnn, redmon-2016-yolo, liu-2016-ssd, carion-2020-detr

Local checks4 local checks

Use equations, runnable code, and demos to check whether the source support is operational.

Substantively reviewedObject detection extends image classification by predicting a class, a bounding box, and a confidence or objectness score for each retained object hypothesis.Claim metadata: source checked

The references support the common detector output contract: locate objects with boxes, score object/class hypotheses, and retain a final set of detections after candidate filtering or suppression.

Sources: Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation, Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks, You Only Look Once: Unified, Real-Time Object Detection, SSD: Single Shot MultiBox DetectorThe page teaches rectangular bounding-box detection, not masks, keypoints, tracking, rotated boxes, open-vocabulary detection, or a benchmark ranking.A bounded review summary is present; still check caveats and exact reference scope.

Checked R-CNN, Faster R-CNN, YOLO, and SSD for proposal or dense candidate boxes, class probabilities/scores, objectness/confidence, and box refinement. GPT Pro publication critique remains pending because the Oracle lane is unavailable on this workstation.

Reviewer: codex-local-primary-reference-audit; reviewed 2026-07-04
Substantively reviewedR-CNN-style detectors classify proposals, YOLO/SSD-style detectors predict over dense grid/default-box candidates, and DETR-style detectors use a fixed set of predictions trained with bipartite matching instead of anchor generation or NMS in the basic formulation.Claim metadata: source checked

The references support the three route comparison used in the demo: proposal route, dense candidate route, and set-prediction route.

Sources: Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation, Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks, You Only Look Once: Unified, Real-Time Object Detection, SSD: Single Shot MultiBox Detector, End-to-End Object Detection with TransformersModern production detectors have many variants and hybrids. This concept teaches the routing logic, matching vocabulary, and box arithmetic before comparing model families.A bounded review summary is present; still check caveats and exact reference scope.

Checked R-CNN/Faster R-CNN for proposals and RPNs, YOLO/SSD for one-stage dense predictions/default boxes, and DETR for set prediction, object queries, no-object slots, and bipartite matching.

Reviewer: codex-local-primary-reference-audit; reviewed 2026-07-04

Practice Loop

Try the idea before it explains itself

Object detection turns image recognition into a set of localized class predictions: boxes, scores, duplicates, and matches.

Readiness0/3 checks ready
Predict

Before touching the demo, predict one visible change that should happen in Object Detection: R-CNN, YOLO, SSD, and DETR.

Hint 1

Reveal when your model needs a nudge.

Hint 2

Reveal when your model needs a nudge.

Hint 3

Reveal when your model needs a nudge.

Grounded research drawerClose
ConceptObject Detection: R-CNN, YOLO, SSD, and DETRMachine Learning

Research Room

Attach the question to a claim, equation, code, or demo

Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.
Next local actionNo local draft saved yet

Open the draft below to save one note and next action in this browser.

conceptMachine Learning

Object Detection: R-CNN, YOLO, SSD, and DETR

Attached question

What is the smallest example that makes Object Detection: R-CNN, YOLO, SSD, and DETR click without losing the math?

Local action draftNo local draft saved yetExpand only when ready to capture one local next action
Local action draft

This draft stays in this browser, attached to the selected learning item.

No local draft saved.
Evidence to inspect
  • References to inspect: attached references on this page.
  • Definition, prerequisite, and contrast concept links
  • The equation or runnable code that makes the concept operational
  • One demo state that shows the invariant instead of a slogan
What would resolve this
  • The learner can state the mechanism in their own words
  • The learner can name the prerequisite that would repair confusion
  • The learner can predict how the mechanism changes under one perturbation
Grounded AI handoff

I am working in Continuous Function's research reading room. Object: concept - Object Detection: R-CNN, YOLO, SSD, and DETR Selected item key: recorded for copy. Context: Machine Learning Page anchor: recorded for copy. Open question: What is the smallest example that makes Object Detection: R-CNN, YOLO, SSD, and DETR click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.

View it in context
concept/concept-notebook/machine-learning/object-detection-rcnn-yolo-ssd-detr concept:machine-learning/object-detection-rcnn-yolo-ssd-detr