arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.01197cs.CVcs.AI
收藏

AiluRus:一种用于密集预测的可扩展 ViT 框架

AiluRus: A Scalable ViT Framework for Dense Prediction

Shanghai Jiao Tong University(上海交通大学);Huawei Cloud(华为云)

Jin Li, Yaoming Wang, Xiaopeng Zhang, Bowen Shi, Dongsheng Jiang, Chenglin Li, Wenrui Dai, Hongkai Xiong, Qi Tian

AI总结:

本文提出 AiluRus 框架,通过空间感知密度聚类自适应合并 ViT token,在保持密集预测精度的同时显著提升推理与微调速度。

摘要:

视觉 Transformer(ViTs)凭借其出色性能,已成为视觉任务中普遍采用的架构。然而,在处理长 token 序列时,尤其是在需要高分辨率输入的密集预测任务中,ViT 的复杂度会显著增加。值得注意的是,语义分割或目标检测等密集预测任务更强调物体的轮廓或形状,而物体内部纹理的信息量较少。受这一观察启发,本文提出根据图像中不同区域的重要性对其采用自适应分辨率。具体而言,在 ViT 的中间层,我们利用一种具有空间感知能力、基于密度的聚类算法,从 token 序列中选择具有代表性的 token。一旦确定代表性 token,我们便将其他 token 合并到与其最近的代表性 token。因此,语义相似的 token 会被合并在一起,形成低分辨率区域;而语义不相关的 token 则作为高分辨率区域被独立保留。该策略有效减少了 token 数量,使后续层能够处理更短的 token 序列并实现加速。我们在三个不同数据集上评估了所提方法,并观察到良好性能。例如,“Segmenter ViT-L”模型在无需微调的情况下,FPS 可提升 48%,同时保持性能。此外,我们的方法也可用于加速微调。实验结果表明,我们能够节省 52% 的训练时间,并将 FPS 加速 2.46 倍,而性能仅下降 0.09%。代码可在 https://github.com/caddyless/ailurus/tree/main 获取。

英文摘要:

Vision transformers (ViTs) have emerged as a prevalent architecture for vision tasks owing to their impressive performance. However, when it comes to handling long token sequences, especially in dense prediction tasks that require high-resolution input, the complexity of ViTs increases significantly. Notably, dense prediction tasks, such as semantic segmentation or object detection, emphasize more on the contours or shapes of objects, while the texture inside objects is less informative. Motivated by this observation, we propose to apply adaptive resolution for different regions in the image according to their importance. Specifically, at the intermediate layer of the ViT, we utilize a spatial-aware density-based clustering algorithm to select representative tokens from the token sequence. Once the representative tokens are determined, we proceed to merge other tokens into their closest representative token. Consequently, semantic similar tokens are merged together to form low-resolution regions, while semantic irrelevant tokens are preserved independently as high-resolution regions. This strategy effectively reduces the number of tokens, allowing subsequent layers to handle a reduced token sequence and achieve acceleration. We evaluate our proposed method on three different datasets and observe promising performance. For example, the "Segmenter ViT-L" model can be accelerated by 48% FPS without fine-tuning, while maintaining the performance. Additionally, our method can be applied to accelerate fine-tuning as well. Experimental results demonstrate that we can save 52% training time while accelerating 2.46 times FPS with only a 0.09% performance drop. The code is available at https://github.com/caddyless/ailurus/tree/main.

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

↑