Interactive demo · Applied Statistical Learning in R and Python · Chapter 10

Convolution, the ReLU detector and max pooling on a digit

A convolution filter slides over the image and, at each position, multiplies the 3 × 3 patch under it by its weights and adds them up: the result is large where the patch looks like the filter (Section 10.3.1). The ReLU then keeps only the positive responses (the detector layer), and 2 × 2 max pooling keeps the largest value of each block (Section 10.3.2). Shift the digit by a pixel or two: the convolved image moves with it, but after pooling it hardly changes. That is the location invariance pooling buys.

Digit

Filter

Padding

Shift the digit (right, down)

Count the parameters

Try these

Pixels are scaled to [0, 1]. The convolution is the one of Section 10.3.1 (the filter is not flipped), with zero padding of one pixel for "same". Colours: gold positive, blue negative, each map scaled to its own largest absolute value. The correlations in the readout compare each map of the shifted digit with the same map of the unshifted one, position by position.

In the lecture notes