Approximating CNNs with Bag-of-local-Features models works surprisingly well on ImageNet

Wieland Brendel, Matthias Bethge

Abstract

Deep Neural Networks (DNNs) excel on many complex perceptual tasks but it has proven notoriously difficult to understand how they reach their decisions. We here introduce a high-performance DNN architecture on ImageNet whose decisions are considerably easier to explain. Our model, a simple variant of the ResNet-50 architecture called BagNet, classifies an image based on the occurrences of small local image features without taking into account their spatial ordering. This strategy is closely related to the bag-of-feature (BoF) models popular before the onset of deep learning and reaches a surprisingly high accuracy on ImageNet (87.6% top-5 for 33 x 33 px features and Alexnet performance for 17 x 17 px features). The constraint on local features makes it straight-forward to analyse how exactly each part of the image influences the classification. Furthermore, the BagNets behave similar to state-of-the art deep neural networks such as VGG-16, ResNet-152 or DenseNet-169 in terms of feature sensitivity, error distribution and interactions between image parts. This suggests that the improvements of DNNs over previous bag-of-feature classifiers in the last few years is mostly achieved by better fine-tuning rather than by qualitatively different decision strategies.

Introduction

A fundamental assumption in computer vision is that Deep Neural Networks (DNNs) succeed because they learn to integrate complex, global shapes. However, research by Wieland Brendel and Matthias Bethge (ICLR 2019) challenges this notion. They demonstrate that a model looking only at tiny, local image patches—completely ignoring their spatial arrangement—can perform surprisingly well on the massive ImageNet dataset. This suggests that modern CNNs might be making decisions based on local statistical regularities (textures) rather than a holistic understanding of object shapes.

The BagNet Architecture

Standard CNNs are often criticized as "black boxes" because every pixel's influence is filtered through many layers of non-linear interactions. To address this, the authors developed BagNets, a variant of the ResNet-50 architecture designed to be interpretable by design.

The core of the BagNet strategy involves two key modifications:

  1. Restricted Receptive Fields: By replacing most 3x3 convolutions with 1x1 convolutions, the authors limit the "receptive field" (the area of the input image a single neuron "sees") of the final convolutional layer to a fixed size: 9x9, 17x17, or 33x33 pixels.
  2. Linear Aggregation: The model extracts features from these small patches independently and applies a linear classifier to each to get a "logit" (score) for every class. To make the final image-level decision, the model simply averages these scores across the image. This "bag-of-features" approach completely discards spatial relationships between patches.
Overview of BagNet architecture, validation performance, and correlation with VGG-16.

Key Results and Insights

Despite their simplicity, BagNets achieve remarkable performance on the ImageNet dataset. BagNet-33 (using 33x33 pixel patches) reached 87.6% top-5 accuracy, while BagNet-17 performed comparably to the landmark AlexNet.

Furthermore, the authors found that the decisions made by BagNets are highly correlated with those of standard CNNs. For instance, the correlation between BagNet-33 and VGG-16 logits is 0.88. This high correlation suggests that standard, high-performing models like VGG-16 and ResNet-152 may behave more like bag-of-features models than previously thought, sharing similar error distributions and showing few long-range spatial interactions.

The Texture Hypothesis and Interpretability

The success of BagNets supports the "Texture Hypothesis": the idea that ImageNet can be "solved" largely by identifying local textures. For example, a "tench" (a fish) is often identified by the texture of fingers holding it, as many training photos are of trophy fish.

One of the primary advantages of BagNets is their inherent interpretability. Because the final decision is a simple sum of evidence from individual patches, it is straightforward to generate precise heatmaps showing exactly which parts of an image "voted" for a particular class.

Class evidence heatmaps for BagNets with different receptive field sizes.

Conclusion

The performance of BagNets reveals a fundamental qualitative difference between how humans and current AI "see" the world. While humans rely heavily on global shape, current DNNs appear to rely more on local statistical regularities. While BagNets still trail state-of-the-art ResNets by a few percentage points—indicating that some global information is useful—their high accuracy suggests that much of the progress in deep learning has come from better fine-tuning of local feature extraction rather than fundamentally new decision strategies. Future research should focus on tasks and architectures that explicitly require a more holistic, shape-based understanding to improve generalization and robustness.

Summary updated

Abstract

Deep Neural Networks (DNNs) excel on many complex perceptual tasks but it has proven notoriously difficult to understand how they reach their decisions. We here introduce a high-performance DNN architecture on ImageNet whose decisions are considerably easier to explain. Our model, a simple variant of the ResNet-50 architecture called BagNet, classifies an image based on the occurrences of small local image features without taking into account their spatial ordering. This strategy is closely related to the bag-of-feature (BoF) models popular before the onset of deep learning and reaches a surprisingly high accuracy on ImageNet (87.6% top-5 for 33 x 33 px features and Alexnet performance for 17 x 17 px features). The constraint on local features makes it straight-forward to analyse how exactly each part of the image influences the classification. Furthermore, the BagNets behave similar to state-of-the art deep neural networks such as VGG-16, ResNet-152 or DenseNet-169 in terms of feature sensitivity, error distribution and interactions between image parts. This suggests that the improvements of DNNs over previous bag-of-feature classifiers in the last few years is mostly achieved by better fine-tuning rather than by qualitatively different decision strategies.
BibTeX
@inproceedings{brendel2019approximating,
  author = {Wieland Brendel and Matthias Bethge},
  title = {{Approximating CNNs with Bag-of-local-Features models works surprisingly well on ImageNet}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=lvapdo1BqV},
}
Figure