3.4.1 · D1Convolutional Neural Networks

Foundations — Convolution operation and filters

2,095 words10 min readBack to topic

This page assumes you have seen nothing. We build every letter and symbol the parent note on Convolution operation and filters uses, in an order where each new idea leans only on the ones before it. A Hinglish version of the parent lives at 3.4.01 Convolution operation and filters (Hinglish).


0. A picture is a grid of numbers

Before any symbol, look at what an image is to a computer.

Figure — Convolution operation and filters

Look at the figure: the pale-yellow square is one pixel; its number 2 is its brightness. The image has a height (how many rows) and a width (how many columns). That is all "image" means from here on.


1. — the input image

  • Plain words: = the picture-as-a-table.
  • The picture: the full grid in figure s01.
  • Why the topic needs it: convolution reads its numbers out of , so we need a way to point at any one cell.

2. and — where we are looking

  • The picture: in figure s01 the arrow labelled points at exactly one square.
  • Counting starts at 0. The very top-left pixel is , not . This is called zero-indexing and every formula below relies on it.
Recall Why start counting at 0?

If a row has columns, the addresses run . Starting at 0 makes "the -th step from here" simply add , with no awkward corrections. That is why the sums below use , not .


3. , — height and width

  • The picture: the two arrows down the side () and along the top () in figure s01.
  • Why needed: they tell us how far we can slide the filter before we fall off the edge — which is exactly what the output-size formula measures.

4. — the filter (kernel), and its size

Figure — Convolution operation and filters
  • Plain words: is the little pattern we are hunting for. Its numbers say "I want dark here, bright there."
  • The picture: the small chalk-blue grid in figure s02. Here .
  • Why the topic needs it: without a filter there is no pattern to match. The filter's weights ARE the question convolution answers.

5. , — walking inside the filter

  • The picture: figure s02 shows the filter laid on top of the image; the offsets measure how far inside the overlaid window we are.
  • Why the ? The window's top-left corner is at . Move down and right inside the window, and you land on image pixel . That is the whole reason those sums look the way they do.

6. — "add up a list"

  • Plain words: it is a for-loop that keeps a running total.
  • Example (one dimension): .
  • Why two of them? The filter is 2D, so we loop over rows () and columns (). A double sum visits every one of the cells exactly once.
Recall Read this double sum out loud

::: "for every row , and for every column in that row, add up " — i.e. total over the whole little grid.


7. The core operation: multiply-then-add

Figure — Convolution operation and filters

Now every symbol in the parent's main formula is defined, so we can read it:

Figure s03 shows the three moves: overlay, multiply cell-by-cell, add into one output square.


8. The feature map — collecting every answer

  • The picture: figure s03's output grid on the right — one output cell per filter position.
  • Why the topic needs it: the feature map is a "heat map of matches" — bright where the pattern is present. This is the whole point of a convolution layer.

9. Sliding controls: stride and padding

Figure — Convolution operation and filters
  • The picture: figure s04 — a stride-2 jump (blue arrows) and a one-pixel zero border (pale ring).
  • Why stride: shrinks the output on purpose (cheaper compute, like pooling).
  • Why padding: without it the feature map is smaller than the input by each side; padding lets you keep the size.

10. The depth dimension: channels

For colour input the filter also gains a depth, and we add across it:


Prerequisite map

Pixel = one brightness number

Image I = grid of pixels

Indices i j address a pixel

Sizes H and W

Filter K = tiny pattern grid

Indices m n inside filter

Multiply then Sum over m n

One output number

Feature map = all outputs

Stride s and Padding p

Output size formula

Channels c stack RGB

Convolution layer

Each foundation feeds the next; together they assemble the full convolution the parent note defines. From here you can move on to receptive fields, full CNN architectures, and how these filters are learned via backpropagation (with helpers like batch normalization and reused across tasks in transfer learning).


Equipment checklist

Cover the right side and answer aloud. If any stumps you, reread its section.

What does point to, and which index is the row?
The single pixel value at row , column — the first index is the row.
Where does counting start for ?
At 0 (zero-indexing); the top-left pixel is .
What are and ?
Height = number of rows, Width = number of columns.
What is and what does mean?
is the filter (a small square pattern grid); is its side length (e.g. means ).
Why is there a and in ?
Because the window's corner sits at ; moving down and right inside the window lands you on that image pixel.
What does tell you to do?
Plug in and add all the results (a summing loop).
In words, what is the convolution at one spot?
Overlay filter, multiply each weight by the pixel under it, add all products into one number = match score.
What is a feature map?
The grid of all those match scores, one per filter position.
What do stride and padding each control?
= how far the filter jumps per move; = rings of zeros added around the border.
What does do and why is it here?
Rounds down to a whole number, because you can't have a fractional filter position.
For a 3-channel RGB image, why do we sum over ?
Each colour layer is scored, then merged into one number so the filter can react to colour combinations.