FastViT:一种使用结构重参数化的快速混合视觉 Transformer
FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization
AI总结:
本文提出混合视觉 Transformer FastViT,通过 RepMixer 结构重参数化、训练时过参数化和大核卷积,在多项视觉任务上实现更优的延迟-准确率权衡与鲁棒性。
摘要:
近期 Transformer 与卷积设计的融合使模型在准确率和效率方面持续提升。本文提出 FastViT,这是一种混合视觉 Transformer 架构,实现了最先进的延迟-准确率权衡。为此,我们提出一种新颖的 token 混合算子 RepMixer,作为 FastViT 的构建模块;它利用结构重参数化,通过去除网络中的跳跃连接来降低内存访问成本。我们进一步采用训练时过参数化和大核卷积以提升准确率,并通过实验证明这些选择对延迟的影响极小。结果显示,在 ImageNet 数据集上达到相同准确率时,我们的模型在移动设备上比近期最先进的混合 Transformer 架构 CMT 快 3.5 倍,比 EfficientNet 快 4.9 倍,比 ConvNeXt 快 1.9 倍。在相近延迟下,我们的模型在 ImageNet 上的 Top-1 准确率比 MobileOne 高 4.2%。在图像分类、检测、分割和三维网格回归等多项任务中,我们的模型始终优于竞争架构,同时在移动设备和桌面 GPU 上均显著降低延迟。此外,我们的模型对分布外样本和图像损坏具有很强的鲁棒性,优于其他鲁棒模型。代码和模型可在 https://github.com/apple/ml-fastvit 获取。
英文摘要:
The recent amalgamation of transformer and convolutional designs has led to steady improvements in accuracy and efficiency of the models. In this work, we introduce FastViT, a hybrid vision transformer architecture that obtains the state-of-the-art latency-accuracy trade-off. To this end, we introduce a novel token mixing operator, RepMixer, a building block of FastViT, that uses structural reparameterization to lower the memory access cost by removing skip-connections in the network. We further apply train-time overparametrization and large kernel convolutions to boost accuracy and empirically show that these choices have minimal effect on latency. We show that - our model is 3.5x faster than CMT, a recent state-of-the-art hybrid transformer architecture, 4.9x faster than EfficientNet, and 1.9x faster than ConvNeXt on a mobile device for the same accuracy on the ImageNet dataset. At similar latency, our model obtains 4.2% better Top-1 accuracy on ImageNet than MobileOne. Our model consistently outperforms competing architectures across several tasks -- image classification, detection, segmentation and 3D mesh regression with significant improvement in latency on both a mobile device and a desktop GPU. Furthermore, our model is highly robust to out-of-distribution samples and corruptions, improving over competing robust models. Code and models are available at https://github.com/apple/ml-fastvit.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。