global average pooling
Global average pooling collapses each entire feature map to a single number — its average over all spatial positions. If a feature map is a heat-map of 'where did feature X appear', its global average is 'how much of feature X is present in the whole image'. After GAP, a tensor of shape (C, H, W) becomes a vector of length C: one score per feature, with all spatial layout discarded. It is the standard way to bridge from the spatial convolutional body of a network to a final per-class decision.
Precisely, GAP outputs, for each channel c, (1/(H*W)) times the sum over all (i,j) of x[c,i,j]. It has no parameters, no hyperparameters, and works on any input resolution because it always reduces the spatial dimensions to 1x1 — which is precisely why GAP-headed networks (unlike flatten-then-dense networks) accept variable-size images. Introduced in Network in Network (Lin et al., 2013) and adopted by GoogLeNet and ResNet, it replaced the huge fully-connected layers of AlexNet/VGG that held most of those models' parameters.
GAP does two valuable things at once. It slashes parameter count and acts as a structural regularizer against overfitting, because there are no weights to memorize the training set in the head. And because each channel's final score is just its average activation, GAP makes the network's reasoning more interpretable — this is the mechanism behind Class Activation Mapping (CAM), which uses the weights connecting GAP outputs to a class to highlight which spatial regions drove the prediction. The cost is that GAP throws away all position information, so it is used for whole-image classification, not for tasks that must localize.
A backbone ending in a 7x7x2048 feature volume passes through GAP to a length-2048 vector, then a single dense layer of 2048x1000 weights maps to 1000 classes — versus a VGG-style flatten (7*7*512=25088) feeding a 4096-wide dense layer with ~100M parameters.
Why it matters: GAP is why a ResNet trained at 224x224 can run on a 500x500 image without retraining — the head adapts automatically. Contrast with a flatten + dense head, whose first dense layer is wired to an exact feature-map size and breaks if resolution changes.