DEV Community

Cover image for How Do Machines Identify Objects?
Ganesh Kumar
Ganesh Kumar

Posted on

How Do Machines Identify Objects?

When you look at an image, you can immediately recognize things like a person, a dog, a car, or a chess piece.

But for a computer, an image is not a "dog", "car", or "chess piece".

It is just data.

In this series, I will explain how images are stored, how machines identify objects in them, and how these techniques are used in AI, robotics, and embedded systems.

Before we start talking about AI models, we first need to understand how an image works at the lowest level.

An Image Is Just Data

A digital image is represented as a collection of pixels.

For a normal RGB image, every pixel contains three values:

R = Red
G = Green
B = Blue
Enter fullscreen mode Exit fullscreen mode

For example, a single pixel might look like:

R = 255
G = 0
B = 0
Enter fullscreen mode Exit fullscreen mode

This represents pure red.

A complete image is therefore a large grid of these RGB values:

Image
 │
 ├── Pixel (R, G, B)
 ├── Pixel (R, G, B)
 ├── Pixel (R, G, B)
 ├── Pixel (R, G, B)
 │
 └── ...
Enter fullscreen mode Exit fullscreen mode

Ultimately, these values are stored digitally as bits.

For an 8-bit RGB image, each channel normally has values from:

0 → 255
Enter fullscreen mode Exit fullscreen mode

So one pixel requires:

8 bits → Red
8 bits → Green
8 bits → Blue

Total = 24 bits per pixel
Enter fullscreen mode Exit fullscreen mode

A computer therefore does not initially "see" an animal.

It sees numbers.

And this leads to the interesting question:

How can a machine look at these numbers and determine that they represent a dog, a car, or a person?

So How Does It Identify an Object?

Let's imagine our robot, WALL-E, is looking at a pile of objects.

For example:

        ┌──────────────────────────────┐
        │                              │
        │   Bottle     Rusty Can       │
        │                              │
        │       Metal Gear             │
        │                              │
        └──────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

WALL-E's camera captures this scene as an image. But to the computer, it is still just a collection of pixel values.

We want the machine to understand something like:

Plastic Bottle → Valuable → 95%
Rusty Can      → Waste    → 92%
Metal Gear     → Valuable → 93%
Enter fullscreen mode Exit fullscreen mode

But there are actually two questions the machine needs to answer:

What is it?
+
Where is it?
Enter fullscreen mode Exit fullscreen mode

For example:

Object: Plastic Bottle
Confidence: 95%

Bounding Box:
(x1, y1, x2, y2)
Enter fullscreen mode Exit fullscreen mode

The bounding box tells the machine where the object is, while the class tells it what the object is.

Once the object has been identified, another part of the system can decide what that object means for the application:

Plastic Bottle
      │
      ▼
Detected as "Plastic Bottle"
      │
      ▼
Valuable / Recyclable
      │
      ▼
Pick it up
Enter fullscreen mode Exit fullscreen mode

Or:

Rusty Can
      │
      ▼
Detected as "Rusty Can"
      │
      ▼
Waste
      │
      ▼
Ignore it
Enter fullscreen mode Exit fullscreen mode

This ability to find objects and determine what they are is called object detection.

But how does a machine actually learn to recognize a bottle, a can, a dog, or a chess piece from millions of pixel values?

That is where neural networks and object-detection models such as YOLO come into the picture.

How Did We Start Doing This?

If you are already familiar with neural networks, some of the concepts in this series will be easier to understand.

But if you don't know neural networks yet, don't worry.

We will learn the necessary concepts throughout the series.

One of the earlier approaches to object detection was based on techniques such as R-CNN (Region-based Convolutional Neural Networks).

The basic idea was:

Image
  │
  ▼
Find possible regions
  │
  ▼
Examine each region
  │
  ▼
Classify the object
  │
  ▼
Object + Bounding Box
Enter fullscreen mode Exit fullscreen mode

The problem is that processing many candidate regions separately can be computationally expensive.

This becomes especially challenging when we want real-time detection.

For example, imagine a camera continuously producing:

30 frames / second
Enter fullscreen mode Exit fullscreen mode

We need to process those frames quickly enough to keep up with the camera.

If processing one frame takes too long, the system cannot respond in real time.

This created the need for faster object-detection approaches.

How Did YOLO Come Into the Picture?

One of the most influential approaches is YOLO — You Only Look Once.

Instead of treating object detection as a collection of separate region-classification problems, YOLO approaches the image more directly and performs object detection in a single unified pipeline.

Conceptually:

Image
  │
  ▼
 YOLO
  │
  ├── Object 1 → Dog → Bounding Box
  ├── Object 2 → Person → Bounding Box
  └── Object 3 → Car → Bounding Box
Enter fullscreen mode Exit fullscreen mode

This makes YOLO particularly useful for applications where speed matters.

YOLO-based object detection can be used in areas such as:

  • surveillance cameras
  • autonomous systems
  • robotics
  • industrial inspection
  • traffic monitoring
  • drones
  • medical imaging
  • mobile applications
  • embedded systems

And this is where YOLO becomes particularly interesting.

We are not limited to running an object-detection model on a powerful desktop or server.

We can also deploy computer-vision models on embedded systems.

From an Image to an Embedded System

Imagine a camera mounted on a small robot.

The camera continuously captures images:

Camera
   │
   ▼
RGB Image
   │
   ▼
Object Detection Model
   │
   ▼
"Person detected"
   │
   ▼
Robot decides what to do
Enter fullscreen mode Exit fullscreen mode

The detection model does not necessarily need to run on a powerful desktop computer.

It can potentially run directly on an embedded device.

For example:

Camera
   │
   ▼
Embedded Computer
   │
   ├── Image preprocessing
   │
   ├── YOLO model
   │
   └── Post-processing
   │
   ▼
Detected Objects
Enter fullscreen mode Exit fullscreen mode

The embedded system can then use the detection result to control something in the physical world:

Person detected
      │
      ▼
Stop motor

Object detected
      │
      ▼
Trigger alarm

Vehicle detected
      │
      ▼
Control traffic system
Enter fullscreen mode Exit fullscreen mode

So the complete journey looks like this:

Physical World
      │
      ▼
Camera
      │
      ▼
RGB Pixels
      │
      ▼
Numerical Representation
      │
      ▼
Neural Network
      │
      ▼
Object Detection
      │
      ▼
Decision
      │
      ▼
Physical Action
Enter fullscreen mode Exit fullscreen mode

This is the basic idea behind many modern computer-vision systems.

What I Will Cover in This Series

In this series, I will focus on YOLO and understand what actually happens between the camera image and the final detection.

We will go from:

RGB Image
    ↓
Image preprocessing
    ↓
YOLO
    ↓
Feature extraction
    ↓
Object detection
    ↓
Bounding boxes
    ↓
Class prediction
    ↓
Confidence score
    ↓
Real-time inference
    ↓
Embedded deployment
Enter fullscreen mode Exit fullscreen mode

The goal is not just to learn how to run:

model.predict(image)
Enter fullscreen mode Exit fullscreen mode

but to understand what is happening underneath.

How does a collection of RGB values become meaningful features?

How does a neural network learn that a particular pattern represents a dog?

How does YOLO locate that dog inside an image?

And finally, how can the same model be deployed on an embedded system and used to make decisions in the physical world?

That is the journey we will explore in this series.

Thanks for reading!

I'm Ganesh, and I'm building MakeSense, an AI tool that turns public GitHub pull requests into concise summaries, prioritized insights, and interactive quizzes.

It's free, unlimited, and source-available.

If you review open-source code, I'd love for you to give it a try and share your feedback.

MakeSense: makesensegithub.com

Top comments (0)