这篇论文证明了simPE在图像旋转下比标准位置编码更稳,用四个数据集给出了理论界和实验验证,做视觉Transformer的值得看。
本研究从理论和实验两方面分析了相似性位置编码(simPE)在旋转扰动下的鲁棒性。论文首先证明simPE通常不具备旋转不变性,但基于Lipschitz假设推导出其在Frobenius范数下的显式扰动界。实验在四个数据集(Arrow、Shapes、Digits、FashionMNIST)上进行,测试图像逐渐增大旋转角度,simPE在准确率、F1、精确率和召回率上均优于标准学习型位置编码,尤其在小到中等旋转角度下表现更优。
Robustness of Similarity-based Positional Encoding Under Rotations: Theoretical Analysis and Experimental Validation
Positional encoding is a fundamental component of Transformer architectures, as it injects information about the spatial or sequential arrangement of inputs. Among recent alternatives to standard absolute and sinusoidal encodings, similarity-based positional encoding (simPE) has emerged as a flexible framework for representing positional structure through pairwise relations. simPE was originally designed for medical imaging applications, where geometric robustness is especially relevant: small rotations naturally arise during image acquisition, induced by imaging instruments, patient positioning, or slight acquisition misalignments. Despite its empirical promise, the theoretical behavior of simPE under geometric perturbations has not been fully characterized. In this paper, we study the robustness of simPE with respect to rotations, combining formal theoretical analysis with experimental validation. We first show that simPE is generally not rotation-invariant. We then prove that, under mild Lipschitz assumptions on the elementary components, simPE is stable under rotational perturbations and derive explicit perturbation bounds in Frobenius norm. We validate these findings experimentally on four controlled datasets--a synthetic Arrow dataset, a synthetic Shapes dataset (four geometric shape categories), a synthetic Digits dataset, and a benchmark image classification dataset (FashionMNIST)--in which training and validation images are kept in a fixed canonical orientation while test images are subjected to increasing rotation angles. Across all datasets, simPE consistently outperforms standard learned positional encoding in terms of accuracy, F1 score, precision, and recall under rotation, particularly in the small-to-moderate angle regime, corroborating the theoretical stability guarantees.