What AI Can and Cannot Do

How Computers Recognize Objects in Photos, and Where They Fail

How software learns to name and locate things in pictures, how its accuracy is measured, and the conditions that commonly break it.

Key takeaways

  • To software, a photo is a grid of numbers, and recognition is a learned mapping from those numbers to labels or locations.
  • Classification, detection and segmentation answer different questions and fail in different ways.
  • Systems can latch onto backgrounds and other shortcuts that happen to match the label in the training pictures.
  • Poor lighting, odd angles, blocked views, small objects and unfamiliar settings are common sources of error.
  • Precision and recall measure two different mistakes, and improving one often costs some of the other.

A computer recognizes objects by learning statistical patterns that connect arrangements of pixels with labels such as "dog", "bicycle" or "stop sign". It learns those patterns from very large collections of example images. It then applies them to new pictures and reports its best guess, usually with a score.

This works remarkably well when new photos resemble the examples. It fails, sometimes in strange ways, when they do not. Understanding why gives you a good sense of when to trust a photo app, a camera alert or an automated inspection.

A picture as numbers

A digital photo is a grid of tiny squares called pixels. Each pixel in a color image is typically stored as three numbers for the amounts of red, green and blue. Even a modest picture holds hundreds of thousands of these values.

Nothing in the numbers announces "cat". Move the camera slightly, dim the light or change the cat, and almost every value changes while the answer stays the same. For decades programmers tried to write rules by hand to bridge that gap, with limited success on everyday scenes.

The modern approach lets the system learn the bridge. A neural network (a layered set of simple calculations with adjustable numbers) is shown many labeled pictures. Its numbers are nudged repeatedly so that its guesses match the labels more often. The idea is explained without math in neural networks through everyday comparisons.

What the layers tend to pick up

In many image networks, early layers respond to simple features such as edges and color contrasts. Later layers combine these into textures and shapes, and later still into things resembling parts: a wheel, an eye, a handle. The final stage weighs the evidence and scores each label.

A simplified path from pixels to a label
1 Pixels A grid of color values. 2 Edges and contrasts Early layers react to simple patterns. 3 Textures and parts Patterns combine into richer shapes. 4 Scores Each possible label gets a number. 5 Decision A threshold or top score picks the output. Pixels A grid of color values. 1 Edges and contrasts Early layers react to simple patterns. 2 Textures and parts Patterns combine into richer shapes. 3 Scores Each possible label gets a number. 4 Decision A threshold or top score picks the output. 5

This picture is a simplification. Nobody programs a "wheel detector"; whatever features arise do so because they helped reduce errors in training. Some newer designs cut the image into patches and relate the patches to each other, but they too learn their features from data.

Where the labeled examples come from

The pictures used for training are usually labeled by people, who draw boxes, trace outlines or choose category names. Some newer systems also learn from huge numbers of images paired with nearby text, such as captions, which is cheaper to gather and much messier.

Labels carry human decisions with them. Someone chose the category list. Someone decided whether a stool counts as a chair. Annotators in a hurry may skip small objects or disagree about blurry ones. The system learns these habits along with everything else, and it cannot learn a category nobody gave it a way to express.

The collection matters as much as the labels. If kitchens in the training pictures mostly come from a few wealthy countries, a cooking pot or stove from elsewhere may be misread. A large dataset can still be narrow. When you evaluate a product, asking where its training and test pictures came from is more informative than asking how many there were.

Different questions, different outputs

"Object recognition" covers several tasks.

Task Question answered Typical output
Classification What is this picture of? One or more labels with scores
Detection What is here, and where? Boxes around objects, each labeled
Segmentation Which pixels belong to what? An outline or mask for each region
Open description What is going on? Sentences written by a model

A classifier forced to choose from a fixed list will pick something even for an object it has never met. A detector can miss an item or draw two boxes around one. Chat-style models that accept images can answer open questions, but they may also describe things that are not there. How they combine words and pictures is covered in multimodal models.

Shortcuts and borrowed clues

A system learns whatever predicts the labels in its training pictures, and that may not be what you intended. If most photos of cows show green pasture, the grass can become part of the evidence for "cow". A cow on a beach may then be missed, and an empty meadow may look faintly cow-like.

Say a company trains a model to tell its good parts from scratched ones, and all the scratched samples happen to be photographed on a different table. The model could score perfectly by recognizing tables. It would fail the first day on the line.

The same hazard appears in higher-stakes work, where markings or equipment differences can stand in for the condition being sought, as described in medical models that learn the wrong clue. The defense is varied training data and testing on pictures collected separately.

Conditions that commonly cause errors

  • Lighting. Glare, deep shadow, backlight and night scenes hide or distort detail.
  • Viewpoint. A chair seen from directly above may look nothing like the typical catalog angle.
  • Occlusion. Objects partly hidden behind others give less evidence.
  • Size and distance. A faraway object covering a few pixels carries little information.
  • Motion and focus. Blur erases edges and texture.
  • Weather and dirt. Rain, fog, snow or a smudged lens change appearance.
  • Rare variations. An overturned truck or a costume may be nearly absent from training.
  • New settings. Products, signs or homes from another region may look unfamiliar.

The last two belong to a broader problem: inputs unlike the training data. Deliberately altered images are a separate risk, taken up in why small changes can fool a vision system.

Measuring the two kinds of mistake

For a detector, you want to know both how often its alarms are right and how much it misses. Precision is the share of detections that are correct. Recall is the share of real objects that were found.

Here is an invented example. A street photo set contains 80 bicycles. A detector marks 90 boxes as "bicycle", and 72 of them are real bicycles.

Correct detections      72
False alarms            18      (90 − 72)
Missed bicycles          8      (80 − 72)
Precision               72 ÷ 90 = 0.80   (80%)
Recall                  72 ÷ 80 = 0.90   (90%)

Most detectors let you set a score threshold. Demanding higher scores usually removes false alarms, raising precision, but also discards some real objects, lowering recall. A doorbell camera that buzzes at every shadow and one that misses a visitor sit at opposite ends of that dial. The right setting depends on which mistake costs more.

A single "accuracy" figure can hide all this. It can also hide that performance differs between types of object, places or groups of people. Ask what was tested and on which pictures.

Scores are not certainty

A box labeled "dog 0.97" looks authoritative. The number reflects the model's internal scoring, which may not match real-world frequencies, particularly on unfamiliar images. A confident wrong label is entirely possible.

Recognition also differs from interpretation. Software may correctly find a person, a ladder and a window and still have no reliable basis for saying whether the person is cleaning the window or breaking in. Claims about intent, emotion or character drawn from a picture deserve strong skepticism.

Face recognition is a related but distinct task, matching an identity instead of naming a category, and it raises its own questions. See how face recognition works.

Video adds time, and new problems

Video is a rapid series of pictures, so the same methods apply frame by frame, often with extra steps that follow an object from one frame to the next. Seeing motion helps: a shape that is ambiguous in one frame may become obvious as it turns.

Tracking can also fail in its own ways. Two people who cross paths may swap identities in the software. An object that disappears behind a pillar may be counted twice when it returns. A system that processes only some frames, to save computing power, can miss a brief event entirely.

Using vision tools sensibly

  1. Test with your own pictures, taken with your camera, in your light, including bad days.
  2. Include cases that should return nothing, to measure false alarms.
  3. Give it a clearer view by moving closer, steadying the camera and cleaning the lens.
  4. Keep a person in the loop where a miss or a false alarm could harm someone.
  5. Recheck after changes such as a new camera position, season or product design.

Industrial users often control the scene closely, with fixed lights and angles, and that control is a large part of why camera inspection on a production line can work well. Your phone in a dim garage has no such advantage.

Common questions

Does the system see the object the way I do?

There is no good reason to assume so. It can agree with you on thousands of photos while relying partly on different cues, which becomes visible when it makes a mistake no person would.

Why does my photo app confuse similar items?

Categories that differ in small details, such as related plant species or dog breeds, are hard from a single image. Several angles help. Never decide that a wild plant or mushroom is safe to eat from an app's label.

Do more training pictures solve everything?

More varied examples help a great deal, especially for under-represented conditions. The world keeps producing new combinations, so testing and fallback plans remain necessary.

Written for 4ArtificialIntelligence with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 42 articles in What AI Can and Cannot Do →

Latest news on this topic