SimAM
A ResNet-50 classifier with SimAM, an attention module that weights every neuron and adds no parameters.
Image classification · 351 operations Checked
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
- Task
- Image classification
- Parameters
- 25.6M
- Operations
- 351
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICML 2021
- Authors
- Lingxiao Yang, Ru-Yuan Zhang, Lida Li, Xiaohua Xie
- Source
- GitHub: ZjjConan/SimAM
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m20412
- Graph hash
- 31ae79130edba440ea1c87b927c6c2250c3705520f38eafc19aac6a2e4c40921
- Skeleton hash
- 840ed83bcd5945f1aa85b7e9743430648b1d55f1b9459a585bb5edbd98d8c4b3
- Architecture hash
- 50531dec8b62d0c926274b79ed3fac07634fe95e25cf4805d4d7d7bccb8643ae
- Diagram SHA-256
- e63b8d82a9254c1a94f4b046f618d485478c101c6c9586d24c7f3e43dd72f019
- 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
SimAM is an attention module for convolutional networks that infers attention weights for a feature map without adding parameters to the network. Where earlier modules refine features along either the channel or the spatial dimension, SimAM infers full 3-D weights from the neurons themselves. This model is a ResNet-50 image classifier with the module added after the second convolutional layer within each block.
The design starts from neuroscience: an active neuron may suppress the activity of surrounding neurons, a phenomenon called spatial suppression, and the paper treats neurons that show it as the important ones. The authors define an energy function for each neuron and derive a closed-form solution, which is why the module introduces no additional parameters. A neuron with lower energy is more distinctive from surrounding neurons and gets a larger weight. A sigmoid restricts values that are too large before the weights scale the features.
The paper sets the hyper-parameter λ to 0.0001, found by a search with ResNet-20. The repository's ImageNet table lists SimAM-R50 at 77.45% top-1 accuracy with 25.56 M parameters.
Key idea. SimAM derives 3-D attention weights from a closed-form solution to a per-neuron energy function, giving an attention module that adds no parameters to the network.
- SimAM
- simple parameter-free attention module
- parameter-free attention
- 3-D attention weights
- attention module for ConvNets
- SimAM-R50
- image classification
- energy function attention
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@article{simam2021,
title = {SimAM: A Simple, Parameter-Free Attention Module for Convolutional Neural Networks},
author = {Lingxiao Yang and Ru-Yuan Zhang and Lida Li and Xiaohua Xie},
year = {2021},
journal = {ICML 2021}
}