视觉变压器(VIV)及其变体(例如,Swin,PVT)在各种计算机视觉任务中取得了巨大的成功,这是由于他们学习远程语境信息的能力。层标准化(LN)是这些模型中的必要成分。然而,我们发现普通LN在不同位置处的令牌幅度,因为它标准化每个令牌内的嵌入物。变压器难以捕获诱导偏压,例如用LN的图像中的位置上下文。我们通过提出新的标准化器,称为动态令牌归一化(DTN)来解决这个问题,其中归一化在每个令牌(令牌)和跨不同的标记(令牌互补)中执行归一化。 DTN有几个优点。首先,它基于统一的制定,因此可以代表各种现有的归一化方法。其次,DTN学习在令牌内部和令牌间的互联网上标准化令牌,使变换器能够捕获全局上下文信息和本地位置上下文。 {第三,通过简单地更换LN层,DTN可以容易地插入各种视觉变压器,例如VIT,SWIN,PVT,Levit,T2T-VIT,BIGBIRD和REPLERER。广泛的实验表明,配备DTN的变压器始终如一地优于基线模型,具有最小的额外参数和计算开销。例如,DTN优于0.5 \%$ 0.5 \%$ - $ 1.2 \%$ 1.2 \%$ top-1在Imagenet上的准确性,超过1.2 $ - $ 1.4 $ box ap在Coco基准测试的对象检测中,达到2.3 \%$ - $ 3.9 \%$ mce在ImageNet-C上的鲁棒性实验,在远程竞技场上长浪列表中的0.5 \%$ 0.8 \%$ 0.8 \%。}代码将在\ url {https://github.com/wqshao126/dtn}公开。
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 谷歌翻译
视觉多层感知器(MLP)在计算机视觉任务中表现出了有希望的表现,并成为CNNS和Vision Transformers的主要竞争对手。他们使用令牌混合层来捕获交叉互动,而不是变形金刚使用的多头自我发项机制。然而,严重的参数化令牌混合层自然缺乏捕获局部信息和多粒性非本地关系的机制,因此它们的判别能力受到限制。为了解决这个问题,我们提出了一个新的位置空间门控单元(POSGU)。它利用经典相对位置编码(RPE)中使用的注意力公式,以有效地编码令牌混合的交叉关系。它可以成功地将视觉MLP的当前二次参数复杂度$ O(n^2)$ $ O(n^2)$ o(n)$(n)$和$ o(1)$。我们实验了两种RPE机制,并进一步提出了一个小组扩展,以实现多种环境的成就,以提高其表现力。然后,它们是一种新型视觉MLP的关键构建块,称为POSMLP。我们通过进行彻底的实验来评估所提出的方法的有效性,证明参数复杂性的提高或可比性能得到了改善或可比性。例如,对于在ImagEnet1k上训练的模型,我们实现了从72.14 \%\%\%\%的绩效提高,并且可学习的参数从$ 194M $ $ $ $ $ $ $ $ 1.182亿美元。代码可以在\ href {https://github.com/zhicaiwww/posmlp} {https://github.com/zhicaiwww/posmlp}中找到代码。
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 谷歌翻译
Recent studies show that Vision Transformers(ViTs) exhibit strong robustness against various corruptions. Although this property is partly attributed to the self-attention mechanism, there is still a lack of systematic understanding. In this paper, we examine the role of self-attention in learning robust representations. Our study is motivated by the intriguing properties of the emerging visual grouping in Vision Transformers, which indicates that self-attention may promote robustness through improved mid-level representations. We further propose a family of fully attentional networks (FANs) that strengthen this capability by incorporating an attentional channel processing design. We validate the design comprehensively on various hierarchical backbones. Our model achieves a state-of-the-art 87.1% accuracy and 35.8% mCE on ImageNet-1k and ImageNet-C with 76.8M parameters. We also demonstrate state-of-the-art accuracy and robustness in two downstream tasks: semantic segmentation and object detection. Code is available at: https://github.com/NVlabs/FAN.
translated by 谷歌翻译
我们提出了全球环境视觉变压器(GC VIT),这是一种新的结构,可增强参数和计算利用率。我们的方法利用了与本地自我注意的联合的全球自我发项模块,以有效但有效地建模长和短距离的空间相互作用,而无需昂贵的操作,例如计算注意力面罩或移动本地窗户。此外,我们通过建议在我们的体系结构中使用修改后的融合倒置残差块来解决VIT中缺乏归纳偏差的问题。我们提出的GC VIT在图像分类,对象检测和语义分割任务中实现了最新的结果。在用于分类的ImagEnet-1k数据集上,基本,小而微小的GC VIT,$ 28 $ M,$ 51 $ M和$ 90 $ M参数实现$ \ textbf {83.2 \%} $,$ \ textbf {83.9 \%} $和$ \ textbf {84.4 \%} $ top-1的精度,超过了相当大的先前艺术,例如基于CNN的Convnext和基于VIT的Swin Transformer,其优势大大。在对象检测,实例分割和使用MS Coco和ADE20K数据集的下游任务中,预训练的GC VIT主机在对象检测,实例分割和语义分割的任务中始终如一地超过事务,有时是通过大余量。可在https://github.com/nvlabs/gcvit上获得代码。
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 谷歌翻译
尽管变形金刚已成功地从其语言建模起源过渡到基于图像的应用程序,但它们的二次计算复杂性仍然是一个挑战,尤其是对于密集的预测。在本文中,我们提出了一种基于内容的稀疏注意方法,以替代密集的自我注意力,旨在降低计算复杂性,同时保留对远程依赖性建模的能力。具体而言,我们聚集,然后汇总键和值代币,作为减少总代币计数的基于内容的方法。由此产生的聚类序列保留了原始信号的语义多样性,但可以以较低的计算成本进行处理。此外,我们进一步将聚类引导的注意力从单尺度扩展到多尺度,这有利于密集的预测任务。我们标记了提出的变压器体系结构固定,并证明它在各种视觉任务上实现了最新的性能,但计算成本较低,参数较少。例如,我们具有2270万参数的cluster小型模型可在Imagenet上实现83.2 \%TOP-1的精度。源代码和Imagenet模型将公开可用。
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 谷歌翻译
最近,Vision Transformer通过推动各种视觉任务的最新技术取得了巨大的成功。视觉变压器中最具挑战性的问题之一是,图像令牌的较大序列长度会导致高计算成本(二次复杂性)。解决此问题的一个流行解决方案是使用单个合并操作来减少序列长度。本文考虑如何改善现有的视觉变压器,在这种变压器中,单个合并操作提取的合并功能似乎不太强大。为此,我们注意到,由于其在上下文抽象中的强大能力,金字塔池在各种视觉任务中已被证明是有效的。但是,在骨干网络设计中尚未探索金字塔池。为了弥合这一差距,我们建议在视觉变压器中将金字塔池汇总到多头自我注意力(MHSA)中,同时降低了序列长度并捕获强大的上下文特征。我们插入了基于池的MHSA,我们构建了一个通用视觉变压器主链,称为金字塔池变压器(P2T)。广泛的实验表明,与先前的基于CNN-和基于变压器的网络相比,当将P2T用作骨干网络时,它在各种视觉任务中显示出很大的优势。该代码将在https://github.com/yuhuan-wu/p2t上发布。
translated by 谷歌翻译
尽管图像变形金刚与计算机视觉任务中的卷积神经网络显示出竞争性结果,但缺乏诸如区域的电感偏见仍然在模型效率方面构成问题,尤其是对于嵌入式应用程序而言。在这项工作中,我们通过引入注意力面具以将空间位置纳入自我发挥作用来解决这个问题。局部依赖性有效地捕获了掩盖的注意力头,以及由未掩盖的注意力头部捕获的全球依赖性。随着蒙版注意力图像变压器 - MAIT,与CAIT相比,TOP -1的准确性提高了1.7%,与SWIN相比,吞吐量更少,吞吐量提高了1.5倍。使用注意力面罩编码局部性是模型的不可知论,因此它适用于整体,分层或其他新型变压器体系结构。
translated by 谷歌翻译
While the Transformer architecture has become the de-facto standard for natural language processing tasks, its applications to computer vision remain limited. In vision, attention is either applied in conjunction with convolutional networks, or used to replace certain components of convolutional networks while keeping their overall structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.), Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train. 1
translated by 谷歌翻译
vision变压器(VIT)最近在图像分类上实现了对卷积神经网络(CNNS)的可比结果的强大能力。然而,Vanilla Vit只是直接从自然语言处理继承相同的架构,这通常不会针对视觉应用进行优化。在这篇文章的推动中,我们提出了一种采用金字塔结构的新架构,并在视觉变压器中采用新的区域到局部关注,而不是全球自我关注。更具体地,我们的模型首先从具有不同补丁大小的图像生成区域令牌和本地标记,其中每个区域令牌与基于空间位置的一组本地代币相关联。区域到当地的注意力包括两个步骤:第一,区域自我关注提取所有区域代币之间的全球信息,然后通过自我关注将局部自我关注与相关的本地代币之间的信息交换。因此,尽管局部自我关注限制了当地区域的范围,但它仍然可以接收全球信息。在四个视觉任务中进行广泛的实验,包括图像分类,对象和关键点检测,语义分割和动作识别,表明我们的方法优于或与最先进的Vit变体(包括许多并发作品)的差异。我们的源代码和模型可在https://github.com/ibm/regionvit上使用。
translated by 谷歌翻译
变压器已成为深度学习中的主导架构之一,特别是计算机视觉中的卷积神经网络(CNNS)的强大替代品。然而,由于长期表示的自我关注的二次复杂性,以前作品中的变压器培训和推理可能是非常昂贵的,特别是对于高分辨率密集预测任务。为此,我们提出了一种更少的关注视觉变压器(点亮),建立在变形金刚的早期自我注意层仍然专注于当地模式并在最近的等级视觉变压器中带来轻微的益处。具体而言,我们提出了一种分层变压器,在那里我们使用纯多层的感知(MLP)来在早期阶段编码丰富的本地模式,同时应用自我注意模块来捕获更深层中的较长依赖性。此外,我们进一步提出了一种学习的可变形的令牌合并模块,以以非均匀方式自适应地熔化信息贴片。建议的点亮在图像识别任务中实现了有希望的性能,包括图像分类,对象检测和实例分段,作为许多愿景任务的强骨干。代码可用:https://github.com/zhuang-group/lit
translated by 谷歌翻译
视觉变压器(VIT)最近在一系列计算机视觉任务中占据了主导地位,但训练数据效率低下,局部语义表示能力较低,而没有适当的电感偏差。卷积神经网络(CNNS)固有地捕获了区域感知语义,激发了研究人员将CNN引入VIT的架构中,以为VIT提供理想的诱导偏见。但是,嵌入在VIT中的微型CNN实现的位置是否足够好?在本文中,我们通过深入探讨混合CNNS/VIT的宏观结构如何增强层次VIT的性能。特别是,我们研究了令牌嵌入层,别名卷积嵌入(CE)的作用,并系统地揭示了CE如何在VIT中注入理想的感应偏置。此外,我们将最佳CE配置应用于最近发布的4个最先进的Vits,从而有效地增强了相应的性能。最后,释放了一个有效的混合CNN/VIT家族,称为CETNET,可以用作通用的视觉骨架。具体而言,CETNET在Imagenet-1K上获得了84.9%的TOP-1准确性(从头开始训练),可可基准上的48.6%的盒子地图和ADE20K上的51.6%MIOU,从而显着提高了相应的最新态度的性能。艺术基线。
translated by 谷歌翻译
The architecture of transformers, which recently witness booming applications in vision tasks, has pivoted against the widespread convolutional paradigm. Relying on the tokenization process that splits inputs into multiple tokens, transformers are capable of extracting their pairwise relationships using self-attention. While being the stemming building block of transformers, what makes for a good tokenizer has not been well understood in computer vision. In this work, we investigate this uncharted problem from an information trade-off perspective. In addition to unifying and understanding existing structural modifications, our derivation leads to better design strategies for vision tokenizers. The proposed Modulation across Tokens (MoTo) incorporates inter-token modeling capability through normalization. Furthermore, a regularization objective TokenProp is embraced in the standard training regime. Through extensive experiments on various transformer architectures, we observe both improved performance and intriguing properties of these two plug-and-play designs with negligible computational overhead. These observations further indicate the importance of the commonly-omitted designs of tokenizers in vision transformer.
translated by 谷歌翻译
变压器最近在各种视觉任务上表现出卓越的性能。大型有时甚至全球,接收领域赋予变换器模型,并通过其CNN对应物具有更高的表示功率。然而,简单地扩大接收领域也产生了几个问题。一方面,使用致密的注意,例如,在VIT中,导致过度的记忆和计算成本,并且特征可以受到超出兴趣区域的无关紧要的影响。另一方面,PVT或SWIN变压器采用的稀疏注意是数据不可知论,可能会限制模拟长距离关系的能力。为了缓解这些问题,我们提出了一种新型可变形的自我关注模块,其中以数据相关的方式选择密钥和值对中的密钥和值对的位置。这种灵活的方案使自我关注模块能够专注于相关区域并捕获更多的信息性功能。在此基础上,我们呈现可变形的关注变压器,一般骨干模型,具有可变形关注的图像分类和密集预测任务。广泛的实验表明,我们的模型在综合基准上实现了一致的改善结果。代码可在https://github.com/leaplabthu/dat上获得。
translated by 谷歌翻译
变压器架构现在是序列建模任务的核心。注意机制是核心,它可以在序列中对长期依赖性进行有效的建模。最近,变压器已成功地应用于计算机视觉域,在该域中首先将2D图像分割成斑块,然后将其视为1D序列。然而,这种线性化会损害图像中空间位置的概念,该图像具有重要的视觉线索。为了弥合差距,我们提出了连锁反应,这是视觉变压器的次级注意机制。基于最近基于内核的有效注意机制,我们设计了一种新型的动态编程算法,该算法将不同令牌的贡献加重了与它们在线性观察到的2D空间中相对空间距离的查询的贡献。广泛的实验和分析证明了连锁反应对各种视觉任务的有效性。
translated by 谷歌翻译
香草自我注意的机制固有地依赖于预定和坚定的计算维度。这种僵化的性限制了它具有面向上下文的概括,可以带来更多的上下文提示和全球表示。为了减轻此问题,我们提出了一种可扩展的自我注意(SSA)机制,该机制利用两个缩放因素来释放查询,键和价值矩阵的维度,同时使它们不符合输入。这种可伸缩性可获得面向上下文的概括并增强对象灵敏度,从而将整个网络推向准确性和成本之间的更有效的权衡状态。此外,我们提出了一个基于窗口的自我注意事项(IWSA),该自我注意力(IWSA)通过重新合并独立的值代币并从相邻窗口中汇总空间信息来建立非重叠区域之间的相互作用。通过交替堆叠SSA和IWSA,可扩展的视觉变压器(可伸缩率)在通用视觉任务中实现最先进的性能。例如,在Imagenet-1K分类中,可伸缩率S的表现优于双胞胎-SVT-S,而Swin-T则比1.4%。
translated by 谷歌翻译
Vision transformers (ViTs) encoding an image as a sequence of patches bring new paradigms for semantic segmentation.We present an efficient framework of representation separation in local-patch level and global-region level for semantic segmentation with ViTs. It is targeted for the peculiar over-smoothness of ViTs in semantic segmentation, and therefore differs from current popular paradigms of context modeling and most existing related methods reinforcing the advantage of attention. We first deliver the decoupled two-pathway network in which another pathway enhances and passes down local-patch discrepancy complementary to global representations of transformers. We then propose the spatially adaptive separation module to obtain more separate deep representations and the discriminative cross-attention which yields more discriminative region representations through novel auxiliary supervisions. The proposed methods achieve some impressive results: 1) incorporated with large-scale plain ViTs, our methods achieve new state-of-the-art performances on five widely used benchmarks; 2) using masked pre-trained plain ViTs, we achieve 68.9% mIoU on Pascal Context, setting a new record; 3) pyramid ViTs integrated with the decoupled two-pathway network even surpass the well-designed high-resolution ViTs on Cityscapes; 4) the improved representations by our framework have favorable transferability in images with natural corruptions. The codes will be released publicly.
translated by 谷歌翻译