Generating Attention from Classifier Activations for Fine-grained Recognition

Wei Shen, Rujie Liu

Abstract

Recent advances in fine-grained recognition utilize attention maps to localize objects of interest. Although there are many ways to generate attention maps, most of them rely on sophisticated loss functions or complex training processes. In this work, we propose a simple and straightforward attention generation model based on the output activations of classifiers. The advantage of our model is that it can be easily trained with image level labels and softmax loss functions. More specifically, multiple linear local classifiers are firstly adopted to perform fine-grained classification at each location of high level CNN feature maps. The attention map is generated by aggregating and max-pooling the output activations. Then the attention map serves as a surrogate target object mask to train those local classifiers, similar to training models for semantic segmentation. Our model achieves state-of-the-art results on three heavily benchmarked datasets, i.e. 87.9% on CUB-200-2011 dataset, 94.1% on Stanford Cars dataset and 92.1% on FGVC-Aircraft dataset, demonstrating its effectiveness on fine-grained recognition tasks.

Introduction

Fine-grained recognition—distinguishing between very similar sub-categories like specific bird species, car models, or aircraft types—is a challenging task in computer vision. Visual differences between categories are often subtle, while intra-category variations due to lighting or pose can be significant. To address this, models typically employ attention mechanisms to focus on discriminative object parts.

However, existing methods often require expensive manual part annotations (supervised localization) or rely on complex, multi-stage training processes with customized loss functions. This paper proposes a "top-down" attention model that is simple to train, requires only image-level labels, and utilizes standard optimization strategies like softmax loss.

Methodology

The core intuition behind the proposed approach is that local regions allowing a classifier to correctly predict a category are inherently discriminative and should receive more attention.

Feature Extraction and Local Activations

The model utilizes a Fully Convolutional Network (FCN) backbone, such as ResNet50, to extract high-level feature maps. Instead of a single global classifier, the architecture applies multiple linear "local classifiers" (implemented as 1x1 convolutions) at every spatial location on the feature map. The authors found that using multiple local classifiers (e.g., 16) significantly boosts performance by increasing the model's capacity to recognize diverse discriminative patterns.

Overview of the proposed attention generation model showing the pipeline from CNN features to attention map generation.

Attention Map Generation

The outputs of these local classifiers are aggregated. By performing max-pooling across the channel dimension (excluding the background category), the model generates a 2D attention map. This map identifies regions with high classification confidence.

Surrogate Mask Training

A key innovation is treating the generated attention map as a "pseudo-ground truth" mask. The local classifiers are then trained to match this mask, effectively creating a self-reinforcing loop that refines the model's focus on discriminative parts. This process is analogous to training a model for semantic segmentation but without manual masks.

Multi-scale Prediction

To further enhance performance, the model recursively crops and zooms into the attended regions at different scales. The predictions from these various scales are combined for the final classification result.

Experimental Results

The model was evaluated on three gold-standard benchmarks: CUB-200-2011 (birds), Stanford Cars, and FGVC-Aircraft.

Quantitative Performance

The proposed model achieved state-of-the-art (SOTA) accuracy across all three datasets at the time of publication:

  • CUB-200-2011: 87.9%
  • Stanford Cars: 94.1%
  • FGVC-Aircraft: 92.1%

These results demonstrate that a simple attention mechanism based on classifier activations can outperform more complex methods.

Qualitative Analysis

Visualizations of the attention maps show that the model successfully ignores cluttered backgrounds and focuses tightly on the objects of interest, even across different scales.

Visualization of attention maps at different scales for aircraft images, showing how the model focuses on discriminative regions.

Conclusion

This work demonstrates that classification confidence is a powerful proxy for object localization. By using dense local classifiers and a surrogate mask training strategy, the model achieves high performance with standard softmax loss and image-level labels. While the multi-scale approach adds some computational cost during inference, the simplicity and effectiveness of the attention generation process offer a promising direction for fine-grained recognition tasks.

Summary updated

Abstract

Recent advances in fine-grained recognition utilize attention maps to localize objects of interest. Although there are many ways to generate attention maps, most of them rely on sophisticated loss functions or complex training processes. In this work, we propose a simple and straightforward attention generation model based on the output activations of classifiers. The advantage of our model is that it can be easily trained with image level labels and softmax loss functions. More specifically, multiple linear local classifiers are firstly adopted to perform fine-grained classification at each location of high level CNN feature maps. The attention map is generated by aggregating and max-pooling the output activations. Then the attention map serves as a surrogate target object mask to train those local classifiers, similar to training models for semantic segmentation. Our model achieves state-of-the-art results on three heavily benchmarked datasets, i.e. 87.9% on CUB-200-2011 dataset, 94.1% on Stanford Cars dataset and 92.1% on FGVC-Aircraft dataset, demonstrating its effectiveness on fine-grained recognition tasks.
BibTeX
@misc{shen2018generating,
  author = {Wei Shen and Rujie Liu},
  title = {{Generating Attention from Classifier Activations for Fine-grained Recognition}},
  year = {2018},
  eprint = {1811.10770},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.10770},
}
Figure