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

用于 Vision Transformer 的折线路径掩码注意力

Polyline Path Masked Attention for Vision Transformer

Xi’an Jiaotong University(西安交通大学);The Hong Kong Polytechnic University(香港理工大学);OPPO Research(OPPO研究院);Pazhou Laboratory (Huangpu) Institute(黄埔研究所)

Zhongchen Zhao, Chaodong Xiao, Hui Lin, Qi Xie, Lei Zhang, Deyu Meng

AI总结:

本文提出 PPMA,通过二维折线路径扫描生成结构化掩码并嵌入 ViT 自注意力,以兼顾全局依赖与空间邻接建模,在分类、检测和分割基准上取得先进性能。

摘要:

全局依赖建模和空间位置建模是当前深度学习框架中基础架构设计的两个核心问题。近年来,Vision Transformers(ViTs)借助自注意力机制强大的全局依赖建模能力,在计算机视觉领域取得了显著成功。此外,Mamba2 通过结构化掩码显式建模空间邻接先验,在自然语言处理任务中展现出巨大潜力。本文提出 Polyline Path Masked Attention(PPMA,折线路径掩码注意力),将 ViTs 的自注意力机制与增强的 Mamba2 结构化掩码相结合,利用两种架构的互补优势。具体而言,我们首先通过引入二维折线路径扫描策略改进 Mamba2 的传统结构化掩码,并推导其对应的结构化掩码,即折线路径掩码,从而更好地保留图像 token 之间的邻接关系。值得注意的是,我们对所提出折线路径掩码的结构特征进行了全面理论分析,并设计了用于计算该折线路径掩码的高效算法。随后,我们将折线路径掩码嵌入 ViTs 的自注意力机制中,实现对空间邻接先验的显式建模。在包括图像分类、目标检测和分割在内的标准基准上进行的大量实验表明,我们的模型优于此前基于状态空间模型和 Transformer 的最先进方法。例如,所提出的 PPMA-T/S/B 模型在 ADE20K 语义分割任务上取得 48.7%/51.1%/52.3% mIoU,分别比 RMT-T/S/B 高出 0.7%/1.3%/0.3%。代码位于 https://github.com/zhongchenzhao/PPMA。

英文摘要:

Global dependency modeling and spatial position modeling are two core issues of the foundational architecture design in current deep learning frameworks. Recently, Vision Transformers (ViTs) have achieved remarkable success in computer vision, leveraging the powerful global dependency modeling capability of the self-attention mechanism. Furthermore, Mamba2 has demonstrated its significant potential in natural language processing tasks by explicitly modeling the spatial adjacency prior through the structured mask. In this paper, we propose Polyline Path Masked Attention (PPMA) that integrates the self-attention mechanism of ViTs with an enhanced structured mask of Mamba2, harnessing the complementary strengths of both architectures. Specifically, we first ameliorate the traditional structured mask of Mamba2 by introducing a 2D polyline path scanning strategy and derive its corresponding structured mask, polyline path mask, which better preserves the adjacency relationships among image tokens. Notably, we conduct a thorough theoretical analysis on the structural characteristics of the proposed polyline path mask and design an efficient algorithm for the computation of the polyline path mask. Next, we embed the polyline path mask into the self-attention mechanism of ViTs, enabling explicit modeling of spatial adjacency prior. Extensive experiments on standard benchmarks, including image classification, object detection, and segmentation, demonstrate that our model outperforms previous state-of-the-art approaches based on both state-space models and Transformers. For example, our proposed PPMA-T/S/B models achieve 48.7%/51.1%/52.3% mIoU on the ADE20K semantic segmentation task, surpassing RMT-T/S/B by 0.7%/1.3%/0.3%, respectively. Code is available at https://github.com/zhongchenzhao/PPMA.

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

↑