wikillm

Concept · 1 paper · updated 2026-11-08

Spatial pooling

Spatial pooling shrinks a feature map by reducing each small window of each channel to one value. The one card so far, SoftPool, replaces max or average pooling with a softmax-weighted sum that has no trainable parameters. Author-reported gains on image-similarity and ImageNet1K tests. Its official backward pass omits a term of the exact gradient.

poolingcnndownsampling

Markdown4 min read

AI-compiled overview, updated 2026-11-08, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

Overview

Spatial pooling reduces the height and width of an activation map by replacing each window of each channel with one value 2101.00440 §1 2101.00440 §3. The stated aims are lower computation and memory in the following layers, a larger receptive field, and as little lost information as possible 2101.00440 §1 2101.00440 §3. The usual baselines are max pooling, which keeps only the largest value in a window, and average pooling, which weights every value equally 2101.00440 §3.2 2101.00440 §3.3.

Variants

Softmax-weighted pooling (SoftPool)

Each output is a softmax-weighted sum over a k × k window. Every activation is weighted by its exponential, normalised over the window, and the output is the weighted sum of the activations 2101.00440 §3.1. Large values dominate, but smaller values still contribute, so the output depends smoothly on every activation in the window 2101.00440 §3.1 2101.00440 §3.3. The operator has no trainable parameters, so parameter counts and GFLOPs match the pooling it replaces 2101.00440 §4.4. The same formulation extends to 3D inputs with a spatio-temporal kernel 2101.00440 §3.4. Card: Refining activation downsampling with SoftPool.

Author-reported results:

  • Image similarity: highest SSIM and PSNR in all nine settings (k = 2, 3, 5 on three datasets) against the pooling methods the paper compares 2101.00440 tab. 1.
  • ImageNet1K, trained from scratch: top-1 gains over the original network between +0.81 and +1.51 as printed, across 11 networks 2101.00440 tab. 2. Some printed gains disagree with the table's own numbers (see Contradictions).
  • ImageNet1K, pooling swapped into a trained network without retraining: printed gains between +0.37 and +0.80, with one row whose printed gain conflicts with its own numbers 2101.00440 tab. 2.
  • Same ResNet18 setting, six CNNs: the highest from-scratch top-1 in every column against the other pooling operators 2101.00440 tab. 5.
  • Action recognition: SoftPool versions of three video models are reported with higher top-1 on HACS, Kinetics-700 and UCF-101 in most rows. The baselines use different pre-training, so these rows are not controlled comparisons 2101.00440 §4.6 2101.00440 tab. 7.

When to use which

SituationUseWhy
A drop-in change to an existing CNN, with no new parameters or FLOPsSoftPoolParameters and GFLOPs are unchanged 2101.00440 §4.4; from-scratch gains in 2101.00440 tab. 2
The window's weaker responses should still count, not only its peakSoftPoolEvery activation enters the weighted sum 2101.00440 §3.1
Training-time pooling cost is the binding constraintAverage poolingLowest backward cost in the authors' CUDA test: 76 ms, against 234 ms for SoftPool and 267 ms for max 2101.00440 tab. 3
Pooling forward cost matters on either CPU or GPUSoftPool, or average pooling if cheapest is requiredSoftPool forward sits between average and max pooling in the authors' float16 setup 2101.00440 tab. 3 2101.00440 app. §7
Inputs can be negative, e.g. no ReLU before poolingTest firstThe paper's overflow and underflow checks assume non-negative activations 2101.00440 app. §7
You need the exact gradient of the pooling outputSoftPool with an exact backward, checked against autogradThe paper's backward uses the weights alone 2101.00440 §3.2. The exact form is derived on the card, not stated in the paper (card)
You plan to claim a gain of about one top-1 pointRun several seedsThe number of seeds is not stated, and McNemar's test compares paired predictions rather than seed variance 2101.00440 app. §6

Implementation sketch

Forward pass for one window of one channel. The paper omits the channel index; pooling is applied per channel.

Pseudocode
# Forward pass over one window R of one channel  [arxiv:2101.00440 §3.1]
# Input:  window, k*k activations (non-negative, see When to use which)
# Output: pooled scalar

def softpool_window(window):
    # Exponentiate each activation  [arxiv:2101.00440 eq. 1]
    exp_values = exp(window)
    # Normalise so the weights in the window sum to one  [arxiv:2101.00440 eq. 1]
    weights = exp_values / sum(exp_values)
    # Output is the weighted sum of the activations  [arxiv:2101.00440 eq. 2]
    return sum(weights * window)

Subtracting the window maximum before the exponential leaves the weights unchanged, because softmax is invariant to a shift. This matters for half-precision overflow. The card records that the official CUDA kernel does not subtract it.

Contradictions

  • Backward pass. The paper gives each input a gradient proportional to its forward weight 2101.00440 §3.2. The exact derivative of 2101.00440 eq. 2 also depends on how the weights change with each input. The card derives this term and notes that the official code uses the weights-only form (card). The paper does not say which form the reported results used 2101.00440 §3.2.
  • Operator on CPU and GPU. The paper computes the weights within each channel's window 2101.00440 §3.1. The card records that the official non-CUDA path normalises over the channel dimension, so outputs differ between devices (card).
  • 3D windows. The paper states the 3D extension only as a kernel extension 2101.00440 §3.4. The card records that the official 3D forward and backward passes place their windows differently (card).
  • Printed gains. Some printed gains in 2101.00440 tab. 2 do not equal the difference of the printed top-1 values. ResNeXt101 32x8d pre-trained reads +0.58, but 78.89 − 79.31 = −0.42. DenseNet161 from scratch reads +0.93, but 78.72 − 77.65 = 1.07.
  • Baseline labels. 2101.00440 tab. 5 attaches the Lp and Gate citations to the opposite labels from 2101.00440 tab. 1 and 2101.00440 tab. 3.

Papers

Source and license

Compiled from the papers listed on this page, all published under CC BY, CC BY-SA or CC0, with citations. See each paper's page for its authors and license.