Scaling Laws in Patchification: An Image Is Worth 50,176 Tokens And More
这篇论文研究了图像分块化对视觉模型的影响,发现减小分块大小可以提高模型性能,并提出了“一个像素等于50,176个token”的视觉编码新范式。
更新于 2025-02-10。作者:Feng Wang、Yaodong Yu、Guoyizhe Wei、Wei Shao、Yuyin Zhou、Alan Yuille、Cihang Xie。
中文摘要
自从视觉Transformer(ViT)被引入以来,图像块化一直被视为平面视觉架构的默认图像标记化方法。通过压缩图像的空间尺寸,这种方法可以有效地缩短标记序列并降低类似ViT的平面架构的计算成本。在这项工作中,我们旨在彻底检查由基于图像块化的压缩编码范式引起的信息损失以及它如何影响视觉理解。我们进行了广泛的图像块大小缩放实验,并兴奋地观察到在图像块化中的一个有趣缩放规律:模型可以从较小的图像块大小中持续获益并实现更好的预测性能,直到达到最小图像块大小1x1,即像素标记化。这一结论在跨不同视觉任务、各种输入尺度和不同的架构(如ViT和最近的Mamba模型)中具有广泛的适用性。此外,作为副产品,我们发现随着图像块尺寸的减小,特定于任务的解码器头部对于密集预测变得不那么关键。在实验中,我们成功地将视觉序列扩展到异常长的50,176个标记,在ImageNet-1k基准上使用基线大小的模型实现了84.6%的竞争性测试准确率。我们希望这项研究可以为构建非压缩视觉模型未来的工作提供洞察力和理论基础。代码可在https://github.com/wangf3014/Patch_Scaling获取。
英文摘要
Since the introduction of Vision Transformer (ViT), patchification has long been regarded as a de facto image tokenization approach for plain visual architectures. By compressing the spatial size of images, this approach can effectively shorten the token sequence and reduce the computational cost of ViT-like plain architectures. In this work, we aim to thoroughly examine the information loss caused by this patchification-based compressive encoding paradigm and how it affects visual understanding. We conduct extensive patch size scaling experiments and excitedly observe an intriguing scaling law in patchification: the models can consistently benefit from decreased patch sizes and attain improved predictive performance, until it reaches the minimum patch size of 1x1, i.e., pixel tokenization. This conclusion is broadly applicable across different vision tasks, various input scales, and diverse architectures such as ViT and the recent Mamba models. Moreover, as a by-product, we discover that with smaller patches, task-specific decoder heads become less critical for dense prediction. In the experiments, we successfully scale up the visual sequence to an exceptional length of 50,176 tokens, achieving a competitive test accuracy of 84.6% with a base-sized model on the ImageNet-1k benchmark. We hope this study can provide insights and theoretical foundations for future works of building non-compressive vision models. Code is available at https://github.com/wangf3014/Patch_Scaling.
解读
一句话总结
这篇论文研究了图像分块化对视觉模型的影响,发现减小分块大小可以提高模型性能,并提出了“一个像素等于50,176个token”的视觉编码新范式。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:视觉Transformer(ViT)等模型通过分块化来压缩图像,以减少计算成本,但可能造成信息损失。
- 现有方案不足:分块化压缩可能导致视觉信息损失,影响视觉理解。
- 研究目标:研究分块化对视觉模型的影响,并探索减小分块大小对模型性能的影响。
问题2:论文的核心创新点是什么?
- 技术创新:提出了“一个像素等于50,176个token”的视觉编码新范式。
- 方法改进:通过减小分块大小来降低信息压缩率,从而提高模型性能。
- 优势:提高模型性能,减少对特定任务解码器的依赖,扩展视觉序列长度。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在不同视觉任务、输入分辨率和模型架构上进行了实验。
- 性能提升:减小分块大小后,模型在ImageNet-1k基准测试中达到了84.6%的测试准确率。
- 对比结果:与基线方法相比,性能显著提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:图像分类、语义分割、目标检测和实例分割等视觉任务。
- 实施建议:在计算资源允许的情况下,减小分块大小以提高模型性能。
- 局限与展望:随着硬件和算法的进步,视觉编码有望进一步扩展,为构建非压缩视觉基础模型提供理论基础。
来源
机器可读索引:llms.txt