5.6.11 · D3Machine Learning (Aerospace Applications)

Worked examples — Convolutional neural networks — convolution operation, pooling

3,156 words14 min readBack to topic

This is the worked-examples deep dive for Convolutional neural networks — convolution & pooling. The parent gave you the formulas; here we stress-test them against every case class — every sign of the output, every degenerate input, the limiting behaviour of stride and padding, a real aerospace word problem, and an exam twist.

Before we start, one reminder of the two formulas everything below leans on. If either symbol is unfamiliar, re-read the parent — but we re-explain each as it appears.

Recall Three parent-page facts we lean on (so you don't need the parent open)

The parent listed common mistakes; we cite three by name. Restated plainly:

  • Pooling has zero learnable parameters — max/average is a fixed function, not trained.
  • Stride is not just a speed knob — a larger directly shrinks the output via the size formula.
  • Conv parameters are independent of image size — they depend only on , never on .

The scenario matrix

Every problem this topic can hand you falls into one of these cells. The examples below are chosen so that together they touch every row.

# Case class What makes it tricky Covered by
A Padding preserves size (p chosen so ) the "same" convolution — is the arithmetic exact? Ex 1
B Non-divisible / floor kicks in not a multiple of → rounding down loses a position Ex 2
C Negative output value a kernel producing — signs matter, no clipping Ex 3
D Degenerate: kernel, stride 1 is convolution still "doing" anything? Ex 4
E Limiting stride: (no overlap) & shrink how far can stride push before output hits 1? Ex 5
F Multi-channel filter (sum over depth) parameter count and the extra sum Ex 6
G Pooling: max vs average, with a shift to prove invariance does the max really not move? Ex 7
H Real aerospace word problem (crack-detector sizing) translate words → numbers → layer stack Ex 8
I Exam twist: solve for an unknown ( or ) from a target size invert the formula Ex 9
J Zero/empty degenerate: kernel bigger than input when is (invalid)? Ex 10

The worked examples

Example 1 — Cell A: padding that preserves size


Example 2 — Cell B: the floor bites


Example 3 — Cell C: a genuinely negative output


Example 4 — Cell D: the degenerate kernel


Example 5 — Cell E: stride pushed to its limit


Example 6 — Cell F: a multi-channel filter


Example 7 — Cell G: pooling, and proving invariance under a shift

Figure — Convolutional neural networks — convolution operation, pooling

Example 8 — Cell H: aerospace word problem (crack detector)


Example 9 — Cell I: exam twist — solve for the unknown


Example 10 — Cell J: the empty / invalid case


Recall

Recall The scenario checklist

Before trusting any conv/pool answer, which four things do you sanity-check? ::: Sign of the output (can be negative pre-activation), the floor when numerator isn't divisible by stride, that (else invalid), and that pooling has zero parameters. "Same" padding rule for stride 1 ::: , which makes . When does stride force ? ::: When (with ): the kernel lands only at position 0. What does stand for? ::: The number of filters in a conv layer, i.e. the number of output channels/feature maps it produces.

Connections

  • Parent topic — the formulas worked here.
  • Padding and stride — Examples 1, 2, 5, 9, 10 are all its edge cases.
  • Feature maps and receptive fields — every computed here is a feature-map dimension.
  • Translation equivariance vs invariance — Example 7's shift test is the invariance demo.
  • Image classification for aerospace inspection — Example 8 sizes a real detector.
  • Fully-connected neural networks — the comparison in Example 8.
  • Backpropagation — trains the shared weights we counted throughout.