GUEST MODEYou are exploring public lessons. Sign in to save progress to Supabase!
Sign In Free →
Back to Learn CV
BEGINNERCOMPUTER VISIONCORE TASK

Object Detection
(2D)

Object detection is the task of finding objects inside an image, identifying what they are, and locating exactly where they appear. It is one of the foundations of modern computer vision.

What Is Object Detection?

Classification tells us what an image contains. Detection goes further: it tells us what objects exist, where they are, and how confident the model is about each prediction.

Image
Visual Features
Object Locations
Classes + Confidence
Object Detection = Classification + Localization + Multiple Objects

For example, a single image may contain three people, two cars, and a bicycle. A detector must find every object separately and assign each one a class.

Bounding Boxes: The Language of Detection

The most common output of 2D object detection is a bounding box. A bounding box is a rectangle that surrounds a detected object.

Image
Rectangle
Class
Confidence

What Does a Detection Contain?

Coordinates

The position of the box, commonly represented as x₁, y₁, x₂, y₂ or center-x, center-y, width, and height.

Class

The category assigned to the object, such as person, car, tumor, defect, or product.

Confidence

A score representing how confident the model is in the predicted class and detection.

Detection:
{
    class: "car",
    confidence: 0.94,
    box: [120, 80, 520, 410]
}

Intersection over Union (IoU)

To determine whether a predicted box is correct, we compare it with the ground-truth box using IoU.

                    Area of Overlap
IoU = ─────────────────────────────────────
       Area of Prediction ∪ Ground Truth

IoU = 1.0  → Perfect overlap
IoU = 0.0  → No overlap

A higher IoU means that the predicted box is closer to the real location of the object.

CNN-Based Object Detection

Before transformers became dominant, CNNs were the main engine behind modern object detection.

A Convolutional Neural Network (CNN) learns visual features by applying convolutional filters across the image. Early layers learn simple patterns, while deeper layers learn more meaningful visual structures.

Pixels
Edges
Textures
Parts
Objects

How CNN Features Build Up

Early Layers

Detect edges, corners, gradients, and simple visual patterns.

Middle Layers

Combine simple patterns into textures, shapes, and object parts.

Deep Layers

Represent high-level concepts useful for recognizing objects.

From CNN Features to Detection

A detector uses the feature maps produced by a CNN backbone and predicts where objects are located and what classes they belong to.

Input Image
     ↓
CNN Backbone
     ↓
Feature Maps
     ↓
Detection Head
     ↓
Bounding Boxes + Classes + Confidence

This CNN-based design is the foundation of many highly successful detectors, including the YOLO family.

Transformer-Based Object Detection

Transformers introduced a different way of understanding images: instead of processing only local visual patterns, they can model relationships between different regions of the image.

Vision Transformers divide an image into patches and use self-attention to determine which parts of the image are important to each other.

Image
Image Patches
Self-Attention
Global Features
Objects

Why Attention Matters

Imagine an image containing a person holding a tennis racket. Understanding the relationship between the person, the hand, and the racket can be useful for detection and visual reasoning.

Image Regions:

[ Person ] ←──── Attention ────→ [ Racket ]
     ↑                                  ↑
     └──────── Global Context ─────────┘

Transformer-based detectors can use this global context to reason about the image as a whole rather than treating every region independently.

YOLO: Fast Detection with CNNs and Modern Backbones

YOLO — You Only Look Once is one of the most recognizable names in object detection. The goal is simple: process an image efficiently and predict detections in a single model pipeline.

Image
Backbone
Neck
Detection Head
Predictions

The Main Parts of a YOLO Detector

Backbone

Extracts visual features from the input image.

Neck

Combines features at different scales to detect both small and large objects.

Head

Predicts boxes, classes, and confidence scores.

YOLO models are widely used because they provide a practical balance between accuracy, speed, and ease of deployment. This makes them useful for real-time applications such as cameras, robotics, industrial inspection, and edge AI.

RF-DETR: Transformer-Based Detection

RF-DETR represents a modern DETR-style approach to object detection. Instead of following the traditional YOLO-style detection design, it uses transformer-based visual reasoning.

Image
Feature Encoder
Transformer
Object Queries
Detections

Object Queries

A key idea in DETR-style models is to predict a fixed set of possible objects. Each prediction can represent one object in the image.

Image
  ↓
Transformer Encoder
  ↓
Object Queries

Query 1 → Person
Query 2 → Car
Query 3 → Bicycle
Query 4 → No Object

This provides a fundamentally different perspective on detection compared with traditional pipelines that generate many candidate boxes and then filter duplicates.

CNN Detectors vs Transformer Detectors

ConceptCNN-Based DetectionTransformer-Based Detection
Visual ProcessingConvolutional filters learn local patterns.Attention models relationships between image regions.
Feature UnderstandingHierarchical features built through convolutional layers.Global context can be modeled across the image.
Detection ExamplesYOLO-style architectures.DETR-style architectures such as RF-DETR.
StrengthEfficiency and strong real-time performance.Global reasoning and modern attention-based representations.
Note: There is no universally best architecture. The right model depends on your dataset, object sizes, hardware, latency requirements, accuracy requirements, and deployment environment.

Object Detection in Vyrion Vision

Learn the Theory. Run the Models. Compare the Results.

Vyrion Vision brings object detection from theory into practice. You can work with different detection models, run them on your own data, visualize their predictions, and compare their behavior.

Use supported object detection models such as YOLO and RF-DETR to perform inference on images and other supported inputs.

Upload a trained model and test it on new images. Inspect bounding boxes, classes, confidence scores, and failure cases.

Run different models on the same input and compare the results. For example, you can compare a YOLO detector with an RF-DETR detector on the same image or dataset.

Same Input
YOLO
+
RF-DETR
Compare Predictions
Same Image
     │
     ├──→ YOLO
     │       └──→ Boxes + Classes + Confidence
     │
     └──→ RF-DETR
             └──→ Boxes + Classes + Confidence

Compare:
• Which objects were detected?
• Which boxes are more accurate?
• Which model misses objects?
• Which model produces false detections?
• Which model is faster?

That is the difference between simply downloading a model and actually understanding how models perform on your data.

How Detection Models Are Evaluated

A good object detector must locate objects accurately and identify them correctly.

IoU

Measures overlap between the predicted bounding box and the ground-truth box.

Precision

Measures how many predicted detections are correct.

Recall

Measures how many real objects the model successfully finds.

mAP

Combines precision and recall across classes and IoU thresholds.

Latency

Measures how long the model takes to process an input.

FPS

Measures how many frames the model can process per second.

Real-World Model Evaluation:

Accuracy
    +
Speed
    +
Memory
    +
Robustness
    +
Deployment Requirements

Key Takeaways

Boxes

Bounding boxes describe where objects are located in a 2D image.

CNNs

Convolutional networks learn hierarchical visual features from pixels.

Transformers

Attention allows models to reason about relationships across image regions.

YOLO

A practical and highly popular approach for fast object detection.

RF-DETR

A modern transformer-based detection architecture.

Vyrion Vision

Run, test, visualize, and compare detection models on your own data.