Skip to main content
QUICK REVIEW

[Paper Review] Augmenting Convolutional networks with attention-based aggregation

Hugo Touvron, Matthieu Cord|arXiv (Cornell University)|Dec 27, 2021
Advanced Neural Network ApplicationsComputer Science30 citations
TL;DR

The paper augments convnets with an attention-based global aggregation layer that weights image patches for classification, enabling non-local reasoning while maintaining constant patch resolution and favorable accuracy-memory trade-offs across classification, segmentation, and detection tasks.

ABSTRACT

We show how to augment any convolutional network with an attention-based global map to achieve non-local reasoning. We replace the final average pooling by an attention-based aggregation layer akin to a single transformer block, that weights how the patches are involved in the classification decision. We plug this learned aggregation layer with a simplistic patch-based convolutional network parametrized by 2 parameters (width and depth). In contrast with a pyramidal design, this architecture family maintains the input patch resolution across all the layers. It yields surprisingly competitive trade-offs between accuracy and complexity, in particular in terms of memory consumption, as shown by our experiments on various computer vision tasks: object classification, image segmentation and detection.

Motivation & Objective

  • Introduce a learned, attention-based pooling layer to replace standard average pooling in convolutional networks.
  • Develop a simple patch-based trunk (PatchConvNet) that maintains constant input resolution across layers.
  • Provide an interpretable attention map per patch, enabling visualization of patch contributions.
  • Demonstrate competitive accuracy-memory trade-offs on image classification, segmentation, and detection.

Proposed method

  • Replace final average pooling with a cross-attention pooling layer that uses a class token to attend to image patches.
  • Introduce PatchConvNet, a patch-based trunk with fixed dimensionality across layers, built from a lightweight conv stem and residual blocks.
  • Optionally specialize attention maps per class by using a per-class class token matrix.
  • Train using DeiT-inspired recipe with Lamb optimizer, half-cosine schedule, label smoothing, RandAugment, Mixup, CutMix, Stochastic Depth, LayerNorm/BatchNorm choices.
  • Provide single-head attention for interpretability and reduced memory footprint; visualize attention maps directly from pooling stage.

Experimental results

Research questions

  • RQ1Can an attention-based aggregation layer replace traditional pooling in convnets while preserving performance and interpretability?
  • RQ2Does keeping a constant patch resolution (PatchConvNet) offer competitive accuracy with favorable memory and compute trade-offs compared to pyramidal, pyramid-based architectures?
  • RQ3How does per-class attention (one class token per class) affect interpretability and performance in classification tasks?
  • RQ4What are the training dynamics and hyperparameter sensitivities (e.g., stochastic depth, normalization) for PatchConvNet across datasets and resolutions?
  • RQ5How do the proposed models perform on segmentation and detection alongside classification compared to state-of-the-art architectures?

Key findings

  • Attention-based pooling provides direct patch contribution weights, enabling interpretable visualizations.
  • PatchConvNet delivers competitive Top-1 accuracy with favorable memory usage compared to many attention-based models.
  • Higher input resolutions improve accuracy, with linear memory scaling and no heavy pyramid downsampling.
  • The learned pooling improves ResNet-50 performance when integrated, with modest FLOPs increase.
  • Models pre-trained on ImageNet21k and finely tuned at higher resolutions achieve improved accuracy over 224-site pre-training.
  • PatchConvNet achieves competitive results in semantic segmentation (ADE20k) and object detection (COCO) with comparable FLOPs and memory to attention-based baselines.

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.