CSE445Computer Vision

Deep Object Detection

Two-stage and one-stage detectors, anchors and box losses, NMS and NMS-free heads, and AP/mAP.

Key Terms

Two-StageOne-StageAnchorsIoU / GIoU LossNMSAP / mAP

Python Tools

PyTorchUltralyticsOpenCVMatplotlib

Textbook Reference

Szeliski Ch.6

Topics Covered

  1. 1Faster R-CNN: the RPN, anchors, RoI pooling, and the two-stage head
  2. 2One-stage detectors: SSD, RetinaNet focal loss, and YOLO
  3. 3Box parameterization and regression losses: smooth L1, IoU, GIoU, and DIoU
  4. 4Label assignment, non-maximum suppression, and NMS-free set prediction (DETR)
  5. 5Evaluation: precision-recall curves, AP, and mAP across IoU thresholds

Learning Outcomes

  • Contrast two-stage and one-stage detector architectures
  • Explain anchor design, label assignment, and box-regression losses
  • Compute AP and mAP and reason about NMS versus set-prediction heads

Detector walkthrough

From sliding windows to one-stage detectors

Seven stages, 26 steps: why exhaustive search fails, how each R-CNN generation removed the previous bottleneck, what an RPN does with 7,056 anchors, how YOLO and SSD skip the proposal step, and how mAP and FPS are actually computed. Every count, timing, IoU, anchor label and average precision on screen is computed live, not hard-coded.

1 / 26

IMAGE · SWEEP24×24 px · 676 positionsWINDOWS PER SCALE24px1,92432px1,82148px1,48964px1,22396px769128px373160px81total 7,680 windowsRUNNING TALLYwindow shapes19stride8 pxwindows7,680SEARCH SPACEshapes19windows7,680× 20 classes153,600HOG + SVM3.07 ssame sweep, CNN172.0 sSweep everything
car×2
person×2
sign×1

Stage 1 · Step 1 of 3

Sweep everything

Why detection cannot be a search over every window

An object can be anywhere, at any size, in any shape. Sweeping a 8-pixel grid over 19 window shapes covers all of them — and produces 7,680 crops from one 224 × 224 image.

Ns,r=(⌊W−wδ⌋+1)(⌊H−hδ⌋+1)N_{s,r} = \Big( \big\lfloor \tfrac{W - w}{\delta} \big\rfloor + 1 \Big)\Big( \big\lfloor \tfrac{H - h}{\delta} \big\rfloor + 1 \Big)
N=∑s∑rNs,r=7,680N = \sum_{s}\sum_{r} N_{s,r} = 7,680

Key idea

A linear classifier can afford 7,680 windows; a convolutional network cannot. Every detector in this lecture is an answer to that one arithmetic problem.

Playing. Selecting any stage or step pauses playback so you can inspect it.

Lecture PDFs

Deep Object Detection

The embedded PDF preview is disabled to reduce Vercel bandwidth usage. Open the lecture file directly in Google Drive for viewing, downloading, or presenting.