2D Rotary Position Embedding for Scene Text Recognition with Transformers
Abstract
Scene Text Recognition (STR) remains challenging due to the diversity of text appearances, including curvature, rotation, and perspective distortion. Recent Transformer-based approaches perform well but usually rely on one-dimensional positional encodings that ignore the 2D spatial structure of text images. Axial 2D extensions of Rotary Position Embedding (RoPE) exist for vision Transformers, but they assume roughly square, isotropic image content and apply the rotation only within encoder self-attention. Scene text violates both assumptions: crops are markedly anisotropic, and STR models are encoder-decoder, so the decoder must relate its queries to the encoder's 2D layout through cross-attention. We introduce 2D-RoPE-STR, which adapts axial 2D-RoPE to this setting through (1) an anisotropic row/column dimension allocation matched to the aspect ratio of text, and (2) an extension of the rotary coupling into encoder-decoder cross-attention, letting autoregressive decoding steps attend to encoder tokens by their 2D layout, a setting not addressed by prior encoder-only formulations. Both changes are essentially parameter-free and require no architectural redesign beyond the positional-encoding module. We further introduce a diagnostic protocol (a controlled ablation pair isolating only the positional encoding, an image-level net-win disagreement analysis, and encoder attention visualization) that identifies where and why relative 2D position helps: curved, rotated, and perspective-distorted layouts where reading order departs from a straight horizontal line. On six standard benchmarks (IIIT5K, SVT, ICDAR 2013, ICDAR 2015, CUTE80, SVTP), gains concentrate on exactly these irregular layouts, with ablations isolating each design choice against 1D RoPE and 2D sinusoidal and learnable alternatives.
Create a lesson
Metadata
- Comments
- 17 pages, 3 figures. Under review at the International Journal on Document Analysis and Recognition (IJDAR)
Related papers
Find the Clue, Not the Scene: Rethinking Reasoning for Entity Recognition in Vision-Language Models
Shared title terminologycs.CVKyungmin Min, Soyeon Kim, Junseok Kim et al.
Quantifying Training Membership Information in the Hyperspherical Embedding Geometry of Face Recognition Models
Shared title terminologycs.CVÜnsal Öztürk, Sébastien Marcel
T3HG-Editor: Text-driven 3D Human Garment Editing with Body Priors Embedded in SMPL-X
Shared title terminologycs.CVShaoru Sun, Xingtao Wang, Zihan Ma et al.
Audio-Text Cross-Attention with Psycholinguistic Support Features for Ambivalence/Hesitancy Recognition
Shared title terminologycs.CVLuiz F. B. F. Martins, Rodrigo W. Pisaia, Matheus M. Girardi et al.
Vision Transformers and Convolutional Neural Networks for Land Use Scene Classification
Shared title terminologycs.CVArun D. Kulkarni
High-Fidelity Image Matting with Pixel-Space Diffusion Transformers
Shared title terminologycs.CVBaihan Yang, Xin Lin, Yufan Wei et al.