用可解释的几何约束提升Transformer在图像变换下的鲁棒性
Geometrically Constrained and Token-Based Probabilistic Spatial Transformers
- 将仿射变换分解为可解释基元,施加自适应几何约束防止训练崩溃
- 在昆虫与医学影像数据集上,准确率优于传统STN且计算开销极低
- 适合需可解释性与高精度的医疗、生物等关键领域应用
旋转、缩放等空间变换会模糊图像分类所需的形态线索,高风险场景中需确保模型鲁棒、能解释矫正原因,并识别输入模糊。虽然几何等变架构有数学基础,但受限于严格对称性且计算开销大。空间变换网络(STN)虽灵活,却仅适配卷积结构且训练不稳定。本文提出新型基于令牌的STN框架,利用Transformer全局建模能力回归输入上的仿射变换。通过将变换分解为可解释基元并施加可调几何约束,有效避免退化变换导致的训练不稳。通过共享定位网络与分类主干权重,实现极小计算开销。在挑战性的昆虫多样性与医学影像基准测试中,本方法在多种空间变换下均取得更优预测性能,同时保持高效率。代码已公开于 https://github.com/johSchm/TokenSTN。
原文摘要 · Abstract (English)
Spatial transformations such as rotation and scale obscure the morphological cues needed for accurate image classification. Careful consideration is required for reliable use in high stakes settings. A model should stay robust under such transformations, expose why a correction was applied, and signal when its input is ambiguous. While geometrically equivariant architectures provide a mathematically grounded solution, they often limit model flexibility through strict symmetry constraints and incur significant computational overhead. Spatial Transformer Networks (STNs) offer a data-driven, flexible alternative for learning pseudo-equivariances to affine transformations. However, STNs have historically been restricted to convolutional architectures and suffer from training instability. To address this, we introduce a novel STN framework. It leverages the global modeling capabilities of transformers to regress the affine transformation acting on the input. For this, we decompose affine transformations into interpretable primitives, regressed under adaptable geometric constraints, thereby preventing the training instability typically caused by degenerate transformations. By sharing weights between the localization network and the classification backbone, the framework requires minimal computational overhead. Extensive experiments on challenging insect biodiversity and medical imaging benchmarks demonstrate that our approach achieves superior predictive performance under diverse spatial transformations while maintaining high efficiency. Code is available at https://github.com/johSchm/TokenSTN.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。