RECEPTIVE FIELD

Ch 9 ▸ What the network learned ▸ Module 3/4

  1. 1A trained network
  2. 2The first layer
  3. 3The second layer
  4. 4Where it fails

The second layer.

🔒 This module is locked

It builds on The first layer. Pass that module’s knowledge check to unlock it, or skip ahead if you already know the material.

Go to The first layer

What the second layer reads

Each second-layer kernel is 3×3×8: it reads a 3×3 window of all 8 pooled first-layer maps at once, as chapter 4’s kernels with depth did. So a second-layer channel can’t see the image directly. It sees how strongly each first-layer channel responded, nearby.

It also sees more of the image. Chapter 6’s rule gives the receptive field after each layer, rnew=r+(k−1) jr_{\text{new}} = r + (k - 1)\,j with jnew=j sj_{\text{new}} = j\,s, starting from r=1r = 1 and j=1j = 1 at the input:

LayerFieldJump
5×5 conv, stride 11 + (5 − 1) × 1 = 51
2×2 max pool, stride 25 + (2 − 1) × 1 = 62
3×3 conv, stride 16 + (3 − 1) × 2 = 102
2×2 max pool, stride 210 + (2 − 1) × 2 = 124

A first-layer unit sees 5×5 pixels. A second-layer unit sees 10×10, more than a third of the 28×28 image’s width. After the last pooling, each of the values the dense layer reads covers 12×12.

The same probe, one layer up

FIG 9.3 ▸ TURN A LINE: LAYER 2 ANGLE 0°

INPUT · LINE AT 0°

CH 0 · 0.03 · SEL 0.97

CH 1 · 0.86 · SEL 0.91

CH 2 · 0.67 · SEL 1.00

CH 3 · 0.00 · SEL 1.00

CH 4 · 0.01 · SEL 1.00

CH 5 · 0.25 · SEL 0.88

CH 6 · 0.00 · SEL 1.00

CH 7 · 0.00 · SEL 1.00

CH 8 · 0.02 · SEL 1.00

CH 9 · 0.47 · SEL 0.88

CH 10 · 0.06 · SEL 1.00

CH 11 · 0.08 · SEL 0.86

CH 12 · 0.00 · SEL 1.00

CH 13 · 0.63 · SEL 0.74

CH 14 · 0.41 · SEL 0.70

CH 15 · 0.33 · SEL 0.56

A straight line through the middle of the input, turned from 0° (flat) to 175°. Each chart is one channel: its largest value anywhere in its map, at every angle, on one scale shared by all 16 channels. SEL is that channel's selectivity, (max − min) / max: 0 means it responds the same at every angle, 1 means some angle leaves it silent.

Figure 9.3 runs the same turning line through the network and records the second layer’s 16 channels, after ReLU.

The curves look different. Many second-layer curves have sharper peaks, and some drop all the way to 0 over a range of angles. Channel 3 gives 0 for 23 of the 36 angles. Their selectivities run from 0.56 to 1.00, and half of the 16 reach 1.00: there’s some angle at which they’re completely silent. Compare the first layer, whose highest was 0.70.

How does a layer of broadly tuned inputs give narrowly tuned outputs? A second-layer kernel has a weight for every first-layer map, and some of those weights are negative. So a channel can add up the maps that respond to one range of angles and subtract the maps that respond to another. Then ReLU sets everything below 0 to 0. A line at the wrong angle drives the sum below 0 at every position, so the whole map comes out 0. Being silent is something ReLU makes possible: without it, the map would just be negative.

One channel stands out the other way. Channel 7’s tuning curve barely leaves 0: its strongest response to any line is 0.06. Yet on real digits from the test set it’s the opposite of quiet. Its strongest response across them, 1.41, is the largest of any second-layer channel. Whatever channel 7 responds to, it isn’t a straight stroke. Draw some curves and corners in figure 9.1 and watch its map, the eighth of the second layer’s sixteen.

What this does and doesn’t show

The pattern, broad tuning in the first layer and narrow tuning in the second, is a measured fact about this network. It matches a common account of CNNs: early layers respond to simple local features, and later layers combine them into more specific ones, each seen over a bigger window.

It doesn’t say what each channel is for. A tuning curve shows how a channel responds to one kind of input we chose. Lines are easy to reason about, but digits aren’t made of straight lines alone, and a channel that ignores lines, like channel 7, may matter as much as one that’s sharply tuned to them.

Knowledge check ▸ 5 questions

Before you move on.

Answer every question correctly to unlock the next module. A wrong answer gets a hint, and you can try again as many times as you like.

  1. 1How many input pixels wide is the receptive field of one second-layer convolution unit?

  2. 2After the second pooling, how many input pixels wide is each value’s receptive field?

  3. 3How many weights does one second-layer kernel have?

  4. 4How can a second-layer channel give exactly 0 everywhere for a line at some angle?

  5. 5Channel 7 barely responds to any straight line but responds strongly to real digits. What can you conclude?

0 of 5 answered correctly.

🔒 Next module: Where it fails