arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.05795cs.LG
收藏

转换的CNN:用自注意力重铸预先训练的卷积层

Transformed CNNs: recasting pre-trained convolutional layers with self-attention

Laboratoire de Physique de l’Ecole Normale Supérieure(巴黎高等师范学院物理实验室);Université PSL(巴黎文理研究大学);CNRS(法国国家科学研究中心);Sorbonne Université(索邦大学);Université Paris-Diderot(巴黎第七大学);Facebook AI Research(脸书人工智能研究院)

Stéphane d'Ascoli, Levent Sagun, Giulio Biroli, Ari Morcos

摘要:

视觉Transformer(ViT)最近成为卷积网络(CNN)的强大替代方案。尽管混合模型试图弥合这两种架构之间的差距,但它们所依赖的自注意力层引起了强大的计算瓶颈,特别是在大空间分辨率下。在这项工作中,我们探索了通过将它们初始化为卷积层来减少训练这些层所花费的时间的想法。这使我们能够从任何预先训练的CNN平滑地过渡到其功能相同的混合模型,称为转换的CNN(T-CNN)。仅经过50次微调,所得到的T-CNN就表现出了比CNN显著的性能提升(对于ResNet 50-RS,ImageNet-1 k上的top-1增加了2.2%),以及显著提高的鲁棒性(ImageNet-C上的top-1增加了11%)。我们分析了T-CNN学习的表征,为卷积和自注意力之间富有成效的相互作用提供了更深入的见解。最后,我们实验从部分训练的CNN初始化T-CNN,并发现它比从头开始训练的相应混合模型达到更好的性能,同时减少训练时间。

英文摘要:

Vision Transformers (ViT) have recently emerged as a powerful alternative to convolutional networks (CNNs). Although hybrid models attempt to bridge the gap between these two architectures, the self-attention layers they rely on induce a strong computational bottleneck, especially at large spatial resolutions. In this work, we explore the idea of reducing the time spent training these layers by initializing them as convolutional layers. This enables us to transition smoothly from any pre-trained CNN to its functionally identical hybrid model, called Transformed CNN (T-CNN). With only 50 epochs of fine-tuning, the resulting T-CNNs demonstrate significant performance gains over the CNN (+2.2% top-1 on ImageNet-1k for a ResNet50-RS) as well as substantially improved robustness (+11% top-1 on ImageNet-C). We analyze the representations learnt by the T-CNN, providing deeper insights into the fruitful interplay between convolutions and self-attention. Finally, we experiment initializing the T-CNN from a partially trained CNN, and find that it reaches better performance than the corresponding hybrid model trained from scratch, while reducing training time.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑