Computer vision from the ground up
Images as numbers you can see
- Intermediate
- 10 chapters
- 158 min read
What an image actually is: a grid of pixels with a shape, a range and a channel order. Then the operations that made vision work — convolution by hand, pooling and stride, colour and normalisation, augmentation, classification pipelines, detection boxes, segmentation masks and vision transformers — ending with a convolution layer whose output you can read.
What You'll Learn
- Read an image’s shape, range and channel order without guessing
- Convolve an image with a kernel and compute the output size
- Pool and stride a feature map and explain the receptive field
- Convert colour spaces and normalise with training statistics
- Choose augmentations that preserve the label
- Build a classification pipeline and read its confusion matrix
- Compute IoU and apply non-maximum suppression to boxes
- Segment an image and score the mask with per-class IoU
- Explain patch embeddings, positional encodings and attention in a vision transformer
- Build a convolution layer and trace its output shape and parameter count
Prerequisites
- Comfortable with Python lists, functions and loops
- Basic arithmetic: averages, squares and square roots
- No vision library is needed — every example is plain Python
Vocabulary
The terms the chapters assume, in plain words.
- anchor
- A reference box of a fixed size and shape that a detector adjusts to fit an object.
- augmentation
- Random changes to training images that keep the correct answer intact, such as crops, flips and brightness shifts.
- bounding box
- Four numbers marking an object’s edges, either as two corners or as a centre, width and height.
- channel
- One grid of values per colour or per learned pattern; an RGB image has three such grids.
- convolution
- Sliding a small grid of weights across an image, multiplying and summing at each position.
- feature map
- The grid of responses one kernel produces when slid across an image.
- IoU
- The overlap area of two boxes divided by the area they cover together; one means identical, zero means no overlap.
- kernel
- The small grid of weights a convolution slides over an image.
- normalisation
- Rescaling values to a common range or spread, often using statistics from the training images.
- padding
- Extra values, usually zeros, added around an image’s border so a sliding window can reach the edge.
- pixel
- One number in an image grid, giving brightness or colour strength at a single position.
- pooling
- Summarising each small window of a feature map into one value, such as its maximum or average.
- receptive field
- The part of the input that can affect one output value.
- stride
- How far a sliding window moves between positions; larger steps shrink the output.
Course Content
- 01Pixels and channelsNot started
An image is a grid of numbers with a colour model attached. Almost every vision bug starts with the shape, the range or the channel order.
- 02Convolution by handNot started
A convolution slides a small kernel over an image, multiplying and summing. The kernel is the learned part; the sliding is the architecture.
- 03Pooling and strideNot started
Pooling throws away resolution and keeps the strongest response. Stride does the same thing inside the convolution, and the arithmetic is the same.
- 04Colour and normalisationNot started
Colour is a coordinate system, and normalisation is a promise about the numbers a network receives. Both are decided before the first layer and both are easy to get wrong.
- 05AugmentationNot started
Augmentation is a prior written as transforms: it tells the model which changes do not matter. The label has to survive every transform, or the model learns noise.
- 06Classification pipelinesNot started
A classifier is a pipeline: data, transform, model, logits, softmax, argmax. The model is one box in it, and the boxes around it decide whether the number means anything.
- 07Detection and boxesNot started
A detector answers two questions at once: what is here, and where is it. The where is a box, and every box metric is built from overlap.
- 08SegmentationNot started
A segmentation model labels every pixel. The mask, the loss and the metric each have their own failure mode, and the rare class is usually the one that matters.
- 09Vision transformersNot started
A vision transformer turns an image into a sequence of patches and lets attention relate them. The patch size, the positional embedding and the data budget decide whether it works.
- 10Capstone: a convolution layer and its outputNot started
A convolution layer is a bank of kernels with a bias, applied over every position and every input channel. Build one and the shapes stop being mysterious.
