Northeastern University · CS 7150 · Fall 2026

Convolutions, explained

Interactive pieces for the convolution lecture and LeCun et al. 1989: first, why comparing images pixel by pixel fails as soon as something moves, and the oriented detector Hubel and Wiesel found in the cat’s visual cortex; then the operation itself, in 1D and 2D, and as a fully connected matrix with zeros and tied weights; why sharing weights makes it shift-equivariant, and pooling makes it invariant; how big each layer's output is, how far each unit sees as layers stack, and where padding creeps in; and the four axes of a layer’s weights.

  1. The problem

    Shift breaks pixel distance

    A digit, the same digit moved a few pixels, and a different digit. Drag the copy and watch its distance from the original climb past the distance to other digits, often after a single pixel, until a nearest-neighbour classifier on pixels calls it something else. Blurring first only postpones it.

    Open the explainer →
  2. Hubel and Wiesel

    Orientation tuning

    Turn a bar of light in front of one detector, the lecture’s −½ +1 −½ edge-finder rotated, and trace its tuning curve while it crackles. Move the bar off centre and it goes silent, which is why the same detector has to be copied to every position; a bank of eight angles reads out the orientation.

    Open the explainer →
  3. The operation

    1D convolution, step by step

    The lecture’s example animated: the three-wide edge-finder slides along a ten-long signal, multiplies, adds, and drops one output per position, with both drawn as stems. Edit any number, try blur or shift, and flip the kernel to see true convolution against the cross-correlation that libraries actually compute.

    Open the explainer →
  4. Weight sharing

    Convolution as a constrained matrix

    A convolution is a fully connected layer y = Mx with two constraints: zero the entries outside a band (locality), then tie each diagonal to one weight (stationarity), and 80 parameters become 3. Point at an entry to light every entry that shares its weight: the matrix is Toeplitz, and in 2D doubly block Toeplitz. Gradients of a tied weight add up along its diagonal.

    Open the explainer →
  5. The operation, in 2D

    2D convolution and oriented edges

    Step a 3×3 window over the lecture’s striped image: the vertical edge-finder lights up and the horizontal one finds nothing. Then draw a picture and convolve it live with edge-finders at any angle, Sobel, blur and sharpen, or weights you drag yourself.

    Open the explainer →
  6. Equivariance

    Equivariance and invariance

    Shift then convolve, or convolve then shift: the two paths meet exactly, because every position uses the same weights. Pool over positions and the result stops caring where the digit is. Then turn on stride 2 and watch an odd shift break both.

    Open the explainer →
  7. Output size

    How big is the output?

    Count where the window can start: the slide’s 3×3 filter on a 7×7 input fits in 5 places each way, so the output is 5×5. Add stride and padding to get ⌊(W−K+2P)/S⌋+1, with the cells a stride never reads hatched. Then stack layers, drawn as shrinking 3D blocks, from the slide’s 32→28→26→24 to all of AlexNet’s convolutions and max-pools (227→55→27→13→6), VGG-16’s padded 3×3s halved by pools (224→7), and a stack too deep to fit. Drag any filter to scan it; the rest of the chain follows.

    Open the explainer →
  8. Depth, stride, padding

    Receptive field through the layers

    A 1D network drawn unit by unit: point at any unit to light the cone of inputs it depends on. Stack layers and the field grows by (K−1)·d each; add stride and the growth multiplies. With same padding, watch the band of units that have read zeros widen with depth until edge units near the top see mostly padding.

    Open the explainer →
  9. Four axes

    The 4D weight tensor

    A layer’s weights drawn as a grid of kernels, one row per output channel and one column per input channel. Point at any output pixel to see the patch it reads in every channel, one dot product per kernel, and the bias adding up; switch between C maps and a grid of C-vectors, where a 1×1 convolution is a matrix at every pixel.

    Open the explainer →