Skip to main content
QUICK REVIEW

[论文解读] An Image is Worth More Than 16x16 Patches: Exploring Transformers on Individual Pixels

Duy-Kien Nguyen, Mahmoud Assran|arXiv (Cornell University)|Jun 13, 2024
Augmented Reality ApplicationsComputer Science被引用 8
一句话总结

显示 vanilla Transformers 可以直接在单个像素上作为令牌(PiT)运作,具有可学习的位置嵌入,在监督、自监督和生成任务中取得强劲结果,挑战在视觉模型中将局部性作为必要的归纳偏置的观点。

ABSTRACT

This work does not introduce a new method. Instead, we present an interesting finding that questions the necessity of the inductive bias of locality in modern computer vision architectures. Concretely, we find that vanilla Transformers can operate by directly treating each individual pixel as a token and achieve highly performant results. This is substantially different from the popular design in Vision Transformer, which maintains the inductive bias from ConvNets towards local neighborhoods (e.g. by treating each 16x16 patch as a token). We showcase the effectiveness of pixels-as-tokens across three well-studied computer vision tasks: supervised learning for classification and regression, self-supervised learning via masked autoencoding, and image generation with diffusion models. Although it's computationally less practical to directly operate on individual pixels, we believe the community must be made aware of this surprising piece of knowledge when devising the next generation of neural network architectures for computer vision.

研究动机与目标

  • 质疑在视觉架构中局部性作为归纳偏置的必要性。
  • 证明 Transformer 可以通过将每个像素视为一个令牌来处理图像,而无需 2D 网格先验。
  • 在监督分类、自监督 MAE 预训练和基于扩散的图像生成上评估 PiT。
  • 在不同输入大小和补丁配置下将 PiT 与 ViT 进行比较,以分析局部性、序列长度和信息量之间的权衡。

提出的方法

  • 提出 Pixel Transformer (PiT):将 Transformer 编码器直接应用于无序的图像像素集合,具有可学习的位置嵌入。
  • 通过线性投影到隐藏维度将每个像素视为一个令牌,附加一个 [cls] 令牌,并通过带有残差连接的标准 Transformer 块进行处理。
  • 在 CIFAR-100 和 ImageNet 上,比较 PiT 与 2×2 补丁的 ViT 基线,在从头训练和 MAE 预训练条件下。
  • 通过像素置换和受控损坏实验,通过操作 ViT 的位置嵌入和补丁化来研究局部性。
  • 在使用潜在 VQGAN 令牌的 Diffusion Transformer (DiT) 架构上评估 PiT 的图像生成。
  • 提供多种 PiT 尺寸变体(Tiny、Small、Base、Large)及相应的网络配置。
Figure 1 : Overview of a Pixel Transformer (PiT) , which is used to investigate the role of locality. Given an image, we simply treat it as a set of pixels. Besides, we also employ randomly initialized and learnable position embeddings without any information about 2D structure, therefore removing t
Figure 1 : Overview of a Pixel Transformer (PiT) , which is used to investigate the role of locality. Given an image, we simply treat it as a set of pixels. Besides, we also employ randomly initialized and learnable position embeddings without any information about 2D structure, therefore removing t

实验结果

研究问题

  • RQ1在将图像视为单个像素集合进行处理时,局部性是否是 Vision Transformer 的必要归纳偏置?
  • RQ2在 CIFAR-100 和 ImageNet 的监督学习中,像素级令牌化(PiT)与基于补丁的 ViT 有何差异?
  • RQ3自监督预训练(MAE)对 PiT 性能相对于 ViT 的影响是什么?
  • RQ4PiT 是否可以扩展到生成任务,特别是在 ImageNet 潜在空间上的扩散式图像生成?
  • RQ5局部性设计选项(位置嵌入、补丁化)如何影响 ViT 与 PiT 的性能?

主要发现

  • PiT(像素作为令牌)方法在 CIFAR-100 和 ImageNet 的从头训练中,达到与基于补丁的 ViT 基线相当甚至更优的 Acc@1/Acc@5。
  • 自监督 MAE 预训练提升 PiT 的性能,对于较小的 PiT 模型收益更大,缩小与 ViT 的差距,有时甚至超过它。
  • 在图像生成方面,PiT-L 在潜在 VQGAN 令牌上运行的结果与偏好局部性的 DiT 基线在 FID、sFID 和 IS 指标上具有竞争力,表明局部性并非高质量生成的必要条件。
  • ViT 的局部性设计(补丁化和位置嵌入)对性能贡献显著,去除局部性的 PiT 突显了 Transformer 的替代信号学习潜力。
  • 像素级置换实验表明补丁化对 ViT 的性能贡献很大,而 PiT 通过依赖学习得到的全局令牌交互来维持性能。
(a) Acc@1 with fixed sequence length .
(a) Acc@1 with fixed sequence length .

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。