All models

bagnet33_brainscore

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

Image classification · 179 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
18.3M
Operations
179
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
m3603
Graph hash
1e0d9ccc22fea736e96a6d47ab5245cbfa422dce78b13feee31566cb06e54c34
Skeleton hash
fde39e093a242966cbac7f714e68007579205afcc13dab12dd52bfcba861a3ad
Architecture hash
28a1310fec6290720de66101005319d861b11d944fbd372bd476969427301e9f
Diagram SHA-256
900fc3a63aecb7f03639be5d9e331b88ffbaafb3cd8da81551d901cbe713baa1
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-33, the largest of the three patch sizes, for which the paper reports 87.6% top-5 accuracy on ImageNet.

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}, 
}