# Pooling

Pooling is a downsampling operation in neural networks, primarily convolutional neural networks, that aggregates information from multiple input vectors into fewer vectors, reducing computation and increasing robustness to input variations.

Pooling is a downsampling operation used in [neural networks](https://www.wikiprompt.org/wiki/neural-network), most prominently in [convolutional neural networks](https://www.wikiprompt.org/wiki/deep-learning) (CNNs). A pooling layer aggregates information dispersed across many vectors into fewer vectors, reducing redundancy and the amount of computation and memory required. It also increases the receptive field of neurons in later layers, making the model more robust to small variations in the input. Pooling is typically applied after convolutional layers to progressively reduce the spatial dimensions of feature maps while preserving the most salient information.

In a 2-dimensional CNN, a pooling layer takes an input tensor \(x \in \mathbb{R}^{H \times W \times C}\), where \(H\) is height, \(W\) is width, and \(C\) is the number of channels, and outputs a tensor \(y \in \mathbb{R}^{H' \times W' \times C'}\). The operation is controlled by two parameters: filter size (or kernel size) \(f\) and stride \(s\). In some cases, separate filter sizes and strides are used for horizontal and vertical directions, denoted \(f_H, f_W, s_H, s_W\). The receptive field of an output entry \(y_{i,j,c}\) is the set of input entries that can affect it, typically a window of size \(f \times f\) centered at a position determined by the stride.

## Max Pooling

Max pooling is the most common pooling variant. It selects the maximum value from each window of the input. Formally, for a filter size \(f\) and stride \(s\), the output at position \((i,j,c)\) is defined as:

\[\mathrm{MaxPool}(x|f,s)_{i,j,c} = \max(x_{is:is+f-1, js:js+f-1, c})\]

where the notation \(is:is+f-1\) indicates the range of indices from \(is\) to \(is+f-1\). If horizontal and vertical strides differ, the formula generalizes to \(x_{i s_H : i s_H + f_H - 1, j s_W : j s_W + f_W - 1, c}\). Max pooling is effective at preserving the strongest activation in each local region, which helps retain features like edges or textures while discarding less important details.

## Average Pooling

Average pooling computes the mean of all values in each window instead of the maximum. It is sometimes used in place of max pooling, particularly in the final layers of a network before a classification output. Average pooling smooths the feature map, which can reduce overfitting but may lose sharp features. Global average pooling, a special case where the filter size equals the entire spatial dimension, outputs a single value per channel and is often used to replace fully connected layers in architectures like [network designs](https://www.wikiprompt.org/wiki/xerox-parc) from the late 2010s.

## Role in Convolutional Architectures

Pooling layers are integral to many classic CNN architectures. For example, the [AlexNet](https://www.wikiprompt.org/wiki/mit-csail) model, introduced in 2012, used max pooling after its first, second, and fifth convolutional layers. The [VGG](https://www.wikiprompt.org/wiki/stanford-ai-lab) networks, developed in 2014, employed max pooling with a filter size of 2 and stride 2 after each block of convolutional layers. These designs helped reduce the spatial size of feature maps from dimensions like 224x224 down to 7x7 before classification, enabling deeper networks with fewer parameters.

## Alternatives and Modern Usage

In modern architectures, pooling is sometimes replaced by strided convolutions, which downsample by using a convolution with a stride greater than 1. This approach, used in models like [generative models](https://www.wikiprompt.org/wiki/google-deepmind) and certain [transformer-based](https://www.wikiprompt.org/wiki/openai) vision systems, allows the network to learn the downsampling operation rather than using a fixed rule. However, pooling remains common in many practical implementations due to its simplicity and effectiveness. In [transformer](https://www.wikiprompt.org/wiki/large-language-model) architectures, pooling is less central, but global average pooling is still used in some vision transformers for classification heads.

## Theoretical Properties

Pooling provides translation invariance to a limited degree: because it aggregates over a local window, small shifts in the input may produce the same output if the maximum or average value remains within the window. This property is useful for tasks like object recognition, where the exact position of a feature is less important than its presence. The increase in receptive field means that neurons in deeper layers can respond to larger regions of the input, allowing the network to capture hierarchical patterns. Pooling also reduces the computational cost of subsequent layers by decreasing the number of parameters and operations, which is critical for training on hardware like [GPUs](https://www.wikiprompt.org/wiki/nvidia) and [accelerators](https://www.wikiprompt.org/wiki/amd).

## See Also

- [machine-learning](https://www.wikiprompt.org/wiki/machine-learning)
- [artificial-intelligence](https://www.wikiprompt.org/wiki/artificial-intelligence)
- [convolutional-neural-network](https://www.wikiprompt.org/wiki/convolutional-neural-network)

---
Source: https://www.wikiprompt.org/wiki/pooling
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-08T06:10:10.565879+00:00
