Object Detection: Boxes, IoU and NMS — lecture notes
Find every object and draw a box around it. From sliding windows to YOLO-style grids, IoU and non-maximum suppression.
0:001. Introduction

Classification says what is in an image. Object detection says what and where: it draws a labelled box around every object.
0:092. Sliding windows

The classic approach slides a window across the image and asks a classifier: is there a car here? The score rises when the window covers a car. But a real image needs thousands of windows at many sizes, which is very slow.
0:273. Modern detectors

Modern detectors like YOLO look once. The image is divided into a grid, and every cell predicts boxes and confidence scores for objects centred in it, all in a single pass. That produces many overlapping candidate boxes. Non-maximum suppression keeps the best box for each object and removes the duplicates.
0:494. IoU

How do we measure whether a predicted box is right? Intersection over union: the overlap area divided by the combined area. Zero means no overlap, one means a perfect match. As the prediction slides into place, IoU rises to 0.6, and a common rule counts 0.5 or more as a correct detection.
1:115. Detector families

Two-stage detectors, like Faster R-CNN, first propose regions and then classify them: accurate but slower. One-stage detectors, like YOLO and SSD, predict everything in one pass, fast enough for real-time video.
1:246. Recap

To recap. Detection gives a class and a box for every object. Modern detectors predict many boxes at once. IoU measures overlap, and non-maximum suppression removes duplicates.
Key takeaways
- Object detection predicts a class and a bounding box for each object.
- IoU = overlap area ÷ union area; 0.5 is a common threshold for a correct box.
- Non-maximum suppression keeps the highest-scoring box and removes overlapping duplicates.
- One-stage detectors (YOLO, SSD) are fast; two-stage detectors (Faster R-CNN) are very accurate.
Check yourself
- What does IoU measure?
Show answer
How much two boxes overlap — Intersection over union compares overlap to total area.
- What is non-maximum suppression for?
Show answer
Removing duplicate overlapping boxes — It keeps the best box and suppresses its overlapping neighbours.
- Why were sliding windows slow?
Show answer
They classify thousands of windows at many sizes — Exhaustive scanning is expensive.
Go deeper
- Object Detection II: YOLO and Real-Time Detection · The AI Lecture Hall
- Object Detection I: R-CNN, Fast R-CNN and Faster R-CNN · The AI Lecture Hall
- Object Detection III: SSD, RetinaNet and the Focal Loss · The AI Lecture Hall
© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/object-detection.html