Existing fine-tuning methods either tune all parameters of the pre-trained model (full fine-tuning), which is not efficient, or only tune the last linear layer (linear probing), which suffers a significant accuracy drop compared to the full fine-tuning. In this paper, we propose a new parameter-efficient fine-tuning method termed as SSF, representing that researchers only need to Scale and Shift the deep Features extracted by a pre-trained model to catch up with the performance of full fine-tuning. In this way, SSF also surprisingly outperforms other parameter-efficient fine-tuning approaches even with a smaller number of tunable parameters. Furthermore, different from some existing parameter-efficient fine-tuning methods (e.g., Adapter or VPT) that introduce the extra parameters and computational cost in the training and inference stages, SSF only adds learnable parameters during the training stage, and these additional parameters can be merged into the original pre-trained model weights via re-parameterization in the inference phase. With the proposed SSF, our model obtains 2.46% (90.72% vs. 88.54%) and 11.48% (73.10% vs. 65.57%) performance improvement on FGVC and VTAB-1k in terms of Top-1 accuracy compared to the full fine-tuning but only fine-tuning about 0.3M parameters. We also conduct amounts of experiments in various model families (CNNs, Transformers, and MLPs) and datasets. Results on 26 image classification datasets in total and 3 robustness & out-of-distribution datasets show the effectiveness of SSF. Code is available at https://github.com/dongzelian/SSF.
translated by 谷歌翻译
当前的Modus Operandi在改编预训练的模型中涉及更新所有骨干参数,即,完整的微调。本文介绍了视觉及时调整(VPT),作为视觉中大规模变压器模型的全面微调的有效替代方案。VPT从最近有效地调整大型语言模型的最新进展中汲取灵感,在输入空间中仅引入了少量的可训练参数(少于模型参数),同时保持模型骨架冻结。通过对各种下游识别任务的广泛实验,我们表明VPT与其他参数有效调整协议相比获得了显着的性能增长。最重要的是,在许多情况下,VPT甚至在模型能力和培训数据量表的许多情况下都胜过全面的微调,同时降低了每任务的存储成本。
translated by 谷歌翻译
尽管参数有效调整(PET)方法在自然语言处理(NLP)任务上显示出巨大的潜力,但其有效性仍然对计算机视觉(CV)任务的大规模转向进行了研究。本文提出了Conv-Adapter,这是一种专为CONCNET设计的PET模块。 Conv-Adapter具有轻巧的,可转让的域和架构,不合时宜,并且在不同的任务上具有广义性能。当转移下游任务时,Conv-Adapter将特定于任务的特征调制到主链的中间表示,同时保持预先训练的参数冻结。通过仅引入少量可学习的参数,例如,仅3.5%的RESNET50的完整微调参数,Conv-Adapter优于先前的宠物基线方法,并实现可比性或超过23个分类任务的全面调查的性能。它还在几乎没有分类的情况下表现出卓越的性能,平均利润率为3.39%。除分类外,Conv-Adapter可以推广到检测和细分任务,其参数降低了50%以上,但性能与传统的完整微调相当。
translated by 谷歌翻译
Intermediate features of a pre-trained model have been shown informative for making accurate predictions on downstream tasks, even if the model backbone is kept frozen. The key challenge is how to utilize these intermediate features given their gigantic amount. We propose visual query tuning (VQT), a simple yet effective approach to aggregate intermediate features of Vision Transformers. Through introducing a handful of learnable ``query'' tokens to each layer, VQT leverages the inner workings of Transformers to ``summarize'' rich intermediate features of each layer, which can then be used to train the prediction heads of downstream tasks. As VQT keeps the intermediate features intact and only learns to combine them, it enjoys memory efficiency in training, compared to many other parameter-efficient fine-tuning approaches that learn to adapt features and need back-propagation through the entire backbone. This also suggests the complementary role between VQT and those approaches in transfer learning. Empirically, VQT consistently surpasses the state-of-the-art approach that utilizes intermediate features for transfer learning and outperforms full fine-tuning in many cases. Compared to parameter-efficient approaches that adapt features, VQT achieves much higher accuracy under memory constraints. Most importantly, VQT is compatible with these approaches to attain even higher accuracy, making it a simple add-on to further boost transfer learning.
translated by 谷歌翻译
Recent work has explored the potential to adapt a pre-trained vision transformer (ViT) by updating only a few parameters so as to improve storage efficiency, called parameter-efficient transfer learning (PETL). Current PETL methods have shown that by tuning only 0.5% of the parameters, ViT can be adapted to downstream tasks with even better performance than full fine-tuning. In this paper, we aim to further promote the efficiency of PETL to meet the extreme storage constraint in real-world applications. To this end, we propose a tensorization-decomposition framework to store the weight increments, in which the weights of each ViT are tensorized into a single 3D tensor, and their increments are then decomposed into lightweight factors. In the fine-tuning process, only the factors need to be updated and stored, termed Factor-Tuning (FacT). On VTAB-1K benchmark, our method performs on par with NOAH, the state-of-the-art PETL method, while being 5x more parameter-efficient. We also present a tiny version that only uses 8K (0.01% of ViT's parameters) trainable parameters but outperforms full fine-tuning and many other PETL methods such as VPT and BitFit. In few-shot settings, FacT also beats all PETL baselines using the fewest parameters, demonstrating its strong capability in the low-data regime.
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 谷歌翻译
视觉识别的“咆哮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 谷歌翻译
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 谷歌翻译
最近的进展表明,使用对比图像文本对的大规模预训练可以是从自然语言监督的高质量视觉表演学习的有前途的替代方案。从更广泛的监督来源受益,这种新的范例展示了对下游分类任务和数据集的令人印象深刻的可转移性。然而,从图像文本对中学习的知识转移到更复杂的密集预测任务的问题几乎没有访问过。在这项工作中,我们通过隐式和明确地利用来自剪辑的预先训练的知识来提出了一种新的密集预测框架。具体地,我们将剪辑中的原始图像文本匹配问题转换为像素文本匹配问题,并使用像素文本分数图来指导致密预测模型的学习。通过进一步使用图像中的上下文信息来提示语言模型,我们能够促进我们的模型来更好地利用预先接受训练的知识。我们的方法是模型 - 不可行的,它可以应用于任意密集的预测系统和各种预先训练的视觉底座,包括夹模型和想象成预先训练的模型。广泛的实验证明了我们对语义分割,对象检测和实例分段任务的方法的卓越性能。代码可在https://github.com/raoyongming/denseclip获得
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 谷歌翻译
Transformer is a new kind of neural architecture which encodes the input data as powerful features via the attention mechanism. Basically, the visual transformers first divide the input images into several local patches and then calculate both representations and their relationship. Since natural images are of high complexity with abundant detail and color information, the granularity of the patch dividing is not fine enough for excavating features of objects in different scales and locations. In this paper, we point out that the attention inside these local patches are also essential for building visual transformers with high performance and we explore a new architecture, namely, Transformer iN Transformer (TNT). Specifically, we regard the local patches (e.g., 16×16) as "visual sentences" and present to further divide them into smaller patches (e.g., 4×4) as "visual words". The attention of each word will be calculated with other words in the given visual sentence with negligible computational costs. Features of both words and sentences will be aggregated to enhance the representation ability. Experiments on several benchmarks demonstrate the effectiveness of the proposed TNT architecture, e.g., we achieve an 81.5% top-1 accuracy on the ImageNet, which is about 1.7% higher than that of the state-of-the-art visual transformer with similar computational cost.
translated by 谷歌翻译
变压器已成为深度学习中的主导架构之一,特别是计算机视觉中的卷积神经网络(CNNS)的强大替代品。然而,由于长期表示的自我关注的二次复杂性,以前作品中的变压器培训和推理可能是非常昂贵的,特别是对于高分辨率密集预测任务。为此,我们提出了一种更少的关注视觉变压器(点亮),建立在变形金刚的早期自我注意层仍然专注于当地模式并在最近的等级视觉变压器中带来轻微的益处。具体而言,我们提出了一种分层变压器,在那里我们使用纯多层的感知(MLP)来在早期阶段编码丰富的本地模式,同时应用自我注意模块来捕获更深层中的较长依赖性。此外,我们进一步提出了一种学习的可变形的令牌合并模块,以以非均匀方式自适应地熔化信息贴片。建议的点亮在图像识别任务中实现了有希望的性能,包括图像分类,对象检测和实例分段,作为许多愿景任务的强骨干。代码可用:https://github.com/zhuang-group/lit
translated by 谷歌翻译
在计算机视觉中广泛采用了预处理 - 最终的范式。但是,随着视觉变压器(VIT)的尺寸呈指数增长,鉴于较重的存储空间的头顶,完整的燃料变得过于望而却步。最近的研究是由参数效率转移学习(PETL)的动机,最近的研究试图插入轻巧的适应模块(例如,适配器层或及时令牌)以预处理VIT,并且仅释放这些模块,而预处理的权重则是冷冻的。但是,这些模块最初是为了芬太尼语言模型而提出的。尽管对VIT的口号很好,但他们的设计缺乏视觉任务的先验知识。在本文中,我们建议在VIT中构建卷积旁路(Convass)作为适应模块,仅引入了可训练参数的少量(少于模型参数的0.5%)以适应大型VIT。与其他PETL方法不同,卷积层的硬编码电感偏置的互惠受益,因此更适合视觉任务,尤其是在低数据表格中。 VTAB-1K基准和少量学习数据集的实验结果表明,Convass的表现优于当前面向语言的适应模块,这证明了对视觉模型量身定制面向视觉的适应模块的必要性。
translated by 谷歌翻译
最近出现了有希望的表现,利用大型预训练的模型来实现各种感兴趣的下游任务。由于模型的规模不断增长,因此,在模型培训和存储方面,基于标准的完整任务适应策略的成本高昂。这导致了参数有效传输学习的新研究方向。但是,现有的尝试通常集中在预训练模型的相同模式(例如图像理解)的下游任务上。这会产生限制,因为在某些特定的方式(例如,视频理解)中,具有足够知识的强大预训练模型较少或不可用。在这项工作中,我们研究了这样一种新型的跨模式转移学习设置,即参数有效的图像到视频传输学习。为了解决此问题,我们为每个视频任务提出了一个新的时空适配器(ST-ADAPTER),以进行参数有效调整。凭借紧凑设计中的内置时空推理能力,ST-ADAPTER可以实现预训练的图像模型,而无需时间知识,以小(〜8%)的每任务参数成本来理解动态视频内容,以大约需要与以前的工作相比,更新参数少20倍。在视频动作识别任务上进行的广泛实验表明,我们的ST-ADAPTER可以匹配甚至优于强大的完整微调策略和最先进的视频模型,同时享受参数效率的优势。
translated by 谷歌翻译
在计算机视觉中,微调是利用预训练的视觉模型来执行下游任务的事实上的方法。但是,由于采用参数效率低下的全局更新并严重依赖于高质量的下游数据,因此在实践中部署它是非常具有挑战性的。最近,基于及时的学习添加了与任务相关的提示,以使下游任务适应预训练的模型,从而极大地提高了许多自然语言下游任务的性能。在这项工作中,我们扩展了这种显着的转移能力,从迅速的愿景模型中受益,以替代微调。为此,我们提出了参数有效的及时调整(亲调整),以使冷冻视觉模型适应各种下游视觉任务。实行调整的关键是基于及时的调整,即学习特定于任务的视觉提示,以使用预先训练的模型冷冻的下游输入图像。通过仅培训一些其他参数,它可以在基于CNN和基于变压器的各种架构上工作。广泛的实验证据表明,在广泛的视觉任务和场景中,主张表现优于微调,包括图像分类(通用对象,类失衡,图像腐败,对抗性稳定性和分布范围内的概括)和密集的预测任务例如对象检测和语义分割。
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 谷歌翻译
先前的视觉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 谷歌翻译
We propose focal modulation networks (FocalNets in short), where self-attention (SA) is completely replaced by a focal modulation mechanism for modeling token interactions in vision. Focal modulation comprises three components: (i) hierarchical contextualization, implemented using a stack of depth-wise convolutional layers, to encode visual contexts from short to long ranges, (ii) gated aggregation to selectively gather contexts for each query token based on its content, and (iii) element-wise modulation or affine transformation to inject the aggregated context into the query. Extensive experiments show FocalNets outperform the state-of-the-art SA counterparts (e.g., Swin and Focal Transformers) with similar computational costs on the tasks of image classification, object detection, and segmentation. Specifically, FocalNets with tiny and base size achieve 82.3% and 83.9% top-1 accuracy on ImageNet-1K. After pretrained on ImageNet-22K in 224 resolution, it attains 86.5% and 87.3% top-1 accuracy when finetuned with resolution 224 and 384, respectively. When transferred to downstream tasks, FocalNets exhibit clear superiority. For object detection with Mask R-CNN, FocalNet base trained with 1\times outperforms the Swin counterpart by 2.1 points and already surpasses Swin trained with 3\times schedule (49.0 v.s. 48.5). For semantic segmentation with UPerNet, FocalNet base at single-scale outperforms Swin by 2.4, and beats Swin at multi-scale (50.5 v.s. 49.7). Using large FocalNet and Mask2former, we achieve 58.5 mIoU for ADE20K semantic segmentation, and 57.9 PQ for COCO Panoptic Segmentation. Using huge FocalNet and DINO, we achieved 64.3 and 64.4 mAP on COCO minival and test-dev, respectively, establishing new SoTA on top of much larger attention-based models like Swinv2-G and BEIT-3. Code and checkpoints are available at https://github.com/microsoft/FocalNet.
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 谷歌翻译
我们介绍克斯内变压器,一种高效且有效的变压器的骨干,用于通用视觉任务。变压器设计的具有挑战性的问题是,全球自我关注来计算成本昂贵,而局部自我关注经常限制每个令牌的相互作用。为了解决这个问题,我们开发了以平行的横向和垂直条纹在水平和垂直条纹中计算自我关注的交叉形窗口自我关注机制,通过将输入特征分成相等的条纹而获得的每个条纹宽度。我们提供了条纹宽度效果的数学分析,并改变变压器网络的不同层的条纹宽度,这在限制计算成本时实现了强大的建模能力。我们还介绍了本地增强的位置编码(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 谷歌翻译