arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.02250cs.CV
收藏

用于视觉Transformer的补丁相似性感知无数据Quantization

Patch Similarity Aware Data-Free Quantization for Vision Transformers

Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)

Zhikai Li, Liping Ma, Mengjuan Chen, Junrui Xiao, Qingyi Gu

摘要:

视觉Transformer最近在各种计算机视觉任务上取得了巨大成功;然而,它们的高模型复杂性使得在资源受限的设备上部署具有挑战性。量化是降低模型复杂度的有效方法,而无数据量化能够解决模型部署过程中的数据隐私和安全问题,受到了广泛的关注。不幸的是,所有现有的方法,例如BN正则化,都是为卷积神经网络设计的,并且不能应用于具有显著不同的模型架构的视觉Transformer。在本文中,我们提出了PSAQ-ViT,一个补丁相似性感知无数据量化框架的视觉变换器,使“现实”的样本的生成基于Vision Transformer的独特属性校准的量化参数。具体来说,我们分析了自我注意模块的属性,并揭示了一般的差异(补丁相似性)在其处理高斯噪声和真实图像。上述见解指导我们设计一个相对值度量来优化高斯噪声以近似真实图像,然后利用该相对值度量来校准量化参数。在各种基准上进行了大量的实验和消融研究,以验证PSAQ-ViT的有效性,它甚至可以优于真实数据驱动的方法。代码可从以下网址获得:https://github.com/zkkli/PSAQ-ViT。

英文摘要:

Vision transformers have recently gained great success on various computer vision tasks; nevertheless, their high model complexity makes it challenging to deploy on resource-constrained devices. Quantization is an effective approach to reduce model complexity, and data-free quantization, which can address data privacy and security concerns during model deployment, has received widespread interest. Unfortunately, all existing methods, such as BN regularization, were designed for convolutional neural networks and cannot be applied to vision transformers with significantly different model architectures. In this paper, we propose PSAQ-ViT, a Patch Similarity Aware data-free Quantization framework for Vision Transformers, to enable the generation of "realistic" samples based on the vision transformer's unique properties for calibrating the quantization parameters. Specifically, we analyze the self-attention module's properties and reveal a general difference (patch similarity) in its processing of Gaussian noise and real images. The above insights guide us to design a relative value metric to optimize the Gaussian noise to approximate the real images, which are then utilized to calibrate the quantization parameters. Extensive experiments and ablation studies are conducted on various benchmarks to validate the effectiveness of PSAQ-ViT, which can even outperform the real-data-driven methods. Code is available at: https://github.com/zkkli/PSAQ-ViT.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑