What it does
Max pooling slides a window over each channel separately and outputs the largest value inside it. It has nothing to learn. It halves (or more) the height and width, which cuts the work of later layers, and because only the maximum survives, a feature that moves by a pixel or two inside the window still produces the same output. Global max pooling uses one window covering the whole map, turning [C, H, W] into a single value per channel, which is how 1D text CNNs pick the strongest n-gram match anywhere in a sentence.
Formula
Y[c, y, x] = max0 ≤ i, j < k X[c, s·y + i, s·x + j]Shapes and parameters
- Shapes
- Input [N, C, H, W]; output [N, C, H', W'] with H' = ⌊(H − k) / s⌋ + 1. Global pooling gives [N, C, 1, 1].
- Parameters
- None. Pooling has no weights; the channel count stays the same.
- Used for
- Between convolution stages in classic CNNs, in keyword spotting models, and as global max pooling in text CNNs.
In WeightSpace
Read-only in WeightSpace today: there is nothing learned inside it. The voice command and text sentiment models use it, and are edited through their classifier biases further on.
Where it appears
- Find what stands out in a photoU²-Net-p331.1M params
- Track the pitch of a soundCREPE Tiny6487K params
- Track fingertips in a photoMediaPipe Hand Landmarker52.0M params
- Locate faces and facial landmarksYuNet453K params
- Read a facial expressionOpenCV Zoo MobileFaceNet41.2M params
- Read text in an imageCRNN English48.4M params
- Recognize 18 spoken wordsSpeech Commands 18w41.5M params
- Recognize voice commandsSpeech Commands41.4M params
- Label a photo with ImageNetSqueezeNet 1.131.2M params
- Recognize a handwritten digitMNIST CNN26.0K params
- Track body joints in a photoMediaPipe BlazePose24.3M params
- Classify the tone of a film reviewTensorFlow IMDB CNN12.7M params
- Detect objects in a photoNanoDet-Plus1942K params