Pooling
Ways to summarize feature maps: max, global average, SPP, RoI pooling, and more.
Global Average Pooling (GAP)Global average pooling (GAP) averages each channel of a feature map over all spatial positions, reducing it to a single value. Used in place of the final fully connected layers of a CNN, it greatly reduces the number of weights, curbs overfitting, and makes the network independent of the input size.
Max PoolingMax pooling divides a feature map into small windows and keeps only the maximum in each window, reducing the height and width. It is used in CNNs to reduce computation and to make the network robust to small shifts in position.
RoI PoolingRoI pooling turns candidate regions (RoIs) of varying size on a feature map into features of the same size by dividing each region into a fixed number of bins (e.g. 7×7) and taking the maximum in each bin. Proposed in the Fast R-CNN object detector, it lets the convolution over the whole image be computed only once while still allowing the convolutional layers to be trained jointly.
RoIAlignRoIAlign divides a candidate region (RoI) into a fixed number of bins without rounding coordinates to integers, computes the values at a few points in each bin by bilinear interpolation, and aggregates them. It removes the misalignment caused by rounding in RoI pooling and greatly improved the accuracy of object masks and keypoints in Mask R-CNN.
Spatial Pyramid Pooling (SPP)Spatial pyramid pooling (SPP) divides a feature map into grids at several levels, such as 1×1, 2×2 and 4×4, takes the maximum in each bin, and concatenates the results. Because it produces a vector of the same length regardless of the feature map size, a CNN can accept images of any size, and in object detection the convolution needs to be computed only once over the whole image.
Stochastic PoolingStochastic pooling picks one value from each pooling window with probability proportional to its magnitude. By choosing randomly only during training, it acts as a regularizer that curbs overfitting in convolutional layers; at inference time it uses the probability-weighted sum instead.
