[论文解读] A Battle of Network Structures: An Empirical Study of CNN, Transformer, and MLP
本文提出一个统一的 SPACH 框架,用于在图像分类中公平比较 CNN、Transformer 和 MLP 架构,发现三者都能具有竞争力,强调多阶段设计和局部建模的优势,并提出在 ImageNet-1K 上取得强结果的混合卷积-Transformer 模型。
Convolutional neural networks (CNN) are the dominant deep neural network (DNN) architecture for computer vision. Recently, Transformer and multi-layer perceptron (MLP)-based models, such as Vision Transformer and MLP-Mixer, started to lead new trends as they showed promising results in the ImageNet classification task. In this paper, we conduct empirical studies on these DNN structures and try to understand their respective pros and cons. To ensure a fair comparison, we first develop a unified framework called SPACH which adopts separate modules for spatial and channel processing. Our experiments under the SPACH framework reveal that all structures can achieve competitive performance at a moderate scale. However, they demonstrate distinctive behaviors when the network size scales up. Based on our findings, we propose two hybrid models using convolution and Transformer modules. The resulting Hybrid-MS-S+ model achieves 83.9% top-1 accuracy with 63M parameters and 12.3G FLOPS. It is already on par with the SOTA models with sophisticated designs. The code and models are publicly available at https://github.com/microsoft/SPACH.
研究动机与目标
- 在一个公平、统一的框架下澄清 CNN、Transformer 和 MLP 架构在视觉任务中的表现。
- 分离影响跨架构性能的设计选择(多阶段、局部建模)?
- 探索将卷积与 Transformer 块结合的混合模型是否能够在 ImageNet-1K 上超越单结构模型?
提出的方法
- 引入 SPACH,一个具有空间混合和通道混合块的即插即用框架,在相同设置下比较 CNN、Transformer 和 MLP。
- 在 SPACH 内通过卷积、自注意力或 MLP 实现空间混合,形成三种变体。
- 在 ImageNet-1K 上使用一致的训练流程(AdamW、300 轮、数据增强)评估单阶段和多阶段 SPACH 变体。
- 通过在 MLP 和 Transformer 块中插入一个轻量级的 3x3 深度卷积作为旁路,分析局部建模的影响。
- 通过在卷积骨干中替换选定层为 Transformer 块,提出 Hybrid-MS-S 和 Hybrid-MS-XS 模型;并通过深度补丁嵌入增强。
实验结果
研究问题
- RQ1在统一的 SPACH 框架下,CNN、Transformer 和 MLP 架构是否提供可比较的准确率-延迟(或 FLOPs)权衡?
- RQ2多阶段设计和局部建模如何影响三大架构族的性能?
- RQ3结合卷积和 Transformer 组件的混合模型在 ImageNet-1K 上是否能达到接近 state-of-the-art 的性能,而不需要复杂的技巧?
主要发现
- 在 SPACH 内,三种架构都能在中等规模下实现接近 ImageNet-1K 的准确度。
- 多阶段设计在 CNN、Transformer 和 MLP 的不同尺寸中始终优于单阶段的对应物。
- 通过一个轻量级的 3x3 深度卷积进行局部建模显著提升 Transformer 和 MLP 的性能,且参数/ FLOP 成本很小。
- MLP 模型在较大规模时易过拟合,但多阶段设计和权重共享缓解了这一点,使性能更接近 Transformer/CNN。
- 卷积和 Transformer 是互补的:卷积提供更好的泛化,Transformer 提供更高容量;混合 Conv-Transformer 模型可在不使用复杂技巧的情况下取得优异结果。
- Hybrid-MS-S+(63M 参数,12.3G FLOPs)在 ImageNet-1K 上达到 83.9% 的 top-1,超过若干 SOTA 基线且 FLOPs 较少;Hybrid-MS-XS+ 在 28M 参数下达到 82.8%。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。