AI Grounds

Open AI Grounds on a desktop

These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.

Guided discovery

Convolution Filter Lab

Slide a small grid of weights. Trace how one patch becomes one output.

Filter

Stride is the pixel step. Padding adds zero-valued border cells.

Your image → output

Choose an output cell to inspect its 3 × 3 image window. Rows and columns count from 0.

Image + zero padding · 7 × 7

0000000
0123450
0123450
0123450
0123450
0123450
0000000

Gray cells are padding; original zeros stay white.

Output · 5 × 5

Full map; selected cell y[1,1]. ≈ marks rounded values.

Selected output

Click an output cell, or focus it and use arrow keys. Home / End moves to the first / last column. Row and Column fields set an exact position.

Build one output cell

Multiply matching positions, then add all nine products. Right column minus left column: positive for a rise, negative for a fall, zero when they match.

Image patch

123
123
123

Kernel weights

-101
-101
-101

Products

-103
-103
-103

Row sums: 2; 2; 2. Fractions are exact.

y[1,1] = 2 + 2 + 2 = 6

Selected sum

Nine products added.

6

Σ patch value × weight

Output size

One cell per sampled window.

5 × 5

floor((5 + 2 × 1 − 3) / 1) + 1 = 5

Window step

Weights stay fixed as the patch moves.

1 px

p = padding; s = stride

CNN convention: weights are used as shown, without flipping (cross-correlation). One input channel, no bias. These are fixed teaching filters, not learned weights.

Ramp, Edge, stride 1, zero padding 1; output 5 by 5; selected row 1, column 1, sum 6.