Data Science and Data Scientist

Module 35 of 43

Module 35: Computer Vision

4 min read784 words
What you'll learn
Explain what computer vision doesUnderstand how images become dataRecognize common vision tasks

"Computer vision teaches machines to 'see' — turning pixels into understanding, from face unlock to medical scans."

Learning Objectives

By the end of this module, you will be able to:

  • Explain what computer vision does
  • Understand how images become data
  • Recognize common vision tasks

1. Images as Data

Computer vision helps computers interpret images and video. To a computer, an image is just a grid of numbers — each pixel's color as values. Vision models find patterns in those numbers.

Key idea: A photo is a grid of pixel numbers. Deep learning models (Module 33) learn to combine them — edges, then shapes, then objects — until they can say "that's a cat." It's pattern-finding on pixels.

Explain like I'm new: Zoom into any digital photo far enough and you see tiny colored squares — pixels. Each pixel is stored as numbers: how much red, green, and blue it holds (usually 0–255 each). A small 100×100 photo is therefore a grid of 10,000 pixels — 30,000 numbers once you count the three colors. To a computer, "seeing" a cat means finding a familiar pattern in that huge grid of numbers.

Because images are just numbers, everything from Module 33 applies: early layers of a network learn to spot edges and gradients, middle layers assemble those into textures and shapes (whiskers, ears), and later layers combine shapes into whole objects. Nobody hand-programs "a cat has pointy ears" — the model discovers it from thousands of labeled examples.

The workhorse behind most of this is the convolutional neural network (CNN). The clever idea is that a small pattern-detector (say, one that spots a curved edge) slides across the whole image, checking every region. That's efficient — the model reuses the same detector everywhere instead of learning "an edge in the top-left" separately from "an edge in the bottom-right." Stack many such detectors in layers and you get the edges-to-objects hierarchy. You don't need to build a CNN by hand to start, but knowing the name helps you read tutorials and documentation.

Try this: Grab 20 photos — 10 cats, 10 dogs — and sort them yourself, noting what told you which was which (ear shape, snout, eyes). You just did, by hand, what a vision model does at scale: turn visual features into a label. It makes the whole idea concrete.

2. Common Vision Tasks

TaskWhat it doesExample
ClassificationLabel the whole image"This is a dog"
DetectionFind and box objectsLocate cars in a photo
SegmentationLabel every pixelOutline a tumor in a scan
RecognitionIdentify specificsFace unlock

These four tasks form a ladder of precision. Classification answers "what is this picture?" with one label. Detection goes further — "where are the objects?" — drawing boxes around each one. Segmentation is the most precise, coloring in every pixel that belongs to an object (essential in medicine, where the exact outline of a tumor matters). Recognition narrows to identity: not just "a face" but "this specific face."

3. Where It's Used

  • Healthcare — spotting anomalies in X-rays and scans
  • Cars — detecting pedestrians and lanes
  • Retail — checkout-free stores
  • Phones — face unlock, photo search

Simple example: Sorting photos by "beach" vs. "mountain" is image classification — the model learned the visual patterns of each from many labeled examples.

Real-world use case: A self-driving car runs detection and segmentation dozens of times per second: boxing pedestrians and other cars, and coloring in the drivable road surface. All of it comes from turning each camera frame — a fresh grid of pixel numbers — into decisions like "brake" or "steer left."

Common mistake: Trusting vision models blindly in high-stakes settings. They can be fooled by odd lighting, angles, or rare cases — and mistakes in medicine or driving are serious. Keep human review where it counts (Module 3).

Data scientist tip: Vision models learn only what they're shown. Train one on daytime photos and it may fail at night; train on one demographic and it may misjudge others. Diverse, representative training images are as important as the model itself.

Key Takeaway: Computer vision interprets images, which to a computer are grids of pixel numbers. Deep-learning models find patterns from edges to objects. Common tasks are classification, detection, segmentation, and recognition — powering healthcare, cars, retail, and phones. Diverse training data matters, and humans should stay in the loop for high-stakes uses.

Further Learning

Part of the "Data Science and Data Scientist" course.