All models

swiftformer_l1

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

Image classification · 348 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 (25 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
12.1M
Operations
348
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
m10399
Graph hash
d4ee6de066e6120a080ef439528815d4a4e3c79e9a225493950b99a54a4127d8
Skeleton hash
811b77728e6455c4bbc7cc8d98a059f305af110bb68a1f8678b02171d53e7939
Architecture hash
71f86a3eec2098deee4d1413c58768e41872ee3f60eb0b396b006b37979ec8bc
Diagram SHA-256
803066eaa64d16c335e5cfc17f992831a93100d405b35beb12a91c90888253b2
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_l1', pretrained=False)

What it is

This model is SwiftFormer-L1, for which the paper reports a 1.7% absolute gain in top-1 accuracy over EfficientFormer-L1 at the same latency.

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