Part III's layers connected every input to every neuron. For an image, that throws away something a filter can use directly: where things are.
This image is just a dark-to-light edge. Slide the window across it. The response is near zero on either flat side, but spikes right where the edge actually is — the same small filter, reused at every position, looking for the exact same pattern everywhere.
A convolution slides a small filter (the kernel) across an image and, at every position, computes one number — the sum of the kernel multiplied elementwise with the patch underneath it:
- — the output feature-map value at row , column .
- — the learned filter weight at offset within the small window.
- — the input image's pixel value at the position the kernel currently overlaps.
- — the row and column of the output position being computed.
- — the row and column offsets that range over the kernel's own window.
- One kernel, reused everywhere
The same 9 kernel numbers are reused at all 16 positions here — the identical filter weights get multiplied against every patch of the image as the window slides across it.
- Why sharing makes sense
That's the whole idea: a pattern worth detecting in one corner of an image is worth detecting anywhere else in it too, so the filter doesn't need its own separate weights for every location.
Drag the row slider alone — the response doesn't change at all. This particular filter only cares about columns, because the edge it's built to find runs vertically. Drag the column slider and the response swings from to and back to , tracing the edge exactly.
- Window position (0, 1) — on the edge
The patch under the kernel is columns 1-3 of the image: two dark pixels () and one light pixel (), in every one of the 3 rows. The kernel row gives per row, times 3 rows — the maximum possible response, because the patch is a perfect textbook edge.
- Window position (0, 3) — off the edge
One column over, the patch is three light pixels: per row — no edge in that patch, no response.
Slide the window to a position where the filter’s response reaches its maximum, 3.
A trained network doesn't get handed an edge detector — it learns kernel values like these from data, the same backprop from Part III, just computing a gradient for each of the kernel's few shared weights instead of one weight per connection. The next chapter asks what to do with the feature map this produces, which is almost as large as the image itself.