Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to Deep Learning Notes
Topic #392

YOLO

YOLO (You Only Look Once) reframes object detection as a single regression problem over a grid — one of the fastest and most widely deployed real-time object detection approaches, with a name that captures its core philosophy exactly.

The Core Idea: A Grid-Based Single Pass

YOLO divides the input image into an \(S\times S\) grid. Each grid cell is directly responsible for predicting: whether an object's center falls within it, that object's bounding box coordinates, a confidence score, and class probabilities — all computed in one single forward pass through the network, with no separate proposal stage and no per-region reprocessing whatsoever.

Diagram

this cell predicts the box + class

The grid cell containing the object's center is responsible for predicting its full bounding box and class, all in one forward pass.

Why "You Only Look Once"

The name directly contrasts with the R-CNN family's approach of looking at (processing) each region separately, potentially many times over — YOLO processes the entire image exactly once, extracting all detections simultaneously from that single pass, which is precisely why it achieves such high inference speed, often enabling genuinely real-time video detection.

Evolution Across Versions

YOLO has gone through many iterations (YOLOv1 through recent versions), each refining the core grid-based single-pass idea with improvements like better anchor box strategies, multi-scale prediction (borrowing SSD's multi-scale idea), and various architectural and training refinements — but the foundational "grid cell predicts directly" philosophy has remained consistent throughout.

Code

# Using the popular ultralytics YOLO implementation
from ultralytics import YOLO

model = YOLO('yolov8n.pt')   # a pretrained, lightweight YOLO variant
# results = model('image.jpg')
# results[0].boxes gives detected boxes, classes and confidence scores

Advantages and Limitations

AdvantagesLimitations
Extremely fast, real-time-capable inferenceHistorically struggled somewhat more with small or tightly clustered objects than two-stage detectors, though later versions have substantially closed this gap
Simple, unified single-pass architectureEach grid cell traditionally predicts a limited number of objects, which can be a bottleneck in dense scenes

Common Mistakes

  • Assuming YOLO's speed necessarily implies substantially worse accuracy today — modern YOLO versions have narrowed the accuracy gap with two-stage detectors considerably while maintaining a large speed advantage.

Interview Relevance

Q: "What does the name 'You Only Look Once' refer to, architecturally?" It refers to processing the entire image in a single forward pass to produce all detections at once, dividing the image into a grid where each cell directly predicts whether an object's center falls within it, along with that object's box and class — in direct contrast to two-stage detectors, which effectively process candidate regions separately (and sometimes redundantly) across multiple stages.

Practice Question

Why might YOLO's grid-based approach face challenges detecting many small, tightly-clustered objects within the same image region?

Related DL Notes

Want to go beyond the notes?

Join Coding Hubs School of AI's Deep Learning course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →