变压器在计算机视觉任务中表现出很大的潜力。常见的信念是他们的注意力令牌混合器模块对他们的能力做出了贡献。但是,最近的作品显示了变压器中的基于关注的模块可以被空间MLP所取代,由此产生的模型仍然表现得很好。基于该观察,我们假设变压器的一般架构,而不是特定的令牌混音器模块对模型的性能更为必要。为了验证这一点,我们刻意用尴尬的简单空间池汇集操作员取代变压器中的注意模块,以仅进行最基本的令牌混合。令人惊讶的是,我们观察到,派生模型称为池,在多台计算机视觉任务上实现了竞争性能。例如,在ImageNet-1K上,泳池制造器实现了82.1%的前1个精度,超越了调节的视觉变压器/ MLP样基线Deit-B / ResmmP-B24,比参数的35%/ 52%的准确度为0.3%/ 1.1%和48%/ 60%的Mac。泳道的有效性验证了我们的假设,并敦促我们启动“MetaFormer”的概念,这是一个从变压器抽象的一般架构,而无需指定令牌混音器。基于广泛的实验,我们认为MetaFormer是在视觉任务上实现最近变压器和MLP样模型的优越结果的关键球员。这项工作要求更具未来的研究,专门用于改善元形器,而不是专注于令牌混音器模块。此外,我们提出的池更换器可以作为未来的MetaFormer架构设计的起始基线。代码可在https://github.com/sail-sg/poolformer使用
translated by 谷歌翻译
MetaFormer, the abstracted architecture of Transformer, has been found to play a significant role in achieving competitive performance. In this paper, we further explore the capacity of MetaFormer, again, without focusing on token mixer design: we introduce several baseline models under MetaFormer using the most basic or common mixers, and summarize our observations as follows: (1) MetaFormer ensures solid lower bound of performance. By merely adopting identity mapping as the token mixer, the MetaFormer model, termed IdentityFormer, achieves >80% accuracy on ImageNet-1K. (2) MetaFormer works well with arbitrary token mixers. When specifying the token mixer as even a random matrix to mix tokens, the resulting model RandFormer yields an accuracy of >81%, outperforming IdentityFormer. Rest assured of MetaFormer's results when new token mixers are adopted. (3) MetaFormer effortlessly offers state-of-the-art results. With just conventional token mixers dated back five years ago, the models instantiated from MetaFormer already beat state of the art. (a) ConvFormer outperforms ConvNeXt. Taking the common depthwise separable convolutions as the token mixer, the model termed ConvFormer, which can be regarded as pure CNNs, outperforms the strong CNN model ConvNeXt. (b) CAFormer sets new record on ImageNet-1K. By simply applying depthwise separable convolutions as token mixer in the bottom stages and vanilla self-attention in the top stages, the resulting model CAFormer sets a new record on ImageNet-1K: it achieves an accuracy of 85.5% at 224x224 resolution, under normal supervised training without external data or distillation. In our expedition to probe MetaFormer, we also find that a new activation, StarReLU, reduces 71% FLOPs of activation compared with GELU yet achieves better performance. We expect StarReLU to find great potential in MetaFormer-like models alongside other neural networks.
translated by 谷歌翻译
本文解决了由多头自我注意力(MHSA)中高计算/空间复杂性引起的视觉变压器的低效率缺陷。为此,我们提出了层次MHSA(H-MHSA),其表示以层次方式计算。具体而言,我们首先将输入图像分为通常完成的补丁,每个补丁都被视为令牌。然后,拟议的H-MHSA学习本地贴片中的令牌关系,作为局部关系建模。然后,将小贴片合并为较大的贴片,H-MHSA对少量合并令牌的全局依赖性建模。最后,汇总了本地和全球专注的功能,以获得具有强大表示能力的功能。由于我们仅在每个步骤中计算有限数量的令牌的注意力,因此大大减少了计算负载。因此,H-MHSA可以在不牺牲细粒度信息的情况下有效地模拟令牌之间的全局关系。使用H-MHSA模块合并,我们建立了一个基于层次的变压器网络的家族,即HAT-NET。为了证明在场景理解中HAT-NET的优越性,我们就基本视觉任务进行了广泛的实验,包括图像分类,语义分割,对象检测和实例细分。因此,HAT-NET为视觉变压器提供了新的视角。可以在https://github.com/yun-liu/hat-net上获得代码和预估计的模型。
translated by 谷歌翻译
先前的视觉MLP,如MLP-MILER和RESMLP接受线性扁平的图像贴片作为输入,使其对不同的输入大小和难以捕获空间信息。这种方法隐瞒了MLP与基于变压器的对应物相比,并防止它们成为计算机视觉的一般骨干。本文介绍了Hire-MLP,通过\ TextBF {Hi} reachical \ TextBF {Re}排列,这是一个简单而竞争的愿景MLP架构,其中包含两个重排级别。具体地,提出内部区域重新排列以捕获空间区域内的局部信息,并且提出横区域重新排列以使不同区域之间的信息通信能够通过沿空间方向循环地转换所有令牌来实现不同区域之间的信息通信。广泛的实验证明了Hire-MLP作为各种视觉任务的多功能骨干的有效性。特别是,Hire-MLP在图像分类,对象检测和语义分割任务上实现竞争结果,例如,在Imagenet上的83.8%的前1个精度,51.7%盒AP和Coco Val2017上的44.8%掩模AP和Ade20k上的49.9%Miou ,超越以前的基于变压器和基于MLP的型号,具有更好的折衷以获得准确性和吞吐量。代码可在https://github.com/ggjy/hire-wave-mlp.pytorch获得。
translated by 谷歌翻译
在过去的十年中,CNN在电脑愿景世界中统治了至高无上,但最近,变压器一直在崛起。然而,自我关注的二次计算成本已成为实践应用中的严重问题。在没有CNN的情况下,在这种情况下已经有很多研究了,并且在这种情况下自我关注。特别地,MLP混合器是使用MLP设计的简单架构,并击中与视觉变压器相当的精度。然而,这种体系结构中唯一的归纳偏见是嵌入令牌。这叶打开了将非卷积(或非本地)电感偏差结合到架构中的可能性,因此我们使用了两个简单的想法,以便利用其捕获全局相关能力的同时将电感偏差纳入MLP混合器。一种方法是将令牌混合块垂直和水平分割。另一种方法是在一些令牌混合通道中进行空间相关性密集。通过这种方法,我们能够提高MLP混合器的准确性,同时降低其参数和计算复杂性。 RAFTMLP-S的小型模型与每个计算的参数和效率方面的基于最先进的全球MLP的模型相当。此外,我们通过利用双向插值来解决基于MLP的模型的固定输入图像分辨率的问题。我们证明这些模型可以应用于诸如物体检测的下游任务的架构的骨干。但是,它没有显着的性能,并提到了对基于全球MLP的模型的下游任务的特定MLP特定架构的需求。 pytorch版本中的源代码可用于\ url {https:/github.com/okojoalg/raft-mlp}。
translated by 谷歌翻译
ous vision tasks without convolutions, where it can be used as a direct replacement for CNN backbones. (3) We validate PVT through extensive experiments, showing that it boosts the performance of many downstream tasks, including object detection, instance and semantic segmentation. For example, with a comparable number of parameters, PVT+RetinaNet achieves 40.4 AP on the COCO dataset, surpassing ResNet50+RetinNet (36.3 AP) by 4.1 absolute AP (see Figure 2). We hope that PVT could serve as an alternative and useful backbone for pixel-level predictions and facilitate future research.
translated by 谷歌翻译
由于复杂的注意机制和模型设计,大多数现有的视觉变压器(VIT)无法在现实的工业部署方案中的卷积神经网络(CNN)高效,例如张力和coreml。这提出了一个独特的挑战:可以设计视觉神经网络以与CNN一样快地推断并表现强大吗?最近的作品试图设计CNN-Transformer混合体系结构来解决这个问题,但是这些作品的整体性能远非令人满意。为了结束这些结束,我们提出了下一代视觉变压器,以在现实的工业场景中有效部署,即下一步,从延迟/准确性权衡的角度来看,它在CNN和VIT上占主导地位。在这项工作中,下一个卷积块(NCB)和下一个变压器块(NTB)分别开发出用于使用部署友好机制捕获本地和全球信息。然后,下一个混合策略(NHS)旨在将NCB和NTB堆叠在有效的混合范式中,从而提高了各种下游任务中的性能。广泛的实验表明,在各种视觉任务方面的延迟/准确性权衡方面,下一个VIT明显优于现有的CNN,VIT和CNN转换混合体系结构。在Tensorrt上,在可可检测上,Next-Vit超过5.4 MAP(从40.4到45.8),在类似延迟下,ADE20K细分的8.2%MIOU(从38.8%到47.0%)。同时,它可以与CSWIN达到可比的性能,而推理速度则以3.6倍的速度加速。在COREML上,在类似的延迟下,在COCO检测上,下一步超过了可可检测的4.6 MAP(从42.6到47.2),ADE20K分割的3.5%MIOU(从45.2%到48.7%)。代码将最近发布。
translated by 谷歌翻译
变压器网络对计算机视觉任务取得了很大的进步。变压器 - 变压器(TNT)架构利用内部变压器和外部变压器提取本地和全局表示。在这项工作中,我们通过引入两个先进的设计:1)金字塔架构和2)卷积阀。通过建立分层表示,新的“金字塔”显着改善了原始TNT。Pyramidtnt比以前的最先进的视觉变压器(如Swin Transformer)实现更好的表演。我们希望这一新基线能够有助于视觉变压器的进一步研究和应用。代码将在https://github.com/huawei-noah/cv-backbones/tree/master/tnt_pytorch获得。
translated by 谷歌翻译
最近,Vision Transformer通过推动各种视觉任务的最新技术取得了巨大的成功。视觉变压器中最具挑战性的问题之一是,图像令牌的较大序列长度会导致高计算成本(二次复杂性)。解决此问题的一个流行解决方案是使用单个合并操作来减少序列长度。本文考虑如何改善现有的视觉变压器,在这种变压器中,单个合并操作提取的合并功能似乎不太强大。为此,我们注意到,由于其在上下文抽象中的强大能力,金字塔池在各种视觉任务中已被证明是有效的。但是,在骨干网络设计中尚未探索金字塔池。为了弥合这一差距,我们建议在视觉变压器中将金字塔池汇总到多头自我注意力(MHSA)中,同时降低了序列长度并捕获强大的上下文特征。我们插入了基于池的MHSA,我们构建了一个通用视觉变压器主链,称为金字塔池变压器(P2T)。广泛的实验表明,与先前的基于CNN-和基于变压器的网络相比,当将P2T用作骨干网络时,它在各种视觉任务中显示出很大的优势。该代码将在https://github.com/yuhuan-wu/p2t上发布。
translated by 谷歌翻译
Since the recent success of Vision Transformers (ViTs), explorations toward transformer-style architectures have triggered the resurgence of modern ConvNets. In this work, we explore the representation ability of DNNs through the lens of interaction complexities. We empirically show that interaction complexity is an overlooked but essential indicator for visual recognition. Accordingly, a new family of efficient ConvNets, named MogaNet, is presented to pursue informative context mining in pure ConvNet-based models, with preferable complexity-performance trade-offs. In MogaNet, interactions across multiple complexities are facilitated and contextualized by leveraging two specially designed aggregation blocks in both spatial and channel interaction spaces. Extensive studies are conducted on ImageNet classification, COCO object detection, and ADE20K semantic segmentation tasks. The results demonstrate that our MogaNet establishes new state-of-the-art over other popular methods in mainstream scenarios and all model scales. Typically, the lightweight MogaNet-T achieves 80.0\% top-1 accuracy with only 1.44G FLOPs using a refined training setup on ImageNet-1K, surpassing ParC-Net-S by 1.4\% accuracy but saving 59\% (2.04G) FLOPs.
translated by 谷歌翻译
香草自我注意的机制固有地依赖于预定和坚定的计算维度。这种僵化的性限制了它具有面向上下文的概括,可以带来更多的上下文提示和全球表示。为了减轻此问题,我们提出了一种可扩展的自我注意(SSA)机制,该机制利用两个缩放因素来释放查询,键和价值矩阵的维度,同时使它们不符合输入。这种可伸缩性可获得面向上下文的概括并增强对象灵敏度,从而将整个网络推向准确性和成本之间的更有效的权衡状态。此外,我们提出了一个基于窗口的自我注意事项(IWSA),该自我注意力(IWSA)通过重新合并独立的值代币并从相邻窗口中汇总空间信息来建立非重叠区域之间的相互作用。通过交替堆叠SSA和IWSA,可扩展的视觉变压器(可伸缩率)在通用视觉任务中实现最先进的性能。例如,在Imagenet-1K分类中,可伸缩率S的表现优于双胞胎-SVT-S,而Swin-T则比1.4%。
translated by 谷歌翻译
人类视力能够从整个场景中捕获部分整个分层信息。本文介绍了Visual解析器(VIP),它明确地构造了与变压器的等层次结构。 VIP将视觉表示分为两个级别,零件级别和整个级别。每个部分的信息代表整个内部的几个独立向量的组合。为了模拟两个级别的表示,我们首先通过注意机制将整体信息从整体编码为部分向量,然后将零件向量内的全局信息解码回到整个表示中。通过使用所提出的编码器 - 解码器交互迭代地解析两个级别,模型可以逐渐改进两个级别上的特征。实验结果表明,VIP可以在三个主要任务中实现非常竞争的性能。分类,检测和实例分割。特别是,它可以通过对象检测的大边缘超越先前的最先进的CNN主干。 VIP系列的小型型号为7.2美元,参数为$ 7.2 \ times $ 10.9 \ times $更少的拖鞋可以与最大的resnext-101-64 $ \ times $ 4d的resne(x)t家族相对表现。可视化结果还表明,学习部分对预测类具有高度信息,使VIP比以前的基本架构更可说明。代码可在https://github.com/kevin-ssy/vip上获得。
translated by 谷歌翻译
在最近的计算机视觉研究中,Vision Transformer(VIT)的出现迅速彻底改变了各种建筑设计工作:VIT使用自然语言处理中发现的自我注意力实现了最新的图像分类性能,而MLP-Mixer实现了使用简单多层感知器的竞争性能。相比之下,一些研究还表明,精心重新设计的卷积神经网络(CNN)可以实现与VIT相当的先进性能,而无需诉诸这些新想法。在这种背景下,越来越多的感应偏见适合计算机视觉。在这里,我们提出了Sequencer,这是VIT的一种新颖且具有竞争力的体系结构,可为这些问题提供新的看法。与VIT不同,音序器使用LSTM而不是自我发项层模型的远程依赖性。我们还提出了二维版本的音序器模块,其中LSTM分解为垂直和水平LSTM,以增强性能。尽管它很简单,但一些实验表明,Sequencer表现出色:Sequencer2d-L,具有54m参数,​​仅在Imagenet-1K上实现了84.6%的TOP-1精度。不仅如此,我们还表明它具有良好的可传递性和在双分辨率波段上具有强大的分辨率适应性。
translated by 谷歌翻译
Vision Transformers have shown great promise recently for many vision tasks due to the insightful architecture design and attention mechanism. By revisiting the self-attention responses in Transformers, we empirically observe two interesting issues. First, Vision Transformers present a queryirrelevant behavior at deep layers, where the attention maps exhibit nearly consistent contexts in global scope, regardless of the query patch position (also head-irrelevant). Second, the attention maps are intrinsically sparse, few tokens dominate the attention weights; introducing the knowledge from ConvNets would largely smooth the attention and enhance the performance. Motivated by above observations, we generalize self-attention formulation to abstract a queryirrelevant global context directly and further integrate the global context into convolutions. The resulting model, a Fully Convolutional Vision Transformer (i.e., FCViT), purely consists of convolutional layers and firmly inherits the merits of both attention mechanism and convolutions, including dynamic property, weight sharing, and short- and long-range feature modeling, etc. Experimental results demonstrate the effectiveness of FCViT. With less than 14M parameters, our FCViT-S12 outperforms related work ResT-Lite by 3.7% top1 accuracy on ImageNet-1K. When scaling FCViT to larger models, we still perform better than previous state-of-the-art ConvNeXt with even fewer parameters. FCViT-based models also demonstrate promising transferability to downstream tasks, like object detection, instance segmentation, and semantic segmentation. Codes and models are made available at: https://github.com/ma-xu/FCViT.
translated by 谷歌翻译
Very recently, a variety of vision transformer architectures for dense prediction tasks have been proposed and they show that the design of spatial attention is critical to their success in these tasks. In this work, we revisit the design of the spatial attention and demonstrate that a carefully devised yet simple spatial attention mechanism performs favorably against the state-of-the-art schemes. As a result, we propose two vision transformer architectures, namely, Twins-PCPVT and Twins-SVT. Our proposed architectures are highly efficient and easy to implement, only involving matrix multiplications that are highly optimized in modern deep learning frameworks. More importantly, the proposed architectures achieve excellent performance on a wide range of visual tasks including image-level classification as well as dense detection and segmentation. The simplicity and strong performance suggest that our proposed architectures may serve as stronger backbones for many vision tasks. Our Code is available at: https://git.io/Twins.
translated by 谷歌翻译
视觉变压器由于能够捕获图像中的长期依赖性的能力而成功地应用于图像识别任务。但是,变压器与现有卷积神经网络(CNN)之间的性能和计算成本仍然存在差距。在本文中,我们旨在解决此问题,并开发一个网络,该网络不仅可以超越规范变压器,而且可以超越高性能卷积模型。我们通过利用变压器来捕获长期依赖性和CNN来建模本地特征,从而提出了一个新的基于变压器的混合网络。此外,我们将其扩展为获得一个称为CMT的模型家族,比以前的基于卷积和基于变压器的模型获得了更好的准确性和效率。特别是,我们的CMT-S在ImageNet上获得了83.5%的TOP-1精度,而在拖鞋上的拖曳率分别比现有的DEIT和EficitiveNet小14倍和2倍。拟议的CMT-S还可以很好地概括CIFAR10(99.2%),CIFAR100(91.7%),花(98.7%)以及其他具有挑战性的视觉数据集,例如可可(44.3%地图),计算成本较小。
translated by 谷歌翻译
与传统的卷积神经网络(CNN)和视觉变压器不同,多层默认(MLP)是一种新的视觉模型,具有极其简单的架构,其仅由完全连接的层堆叠。 Vision MLP的输入图像通常被分成多个令牌(补丁),而现有的MLP模型直接用固定权重聚合它们,忽略来自不同图像的令牌的变化语义信息。为了动态聚合令牌,我们建议将每个令牌代表为具有两个部分,幅度和相位的波函数。幅度是原始特征,并且相位项是根据输入图像的语义内容改变的复值。介绍相位项可以动态调制MLP中令牌和固定权重之间的关系。基于波浪状令牌表示,我们建立了一种用于视觉任务的新型波-MLP架构。广泛的实验表明,所提出的波-MLP优于各种视觉任务的最先进的MLP架构,例如图像分类,对象检测和语义分割。
translated by 谷歌翻译
This paper presents a new vision Transformer, called Swin Transformer, that capably serves as a general-purpose backbone for computer vision. Challenges in adapting Transformer from language to vision arise from differences between the two domains, such as large variations in the scale of visual entities and the high resolution of pixels in images compared to words in text. To address these differences, we propose a hierarchical Transformer whose representation is computed with Shifted windows. The shifted windowing scheme brings greater efficiency by limiting self-attention computation to non-overlapping local windows while also allowing for cross-window connection. This hierarchical architecture has the flexibility to model at various scales and has linear computational complexity with respect to image size. These qualities of Swin Transformer make it compatible with a broad range of vision tasks, including image classification (87.3 top-1 accuracy on ImageNet-1K) and dense prediction tasks such as object detection (58.7 box AP and 51.1 mask AP on COCO testdev) and semantic segmentation (53.5 mIoU on ADE20K val). Its performance surpasses the previous state-of-theart by a large margin of +2.7 box AP and +2.6 mask AP on COCO, and +3.2 mIoU on ADE20K, demonstrating the potential of Transformer-based models as vision backbones. The hierarchical design and the shifted window approach also prove beneficial for all-MLP architectures. The code and models are publicly available at https://github. com/microsoft/Swin-Transformer.
translated by 谷歌翻译
变压器已成为深度学习中的主导架构之一,特别是计算机视觉中的卷积神经网络(CNNS)的强大替代品。然而,由于长期表示的自我关注的二次复杂性,以前作品中的变压器培训和推理可能是非常昂贵的,特别是对于高分辨率密集预测任务。为此,我们提出了一种更少的关注视觉变压器(点亮),建立在变形金刚的早期自我注意层仍然专注于当地模式并在最近的等级视觉变压器中带来轻微的益处。具体而言,我们提出了一种分层变压器,在那里我们使用纯多层的感知(MLP)来在早期阶段编码丰富的本地模式,同时应用自我注意模块来捕获更深层中的较长依赖性。此外,我们进一步提出了一种学习的可变形的令牌合并模块,以以非均匀方式自适应地熔化信息贴片。建议的点亮在图像识别任务中实现了有希望的性能,包括图像分类,对象检测和实例分段,作为许多愿景任务的强骨干。代码可用:https://github.com/zhuang-group/lit
translated by 谷歌翻译
我们介绍克斯内变压器,一种高效且有效的变压器的骨干,用于通用视觉任务。变压器设计的具有挑战性的问题是,全球自我关注来计算成本昂贵,而局部自我关注经常限制每个令牌的相互作用。为了解决这个问题,我们开发了以平行的横向和垂直条纹在水平和垂直条纹中计算自我关注的交叉形窗口自我关注机制,通过将输入特征分成相等的条纹而获得的每个条纹宽度。我们提供了条纹宽度效果的数学分析,并改变变压器网络的不同层的条纹宽度,这在限制计算成本时实现了强大的建模能力。我们还介绍了本地增强的位置编码(LEPE),比现有的编码方案更好地处理本地位置信息。 LEPE自然支持任意输入分辨率,因此对下游任务特别有效和友好。 CSWIN变压器并入其具有这些设计和分层结构,展示了普通愿景任务的竞争性能。具体来说,它在ImageNet-1K上实现了85.4 \%Top-1精度,而无需任何额外的培训数据或标签,53.9盒AP和46.4掩模AP,ADE20K语义分割任务上的52.2 Miou,超过以前的状态 - 在类似的拖鞋设置下,艺术品+1.2,+2.0,+1.4和+2.0分别为+1.2,+2.0,+1.4和+2.0。通过在较大的数据集Imagenet-21k上进行前预先预订,我们在Ave20K上实现了87.5%的成像-1K和高分性能,55.7 miou。代码和模型可在https://github.com/microsoft/cswin-transformer中找到。
translated by 谷歌翻译