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 谷歌翻译
由于复杂的注意机制和模型设计,大多数现有的视觉变压器(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 谷歌翻译
本文介绍了一个简单的MLP架构,CycleMLP,这是一种多功能骨干,用于视觉识别和密集的预测。与现代MLP架构相比,例如MLP混合器,RESMLP和GMLP,其架构与图像尺寸相关,因此在物体检测和分割中不可行,与现代方法相比具有两个优点。 (1)它可以应对各种图像尺寸。 (2)通过使用本地窗口,它可以实现对图像大小的线性计算复杂性。相比之下,由于完全空间连接,以前的MLP具有$ O(n ^ 2)$计算。我们构建一系列模型,超越现有的MLP,甚至最先进的基于变压器的模型,例如,使用较少的参数和拖鞋。我们扩展了类似MLP的模型的适用性,使它们成为密集预测任务的多功能骨干。 CycleMLP在对象检测,实例分割和语义细分上实现了竞争结果。特别是,Cyclemlp-tiny优于3.3%Miou在Ade20K数据集中的速度较少,具有较少的拖鞋。此外,CycleMLP还在Imagenet-C数据集上显示出优异的零射鲁布利。代码可以在https://github.com/shoufachen/cyclemlp获得。
translated by 谷歌翻译
尽管变形金刚已成功地从其语言建模起源过渡到基于图像的应用程序,但它们的二次计算复杂性仍然是一个挑战,尤其是对于密集的预测。在本文中,我们提出了一种基于内容的稀疏注意方法,以替代密集的自我注意力,旨在降低计算复杂性,同时保留对远程依赖性建模的能力。具体而言,我们聚集,然后汇总键和值代币,作为减少总代币计数的基于内容的方法。由此产生的聚类序列保留了原始信号的语义多样性,但可以以较低的计算成本进行处理。此外,我们进一步将聚类引导的注意力从单尺度扩展到多尺度,这有利于密集的预测任务。我们标记了提出的变压器体系结构固定,并证明它在各种视觉任务上实现了最新的性能,但计算成本较低,参数较少。例如,我们具有2270万参数的cluster小型模型可在Imagenet上实现83.2 \%TOP-1的精度。源代码和Imagenet模型将公开可用。
translated by 谷歌翻译
We present the Group Propagation Vision Transformer (GPViT): a novel nonhierarchical (i.e. non-pyramidal) transformer model designed for general visual recognition with high-resolution features. High-resolution features (or tokens) are a natural fit for tasks that involve perceiving fine-grained details such as detection and segmentation, but exchanging global information between these features is expensive in memory and computation because of the way self-attention scales. We provide a highly efficient alternative Group Propagation Block (GP Block) to exchange global information. In each GP Block, features are first grouped together by a fixed number of learnable group tokens; we then perform Group Propagation where global information is exchanged between the grouped features; finally, global information in the updated grouped features is returned back to the image features through a transformer decoder. We evaluate GPViT on a variety of visual recognition tasks including image classification, semantic segmentation, object detection, and instance segmentation. Our method achieves significant performance gains over previous works across all tasks, especially on tasks that require high-resolution outputs, for example, our GPViT-L3 outperforms Swin Transformer-B by 2.0 mIoU on ADE20K semantic segmentation with only half as many parameters. Code and pre-trained models are available at https://github.com/ChenhongyiYang/GPViT .
translated by 谷歌翻译
视觉变压器的最新进展在基于点产生自我注意的新空间建模机制驱动的各种任务中取得了巨大成功。在本文中,我们表明,视觉变压器背后的关键要素,即输入自适应,远程和高阶空间相互作用,也可以通过基于卷积的框架有效地实现。我们介绍了递归封闭式卷积($ \ textit {g}^\ textit {n} $ conv),该卷积{n} $ conv)与封闭的卷积和递归设计执行高阶空间交互。新操作是高度灵活和可定制的,它与卷积的各种变体兼容,并将自我注意的两阶相互作用扩展到任意订单,而无需引入大量额外的计算。 $ \ textit {g}^\ textit {n} $ conv可以用作插件模块,以改善各种视觉变压器和基于卷积的模型。根据该操作,我们构建了一个名为Hornet的新型通用视觉骨干家族。关于ImageNet分类,可可对象检测和ADE20K语义分割的广泛实验表明,大黄蜂的表现优于Swin变形金刚,并具有相似的整体体系结构和训练配置的明显边距。大黄蜂还显示出对更多训练数据和更大模型大小的有利可伸缩性。除了在视觉编码器中的有效性外,我们还可以将$ \ textit {g}^\ textit {n} $ conv应用于特定于任务的解码器,并始终通过较少的计算来提高密集的预测性能。我们的结果表明,$ \ textIt {g}^\ textit {n} $ conv可以成为视觉建模的新基本模块,可有效结合视觉变形金刚和CNN的优点。代码可从https://github.com/raoyongming/hornet获得
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 谷歌翻译
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 谷歌翻译
Data mixing strategies (e.g., CutMix) have shown the ability to greatly improve the performance of convolutional neural networks (CNNs). They mix two images as inputs for training and assign them with a mixed label with the same ratio. While they are shown effective for vision transformers (ViTs), we identify a token fluctuation phenomenon that has suppressed the potential of data mixing strategies. We empirically observe that the contributions of input tokens fluctuate as forward propagating, which might induce a different mixing ratio in the output tokens. The training target computed by the original data mixing strategy can thus be inaccurate, resulting in less effective training. To address this, we propose a token-label alignment (TL-Align) method to trace the correspondence between transformed tokens and the original tokens to maintain a label for each token. We reuse the computed attention at each layer for efficient token-label alignment, introducing only negligible additional training costs. Extensive experiments demonstrate that our method improves the performance of ViTs on image classification, semantic segmentation, objective detection, and transfer learning tasks. Code is available at: https://github.com/Euphoria16/TL-Align.
translated by 谷歌翻译
视觉变压器(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 谷歌翻译
视觉识别的“咆哮20S”开始引入视觉变压器(VITS),这将被取代的Cummnets作为最先进的图像分类模型。另一方面,vanilla vit,当应用于一般计算机视觉任务等对象检测和语义分割时面临困难。它是重新引入多个ConvNet Priors的等级变压器(例如,Swin变压器),使变压器实际上可作为通用视觉骨干网,并在各种视觉任务上展示了显着性能。然而,这种混合方法的有效性仍然在很大程度上归功于变压器的内在优越性,而不是卷积的固有感应偏差。在这项工作中,我们重新审视设计空间并测试纯粹的Convnet可以实现的限制。我们逐渐“现代化”标准Reset朝着视觉变压器的设计设计,并发现几个有助于沿途绩效差异的关键组件。此探索的结果是一个纯粹的ConvNet型号被称为ConvNext。完全由标准的Convnet模块构建,ConvNexts在准确性和可扩展性方面与变压器竞争,实现了87.8%的ImageNet Top-1精度和表现优于COCO检测和ADE20K分割的Swin变压器,同时保持了标准Convnet的简单性和效率。
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 谷歌翻译
视觉变压器由于能够捕获图像中的长期依赖性的能力而成功地应用于图像识别任务。但是,变压器与现有卷积神经网络(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),也在视觉域中探索。除传统CNN以外,这些架构最近引起了人们的关注,并提出了许多方法。作为将参数效率和性能与图像识别中的局部性和层次结合在一起的一种,我们提出了将两个流合并的GSWIN。Swin Transformer和(多头)GMLP。我们表明,与具有较小模型大小的SWIN Transformer相比,GSWIN可以在三个视觉任务,图像分类,对象检测和语义分割方面实现更好的准确性。
translated by 谷歌翻译
视觉变压器(VIT)的最新进展在视觉识别任务中取得了出色的表现。卷积神经网络(CNNS)利用空间电感偏见来学习视觉表示,但是这些网络在空间上是局部的。 VIT可以通过其自我注意力机制学习全球表示形式,但它们通常是重量重量,不适合移动设备。在本文中,我们提出了交叉功能关注(XFA),以降低变压器的计算成本,并结合有效的移动CNN,形成一种新型有效的轻质CNN-CNN-VIT混合模型Xformer,可以用作通用的骨干链。学习全球和本地代表。实验结果表明,Xformer在不同的任务和数据集上的表现优于大量CNN和基于VIT的模型。在ImagEnet1k数据集上,XFormer以550万参数的优先级达到78.5%的TOP-1精度,比EdgitionNet-B0(基于CNN)(基于CNN)和DEIT(基于VIT)(基于VIT)的参数高2.2%和6.3%。当转移到对象检测和语义分割任务时,我们的模型也表现良好。在MS Coco数据集上,Xformer在Yolov3框架中仅超过10.5 AP(22.7-> 33.2 AP),只有630万参数和3.8克Flops。在CityScapes数据集上,只有一个简单的全MLP解码器,Xformer可实现78.5的MIOU,而FPS为15.3,超过了最先进的轻量级分割网络。
translated by 谷歌翻译
最近,类似于MLP的视觉模型已在主流视觉识别任务上实现了有希望的表演。与视觉变压器和CNN相反,类似MLP的模型的成功表明,令牌和渠道之间的简单信息融合操作可以为深度识别模型带来良好的表示能力。但是,现有的类似于MLP的模型通过静态融合操作融合代币,缺乏对代币内容的适应性。因此,习惯信息融合程序不够有效。为此,本文介绍了一种有效的MLP式网络体系结构,称为Dynamixer,诉诸动态信息融合。至关重要的是,我们提出了一个程序,该过程依赖于该过程,以通过利用混合所有令牌的内容来动态生成混合矩阵。为了减少时间复杂性并提高鲁棒性,采用了降低性降低技术和多段融合机制。我们提出的Dynamixer模型(9700万参数)在没有额外的训练数据的情况下,在Imagenet-1k数据集上实现了84.3 \%TOP-1的精度,对最先进的视觉MLP模型表现出色。当参数数量减少到26m时,它仍然可以达到82.7 \%TOP-1的精度,超过了具有相似容量的现有MLP样模型。该代码可在\ url {https://github.com/ziyuwwang/dynamixer}中获得。
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 谷歌翻译
变压器提供了一种设计神经网络以进行视觉识别的新方法。与卷积网络相比,变压器享有在每个阶段引用全局特征的能力,但注意模块带来了更高的计算开销,阻碍了变压器的应用来处理高分辨率的视觉数据。本文旨在减轻效率和灵活性之间的冲突,为此,我们为每个地区提出了专门的令牌,作为使者(MSG)。因此,通过操纵这些MSG令牌,可以在跨区域灵活地交换视觉信息,并且减少计算复杂性。然后,我们将MSG令牌集成到一个名为MSG-Transformer的多尺度体系结构中。在标准图像分类和对象检测中,MSG变压器实现了竞争性能,加速了GPU和CPU的推断。代码可在https://github.com/hustvl/msg-transformer中找到。
translated by 谷歌翻译
变压器最近在各种视觉任务上表现出卓越的性能。大型有时甚至全球,接收领域赋予变换器模型,并通过其CNN对应物具有更高的表示功率。然而,简单地扩大接收领域也产生了几个问题。一方面,使用致密的注意,例如,在VIT中,导致过度的记忆和计算成本,并且特征可以受到超出兴趣区域的无关紧要的影响。另一方面,PVT或SWIN变压器采用的稀疏注意是数据不可知论,可能会限制模拟长距离关系的能力。为了缓解这些问题,我们提出了一种新型可变形的自我关注模块,其中以数据相关的方式选择密钥和值对中的密钥和值对的位置。这种灵活的方案使自我关注模块能够专注于相关区域并捕获更多的信息性功能。在此基础上,我们呈现可变形的关注变压器,一般骨干模型,具有可变形关注的图像分类和密集预测任务。广泛的实验表明,我们的模型在综合基准上实现了一致的改善结果。代码可在https://github.com/leaplabthu/dat上获得。
translated by 谷歌翻译
We propose a new neural network design paradigm Reversible Column Network (RevCol). The main body of RevCol is composed of multiple copies of subnetworks, named columns respectively, between which multi-level reversible connections are employed. Such architectural scheme attributes RevCol very different behavior from conventional networks: during forward propagation, features in RevCol are learned to be gradually disentangled when passing through each column, whose total information is maintained rather than compressed or discarded as other network does. Our experiments suggest that CNN-style RevCol models can achieve very competitive performances on multiple computer vision tasks such as image classification, object detection and semantic segmentation, especially with large parameter budget and large dataset. For example, after ImageNet-22K pre-training, RevCol-XL obtains 88.2% ImageNet-1K accuracy. Given more pre-training data, our largest model RevCol-H reaches 90.0% on ImageNet-1K, 63.8% APbox on COCO detection minival set, 61.0% mIoU on ADE20k segmentation. To our knowledge, it is the best COCO detection and ADE20k segmentation result among pure (static) CNN models. Moreover, as a general macro architecture fashion, RevCol can also be introduced into transformers or other neural networks, which is demonstrated to improve the performances in both computer vision and NLP tasks. We release code and models at https://github.com/megvii-research/RevCol
translated by 谷歌翻译