现有的二进制神经网络(BNN)主要在具有二进制功能的局部卷积上运作。但是,这种简单的位操作缺乏建模上下文依赖性的能力,这对于学习视觉模型中的歧视性深度表示至关重要。在这项工作中,我们通过介绍二进制神经模块的新设计来解决这个问题,这使BNN能够学习有效的上下文依赖性。首先,我们建议二进制多层感知器(MLP)块作为二进制卷积块的替代方案,以直接建模上下文依赖性。短距离和远程特征依赖性均由二进制MLP建模,其中前者提供局部电感偏置,后者在二元卷积中有限的接受场有限。其次,为了提高具有上下文依赖性的二进制模型的鲁棒性,我们计算上下文动态嵌入,以确定一般二进制卷积块中的二进化阈值。用我们的二进制MLP块和改进的二进制卷积,我们用明确的上下文依赖性建模构建了BNN,称为BCDNET。在标准Imagenet-1K分类基准上,BCDNET可实现72.3%的TOP-1准确性,并且优于领先的二进制方法的差距很大。尤其是,提出的BCDNET超过了最新的ReactNet-A,具有相似操作的2.9%TOP-1准确性。我们的代码可从https://github.com/sense-gvt/bcdn获得
translated by 谷歌翻译
This paper studies the problem of designing compact binary architectures for vision multi-layer perceptrons (MLPs). We provide extensive analysis on the difficulty of binarizing vision MLPs and find that previous binarization methods perform poorly due to limited capacity of binary MLPs. In contrast with the traditional CNNs that utilizing convolutional operations with large kernel size, fully-connected (FC) layers in MLPs can be treated as convolutional layers with kernel size $1\times1$. Thus, the representation ability of the FC layers will be limited when being binarized, and places restrictions on the capability of spatial mixing and channel mixing on the intermediate features. To this end, we propose to improve the performance of binary MLP (BiMLP) model by enriching the representation ability of binary FC layers. We design a novel binary block that contains multiple branches to merge a series of outputs from the same stage, and also a universal shortcut connection that encourages the information flow from the previous stage. The downsampling layers are also carefully designed to reduce the computational complexity while maintaining the classification performance. Experimental results on benchmark dataset ImageNet-1k demonstrate the effectiveness of the proposed BiMLP models, which achieve state-of-the-art accuracy compared to prior binary CNNs. The MindSpore code is available at \url{https://gitee.com/mindspore/models/tree/master/research/cv/BiMLP}.
translated by 谷歌翻译
多层erceptron(MLP),作为出现的第一个神经网络结构,是一个大的击中。但是由硬件计算能力和数据集的大小限制,它一旦沉没了数十年。在此期间,我们目睹了从手动特征提取到带有局部接收领域的CNN的范式转变,以及基于自我关注机制的全球接收领域的变换。今年(2021年),随着MLP混合器的推出,MLP已重新进入敏捷,并吸引了计算机视觉界的广泛研究。与传统的MLP进行比较,它变得更深,但改变了完全扁平化以补丁平整的输入。鉴于其高性能和较少的需求对视觉特定的感应偏见,但社区无法帮助奇迹,将MLP,最简单的结构与全球接受领域,但没有关注,成为一个新的电脑视觉范式吗?为了回答这个问题,本调查旨在全面概述视觉深层MLP模型的最新发展。具体而言,我们从微妙的子模块设计到全局网络结构,我们审查了这些视觉深度MLP。我们比较了不同网络设计的接收领域,计算复杂性和其他特性,以便清楚地了解MLP的开发路径。调查表明,MLPS的分辨率灵敏度和计算密度仍未得到解决,纯MLP逐渐发展朝向CNN样。我们建议,目前的数据量和计算能力尚未准备好接受纯的MLP,并且人工视觉指导仍然很重要。最后,我们提供了开放的研究方向和可能的未来作品的分析。我们希望这项努力能够点燃社区的进一步兴趣,并鼓励目前为神经网络进行更好的视觉量身定制设计。
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 谷歌翻译
Convolutional Neural Networks (CNNs) are the go-to model for computer vision. Recently, attention-based networks, such as the Vision Transformer, have also become popular. In this paper we show that while convolutions and attention are both sufficient for good performance, neither of them are necessary. We present MLP-Mixer, an architecture based exclusively on multi-layer perceptrons (MLPs). MLP-Mixer contains two types of layers: one with MLPs applied independently to image patches (i.e. "mixing" the per-location features), and one with MLPs applied across patches (i.e. "mixing" spatial information). When trained on large datasets, or with modern regularization schemes, MLP-Mixer attains competitive scores on image classification benchmarks, with pre-training and inference cost comparable to state-of-the-art models. We hope that these results spark further research beyond the realms of well established CNNs and Transformers. 1
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 谷歌翻译
We present in this paper a new architecture, named Convolutional vision Transformer (CvT), that improves Vision Transformer (ViT) in performance and efficiency by introducing convolutions into ViT to yield the best of both designs. This is accomplished through two primary modifications: a hierarchy of Transformers containing a new convolutional token embedding, and a convolutional Transformer block leveraging a convolutional projection. These changes introduce desirable properties of convolutional neural networks (CNNs) to the ViT architecture (i.e. shift, scale, and distortion invariance) while maintaining the merits of Transformers (i.e. dynamic attention, global context, and better generalization). We validate CvT by conducting extensive experiments, showing that this approach achieves state-of-the-art performance over other Vision Transformers and ResNets on ImageNet-1k, with fewer parameters and lower FLOPs. In addition, performance gains are maintained when pretrained on larger datasets (e.g. ImageNet-22k) and fine-tuned to downstream tasks. Pretrained on ImageNet-22k, our CvT-W24 obtains a top-1 accuracy of 87.7% on the ImageNet-1k val set. Finally, our results show that the positional encoding, a crucial component in existing Vision Transformers, can be safely removed in our model, simplifying the design for higher resolution vision tasks. Code will be released at https: //github.com/leoxiaobin/CvT.
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 谷歌翻译
自我关注已成为最近网络架构的一个组成部分,例如,统治主要图像和视频基准的变压器。这是因为自我关注可以灵活地模拟远程信息。出于同样的原因,研究人员最近使尝试恢复多层Perceptron(MLP)并提出一些类似MLP的架构,显示出极大的潜力。然而,当前的MLP样架构不擅长捕获本地细节并缺乏对图像和/或视频中的核心细节的逐步了解。为了克服这个问题,我们提出了一种新颖的Morphmlp架构,该架构专注于在低级层处捕获本地细节,同时逐渐改变,以专注于高级层的长期建模。具体地,我们设计一个完全连接的层,称为Morphfc,两个可变过滤器,其沿着高度和宽度尺寸逐渐地发展其接收领域。更有趣的是,我们建议灵活地调整视频域中的Morphfc层。为了我们最好的知识,我们是第一个创建类似MLP骨干的用于学习视频表示的骨干。最后,我们对图像分类,语义分割和视频分类进行了广泛的实验。我们的Morphmlp,如此自我关注的自由骨干,可以与基于自我关注的型号一样强大。
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 谷歌翻译
虽然变形金机对视频识别任务的巨大潜力具有较强的捕获远程依赖性的强大能力,但它们经常遭受通过对视频中大量3D令牌的自我关注操作引起的高计算成本。在本文中,我们提出了一种新的变压器架构,称为双重格式,可以有效且有效地对视频识别进行时空关注。具体而言,我们的Dualformer将完全时空注意力分层到双级级联级别,即首先在附近的3D令牌之间学习细粒度的本地时空交互,然后捕获查询令牌之间的粗粒度全局依赖关系。粗粒度全球金字塔背景。不同于在本地窗口内应用时空分解或限制关注计算以提高效率的现有方法,我们本地 - 全球分层策略可以很好地捕获短期和远程时空依赖项,同时大大减少了钥匙和值的数量在注意计算提高效率。实验结果表明,对抗现有方法的五个视频基准的经济优势。特别是,Dualformer在动态-400/600上设置了新的最先进的82.9%/ 85.2%,大约1000g推理拖鞋,比具有相似性能的现有方法至少3.2倍。
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)是用于计算机视觉的主要的深神经网络(DNN)架构。最近,变压器和多层的Perceptron(MLP)的基础型号,如视觉变压器和MLP-MILER,开始引领新的趋势,因为它们在想象成分类任务中显示出了有希望的结果。在本文中,我们对这些DNN结构进行了实证研究,并试图了解他们各自的利弊。为了确保公平的比较,我们首先开发一个名为SPACH的统一框架,可以采用单独的空间和通道处理模块。我们在SPACH框架下的实验表明,所有结构都可以以适度的规模实现竞争性能。但是,当网络大小缩放时,它们展示了独特的行为。根据我们的调查结果,我们建议使用卷积和变压器模块的混合模型。由此产生的Hybrid-MS-S +模型实现了83.9%的前1个精度,63米参数和12.3g拖薄。它已与具有复杂设计的SOTA模型相提并论。代码和模型在https://github.com/microsoft/spach上公开使用。
translated by 谷歌翻译
与卷积层相比,完全连接的(FC)层更好地在捕获本地模式时更好地建模,但是更糟糕的是,因此通常不对图像识别的青睐。在本文中,我们提出了一种方法,局部注射,通过将培训的并行参数合并到FC内核中的训练参数并将训练的参数合并到FC层中。可以将位置喷射为新颖的结构重新参数化方法,因为它等效地通过转换参数来转换结构。基于此,我们提出了一个名为RepMLP块的多层 - Perceptron(MLP)块,它使用三个FC层提取特征,以及名为Repmlpnet的新颖体系结构。分层设计将RepMLPNET与其他同时提出的视觉MLPS区分开来。由于它生成不同级别的特征映射,它有资格作为下游任务的骨干模型,如语义分割。我们的结果表明,1)地区注射是MLP型号的一般方法; 2)与其他MLP相比,REPMLPNET具有良好的准确性效率折衷; 3)REPMLPNET是第一MLP,可无缝转移到CityCAPES语义分割。代码和模型可在https://github.com/dingxiaoh/repmlp上使用。
translated by 谷歌翻译
The three existing dominant network families, i.e., CNNs, Transformers, and MLPs, differ from each other mainly in the ways of fusing spatial contextual information, leaving designing more effective token-mixing mechanisms at the core of backbone architecture development. In this work, we propose an innovative token-mixer, dubbed Active Token Mixer (ATM), to actively incorporate flexible contextual information distributed across different channels from other tokens into the given query token. This fundamental operator actively predicts where to capture useful contexts and learns how to fuse the captured contexts with the query token at channel level. In this way, the spatial range of token-mixing can be expanded to a global scope with limited computational complexity, where the way of token-mixing is reformed. We take ATM as the primary operator and assemble ATMs into a cascade architecture, dubbed ATMNet. Extensive experiments demonstrate that ATMNet is generally applicable and comprehensively surpasses different families of SOTA vision backbones by a clear margin on a broad range of vision tasks, including visual recognition and dense prediction tasks. Code is available at https://github.com/microsoft/ActiveMLP.
translated by 谷歌翻译
We design a family of image classification architectures that optimize the trade-off between accuracy and efficiency in a high-speed regime. Our work exploits recent findings in attention-based architectures, which are competitive on highly parallel processing hardware. We revisit principles from the extensive literature on convolutional neural networks to apply them to transformers, in particular activation maps with decreasing resolutions. We also introduce the attention bias, a new way to integrate positional information in vision transformers.As a result, we propose LeVIT: a hybrid neural network for fast inference image classification. We consider different measures of efficiency on different hardware platforms, so as to best reflect a wide range of application scenarios. Our extensive experiments empirically validate our technical choices and show they are suitable to most architectures. Overall, LeViT significantly outperforms existing convnets and vision transformers with respect to the speed/accuracy tradeoff. For example, at 80% ImageNet top-1 accuracy, LeViT is 5 times faster than EfficientNet on CPU. We release the code at https: //github.com/facebookresearch/LeViT.
translated by 谷歌翻译
卷积神经网络(CNN)被认为是视觉识别的首选模型。最近,基于多头自我注意力(MSA)或多层感知器(MLP)的无卷积网络变得越来越流行。然而,由于视频数据的差异和复杂性,利用这些新染色的网络进行视频识别并不是微不足道的。在本文中,我们提出了MLP-3D Networks,这是一种新颖的MLP型3D体系结构,用于视频识别。具体而言,该体系结构由MLP-3D块组成,其中每个块包含一个跨令牌施加的一个MLP(即令牌混合MLP),一个MLP独立地应用于每个令牌(即通道MLP)。通过得出新型的分组时间混合(GTM)操作,我们将基本令牌混合MLP配备了时间建模的能力。 GTM将输入令牌分为几个时间组,并用共享投影矩阵线性地映射每个组中的令牌。此外,我们通过不同的分组策略设计了几种GTM的变体,并通过贪婪的体系结构搜索在MLP-3D网络的不同块中组成每个变体。在不依赖卷积或注意机制的情况下,我们的MLP-3D网络分别获得68.5 \%/81.4 \%\%TOP-1的准确性,分别在某些V2和Kinetics-400数据集上。尽管计算较少,但结果与最新通用的3D CNN和视频变压器相当。源代码可从https://github.com/zhaofanqiu/mlp-3d获得。
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 谷歌翻译
变压器已成为深度学习中的主导架构之一,特别是计算机视觉中的卷积神经网络(CNNS)的强大替代品。然而,由于长期表示的自我关注的二次复杂性,以前作品中的变压器培训和推理可能是非常昂贵的,特别是对于高分辨率密集预测任务。为此,我们提出了一种更少的关注视觉变压器(点亮),建立在变形金刚的早期自我注意层仍然专注于当地模式并在最近的等级视觉变压器中带来轻微的益处。具体而言,我们提出了一种分层变压器,在那里我们使用纯多层的感知(MLP)来在早期阶段编码丰富的本地模式,同时应用自我注意模块来捕获更深层中的较长依赖性。此外,我们进一步提出了一种学习的可变形的令牌合并模块,以以非均匀方式自适应地熔化信息贴片。建议的点亮在图像识别任务中实现了有希望的性能,包括图像分类,对象检测和实例分段,作为许多愿景任务的强骨干。代码可用:https://github.com/zhuang-group/lit
translated by 谷歌翻译
量化被疯狂地作为模型压缩技术,该技术通过将神经网络中的浮点重量和激活转换为低位整数来获得有效的模型。量化已被证明可以很好地在卷积神经网络和基于变压器的模型上运行。尽管这些模型具有符合性的典型性,但最近的工作表明,基于MLP的模型能够在从计算机视觉,NLP到3D点云等各种任务上取得可比的结果,同时由于并行性和网络简单性,可以实现更高的吞吐量。但是,正如我们在论文中所显示的那样,将量化直接应用于基于MLP的模型将导致明显的准确性降解。基于我们的分析,两个主要问题说明了准确性差距:1)基于MLP的模型中的激活范围可能太大而无法量化,而2)基于MLP的模型中的特定组件对量化很敏感。因此,我们建议1)应用分层以控制激活的量化范围,2)使用有界的激活功能,3)在激活上应用百分位量化,4)使用我们的改进的模块,称为多个令牌混合MLP,5)应用线性态度敏感操作的不对称量化器。我们的Q-MLP模型配备了上述技术,可以使用8位均匀量化(型号30 MB)和78.47%的Imagenet获得79.68%的精度,而4位量化(15 MB)。
translated by 谷歌翻译