liveBook · Manning

Feature map

As explained in Grokking AI Algorithms, Second Edition

A feature map is a spatially organized array of activation values representing learned features at different locations in an input or intermediate image representation.

A feature map is a grid showing where a filter detects a particular pattern in an image. Think of it as a new image that highlights one feature: each position holds a number indicating how strongly the filter matches that part of the input. The grid keeps locations meaningful—a detection near the input’s top-left appears near the output’s top-left. section 12.14

To make one, slide a filter across the image. At each position, multiply its numbers by the pixels underneath and add the products. A strong match gives a large value; a blank patch gives a value near zero. Padding—usually a border of zeros—lets the filter reach edge pixels and can keep the output the same height and width. section 12.14

Eight maps from one small image

Start with an 8×8 noisy image and eight different 3×3 filters. Give the image a one-pixel border of zero padding. For each filter, scan all 64 image positions, calculate the patch’s dot product, and add that filter’s bias. Each filter produces one 8×8 map, so the eight maps together form an 8×8×8 collection. Subsequent processing normalizes the maps before applying an activation function. section 12.17

Figure 12.30 The first pixel of all feature maps produced by the first convolutional layer
12_30

Compare the first pixel across the eight feature maps to see how different filters produce different values at the same image location. section 12.17

Feature maps also carry information between stages of a U-Net. Its encoder shrinks them to capture broader image context, but shrinking loses some precise location information. Its decoder enlarges low-resolution maps with transposed convolutions. Skip connections bring earlier, high-resolution maps into the decoder so it can combine broad context with fine spatial detail. section 12.15 section 12.19

12.42 How skip-connection feature maps are combined with the upsampled feature maps
12_42

See how high-resolution maps from a skip connection are combined with upsampled maps during reconstruction. section 12.19

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Works through sliding-filter dot products, padding, biases, and an eight-map tensor, then follows maps through downsampling and upsampling.
Examples
Traces eight 3×3 filters over an 8×8 noisy image and illustrates high-resolution maps joining upsampled maps.
What it assumes
Starts with image pixels and explains filter matching through patch-by-patch multiplication and addition.
What you can do after
Build it from scratch in NumPy by padding an image and sliding filters to calculate feature-map values.
How it connects
Links convolution, padding, group normalization, U-Net encoders and decoders, transposed convolution, and skip connections.

Also explained in

Compare how 8 books explain feature map →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.