基于注意的模型,由变压器举例说明,可以有效地模拟长距离依赖性,而是遭受自我注意操作的二次复杂性,使得基于生成的对抗网络(GAN)的高分辨率图像生成使得它们难以采用。在本文中,我们向变压器推出了两个关键成分来解决这一挑战。首先,在生成过程的低分辨率阶段,用所提出的多轴阻塞自我关注取代了标准的全球自我关注,这允许有效地混合本地和全球关注。其次,在高分辨率阶段,我们降低了自我关注,同时只保持多层的感知让人想起隐含的神经功能。为了进一步提高性能,我们基于横向引入额外的自我调制组件。结果模型表示为命中,具有关于图像尺寸的几乎线性的计算复杂度,从而直接缩放到合成高清晰度图像。我们在实验中展示了所提出的命中,实现最先进的FID得分31.87和2.95在无条件的ImageNet上,分别具有合理的吞吐量的128美元和256美元\ times 256美元。我们认为,拟议的命中是全球发电机的一个重要里程碑,完全没有卷积。
translated by 谷歌翻译
最近对变形金刚的爆炸利益提出了他们成为计算机视觉任务的强大“通用”模型的潜力,例如分类,检测和分割。虽然这些尝试主要研究歧视模型,但我们探索变压器,更加臭名昭着的难以愿景任务,例如生成的对抗网络(GANS)。我们的目标是通过仅使用纯的变压器的架构,开展一项完全没有卷曲的GAN的试点研究。我们的Vanilla GaN架构被称为Cransgan,包括一个基于内存友好的变换器的发电机,逐渐增加了特征分辨率,并且相应地是多尺度鉴别器来捕获同时语义上下文和低级纹理。在他们之上,我们介绍了新的网格自我关注模块,以便进一步缓解记忆瓶颈,以便扩展到高分辨率的发电。我们还开发了一个独特的培训配方,包括一系列技术,可以减轻转发的培训不稳定问题,例如数据增强,修改的归一化和相对位置编码。与使用卷积骨架的当前最先进的GAN相比,我们最好的建筑达到了竞争力的表现。具体而言,转发在STL-10上设置10.43和18.28的最新的最新成立得分为18.28,表现优于样式。当涉及更高分辨率(例如256 x 256)的生成任务时,例如Celeba-HQ和Lsun-Church,Rancorgan继续生产具有高保真度和令人印象深刻的纹理细节的不同视觉示例。此外,我们通过可视化培训动力学,深入了解基于变压器的生成模型,了解他们的行为如何与卷积的行为。代码可在https://github.com/vita-group/transgan中获得。
translated by 谷歌翻译
尽管在广泛的愿景任务中取得了诱人的成功,但变形金刚尚未在高分辨率图像生成建模中作为Convnets的讨论能力。在本文中,我们寻求探索使用纯变压器来构建用于高分辨率图像合成的生成对抗网络。为此,我们认为,当地的关注是在计算效率和建模能力之间取得平衡至关重要。因此,所提出的发电机采用基于风格的架构中的Swin变压器。为了实现更大的接收领域,我们提出了双重关注,同时利用本地和移位窗的上下文,从而提高了发电质量。此外,我们表明提供了在基于窗口的变压器中丢失的绝对位置的知识极大地利益了代理。所提出的STYLESWIN可扩展到高分辨率,粗糙几何和细结构都受益于变压器的强效力。然而,在高分辨率合成期间发生阻塞伪像,因为以块明智的方式执行局部注意力可能会破坏空间一致性。为了解决这一点,我们经验研究了各种解决方案,其中我们发现采用小波鉴别器来检查光谱差异的措施有效地抑制伪影。广泛的实验表明了对现有的基于变压器的GAN的优越性,特别是在高分辨率上,例如高分辨率,例如1024x1024。如果没有复杂的培训策略,则在Celeba-HQ 1024上赢得了STYLEGAN,并且在FFHQ-1024上实现了对PAR的表现,证明了使用变压器进行高分辨率图像生成的承诺。代码和模型将在https://github.com/microsoft/styleswin上使用。
translated by 谷歌翻译
变压器在计算机视觉中变得普遍,特别是对于高级视觉任务。然而,采用生成的对抗性网络(GaN)框架中的变压器仍然是一个开放但具有挑战性的问题。本文进行了一项全面的实证研究,探讨了高保真图像合成的GaN中变压器的性能。我们的分析亮点并重申了特征局部度在图像生成中的重要性,尽管局部性的优点在分类任务中是众所周知的。也许更有趣的是,我们发现自我关注层中的残余连接有害,以利用基于变压器的鉴别器和条件发电机。我们仔细检查了影响力,并提出了减轻负面影响的有效方法。我们的研究导致GaN中的变压器的新替代设计,卷积神经网络(CNN) - 免费发电机称为晶体 - G,这在无条件和条件图像代中实现了竞争导致。基于变压器的鉴别器,Strans-D也显着降低了其基于CNN的鉴别器的间隙。
translated by 谷歌翻译
变形金刚最近在计算机视觉社区中引起了极大的关注。然而,缺乏关于图像大小的自我注意力机制的可扩展性限制了它们在最先进的视觉骨架中的广泛采用。在本文中,我们介绍了一种高效且可扩展的注意模型,我们称之为多轴注意,该模型由两个方面组成:阻止局部和扩张的全球关注。这些设计选择允许仅具有线性复杂性的任意输入分辨率上进行全局本地空间相互作用。我们还通过有效地将我们提出的注意模型与卷积混合在一起,提出了一个新的建筑元素,因此,通过简单地在多个阶段重复基本的构建块,提出了一个简单的层次视觉主链,称为Maxvit。值得注意的是,即使在早期的高分辨率阶段,Maxvit也能够在整个网络中“看到”。我们证明了模型在广泛的视觉任务上的有效性。根据图像分类,Maxvit在各种设置下实现最先进的性能:没有额外的数据,Maxvit获得了86.5%的Imagenet-1K Top-1精度;使用Imagenet-21K预训练,我们的模型可实现88.7%的TOP-1精度。对于下游任务,麦克斯维特(Maxvit)作为骨架可在对象检测以及视觉美学评估方面提供有利的性能。我们还表明,我们提出的模型表达了ImageNet上强大的生成建模能力,这表明了Maxvit块作为通用视觉模块的优势潜力。源代码和训练有素的模型将在https://github.com/google-research/maxvit上找到。
translated by 谷歌翻译
Designed to learn long-range interactions on sequential data, transformers continue to show state-of-the-art results on a wide variety of tasks. In contrast to CNNs, they contain no inductive bias that prioritizes local interactions. This makes them expressive, but also computationally infeasible for long sequences, such as high-resolution images. We demonstrate how combining the effectiveness of the inductive bias of CNNs with the expressivity of transformers enables them to model and thereby synthesize high-resolution images. We show how to (i) use CNNs to learn a contextrich vocabulary of image constituents, and in turn (ii) utilize transformers to efficiently model their composition within high-resolution images. Our approach is readily applied to conditional synthesis tasks, where both non-spatial information, such as object classes, and spatial information, such as segmentations, can control the generated image. In particular, we present the first results on semanticallyguided synthesis of megapixel images with transformers and obtain the state of the art among autoregressive models on class-conditional ImageNet. Code and pretrained models can be found at https://git.io/JnyvK.
translated by 谷歌翻译
通过将图像形成过程分解成逐个申请的去噪自身额,扩散模型(DMS)实现了最先进的合成导致图像数据和超越。另外,它们的配方允许引导机构来控制图像生成过程而不会再刷新。然而,由于这些模型通常在像素空间中直接操作,因此强大的DMS的优化通常消耗数百个GPU天,并且由于顺序评估,推理是昂贵的。为了在保留其质量和灵活性的同时启用有限计算资源的DM培训,我们将它们应用于强大的佩带自动化器的潜在空间。与以前的工作相比,这种代表上的培训扩散模型允许第一次达到复杂性降低和细节保存之间的近乎最佳点,极大地提高了视觉保真度。通过将跨关注层引入模型架构中,我们将扩散模型转化为强大而柔性的发电机,以进行诸如文本或边界盒和高分辨率合成的通用调节输入,以卷积方式变得可以实现。我们的潜在扩散模型(LDMS)实现了一种新的技术状态,可在各种任务中进行图像修复和高竞争性能,包括无条件图像生成,语义场景合成和超级分辨率,同时与基于像素的DMS相比显着降低计算要求。代码可在https://github.com/compvis/lattent-diffusion获得。
translated by 谷歌翻译
视觉变压器(VIT)用作强大的视觉模型。与卷积神经网络不同,在前几年主导视觉研究,视觉变压器享有捕获数据中的远程依赖性的能力。尽管如此,任何变压器架构的组成部分,自我关注机制都存在高延迟和低效的内存利用,使其不太适合高分辨率输入图像。为了缓解这些缺点,分层视觉模型在非交错的窗口上局部使用自我关注。这种放松会降低输入尺寸的复杂性;但是,它限制了横窗相互作用,损害了模型性能。在本文中,我们提出了一种新的班次不变的本地注意层,称为查询和参加(QNA),其以重叠的方式聚集在本地输入,非常类似于卷积。 QNA背后的关键想法是介绍学习的查询,这允许快速高效地实现。我们通过将其纳入分层视觉变压器模型来验证我们的层的有效性。我们展示了速度和内存复杂性的改进,同时实现了与最先进的模型的可比准确性。最后,我们的图层尺寸尤其良好,窗口大小,需要高于X10的内存,而不是比现有方法更快。
translated by 谷歌翻译
Image generation has been a long sought-after but challenging task, and performing the generation task in an efficient manner is similarly difficult. Often researchers attempt to create a "one size fits all" generator, where there are few differences in the parameter space for drastically different datasets. Herein, we present a new transformer-based framework, dubbed StyleNAT, targeting high-quality image generation with superior efficiency and flexibility. At the core of our model, is a carefully designed framework that partitions attention heads to capture local and global information, which is achieved through using Neighborhood Attention (NA). With different heads able to pay attention to varying receptive fields, the model is able to better combine this information, and adapt, in a highly flexible manner, to the data at hand. StyleNAT attains a new SOTA FID score on FFHQ-256 with 2.046, beating prior arts with convolutional models such as StyleGAN-XL and transformers such as HIT and StyleSwin, and a new transformer SOTA on FFHQ-1024 with an FID score of 4.174. These results show a 6.4% improvement on FFHQ-256 scores when compared to StyleGAN-XL with a 28% reduction in the number of parameters and 56% improvement in sampling throughput. Code and models will be open-sourced at https://github.com/SHI-Labs/StyleNAT .
translated by 谷歌翻译
Astounding results from Transformer models on natural language tasks have intrigued the vision community to study their application to computer vision problems. Among their salient benefits, Transformers enable modeling long dependencies between input sequence elements and support parallel processing of sequence as compared to recurrent networks e.g., Long short-term memory (LSTM). Different from convolutional networks, Transformers require minimal inductive biases for their design and are naturally suited as set-functions. Furthermore, the straightforward design of Transformers allows processing multiple modalities (e.g., images, videos, text and speech) using similar processing blocks and demonstrates excellent scalability to very large capacity networks and huge datasets. These strengths have led to exciting progress on a number of vision tasks using Transformer networks. This survey aims to provide a comprehensive overview of the Transformer models in the computer vision discipline. We start with an introduction to fundamental concepts behind the success of Transformers i.e., self-attention, large-scale pre-training, and bidirectional feature encoding. We then cover extensive applications of transformers in vision including popular recognition tasks (e.g., image classification, object detection, action recognition, and segmentation), generative modeling, multi-modal tasks (e.g., visual-question answering, visual reasoning, and visual grounding), video processing (e.g., activity recognition, video forecasting), low-level vision (e.g., image super-resolution, image enhancement, and colorization) and 3D analysis (e.g., point cloud classification and segmentation). We compare the respective advantages and limitations of popular techniques both in terms of architectural design and their experimental value. Finally, we provide an analysis on open research directions and possible future works. We hope this effort will ignite further interest in the community to solve current challenges towards the application of transformer models in computer vision.
translated by 谷歌翻译
Score-based diffusion models have captured widespread attention and funded fast progress of recent vision generative tasks. In this paper, we focus on diffusion model backbone which has been much neglected before. We systematically explore vision Transformers as diffusion learners for various generative tasks. With our improvements the performance of vanilla ViT-based backbone (IU-ViT) is boosted to be on par with traditional U-Net-based methods. We further provide a hypothesis on the implication of disentangling the generative backbone as an encoder-decoder structure and show proof-of-concept experiments verifying the effectiveness of a stronger encoder for generative tasks with ASymmetriC ENcoder Decoder (ASCEND). Our improvements achieve competitive results on CIFAR-10, CelebA, LSUN, CUB Bird and large-resolution text-to-image tasks. To the best of our knowledge, we are the first to successfully train a single diffusion model on text-to-image task beyond 64x64 resolution. We hope this will motivate people to rethink the modeling choices and the training pipelines for diffusion-based generative models.
translated by 谷歌翻译
图像综合和图像识别已经见证了显着的进展,但通常以计算昂贵的训练和推断为代价。学习轻量级又表达深度模型已成为一个重要而有趣的方向。本文提出了略微展开的展开构建模块(SLIM),促进了图像合成模型的略微学习,以及相同层变体(称为纤细TOO)作为图像识别的众所周知的RENEXT的替代品更强。在SLIM中,输入特征图首先将多个组(例如,4)。然后转换为潜在风格的向量(通过通道 - 明智地注意)和潜在的空间掩模(通过空间注意)。学习的潜在掩码和潜在风格向量被聚合以调制目标特征映射。对于生成的学习,纤细地建立在最近提出的轻质生成的对抗网络(即,Fastgans)上,该网络展示了跳过层励磁(SLE)模块。对于少量图像综合任务,所提出的纤细可以实现比SLE工作和其他相关方法更好的性能。对于单次图像综合任务,它显示比现有技术(例如初版)保留图像结构的更强能力。对于图像分类任务,所提出的纤细被用作Resnet中的卷积层的替代品(导致Resnext的模型),并在MageNET-1000数据集中实现更好的精度,模型复杂性显着更小
translated by 谷歌翻译
我们通过将此任务视为视觉令牌生成问题来提出新的视角来实现图像综合。与现有的范例不同,即直接从单个输入(例如,潜像)直接合成完整图像,新配方使得能够为不同的图像区域进行灵活的本地操作,这使得可以学习内容感知和细粒度的样式控制用于图像合成。具体地,它需要输入潜像令牌的序列,以预测用于合成图像的视觉令牌。在这种观点来看,我们提出了一个基于令牌的发电机(即Tokengan)。特别是,Tokengan输入了两个语义不同的视觉令牌,即,来自潜在空间的学习常量内容令牌和风格代币。鉴于一系列风格令牌,Tokengan能够通过用变压器将样式分配给内容令牌来控制图像合成。我们进行了广泛的实验,并表明拟议的Tokengan在几个广泛使用的图像综合基准上实现了最先进的结果,包括FFHQ和LSUN教会,具有不同的决议。特别地,发电机能够用1024x1024尺寸合成高保真图像,完全用卷曲分配。
translated by 谷歌翻译
We explore a new class of diffusion models based on the transformer architecture. We train latent diffusion models of images, replacing the commonly-used U-Net backbone with a transformer that operates on latent patches. We analyze the scalability of our Diffusion Transformers (DiTs) through the lens of forward pass complexity as measured by Gflops. We find that DiTs with higher Gflops -- through increased transformer depth/width or increased number of input tokens -- consistently have lower FID. In addition to possessing good scalability properties, our largest DiT-XL/2 models outperform all prior diffusion models on the class-conditional ImageNet 512x512 and 256x256 benchmarks, achieving a state-of-the-art FID of 2.27 on the latter.
translated by 谷歌翻译
Automatic image colorization is a particularly challenging problem. Due to the high illness of the problem and multi-modal uncertainty, directly training a deep neural network usually leads to incorrect semantic colors and low color richness. Existing transformer-based methods can deliver better results but highly depend on hand-crafted dataset-level empirical distribution priors. In this work, we propose DDColor, a new end-to-end method with dual decoders, for image colorization. More specifically, we design a multi-scale image decoder and a transformer-based color decoder. The former manages to restore the spatial resolution of the image, while the latter establishes the correlation between semantic representations and color queries via cross-attention. The two decoders incorporate to learn semantic-aware color embedding by leveraging the multi-scale visual features. With the help of these two decoders, our method succeeds in producing semantically consistent and visually plausible colorization results without any additional priors. In addition, a simple but effective colorfulness loss is introduced to further improve the color richness of generated results. Our extensive experiments demonstrate that the proposed DDColor achieves significantly superior performance to existing state-of-the-art works both quantitatively and qualitatively. Codes will be made publicly available.
translated by 谷歌翻译
桥接全球上下文交互正确对大面具的高保真图像完成非常重要。先前的方法通过深或大的接收领域(RF)卷积无法逃离附近互动的主导地位,这可能是劣等的。在本文中,我们建议将图像完成视为无缝的序列到序列预测任务,并部署变压器以直接捕获编码器中的远程依赖性。至关重要,我们使用具有小而非重叠的RF的限制性CNN,用于加权令牌表示,这允许变压器明确地模拟所有层中的相同重要性,而在使用较大的RF时,没有隐含地混淆邻居令牌。为了改善可见区域之间的外观一致性,引入了一种新的注意力层(aal)以更好地利用远方相关的高频功能。总体而言,与若干数据集上的最先进方法相比,大量实验表现出卓越的性能。
translated by 谷歌翻译
生成的对抗网络(GANS)产生高质量的图像,但致力于训练。它们需要仔细正常化,大量计算和昂贵的超参数扫描。我们通过将生成和真实样本投影到固定的预级特征空间中,在这些问题上进行了重要的头路。发现鉴别者无法充分利用来自预押模型的更深层次的特征,我们提出了更有效的策略,可以在渠道和分辨率中混合特征。我们预计的GaN提高了图像质量,样品效率和收敛速度。它与最多一个百万像素的分辨率进一步兼容,并在二十二个基准数据集上推进最先进的FR \'Echet Inception距离(FID)。重要的是,预计的GAN符合先前最低的FID速度快40倍,鉴于相同的计算资源,将壁钟时间从5天切割到不到3小时。
translated by 谷歌翻译
Image generation has been successfully cast as an autoregressive sequence generation or transformation problem. Recent work has shown that self-attention is an effective way of modeling textual sequences. In this work, we generalize a recently proposed model architecture based on self-attention, the Transformer, to a sequence modeling formulation of image generation with a tractable likelihood. By restricting the selfattention mechanism to attend to local neighborhoods we significantly increase the size of images the model can process in practice, despite maintaining significantly larger receptive fields per layer than typical convolutional neural networks. While conceptually simple, our generative models significantly outperform the current state of the art in image generation on ImageNet, improving the best published negative log-likelihood on ImageNet from 3.83 to 3.77. We also present results on image super-resolution with a large magnification ratio, applying an encoder-decoder configuration of our architecture. In a human evaluation study, we find that images generated by our super-resolution model fool human observers three times more often than the previous state of the art.
translated by 谷歌翻译
分层结构在最近的视觉变压器中很受欢迎,但是,它们需要复杂的设计和大规模的数据集。在本文中,我们探讨了在非重叠图像块上嵌套基本本地变压器的想法,并以分层方式聚合它们。我们发现块聚合函数在启用跨块非本地信息通信方面发挥着关键作用。此观察导致我们设计简化的架构,该架构需要在原始视觉变压器上更改次要代码。拟议的明智选择的设计的好处是三倍:(1)巢汇聚速度更快,需要更少的培训数据,以实现对图中的良好的概率和小型数据集如CiFAR; (2)在将关键思想扩展到图像生成时,巢导致强大的解码器,这是8美元\时代比以前的基于变压器的发电机更快; (3)我们展示通过我们设计中的这种嵌套层次结构解耦了特征学习和抽象过程,使得能够构建一种新的方法(命名的Gradcat),用于视觉解释学习模型。源代码可用https://github.com/google-research/nested-transformer。
translated by 谷歌翻译
最近的研究表明,在介绍问题中建模长期相互作用的重要性。为了实现这一目标,现有方法利用独立的注意技术或变压器,但考虑到计算成本,通常在低分辨率下。在本文中,我们提出了一个基于变压器的新型模型,用于大孔介入,该模型统一了变压器和卷积的优点,以有效地处理高分辨率图像。我们仔细设计框架的每个组件,以确保恢复图像的高保真度和多样性。具体而言,我们自定义了一个面向内部的变压器块,其中注意模块仅从部分有效令牌中汇总非本地信息,该信息由动态掩码表示。广泛的实验证明了在多个基准数据集上新模型的最新性能。代码在https://github.com/fenglinglwb/mat上发布。
translated by 谷歌翻译