Neighbor patches merging reduces spatial redundancy to accelerate vision transformer

IF 5.5 2区 计算机科学 Q1 COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE
Kai Jiang , Peng Peng , Youzao Lian , Weihui Shao , Weisheng Xu
{"title":"Neighbor patches merging reduces spatial redundancy to accelerate vision transformer","authors":"Kai Jiang ,&nbsp;Peng Peng ,&nbsp;Youzao Lian ,&nbsp;Weihui Shao ,&nbsp;Weisheng Xu","doi":"10.1016/j.neucom.2024.128733","DOIUrl":null,"url":null,"abstract":"<div><div>Vision Transformers (ViTs) deliver outstanding performance but often require substantial computational resources. Various token pruning methods have been developed to enhance throughput by removing redundant tokens; however, these methods do not address the peak memory consumption, which remains equivalent to that of the unpruned networks. In this study, we introduce Neighbor Patches Merging (NEPAM), a method that significantly reduces the maximum memory footprint of ViTs while pruning tokens. NEPAM targets spatial redundancy within images and prunes redundant patches at the onset of the model, thereby achieving the optimal throughput-accuracy trade-off without fine-tuning. Experimental results demonstrate that NEPAM can accelerate the inference speed of the Vit-Base-Patch16-384 model by 25% with a negligible accuracy loss of <strong>0.07%</strong> and a notable <strong>18%</strong> reduction in memory usage. When applied to VideoMAE, NEPAM doubles the throughput with a <strong>0.29%</strong> accuracy loss and a <strong>48%</strong> reduction in memory usage. These findings underscore the efficacy of NEPAM in mitigating computational requirements while maintaining model performance.</div></div>","PeriodicalId":19268,"journal":{"name":"Neurocomputing","volume":null,"pages":null},"PeriodicalIF":5.5000,"publicationDate":"2024-10-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Neurocomputing","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0925231224015042","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE","Score":null,"Total":0}
引用次数: 0

Abstract

Vision Transformers (ViTs) deliver outstanding performance but often require substantial computational resources. Various token pruning methods have been developed to enhance throughput by removing redundant tokens; however, these methods do not address the peak memory consumption, which remains equivalent to that of the unpruned networks. In this study, we introduce Neighbor Patches Merging (NEPAM), a method that significantly reduces the maximum memory footprint of ViTs while pruning tokens. NEPAM targets spatial redundancy within images and prunes redundant patches at the onset of the model, thereby achieving the optimal throughput-accuracy trade-off without fine-tuning. Experimental results demonstrate that NEPAM can accelerate the inference speed of the Vit-Base-Patch16-384 model by 25% with a negligible accuracy loss of 0.07% and a notable 18% reduction in memory usage. When applied to VideoMAE, NEPAM doubles the throughput with a 0.29% accuracy loss and a 48% reduction in memory usage. These findings underscore the efficacy of NEPAM in mitigating computational requirements while maintaining model performance.
邻近斑块合并可减少空间冗余,加快视觉转换器的速度
视觉变换器(ViT)性能卓越,但通常需要大量计算资源。目前已开发出多种标记剪枝方法,通过去除多余标记来提高吞吐量;然而,这些方法并不能解决内存消耗峰值问题,内存消耗峰值仍与未剪枝网络的内存消耗峰值相当。在本研究中,我们引入了邻接片合并(NEPAM)方法,这种方法在剪枝标记的同时,还能显著减少 ViTs 的最大内存占用。NEPAM 以图像内的空间冗余为目标,在模型开始时就修剪冗余补丁,从而在不进行微调的情况下实现吞吐量与准确度的最佳权衡。实验结果表明,NEPAM 可以将 Vit-Base-Patch16-384 模型的推理速度提高 25%,而精度损失仅为 0.07%,可以忽略不计,同时显著减少了 18% 的内存使用量。当应用于 VideoMAE 时,NEPAM 的吞吐量翻了一番,准确度损失为 0.29%,内存使用量减少了 48%。这些发现强调了 NEPAM 在保持模型性能的同时降低计算要求的功效。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Neurocomputing
Neurocomputing 工程技术-计算机:人工智能
CiteScore
13.10
自引率
10.00%
发文量
1382
审稿时长
70 days
期刊介绍: Neurocomputing publishes articles describing recent fundamental contributions in the field of neurocomputing. Neurocomputing theory, practice and applications are the essential topics being covered.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信