All models

bagnet9_brainscore

A ResNet-50 variant that classifies images from small local patches without using their spatial ordering.

Image classification · 177 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (16 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
BagNet
Parameters
15.7M
Operations
177
Framework
PyTorch
Recurrent
No
Published
ICLR 2019
Cited by
323 (as of 21 October 2026)
Authors
Wieland Brendel, Matthias Bethge
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3604
Graph hash
bb8ffb58f511d79f03fc4b8d02c9ff5dd4662da532bac9866fbcb011679df5f4
Skeleton hash
863bdfd7918126823f400d8de6c4060379654f010a21c707924c7cc006459a7e
Architecture hash
35a10b4df445cf17a37551d9f8df79b4c0e43aa67129659291ea0f0a631499d2
Diagram SHA-256
2f245e78b629db144fcb1cda3f5a2854cd9c4c5599287ea043cb001de40dfddc
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is BagNet-9, the smallest of the three patch sizes the paper tests, with q set to 9 pixels.

About this model's family

BagNet is an image classifier that decides from small local image features alone, without taking into account their spatial ordering. The paper introduces it as an architecture for ImageNet whose decisions are considerably easier to explain, and describes it as a simple variant of ResNet-50.

The structure differs from other ResNets only in the replacement of many 3 × 3 convolutions by 1 × 1 convolutions, which limits the receptive field of the topmost convolutional layer to q × q pixels. A linear classifier turns the features of each patch into class evidence, and that evidence is averaged across all patches to give the image-level logits. Because the evidence is inferred patch by patch, the result is a heatmap that shows which parts of the image contribute most to a decision. The name carries the patch size: the last number is the maximum local patch size the network can integrate over.

The paper reports that patches of 17 × 17 pixels reach AlexNet performance on ImageNet (80.5% top-5), and that 33 × 33 pixel patches reach close to 87.6%. In its runtime comparison, BagNets reach around 155 images/s against 570 images/s for ResNet-50.

Key idea. The paper shows that BagNet, a ResNet-50 variant restricted to small local patches without their spatial ordering, reaches 87.6% top-5 on ImageNet with 33 x 33 px features.

  • bagnet
  • bagnets
  • bag-of-local-features
  • bag of features
  • bagnet9
  • bagnet17
  • bagnet33
  • image classification
  • interpretable cnn
  • local patches

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{brendel2019approximatingcnnsbagoflocalfeaturesmodels,
      title={Approximating CNNs with Bag-of-local-Features models works surprisingly well on ImageNet}, 
      author={Wieland Brendel and Matthias Bethge},
      year={2019},
      eprint={1904.00760},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1904.00760}, 
}