timm documentation

LowFormer

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

LowFormer

类别: Efficient/Mobile · 代码: timm/models/lowformer.py · 架构: 8 · 预训练权重: 7(0 个具有 ImageNet-1k 结果)

LowFormer 是一种面向硬件效率(以吞吐量而非 MACs 衡量)设计的卷积 Transformer 骨干网络。E1 / E2 / E3 边缘 GPU 变体来自期刊扩展版本。

论文

用法

请参阅快速入门了解如何加载预训练权重、进行图像预处理和微调,以及查阅特征提取了解如何将模型用作骨干网络。

>>> import timm
>>> model = timm.create_model('lowformer_b0.in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

模型 API 支持

功能LowFormer
features_only=True 特征图✓(步长 4、8、16、32)
forward_intermediates()✓
prune_intermediate_layers()✓
任意输入尺寸,无需更改✓
set_input_size()–
dynamic_img_size=True–
set_grad_checkpointing()✓
逐层学习率衰减(group_matcher())✓
reset_classifier()✓

✓ 支持,✓ (square) 仅支持方形尺寸,✗ 不支持,– 无需支持(该模型本身已接受任意输入尺寸)。通过在每个功能上运行随机初始化的模型(LowFormer 使用 lowformer_b0,尺寸为 224)进行验证,预期同一类的其他架构表现相同。有关详细信息,请参阅 模型 API 页面。

架构

架构参数(M)GMAC输入大小预训练权重
lowformer_b014.10-2241
lowformer_b117.94-2241
lowformer_b244.99-2240
lowformer_b357.09-2241
lowformer_b1533.98-2241
lowformer_e118.90-2241
lowformer_e222.75-2241
lowformer_e341.32-2241

GMACs 和参数量对应于每种架构的默认输入大小和分类器,数据来自基准测试结果。

预训练权重

Top-1 是 results-imagenet.csv 中在所列评估规模下的 ImageNet-1k 验证准确率,- 表示该权重没有 ImageNet-1k 结果(例如预训练权重或图文权重)。Classes 是预训练分类器的大小,对于没有分类器的权重则为 none。

权重输入大小Top-1(%)评估大小类许可证Hub
lowformer_b0.in1k224--1000apache-2.0timm
lowformer_b1.in1k224--1000apache-2.0timm
lowformer_b3.in1k224--1000apache-2.0timm
lowformer_b15.in1k224--1000apache-2.0timm
lowformer_e1.in1k224--1000apache-2.0timm
lowformer_e2.in1k224--1000apache-2.0timm
lowformer_e3.in1k224--1000apache-2.0timm

引用

@article{Nottebaum2024LowFormerHE,
  title={LowFormer: Hardware Efficient Design for Convolutional Transformer Backbones},
  author={Moritz Nottebaum and Matteo Dunnhofer and Christian Micheloni},
  journal={2025 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
  year={2024},
  pages={7008-7018},
}

@article{Nottebaum2026BeyondMACs,
  author  = {Nottebaum, Moritz and Dunnhofer, Matteo and Micheloni, Christian},
  title   = {Beyond {MAC}s: Hardware Efficient Architecture Design for Vision Backbones},
  journal = {International Journal of Computer Vision},
  year    = {2026},
  volume  = {134},
  number  = {6},
  pages   = {295},
  doi     = {10.1007/s11263-026-02873-5},
  url     = {https://doi.org/10.1007/s11263-026-02873-5}
}
Update on GitHub