VIPTR: A Vision Permutable Extractor for Fast and Efficient Scene Text Recognition

Xianfu Cheng, Weixiao Zhou, Xiang Li, Xiaoming Chen, Jian Yang, Tongliang Li, Zhoujun Li · DOI

Scene Text Recognition (STR) models typically force a trade-off between high accuracy, often requiring heavy encoder-decoder architectures, and fast inference, which usually relies on lightweight CNNs. This paper introduces SVIPTR, a novel Vision Transformer-based extractor that utilizes permutable local and global attention mechanisms. SVIPTR achieves state-of-the-art accuracy while maintaining blazing-fast inference speeds and remaining completely insensitive to input image length.

What Problem Does This Paper Address?

Scene Text Recognition (STR)—the task of reading text in the wild, from street signs to document scans—is a foundational problem in computer vision. Historically, fast models like CRNNs struggled with complex, distorted text. To address this, the field moved toward heavy encoder-decoder models and autoregressive language models. While highly accurate, these solutions are computationally expensive and slow to run.

Comparison of STR architectures: (a) traditional sequential, (b) encoder-decoder, and (c) the proposed visual-semantic extractor approach.

Recently, Vision Transformers (ViTs) have been applied to STR to balance accuracy and efficiency, but they introduce new challenges:

  1. Fixed Input Lengths: Standard ViTs rely on absolute positional encodings and fixed-size attention masks. Processing unusually long text requires resizing and distorting the image, which significantly degrades performance.
  2. Inefficient Attention: Computing global self-attention across high-resolution text images is memory- and compute-intensive.

The authors developed SVIPTR as a single-encoder visual model that is lightweight, fast, accurate, and capable of reading text of any length without distortion.

Methods

The SVIPTR (Scene Text Recognition with Vision Permutable Extractor) architecture acts as a powerful visual-semantic feature extractor paired with a simple, fast Connectionist Temporal Classification (CTC) decoder.

Detailed architecture of SVIPTR, illustrating the multi-stage pipeline and the V1 (serial) vs V2 (parallel) vision permutation blocks.

Key innovations include:

  • Permutable Attention Blocks: SVIPTR mixes and matches different attention types. The authors designed two variants: SVIPTRv1 processes local and global attention in series, while SVIPTRv2 processes them in parallel and merges them to optimize for speed.
  • Efficient Local Attention: To capture character morphological features (like strokes), the model uses Cross-Shaped Windows (CSWin) and Manhattan Self-Attention (MaSA). These explicitly model local 2D features without the overhead of standard self-attention.
  • Sparse Global Attention: To capture context between characters, the model uses Overlapping Spatial Reduction Attention (OSRA). This reduces the number of tokens required for global attention, preserving edge information while saving compute.
  • Length-Insensitive Positional Encoding: By replacing absolute positional encoding with Locally-enhanced Positional Encoding (LePE) and Conditional Positional Embedding (CPE), the model dynamically adapts to any input image length.

Datasets and Evaluation

The models were evaluated on a standard suite of STR datasets:

  • English Training: Synthetic datasets MJSynth (MJ) and SynthText (ST), supplemented by real-world data from COCO-Text.
  • English Evaluation: Six standard benchmarks: ICDAR 2013 (IC13), Street View Text (SVT), IIIT5K, ICDAR 2015 (IC15), SVTP, and CUTE80.
  • Chinese Training/Evaluation: The Chinese Scene and Document Dataset (over 500k training images). Specific test sets with varying pixel lengths (up to 640+ pixels) were created to verify length-insensitivity.

Key Insights

  • Visual Context vs. Language Models: By combining local stroke-level attention with sparse global attention, SVIPTR captures sufficient visual and semantic context within the encoder to rival models using heavy autoregressive language decoders.
  • Parallel Processing for Speed: The SVIPTRv2 variant provides a massive speedup with negligible accuracy loss compared to sequential processing by calculating local and global attention in parallel.
  • Dynamic Embeddings: Swapping to dynamic positional embeddings (LePE) prevents the performance collapse ViTs typically experience when faced with long text strings.

Key Results

  • Efficiency: The tiny variant, SVIPTRv2-T, has only 5.1M parameters and achieves an inference speed of 3.3ms on a V100 GPU, with a competitive 90.3% average accuracy on English benchmarks.
  • Accuracy: The large variant, SVIPTRv1-L (39.5M parameters), achieves 92.9% average accuracy on English datasets and 72.6% on Chinese datasets, outperforming much larger models like TrOCR (558M parameters).
  • Robustness to Length: On extremely long document texts, where baseline models collapsed to 5.9% accuracy due to distortion, SVIPTR maintained 93.7% accuracy.

Limitations and Future Work

While SVIPTR demonstrates that a powerful encoder with a simple CTC decoder can achieve state-of-the-art results, a linear CTC decoder may lack the deep linguistic reasoning required for highly degraded or occluded text. Future work will explore integrating the SVIPTR extractor with more advanced, yet efficient, text decoders to further push performance boundaries.

Summary updated

BibTeX
@inproceedings{cheng2024viptr,
  author = {Xianfu Cheng and Weixiao Zhou and Xiang Li and Xiaoming Chen and Jian Yang and Tongliang Li and Zhoujun Li},
  title = {{VIPTR: A Vision Permutable Extractor for Fast and Efficient Scene Text Recognition}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2024},
  doi = {10.1145/3627673.3679618},
}
Figure