[论文解读] MetaFormer Is Actually What You Need for Vision
该论文将 Transformer 抽象为一个通用的 MetaFormer 架构,并展示即使是基于池化的简单 token 混合器(PoolFormer)也能实现有竞争力的视觉性能,强调 MetaFormer 作为强大视觉模型的关键。
Transformers have shown great potential in computer vision tasks. A common belief is their attention-based token mixer module contributes most to their competence. However, recent works show the attention-based module in Transformers can be replaced by spatial MLPs and the resulted models still perform quite well. Based on this observation, we hypothesize that the general architecture of the Transformers, instead of the specific token mixer module, is more essential to the model's performance. To verify this, we deliberately replace the attention module in Transformers with an embarrassingly simple spatial pooling operator to conduct only basic token mixing. Surprisingly, we observe that the derived model, termed as PoolFormer, achieves competitive performance on multiple computer vision tasks. For example, on ImageNet-1K, PoolFormer achieves 82.1% top-1 accuracy, surpassing well-tuned Vision Transformer/MLP-like baselines DeiT-B/ResMLP-B24 by 0.3%/1.1% accuracy with 35%/52% fewer parameters and 50%/62% fewer MACs. The effectiveness of PoolFormer verifies our hypothesis and urges us to initiate the concept of "MetaFormer", a general architecture abstracted from Transformers without specifying the token mixer. Based on the extensive experiments, we argue that MetaFormer is the key player in achieving superior results for recent Transformer and MLP-like models on vision tasks. This work calls for more future research dedicated to improving MetaFormer instead of focusing on the token mixer modules. Additionally, our proposed PoolFormer could serve as a starting baseline for future MetaFormer architecture design. Code is available at https://github.com/sail-sg/poolformer.
研究动机与目标
- 提出一个与整体设计解耦 token 混合器的通用视觉模型架构(MetaFormer)。
- 探究一个简单、不可学习的池化算子是否可以在 MetaFormer 内部作为有效的 token 混合器。
- 在图像分类、目标检测、实例分割和语义分割等任务上,经验性比较 PoolFormer 与 ViT/MLP 风格基线的表现。
提出的方法
- 将 MetaFormer 定义为具有未指定 token 混合器、以及标准残差/MLP 组件的 Transformer 风格架构。
- 以基于池化的 token 混合器(PoolFormer)实例化 MetaFormer,以评估架构本身的作用。
- 使用一个 4 阶段的分层 PoolFormer 设计,嵌入维度和块数不同(S12、S24、S36、M36、M48),默认池化大小为 3。
- 在 ImageNet-1K 上进行数据增强、AdamW 优化,并针对通道优先数据的 Layer Normalization(MLN)进行修改。
- 在 ImageNet-1K、COCO(RetinaNet、Mask R-CNN)和 ADE20K(语义分割)上进行评估,以考察在视觉任务上的泛化能力。
- 进行消融实验,改变 token 混合器、归一化、激活和阶段配置,以分离 MetaFormer 的影响。
实验结果
研究问题
- RQ1MetaFormer 的通用架构是否是跨视觉任务性能的主要驱动因素,与具体的 token 混合器无关?
- RQ2基于池化的 token 混合器(PoolFormer)是否能在与注意力驱动的 Transformer、MLP 型模型相当的性能上竞争?
- RQ3与最新基线相比,PoolFormer 在分类、检测/分割和语义分割基准上的表现如何?
主要发现
- PoolFormer 采用简单的池化 token 混合器即可达到有竞争力的 ImageNet-1K top-1 准确率,在 MACs/参数方面超越 DeiT-B 与 ResMLP-B24 基线。
- PoolFormer-S24 在 21M 参数与 3.4G MACs 下达到 80.3% 的 top-1,超过在相似预算下的 ViT/MLP 风格基线。
- PoolFormer-M36 在 56.1M 参数与 8.8G MACs 下达到 82.1% 的 top-1,资源更少时超越若干更强的基线。
- PoolFormer-M48 在 73.4M 参数与 11.6G MACs 下达到 82.5% 的 top-1,延续了竞争趋势。
- 消融实验表明,即使 token 混合器为恒等映射,也能达到 74.3% 的 top-1,支持 MetaFormer 架构在很大程度上驱动性能的论点。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。