arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.23719cs.CVcs.AI
收藏

Weierstrass位置编码用于视觉Transformer

Weierstrass Positional Encoding for Vision Transformers

School of Mathematics and Data Science, Jiangnan University(江南大学数学与数据科学学院);School of Artificial Intelligence and Computer Science, Jiangnan University(江南大学人工智能与计算机科学学院)

Zhihang Xin, Rui Wang, Xitong Hu, Xiaojun Wu

AI总结:

针对视觉Transformer中可学习一维位置编码破坏二维空间结构的问题,提出基于Weierstrass椭圆函数的复数域二维位置编码方法,通过双周期性和非线性几何特性提升空间关系建模能力。

摘要:

视觉Transformer在计算机视觉中取得了显著成功,但它们通常使用可学习的一维位置编码,这削弱了图像块展平后固有的二维空间结构。现有的位置编码往往缺乏几何约束,并且不保持欧氏空间距离与序列索引距离之间的单调关系,限制了ViTs利用空间邻近先验的能力。受周期性在位置编码中实用性的启发,我们提出了Weierstrass椭圆位置编码(WePE),这是一种在复数域中编码二维坐标的数学基础方法。WePE将归一化的二维块坐标映射到复平面,并使用Weierstrass椭圆函数及其导数构建紧凑的四维位置特征。双周期性提供了二维位置的原则性表示,其固有的晶格结构自然匹配图像块网格的规则几何形状。其非线性几何特性有助于更忠实地建模空间距离关系,而代数加法公式使得任意块对之间的相对位置信息可以直接从其绝对编码中推导出来。WePE是即插即用的且与分辨率无关,可以无缝集成到现有的ViTs中。大量实验表明,WePE在大多数设置中带来一致的性能提升。通过预计算的查找表,这些改进不会引入明显的计算或内存开销。额外的分析和消融研究进一步验证了所提方法的有效性。

英文摘要:

Vision Transformers have achieved remarkable success in computer vision, but their common use of learnable one-dimensional positional encodings weakens the inherent two-dimensional spatial structure of images after patch flattening. Existing positional encodings often lack geometric constraints and do not preserve a monotonic relationship between Euclidean spatial distances and sequential index distances, limiting ViTs' ability to exploit spatial proximity priors. Motivated by the usefulness of periodicity in positional encoding, we propose Weierstrass elliptic Positional Encoding (WePE), a mathematically grounded method for encoding two-dimensional coordinates in the complex domain. WePE maps normalized 2D patch coordinates onto the complex plane and constructs compact four-dimensional positional features using the Weierstrass elliptic function and its derivative. The double periodicity provides a principled representation of 2D positions, and its intrinsic lattice structure naturally matches the regular geometry of image patch grids. Its nonlinear geometric properties help model spatial distance relationships more faithfully, while the algebraic addition formula enables relative positional information between arbitrary patch pairs to be derived directly from their absolute encodings. WePE is plug-and-play and resolution-agnostic, allowing seamless integration into existing ViTs. Extensive experiments show that WePE brings consistent performance gains in most settings. With precomputed lookup tables, these improvements introduce no noticeable computational or memory overhead. Additional analyses and ablation studies further validate the effectiveness of the proposed method.

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

↑