Computer Vision (CV)

How computers turn a grid of pixel values into labels, boxes and masks — the task ladder, the 2012 hinge, and where vision is reliable versus brittle.

Published Updated

On this page

Definition

Computer vision is the field that gets a computer from a grid of numbers to a description a person would recognise — a label for the photo, a box drawn round an object, a mask covering every pixel that belongs to it. What it can reliably do today is narrower than the demos suggest: in constrained settings with a fixed camera, controlled lighting and a known set of objects — factory defect inspection, barcode scanning, document and licence-plate reading — vision runs unattended at industrial volume, while in open, uncontrolled scenes it is still routinely wrong in ways no human would be.

To see why that gap exists, look at what an image actually is to the machine. A single 1920x1080 colour photograph is 1920 x 1080 x 3 = 6,220,800 numbers, one per pixel per colour channel, each an integer from 0 to 255 — so a single pixel is one of 256 x 256 x 256 = 16,777,216 possible colours. Nothing in that array says "cat". Photograph the same cat a metre to the left, or under a tungsten bulb rather than daylight, or half-hidden behind a chair, and almost every one of those 6.2 million values changes. Meanwhile a different grey furry object in the same pose under the same light can produce an array almost identical to the first.

That is the whole difficulty, stated precisely: small distances in pixel space do not correspond to small distances in meaning, and large distances do not correspond to large ones. Everything the field has built — hand-tuned edge detectors in the 1980s, convolutional neural networks since 2012, transformer-based vision models since 2020 — is an attempt to construct a representation in which lighting, pose, scale and occlusion move an image only slightly and a change of identity moves it a lot. Video raises the stakes rather than changing the problem: a 30 fps 1080p stream is 186,624,000 values per second, and the system has to work out which of the changes between frames carry meaning.

How It Works

Every vision system, old or new, has the same two stages: turn pixels into features, then turn features into an answer. What changed in 2012 was who designs the first stage.

Before then, features were designed by hand. SIFT (Lowe, 1999) described a keypoint by the local histogram of gradient orientations, built deliberately so that rotating or rescaling the image left the description roughly intact; HOG (Dalal and Triggs, 2005) tiled a whole image with the same idea and fed the result to a linear classifier, which for several years was the best pedestrian detector anyone had. A researcher decided what mattered about a patch, wrote it down as arithmetic, and a comparatively simple model learned only the final decision. This worked, and it was also the ceiling: improving a detector meant a person having a better idea about gradients.

The hinge was ImageNet Classification with Deep Convolutional Neural Networks, the 2012 AlexNet paper — and the thing worth remembering about it is a mechanism, not a milestone. With 1.2 million hand-labelled training photographs across 1,000 categories on one side and two consumer graphics cards on the other, learning the features from data became cheaper than designing them by hand. A network of 60 million parameters, trained for about six days on two GTX 580 cards, discovered its own edge and colour-blob detectors in its first layer and its own object-part detectors deeper in. It cut top-5 error on the ImageNet challenge to 15.3% against 26.2% for the second-place entry — a gap larger than the previous several years of hand-engineering combined. Every serious vision system since learns its features.

The mechanics of that learning belong to two other entries and are not repeated here: convolution is the operation itself, and convolutional neural networks explain why sliding one small filter across every position — rather than wiring every pixel to every neuron — is what makes learning from images tractable at all. What matters at this level is the consequence. A modern vision system is defined less by its architecture than by the labelled data it was trained on, and the shape of those labels is what separates one vision task from another. Generating images rather than interpreting them is the inverse problem, and belongs to image generation.

Types

The field's standard task taxonomy is a ladder. People routinely use "recognition" for all of it, but the rungs are genuinely different problems, and each costs more than the one below for a reason visible in the labels.

Image classification

One label for the entire image. The output is a choice among N fixed categories, the training signal is a single number per photo, and the annotation is one click. This is the cheapest thing a vision system can be asked to do and the reason classification datasets are the largest. It is also structurally limited: a classifier can tell you a bicycle is present and can say nothing whatever about where it is or how many there are.

Object detection

A label plus a location, usually a rectangle given by four numbers. Detection is harder than classification for a reason that has little to do with accuracy: the number of answers varies per image. The model must decide how many objects there are as well as what and where they are, then suppress its own duplicate guesses, then separate two overlapping instances of the same class. Annotation is correspondingly slower — the extreme clicking paper (Papadopoulos et al., 2017) measured conventional high-quality box drawing at about 35 seconds per box, and its own faster protocol at about 7.

Image segmentation

A label for every pixel. On the 1080p frame above that is 2,073,600 labels for a single image instead of one. Semantic segmentation assigns each pixel a category ("road", "pedestrian"); instance segmentation additionally separates individual objects of the same category. The cost lands on boundaries: a human has to trace the outline of a pedestrian, hair and shopping bag included, and the Cityscapes authors reported that annotation and quality control of a single street scene took more than 1.5 hours on average. Their finely annotated set therefore contains 5,000 images where the ImageNet classification set contains 1.2 million.

Tracking and 3-D understanding

Identity over time, depth, and geometry. The new requirement is consistency: an object that passes behind a pillar and reappears must be given the same identity, which no single-frame model can guarantee. Depth is harder still, because a single camera measures no depth at all — it must be inferred from motion between frames, from stereo disparity between two cameras with a known baseline, or from learned priors about how large things usually are. Annotation means either labelling a whole sequence consistently or introducing a second sensor such as LiDAR whose output must itself be registered to the image.

Real-World Applications

The pattern in every reliable deployment is the same, and it is worth naming: the world was engineered to suit the camera, not the other way round.

Retail barcode and QR scanning is the purest case. The object being read was designed to be machine-readable — printed at known contrast, in a fixed symbology, carrying a check digit that catches most misreads before anything acts on them. An EAN-13 barcode is not a hard vision problem because it was built not to be one. The same logic covers cheque and document processing: the MICR line at the bottom of a cheque uses E-13B, a typeface designed in the 1950s specifically so that machines could read it, and consumer mobile deposit works because the hard part was solved by the font.

Industrial inspection is the second family. A camera bolted above a production line sees the same part, in the same orientation, under the same lamp, hundreds of times a minute; the variation that makes open-world vision hard has been engineered out of the scene, and what remains is close to comparison against a known-good template. Automatic number-plate recognition in tolling and car parks works for the same reason — standardised, high-contrast, often retroreflective plates, a camera at fixed geometry, and usually its own infrared illuminator so that the lighting never changes.

Consumer photo search is a third family, distinguished by economics rather than physics: Google Photos and Apple Photos classify billions of images where a wrong answer costs the user a mildly irritating search result, so accuracy that would be unacceptable in a safety system is entirely adequate. Broadcast sports tracking such as Hawk-Eye sits between the two — uncontrolled outdoor lighting, but many calibrated cameras at known positions, which turns a hard 3-D inference into a solvable geometry problem.

Two of the largest application areas have their own entries because they are large enough to be misdescribed in a paragraph: medical imaging, where the great majority of regulator-approved AI devices sit, is covered in AI healthcare, and perception for driving in autonomous vehicle safety.

Challenges

The annotation economics

This is the field's real constraint and it is rarely stated plainly. Put the three annotation costs on one scale: a classification label is about a second of human attention, a bounding box about 35 seconds, and a Cityscapes-quality segmentation mask more than 1.5 hours — that is 5,400 seconds. A mask costs roughly 150 times a box and around 5,000 times a click.

Multiply that out and the whole cost structure of computer vision becomes visible. Labelling ImageNet's 1.2 million training images to Cityscapes segmentation quality would take about 1.8 million person-hours: 205 years of continuous round-the-clock work, or a hundred annotators working full-time for roughly nine years. Nobody has done it, and that is exactly why the ImageNet classification set has 1.2 million images while the Cityscapes fine-annotation set has 5,000 — a 240-fold difference driven almost entirely by the price of a label.

Two consequences follow. First, nearly every segmentation and detection model in production starts from a backbone pre-trained on a large classification corpus and is then fine-tuned on a small task-specific one, because the cheap labels are the only ones available in bulk. Second, if you are scoping a vision project, the annotation budget — not the model — usually decides what is feasible, and choosing detection over segmentation can be the difference between a two-week and a two-year data effort.

Why deployed systems break

Brittleness in vision is not vague unreliability; it has specific, well-documented mechanisms.

Distribution shift is the most common and the most underestimated. Models absorb the photographic conventions of their training data along with the objects. ObjectNet (Barbu et al., 2019) tested this directly by crowdsourcing 50,000 photographs of 313 everyday object classes with backgrounds, rotations and viewpoints deliberately randomised — a teapot on its side on a bathroom floor rather than upright on a kitchen counter. Leading detectors lost 40–45% of their performance, and, crucially, fine-tuning on the new images recovered very little. What they had partly learned was where teapots usually appear, not what a teapot is. In practice this shows up as a model that works on the pilot camera and degrades on the next one installed.

Adversarial fragility follows from the geometry of the input space. A CIFAR-10 image is 32 x 32 pixels — 1,024 pixels, or 3,072 numbers with colour. In a space of that many dimensions the learned decision boundary passes close to almost every natural image, so a tiny step in a carefully chosen direction crosses it. The one-pixel attack (Su et al., 2019) exploited exactly this: changing a single one of those 1,024 pixels pushed about 68% of test images into some wrong class. Nothing about the image looks different to a person.

The long tail is a counting problem, not an accuracy problem. A classifier trained on 1,000 categories has, by construction, nothing to say about the 1,001st, and rare events are where deployments actually fail. The error rate compounds with throughput in a way that per-image benchmark scores hide: at 99% per-frame accuracy — a figure that sounds excellent — a 30 fps camera produces 1,800 frames a minute and therefore about 18 wrong calls a minute. For photo tagging that is invisible. For a system where each call triggers an action, it is 18 incidents a minute, and this arithmetic is the single most common reason a promising pilot never reaches production.

The practical lesson is narrow enough to act on: evaluate a vision system on images captured by the camera it will actually run on, in the lighting it will actually face, and count errors per unit of time rather than per image. See robustness for the general form of this problem.

Frequently Asked Questions

It does not see anything — it receives a grid of numbers. A 1920x1080 colour photo arrives as 1920 x 1080 x 3 = 6,220,800 integers between 0 and 255, one per pixel per colour channel. Nothing in that array says 'cat'. The entire field exists to bridge the gap between those numbers and a description a person would recognise.
They differ in the shape of the answer. Classification returns one label for the whole image. Detection returns a label plus a box for every object, so the system must also decide how many answers to give. Segmentation returns a label for every pixel — over two million labels on a 1080p frame instead of one. Each step up costs far more to annotate, which is why segmentation datasets are hundreds of times smaller than classification datasets.
Because learning the features became cheaper than designing them. Until then a researcher decided what mattered about an image patch and wrote it down as arithmetic (SIFT, HOG). In 2012 AlexNet showed that with 1.2 million labelled ImageNet photos and two consumer GPUs, a network could discover better features on its own — cutting top-5 error from 26.2% to 15.3% in a single year.
Wherever the scene is constrained: a fixed camera, controlled lighting and a known set of objects. Barcode scanning, industrial defect inspection, document and cheque OCR, and licence-plate reading all run unattended at industrial volume. In each case the world was engineered to suit the camera rather than the other way round.
They partly learn the photographic conventions of their training set rather than the objects. When ObjectNet deliberately randomised backgrounds, rotations and viewpoints across 50,000 images and 313 classes, leading detectors lost 40-45% of their performance — and fine-tuning on the new data recovered very little.
Image processing takes an image in and returns an image out — sharpening, denoising, colour correction. Computer vision takes an image in and returns meaning out — a label, a box, a mask, a measurement. Vision systems normally use image processing as a preparatory step, but the goal is interpretation rather than enhancement.

Continue Learning

Explore our use-case guides and prompts to deepen your AI knowledge.