3.4.12 · D1Convolutional Neural Networks

Foundations — Image classification pipeline

3,834 words17 min readBack to topic

Before you can read the parent note, you must be fluent in the alphabet it speaks. This page introduces every symbol and idea it assumes, from absolute zero, in the order they build on each other. Read top to bottom; nothing later uses anything not yet defined.


1. A pixel, and the number that is a pixel

Look at the figure. A photo is a grid: rows and columns of these little squares. Zoom in far enough and the "cat" dissolves into a spreadsheet of numbers.

Figure — Image classification pipeline
Figure 1 — Left: a picture as your eye sees it. Right: the very same picture as the computer stores it, one integer per pixel (0–255). The figure exists to hammer home the single most important mental model on this page: an image is literally a grid of numbers.


2. Colour channels and the symbols , ,

A colour image is not one grid but three stacked grids: one for Red, one for Green, one for Blue (RGB). Each grid has the same shape.

Figure — Image classification pipeline
Figure 2 — A colour image is three grids stacked into a box: one grid per channel (R, G, B). The box is tall, wide, and deep. This figure defines what the symbol looks like as a physical shape, so the notation below is a picture you already know.

So just means "a colour image that is 224 pixels tall, 224 pixels wide". It is the picture in figure 2, written in symbols.


3. Subscripts and indexing: ,

We constantly need to point at one specific number inside the grid. That is what a subscript does.


4. The Greek letters: , ,

The parent note leans on three Greek symbols. Here is each in plain words.

Figure — Image classification pipeline
Figure 3 — Six pixel values shown as dots on a number line. The amber vertical line is the mean (the balance point); the white double-arrow shows the spread, roughly one standard deviation on each side. The figure turns the abstract words "average" and "spread" into two visible distances.


5. Summation — the "add up a list" symbol

This is the single most important symbol in the whole parent note, and it looks scary only until you unpack it.

Every big formula in the parent — the convolution sum, the softmax denominator, the cross-entropy loss — is just one or two of these loops nested. Learn to read and half the notation is already yours. (Later, once we introduce the number of classes in §9, you will see the upper limit written as instead of the generic — same symbol, just a specific value for how many items to add.)


6. Functions, the forward pass, and the prediction

Now the whole network can be written as one nested onion: Data flows left-in, right-out — that flow is what "forward pass" means. You already know every symbol here except softmax, which §9 builds from scratch.


7. Logits — the raw scores the last layer produces


8. The exponential — why softmax lives on it

Figure — Image classification pipeline
Figure 4 — The curve . It never touches or crosses zero (always positive, even for negative ), and it climbs steadily left to right (order-preserving). These are exactly the two properties that make it the right tool for turning logits into probabilities.


9. Softmax — assembling and into probabilities

You now own every ingredient: the logits (§7), the exponential (§8), and the sum (§5). Softmax is just those three snapped together.


10. Logarithm — the undo button, and the loss it builds


11. Argmax — turning probabilities into a decision

You already met the prediction list (§6, §9) and the true one-hot label (§10). One tool remains: how to read off the final answer.


12. How it all connects

Pixel = a whole number 0 to 255

Grid X shaped H by W by 3 of real numbers

Subscripts pick one entry

Mean mu and spread sigma

Normalization slides and scales each entry

Summation adds up lists

Forward pass f of layer l gives y-hat

Logits z one raw score per class

Exponential e to the x

Softmax turns z into probabilities y-hat

Logarithm undoes exponential

Cross entropy loss

One-hot y is the true label

Argmax picks the winning class

Predicted label

Backpropagation tunes theta

Everything upstream (numbers, grids, sums, Greek letters, , ) feeds the three big machines of the parent note: normalization, softmax, and cross-entropy loss. With these foundations you can also step sideways into Transfer learning, ResNet architecture, Multi-label classification and Object detection, all built on the very same alphabet. Return to the parent pipeline note when this checklist is green.


Equipment checklist

Cover the right side and test yourself (the ::: separates the prompt from the hidden answer). If any answer surprises you, reread that section.

What does a pixel value of mean?
Maximum brightness for that channel (white / full light).
How does an integer pixel become an entry of the real-valued tensor ?
Divide it by (and optionally normalize), turning e.g. into the real number .
What does describe?
A colour image, 224 tall, 224 wide, 3 channels (RGB), of real numbers.
Is the superscript in a power?
No — it is a shape tag saying how many slots the box has and how they are arranged.
Is a multiplication?
No — it is a single number at address (row , class ).
Do indices on this page start at 0 or 1?
At 1 (maths convention); most code starts at 0.
What is ?
A single entry of the image before normalization; is that same entry after subtracting and dividing by .
What do and measure?
= the average (balance point); = the spread around it.
Unroll .
.
Is " squared"?
No — it is the output of layer 2; the superscript in parentheses is a label.
What is the difference between and ?
is the true (one-hot) label; is the model's predicted probabilities.
What does the hat in signify?
An estimate / the model's guess, as opposed to the true value .
What is a logit ?
The raw, unnormalized score the last layer gives to class — any real number, not yet a probability.
What does stand for?
The number of possible classes (labels) in the task.
Write the softmax of at position .
.
Name two properties of softmax relies on.
It is always positive and always increasing.
Which base does use here?
Natural log, base (sometimes written ).
What does mean?
The predicted probability the model gave to the correct class (the entry where has its ).
Why does the cross-entropy penalty use ?
A correct confident guess () gives near-zero penalty; a confident wrong guess gives a large positive penalty, and the minus makes the cost positive.
What does return?
The position (class index) of the largest probability, not the value.
Recall Self-check: read this line from the parent aloud

— can you say what every symbol means? Answer ::: "The predicted probability for class equals raised to that class's logit , divided by the sum of over all classes." Here is the raw-score (logit) vector from §7, keeps things positive, and the normalizes so probabilities add to 1.