TwiddleLab / Artificial Intelligence / How Machines See and Hear
Pooling: Zooming Out
What you will learn
- Max pooling cuts a feature map into 2 × 2 blocks and keeps only the biggest number in each.
- Each pooling halves the width and height: 32 × 32 becomes 16 × 16, then 8 × 8.
- A small shift changes most of a detailed map but very little of a pooled one: shift tolerance.
- Too much pooling blurs the shape away, so networks pool a little at a time.
How the lesson goes
Move your face a little and your phone still knows you. Why doesn't one pixel fool it?
First, a guess. Drag the marker, then Check.
Zoom out a feature map: keep only the strongest number in each block.
Tap the biggest number in each colored 2 × 2 block, then Check.
Max pooling keeps the largest value of each block. A feature map says how strongly a pattern was found; the strongest value tells you the pattern is somewhere in that block.
Now shift the critter by a pixel and count what changes.
Drag it, or use Left and Right. Compare the detailed map with the pooled one.
This zooming out has a name.
Tap to reveal.
Keeping the biggest number of each block is max pooling.
Each 2 × 2 pooling halves the width and height, so it keeps a quarter of the numbers.
Because a pattern only has to be somewhere in the block, small moves barely matter: shift tolerance.
Game: speed pool. Two maps, as fast as you can.
Tap the biggest number in every block. Misses count.
How far should a model zoom out? Choose your pooling.
Slide through 0 to 4 poolings, then press Use this size. Your choice races at the end.
Code: this program should pool one block, but it prints 1. Fix it.
Tap the wrong line, pick a replacement, then Check.
top + bottom joins the two rows into one list of four numbers. Max pooling keeps the largest, so the line must use max, not min or sum.
A 64 × 64 feature map goes through three 2 × 2 poolings. How wide is it now?
Each 2 × 2 pooling halves the width: 64 / 2 / 2 / 2 = 8.
The race: five photos of the same critter, a little moved.
Your pooling against a model without pooling. Start the race.
Previous lesson: Stacking Filters: Convolution Layers · Next lesson: Filters Learn Themselves · Part of the course: How Machines See and Hear
Lessons are interactive and need JavaScript. Turn it on to play them.