Learn AI.
Understand Neural Networks · ORIGINAL LEARN AI LESSON

Slide a detector across an image.

Reuse one filter at many positions and trace how stride, borders and pooling change the result.

By the end: Compute one convolution response, explain shared weights and receptive fields, and show what pooling loses.

01 · TRY

Start with something concrete.

A vertical line can appear on either side of an image. Instead of giving every location a separate detector, slide the same nine weights across it. Predict where right-minus-left will respond positively, negatively or not at all.

Try the interactive model ↓
02 · PREDICT
Before you experiment

A 3 × 3 filter visits nine positions. How many weights does this one shared filter use, with no bias?

A 3 × 3 filter visits nine positions. How many weights does this one shared filter use, with no bias?
03 · EXPERIMENT

Change one thing. Watch what follows.

  1. Keep the vertical-line image and right-minus-left filter. Inspect the first three outputs and explain 3, 0 and −3.
  2. Select a different output. Match the outlined pixels, nine products and final sum.
  3. Switch to the corner-dot image and center-only filter. Compare padding 0 and 1: which border information survives?
  4. Change stride from 1 to 2. Predict the output width before comparing the formula and grid.
  5. Compare max and average pooling. Find the cells omitted by incomplete windows. Use the two supplied blocks to explain lost position information.
  6. Draw a new image, predict one response, inspect the trace and export your experiment report.

Loading this browser experiment…

04 · UNDERSTAND

Start with a small image

A grayscale image can be a grid of brightness values. Our synthetic image has five rows and five columns. A value of 0 is dark and 1 is bright; there are no physical brightness units here. A filter, also called a kernel, is a smaller grid of weights. Place its three-by-three window over the image, multiply each pixel by the matching weight, and add the nine products.

The right-minus-left filter has three identical rows: −1, 0, 1. In the starting image, every row is 0, 0, 1, 0, 0. At the first horizontal position, the three window rows are each 0, 0, 1. Each contributes −1 × 0 + 0 × 0 + 1 × 1 = 1. Three rows give 3. Move one pixel right: each row is 0, 1, 0, giving 0. Move again: each is 1, 0, 0, giving −3. The sign describes the local contrast direction; it is not a class probability.

Try the horizontal-line image with this same filter. Predict the response at a complete interior window. Check why the left and right contributions cancel, then change to bottom-minus-top. A detector’s response depends on both the pattern and its weights.

Reuse a rule, not a result

The output grid is a feature map: one response per visited position. Every position uses the same nine weights. This is weight sharing. Nine positions require 81 multiplications, but still only nine weights. A learned convolutional network adjusts shared weights during training; this lesson uses fixed filters so you can inspect the operation without training.

A receptive field is the set of input positions that can affect a particular output. Here it is a three-by-three window. In a deeper network, a feature can depend on a larger input region through several layers. The highlighted square and product list show this layer’s exact dependencies, including padded positions.

The common neural-network operation is technically cross-correlation: we slide the filter without reversing it. Mathematical convolution flips the kernel. Libraries often call the unflipped operation convolution; this lab follows that convention. There is one input channel, one output channel, no bias and no activation. Real image encoders commonly use several channels and filters.

Decide where the window goes

Stride is the number of pixels the window moves between outputs. A stride of 2 skips some positions. It saves work and reduces output size, but may miss a useful response. It is not the same as evaluating every position and keeping a summary.

Zero padding adds an assumed dark border. With padding 0, only fully fitting windows are evaluated. With padding 1, the window can extend one pixel past each edge. Padded zeros are assumptions, not newly observed pixels. The average filter always divides by nine, even near the border, so a border average includes those assumed zeros.

O=⌊N+2P−KS⌋+1O=\left\lfloor\frac{N+2P-K}{S}\right\rfloor+1

Here O is output width, N is input width (5), P is padding per side (0 or 1), K is filter width (3), and S is stride (1 or 2). Widths and stride are in pixels. The floor brackets mean round down to a whole number. The same formula applies to height in this square example. It counts all filter placements that fit in the padded image; dilation is not used.

For N = 5, P = 0, K = 3, S = 2, we get floor(2/2) + 1 = 2, so the output is two by two. Practice: keep stride 2 and add padding 1. Predict the width before checking.

Check the width

floor((5 + 2 − 3)/2) + 1 = floor(4/2) + 1 = 3. The output is three by three, with nine placements.

Pooling trades detail for a summary

Pooling takes a block of responses and summarizes it. Max pooling keeps the largest value. Average pooling adds the values and divides by their count. In this lab both use two-by-two blocks with stride 2, no padding, and no activation before pooling. For [−4, −3; −2, −1], max is −1, not zero; average is −2.5. A separate rectified-linear activation would replace negative responses with zero, but we do not apply it here.

Incomplete blocks at the right and bottom are discarded. The workbench reports how many response cells are omitted. Other boundary conventions exist; compare like with like when reproducing an implementation.

Pooling also loses information inside complete blocks. [1, 0; 0, 0] and [0, 0; 0, 1] both have max 1 and average 0.25. These summaries cannot tell which corner was bright. That may be acceptable for “is a bright point present?” and harmful for “which corner contains it?”

Shifts are a testable claim

Reusing a filter lets a translated pattern produce a translated response under suitable conditions. This is equivariance, not a promise that the output stays identical. Finite borders, stride and pooling can break even that relationship. Recognition that stays unchanged under a transformation is invariance, a separate property requiring evidence for the task.

For a guided experiment, compare a dot at a border with a dot in the middle and explain the trace. For implementation, reproduce the map in code, check an asymmetric filter to catch accidental flipping, and test negative pooling inputs. For a decision brief, choose a task where losing location is acceptable and one where it is not. Export the image, settings and explanation as practice evidence. This does not yet supply a trained image model or independently reviewed perception project.

05 · APPLY
Check your understanding

Two different 2 × 2 blocks both produce max 1 and average 0.25. What does that establish?

Two different 2 × 2 blocks both produce max 1 and average 0.25. What does that establish?
06 · CONTINUE

Take this idea with you.

Convolution shares a local rule across positions. Stride samples locations; padding defines borders; pooling summarizes and loses information.

My work
Learn AI · Understand by doing.Loading local progress…Copyright (c) 2026 Mobi Weave, Inc. All rights reserved