All models

swiftformer_l3

A mobile-oriented image classifier built on efficient additive attention used in every stage.

Image classification · 380 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 (19 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

Parameters
28.5M
Operations
380
Framework
PyTorch
Recurrent
No
Published
ICCV (arXiv 2023)
Cited by
274 (as of 9 October 2026)
Authors
Abdelrahman Shaker, Muhammad Maaz, Hanoona Rasheed and others
License
Apache-2.0
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
m10400
Graph hash
e3beff19753d5aad528ef7fade0d4a536f234879229a7a217c5a80d27f621de0
Skeleton hash
ddfe7fa5e8926a120c775080fd8892597d30e516cb49910e96ba471f0e176865
Architecture hash
6be07869336189bca1388832edb92b98fc52c35d5122b57f5ba0f8dfffe4e317
Diagram SHA-256
5cc5819e59643b839161f9bd84e79338c6df1f76f050c828b2770afcc733ae5d
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('swiftformer_l3', pretrained=False)

What it is

This model is SwiftFormer-L3, for which the paper reports 83.0% top-1 accuracy and a run time of 1.9 ms.

About this model's family

SwiftFormer is a series of image classification models built for real-time use on mobile devices. The paper starts from the cost of self-attention, whose quadratic computational complexity with respect to image resolution limits its use in real-time applications on resource-constrained mobile devices.

Its answer is efficient additive attention, which replaces the quadratic matrix multiplication operations with linear element-wise multiplications. The design drops the explicit key-value interaction and uses a linear layer in its place. Because this attention is linear in the token length, it is used in every stage of the network, where convolutional encoder blocks are followed by a SwiftFormer Encoder.

The architecture is based on EfficientFormer, and the paper notes that the SwiftFormer models are built without any neural architecture search. The paper reports 78.5% top-1 ImageNet-1K accuracy with 0.8 ms latency on iPhone 14 for its small variant. For SwiftFormer-L3 it reports 83.0% top-1 accuracy at 1.9 ms.

Key idea. The paper introduces efficient additive attention, which replaces the quadratic matrix multiplications of self-attention with linear element-wise multiplications and can be used at all stages of the network.

  • swiftformer
  • swift former
  • efficient additive attention
  • additive attention
  • real-time mobile vision
  • mobile image classification
  • image classification
  • hybrid cnn transformer

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

Cite the paper

@misc{shaker2023swiftformerefficientadditiveattention,
      title={SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications}, 
      author={Abdelrahman Shaker and Muhammad Maaz and Hanoona Rasheed and Salman Khan and Ming-Hsuan Yang and Fahad Shahbaz Khan},
      year={2023},
      eprint={2303.15446},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2303.15446}, 
}