What Is Object Detection? Bounding Boxes, YOLO and Two-Stage Models

Updated · By Viviai

Object detection is a computer vision task that both identifies what objects are in an image or video and locates where they are, returning a bounding box, a class label, and a confidence score for each detected object. Unlike image classification, which assigns one label to the whole image, object detection handles several objects at once and marks their positions. It is used in surveillance, autonomous driving, medical imaging, and retail inventory.

Object detection vs image classification

The difference matters because the two tasks answer different questions.

Each detection carries three pieces of information:

Output Meaning
Bounding box Coordinates that frame the object
Class label The category, such as car or person
Confidence score How likely the model considers the detection

The bounding box is usually stored as corner coordinates or as a center point with width and height, normalized or in pixels depending on the model.

How a modern detector works

Many detectors are neural networks organized into three stages.

  1. Backbone: a convolutional network or vision transformer that turns the image into feature maps.
  2. Neck: a component such as a feature pyramid network that merges features across scales so both small and large objects are represented.
  3. Head: the part that predicts class scores and box coordinates at many positions.

Because neighboring positions can fire on the same object, the raw output contains many overlapping boxes. Pipelines drop low-scoring boxes and run non-maximum suppression (NMS), which keeps one box per object. End-to-end detectors such as DETR are trained to emit one prediction per object and can skip this step.

One-stage vs two-stage detectors

Detector designs differ mainly in how candidates are found.

Factor Two-stage (e.g. Faster R-CNN) One-stage (e.g. YOLO)
Process Proposes regions, then classifies them Predicts boxes and classes in one pass
Speed Usually slower Usually faster, suited to real time
Accuracy Often strong on precise localization Competitive, with lighter variants
Typical use Accuracy-focused work Video, cameras, edge devices

Two-stage models first propose regions that may contain an object, then classify and refine each one. One-stage models predict all boxes and classes in a single forward pass.

Why YOLO became widely used

YOLO, short for You Only Look Once, was introduced in 2015 as a one-stage detector. It reframes detection as a single regression problem from image pixels to box coordinates and class probabilities. The original model divided the image into a grid, where each cell predicted boxes and class probabilities, and ran fast enough for real-time video.

The family has since expanded through many versions, including smaller variants that run on limited hardware. This makes it common in projects where inference speed matters, such as cameras and edge AI devices.

Where object detection is used

It also serves as a foundation for more complex tasks such as instance segmentation, pose estimation, and object tracking, which need accurate localization as an intermediate step.

Limits and practical notes

Detectors can miss objects or raise false boxes, especially in poor lighting, with unusual angles, or when an object is partly hidden. Small objects and crowded scenes remain harder than large, clear ones. They also depend on data labeling, since training needs boxes drawn around example objects, and the quality of those labels affects results.

How it relates to other concepts

Object detection sits within computer vision and mostly builds on convolutional neural networks, with newer models using vision transformers. The boxes and labels it predicts are produced by trained models, and smaller versions are often deployed on edge devices for real-time use.

FAQ

What is a bounding box?

A bounding box is a rectangle that frames an object in an image, usually defined by coordinates. Together with a class label and confidence score, it forms one detection.

Is object detection the same as image classification?

No. Classification assigns one label to the whole image, while detection finds several objects and gives the location of each one with a box.

What does non-maximum suppression do?

NMS removes overlapping boxes that refer to the same object, keeping the box with the higher score so each object is represented once.

What is the difference between one-stage and two-stage detection?

Two-stage models propose regions and then classify them, while one-stage models such as YOLO predict boxes and classes in a single pass, generally trading some precision for speed.

Can object detection run on a camera or small device?

Yes. Lightweight one-stage models are designed to run in real time on cameras and edge hardware, although very small models may give up some accuracy compared with larger ones.

Key takeaways

Object detection identifies both what is in an image and where it is, returning a box, a label, and a confidence score for each object. Modern detectors use a backbone, neck, and head, with NMS to remove duplicate boxes. Two-stage models tend to favor accuracy, while one-stage models such as YOLO favor real-time speed, and the technique underpins many practical vision systems from driving to retail.

Sources

  1. https://arxiv.org/pdf/2504.18586v2
  2. https://www.ultralytics.com/glossary/object-detection
  3. https://roboflow.com/blog/yolo-object-detection
  4. http://cv-foundation.org/openaccess/content_cvpr_2016/papers/Redmon_You_Only_Look_CVPR_2016_paper.pdf

Learn by doing

Read a guide, then practice with bite-sized AI lessons you can take offline.

Start learning free