Skip to main content
QUICK REVIEW

[Paper Review] Global Sum Pooling: A Generalization Trick for Object Counting with Small Datasets of Large Images

Shubhra Aich, Ian Stavness|arXiv (Cornell University)|May 28, 2018
Video Surveillance and Tracking MethodsComputer Science33 references22 citations
TL;DR

This paper proposes global sum pooling (GSP) as a generalization technique for object counting in small, high-resolution datasets, replacing global average pooling (GAP) to avoid patchwise error cancellation and overfitting. GSP enables accurate counting on full-resolution images by learning a linear mapping across object counts and input shapes, outperforming state-of-the-art methods on four aerial and crowd counting datasets with simpler, more localized models trained on small patches.

ABSTRACT

In this paper, we explore the problem of training one-look regression models for counting objects in datasets comprising a small number of high-resolution, variable-shaped images. We illustrate that conventional global average pooling (GAP) based models are unreliable due to the patchwise cancellation of true overestimates and underestimates for patchwise inference. To overcome this limitation and reduce overfitting caused by the training on full-resolution images, we propose to employ global sum pooling (GSP) instead of GAP or fully connected (FC) layers at the backend of a convolutional network. Although computationally equivalent to GAP, we show through comprehensive experimentation that GSP allows convolutional networks to learn the counting task as a simple linear mapping problem generalized over the input shape and the number of objects present. This generalization capability allows GSP to avoid both patchwise cancellation and overfitting by training on small patches and inference on full-resolution images as a whole. We evaluate our approach on four different aerial image datasets - two car counting datasets (CARPK and COWC), one crowd counting dataset (ShanghaiTech; parts A and B) and one new challenging dataset for wheat spike counting. Our GSP models improve upon the state-of-the-art approaches on all four datasets with a simple architecture. Also, GSP architectures trained with smaller-sized image patches exhibit better localization property due to their focus on learning from smaller regions while training.

Motivation & Objective

  • To address the challenge of training reliable one-look regression models for object counting when only a small number of high-resolution, variable-sized images are available.
  • To overcome the limitations of global average pooling (GAP) in patchwise inference, where overestimates and underestimates cancel out randomly, leading to deceptively accurate aggregate counts.
  • To reduce overfitting caused by training on full-resolution images with limited data by using small random patches during training.
  • To improve model generalization and localization by training GSP-based models on smaller patches, which implicitly provide weak supervision on object positions.
  • To demonstrate that GSP enables better performance than GAP and fully connected layers on diverse, challenging counting datasets with minimal architectural complexity.

Proposed method

  • Replace global average pooling (GAP) with global sum pooling (GSP) in the backend of a convolutional neural network for object counting.
  • Train the model on small, randomly cropped patches from high-resolution images to reduce overfitting and avoid memorization of full-image counts.
  • Use the same GSP layer during inference on full-resolution images, leveraging its ability to sum feature activations across spatial dimensions without averaging.
  • Apply data augmentation via center-cropped patches (e.g., 64×64, 96×96, 128×128, 224×224) from high-resolution images to increase training diversity.
  • Use class activation mapping (CAM) to visualize attention and localization performance, comparing GSP models trained on different patch sizes.
  • Evaluate performance using MAE, RMSE, and percentage-based metrics on four datasets: CARPK, COWC, ShanghaiTech, and a new wheat spike counting dataset.

Experimental results

Research questions

  • RQ1Can global sum pooling (GSP) reduce overfitting and improve generalization in object counting models trained on small, high-resolution datasets?
  • RQ2Does GSP mitigate the patchwise error cancellation problem inherent in global average pooling (GAP) when using tiled patch inference on full-resolution images?
  • RQ3How does training on smaller patches affect the localization capability of GSP-based counting models compared to GAP models?
  • RQ4Can GSP achieve state-of-the-art performance on diverse object counting benchmarks with a simpler architecture than existing methods?
  • RQ5Does the scaling property of GSP enable better feature utilization across multiple spatial scales compared to GAP or fully connected layers?

Key findings

  • GSP models outperform state-of-the-art approaches on all four datasets—CARPK, COWC, ShanghaiTech (Parts A and B), and the wheat spike dataset—achieving lower MAE and RMSE values.
  • On the wheat spike dataset, GSP-96 achieved the best performance with an MAE of 80.00 (8% of average count), outperforming both GAP and larger GSP models.
  • The GSP-64 model achieved comparable performance to previously published results, demonstrating strong generalization with minimal training data.
  • GSP models trained on smaller patches (e.g., 64×64) showed more concentrated activation maps on actual objects, indicating better localization than larger patch or full-image training.
  • The GSP-Full model exhibited uniformly distributed heatmaps across images, indicating memorization of counts from only eight training images, while GSP-96 localized salient regions effectively.
  • Patchwise error cancellation in GAP models led to deceptively low aggregate errors, masking substantial per-patch inference errors, which GSP avoids by not averaging.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.