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

重新审视用于目标检测与实例分割的Token剪枝

Revisiting Token Pruning for Object Detection and Instance Segmentation

University of Zurich(苏黎世大学)

Yifei Liu, Mathias Gehrig, Nico Messikommer, Marco Cannici, Davide Scaramuzza

AI总结:

该研究针对视觉Transformer计算成本高的问题,探索用于目标检测与实例分割的token剪枝方法,提出四点设计见解并构建相应方案,在COCO数据集上实现了精度损失降低与推理速度提升。

摘要:

视觉Transformer(ViTs)在计算机视觉领域已展现出优异性能,但其计算成本高昂,与token数量呈二次方关系,这限制了其在计算受限场景中的应用。不过,如此多的token或许并非必需,因为并非所有token的重要性都等同。本文对token剪枝展开研究,以加速目标检测和实例分割的推理过程,将此前图像分类领域的相关工作拓展至密集预测任务。通过大量实验,我们针对密集任务提出四点见解:(i)不应将token完全剪枝丢弃,而应将其保留在特征图中以供后续使用。(ii)重新激活此前被剪枝的token可进一步提升模型性能。(iii)基于图像的动态剪枝率优于固定剪枝率。(iv)轻量的2层MLP可有效完成token剪枝,以更简洁的设计实现了与复杂门控网络相当的精度。我们在COCO数据集上评估了这些设计选择的效果,并提出一种融合上述发现的方法,结果表明,与现有token剪枝方法相比,该方法在检测框和掩码上的性能下降幅度从约1.5 mAP降至约0.3 mAP。相较于使用全部token的密集型基线模型,我们的方法提升了推理速度,整网推理速度最高提升34%,骨干网络推理速度最高提升46%。

英文摘要:

Vision Transformers (ViTs) have shown impressive performance in computer vision, but their high computational cost, quadratic in the number of tokens, limits their adoption in computation-constrained applications. However, this large number of tokens may not be necessary, as not all tokens are equally important. In this paper, we investigate token pruning to accelerate inference for object detection and instance segmentation, extending prior works from image classification. Through extensive experiments, we offer four insights for dense tasks: (i) tokens should not be completely pruned and discarded, but rather preserved in the feature maps for later use. (ii) reactivating previously pruned tokens can further enhance model performance. (iii) a dynamic pruning rate based on images is better than a fixed pruning rate. (iv) a lightweight, 2-layer MLP can effectively prune tokens, achieving accuracy comparable with complex gating networks with a simpler design. We assess the effects of these design decisions on the COCO dataset and introduce an approach that incorporates these findings, showing a reduction in performance decline from ~1.5 mAP to ~0.3 mAP in both boxes and masks, compared to existing token pruning methods. In relation to the dense counterpart that utilizes all tokens, our method realizes an increase in inference speed, achieving up to 34% faster performance for the entire network and 46% for the backbone.

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

↑