5.6.11 · D5Machine Learning (Aerospace Applications)

Question bank — Convolutional neural networks — convolution operation, pooling

1,425 words6 min readBack to topic

Before we start, one shared vocabulary reminder so no symbol is unearned:

Definition Quick symbol refresher
  • Kernel / filter : the small grid of learned numbers we slide over the image.
  • Feature map : the output grid we get after sliding everywhere — see Feature maps and receptive fields.
  • Stride : how many pixels the kernel jumps each slide. Padding : border of zeros we add — see Padding and stride.
  • Channels : the depth of the input (e.g. 3 for RGB). : number of filters (= output channels).
  • Sizing law: .
  • Equivariance (feature moves with the input) vs invariance (output ignores the move) — see Translation equivariance vs invariance.

True or false — justify

A conv layer has more parameters when the image is bigger.
False. Parameters are — they depend only on filter size, channels, and filter count, never on . That size-independence is the point of weight sharing.
Convolution is a special case of a fully-connected layer.
True. Impose locality (weights zero outside a neighbourhood) and weight sharing (same weights everywhere) on a fully-connected weight matrix and it collapses into a single slid kernel — see Fully-connected neural networks.
Pooling helps the network by regularizing its weights.
False. Pooling has zero learnable weights, so it regularizes nothing directly. It fights overfitting indirectly by shrinking the representation and adding local invariance.
Max-pooling makes a CNN fully translation-invariant.
False. It only gives local invariance — a shift within one pooling window is absorbed, but a large shift moves the feature into a different window and the output changes. See Translation equivariance vs invariance.
A pure convolution layer (no pooling) is translation equivariant, not invariant.
True. Shift the input by one pixel and the whole feature map shifts by one pixel — the response moves with the feature rather than ignoring the move.
Using stride 2 instead of stride 1 keeps the output the same size but runs faster.
False. Stride directly shrinks output: . Stride 2 roughly halves each spatial dimension; it is not a free speed knob.
Because libraries compute cross-correlation, a hand-designed textbook kernel can be dropped in unchanged.
False. True convolution flips the kernel first. A learned kernel doesn't care, but a hand-designed one must be flipped to match textbook math.
Adding more filters increases output depth but not the spatial height and width.
True. sets the number of output channels; spatial size is governed only by , , , and .
Average-pooling and max-pooling are interchangeable — pick either.
False. Max keeps the strongest "did this feature fire?" signal (good for detection); average retains overall magnitude and smooths (good when you care about typical intensity). They encode different priors.

Spot the error

"My filter on an RGB image has 9 parameters."
Wrong — it has . You must sum over all channels and add the bias, so the filter is , not .
"Input 28, kernel 3, no padding, stride 1 gives output 28."
Wrong — . Without padding the kernel can't overhang the edge, so valid convolution shrinks the map by .
"I stacked two conv layers, so each output neuron sees the whole image."
Wrong (usually) — the receptive field grows only by roughly per layer. Seeing the whole image needs many layers, pooling, or larger strides. See Feature maps and receptive fields.
"Pooling with stride 1 and a window halves the map."
Wrong — halving needs stride = window size (stride 2). Stride-1 pooling barely shrinks the map () and the windows overlap.
"I set padding with a kernel to keep size — but the output grew."
Wrong padding for this kernel — "same" padding needs for . With you get , an over-padded, larger map.
"Bias doesn't count as a parameter, so a filter has weights."
Wrong — each filter has one learnable bias , giving per filter. The in is exactly that bias.

Why questions

Why does the sizing formula have a at the end?
Because the kernel's starting position 0 must be counted in addition to the strided positions after it — it's an off-by-one fencepost, not a fudge factor.
Why do we usually call cross-correlation "convolution" in ML?
Because the kernel is learned, so whether we flip it or not the network simply learns whichever weights make the outputs correct — the flip is absorbed into training.
Why does weight sharing give translation equivariance?
The same weights are applied at every position, so a feature appearing anywhere produces the identical response, just at a shifted location. See Translation equivariance vs invariance.
Why is pooling described as "no parameters" when it clearly changes the data?
It applies a fixed function (max or average) with nothing to learn — it transforms data like a rule, not like a trainable layer.
Why do we prefer convolution over a fully-connected layer for images?
A fully-connected layer ignores spatial structure and needs a separate weight per pixel pair (millions of them); convolution encodes the "nearby pixels matter" prior and reuses tiny kernels, drastically cutting parameters.
Why does max-pooling grant some translation invariance but not equivariance?
Max over a window returns the same value if the peak shifts within that window (invariance to small moves), rather than moving the response along with the feature (which would be equivariance).

Edge cases

What does a conv layer do to a single-pixel input (, )?
. A kernel with channels is just a per-pixel linear mix across channels — a channel-wise fully-connected layer.
What happens if is negative?
The kernel can't fit even once — the formula gives no valid position. In practice this is an invalid layer configuration and libraries throw a size error.
If the numerator isn't divisible by the stride, what does the floor do?
It drops the final partial window that would overhang the edge, keeping only fully-covered kernel positions — hence rather than rounding.
Max-pool a window that is all equal values, say all s — what comes out, and is it invariant?
Output is , and it stays under any shift of that flat patch — a degenerate case where max-pooling is trivially invariant because there's no peak to move.
What does average-pooling do to a window of all zeros (a dead feature)?
Returns , faithfully signalling "nothing fired here." Max-pooling also returns , so on all-zero patches the two agree.
If stride equals the input size with a same-size kernel, what is the output?
A single value — one output covering the whole input, effectively global pooling / global convolution over that map.
Does padding with zeros ever inject false "features" at the border?
Slightly — zero borders create artificial edges the kernel may respond to, which is why some aerospace inspection pipelines prefer reflection padding to avoid phantom edge activations near panel boundaries. See Image classification for aerospace inspection.

Recall One-line survival kit

Params (image-size-free) · Size · Conv = equivariant, Pool = locally invariant · Pooling has 0 params · The kernel flip is learned away.

Connections