[Paper Review] Group Generalized Mean Pooling for Vision Transformer
This paper proposes Group Generalized Mean (GGeM) pooling for Vision Transformers, which divides channel features into groups and applies learnable GeM pooling per group to better capture channel-wise importance. GGeM improves ViT performance by 0.1–0.7% top-1 accuracy on ImageNet-1K and achieves state-of-the-art results on ViT-Base and ViT-Large, while also outperforming baselines in image retrieval and multi-modal learning tasks.
Vision Transformer (ViT) extracts the final representation from either class token or an average of all patch tokens, following the architecture of Transformer in Natural Language Processing (NLP) or Convolutional Neural Networks (CNNs) in computer vision. However, studies for the best way of aggregating the patch tokens are still limited to average pooling, while widely-used pooling strategies, such as max and GeM pooling, can be considered. Despite their effectiveness, the existing pooling strategies do not consider the architecture of ViT and the channel-wise difference in the activation maps, aggregating the crucial and trivial channels with the same importance. In this paper, we present Group Generalized Mean (GGeM) pooling as a simple yet powerful pooling strategy for ViT. GGeM divides the channels into groups and computes GeM pooling with a shared pooling parameter per group. As ViT groups the channels via a multi-head attention mechanism, grouping the channels by GGeM leads to lower head-wise dependence while amplifying important channels on the activation maps. Exploiting GGeM shows 0.1%p to 0.7%p performance boosts compared to the baselines and achieves state-of-the-art performance for ViT-Base and ViT-Large models in ImageNet-1K classification task. Moreover, GGeM outperforms the existing pooling strategies on image retrieval and multi-modal representation learning tasks, demonstrating the superiority of GGeM for a variety of tasks. GGeM is a simple algorithm in that only a few lines of code are necessary for implementation.
Motivation & Objective
- Address the limitation of existing pooling strategies in Vision Transformers that treat all channels equally, regardless of their activation patterns.
- Improve feature representation by exploiting channel-wise differences in ViT activation maps, which are not considered in standard average, max, or GeM pooling.
- Design a simple yet effective pooling mechanism compatible with ViT’s multi-head attention architecture to reduce head-wise dependency and enhance global feature learning.
- Demonstrate the effectiveness of GGeM pooling across diverse vision tasks, including image classification, image retrieval, and multi-modal representation learning.
- Establish a new state-of-the-art performance for ViT-Base and ViT-Large on ImageNet-1K using a minimal architectural modification.
Proposed method
- Divide the final feature map’s channels into multiple groups based on the number of attention heads in the ViT encoder.
- Apply Generalized Mean (GeM) pooling independently within each group using a shared learnable pooling parameter per group.
- Formulate the GGeM operation as: $ y_g = \left( \frac{1}{N_g} \sum_{i \in G_g} x_i^p \right)^{1/p} $, where $ G_g $ is the g-th group of channels and $ p $ is a learnable parameter per group.
- Integrate GGeM as a replacement for class token or average pooling at the final layer of ViT, enabling end-to-end training.
- Use the same pooling parameter across all spatial locations within each group to preserve spatial structure while emphasizing important channels.
- Train and fine-tune ViT models with GGeM pooling on ImageNet-1K, CUB200, Cars196, SOP, and multi-modal benchmarks like Flickr30k and MSCOCO.
Experimental results
Research questions
- RQ1How does pooling strategy affect the gradient concentration and attention head specialization in Vision Transformers?
- RQ2Can grouping channels in pooling operations reduce inter-head similarity and improve feature diversity in ViT?
- RQ3Does learning a separate pooling parameter per channel group lead to better performance than shared pooling across all channels?
- RQ4How does GGeM pooling compare to average, max, and GeM pooling in terms of accuracy and generalization across image classification, retrieval, and multi-modal tasks?
- RQ5Can GGeM pooling be effectively applied to both pre-training and fine-tuning settings in vision models?
Key findings
- GGeM pooling achieves a new state-of-the-art top-1 accuracy of 71.5% on ImageNet-1K for ViT-Base and 71.5% for ViT-Large, outperforming baseline pooling methods by 0.1–0.7 percentage points.
- On the CUB200 dataset, GGeM achieves 75.2% R@1, 45.0% RP, and 34.6% mAP, surpassing GeM (75.0%, 44.1%, 34.1%) and Max pooling (74.6%, 43.6%, 33.1%) in image retrieval.
- In multi-modal zero-shot retrieval, GGeM achieves 11.5% R@1 and 27.7% R@5 on Flickr30k, outperforming GeM (10.7%, 26.9%) and Max (9.9%, 25.7%) pooling.
- GGeM shows a 1.0% improvement in zero-shot image classification accuracy on average across 14 benchmarks compared to the class token baseline.
- Analysis reveals that GGeM reduces inter-head similarity and increases the number of heads focusing on global information as the pooling parameter $ p $ increases.
- The method requires only a few lines of code to implement, demonstrating high practicality and ease of integration into existing ViT frameworks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.