Reading text in natural scenes is significantly more challenging than traditional OCR. While document scanners expect neat, horizontal rows of characters, real-world images often feature text wrapped around objects, tilted on signs, or distorted by perspective. Most standard recognition models struggle with these "irregular" shapes because they expect characters to be arranged along a straight line.
In this paper, researchers introduce RARE (Robust text recognizer with Automatic REctification), a deep neural network designed to automatically straighten distorted text into a standard horizontal format before recognition.
The RARE Architecture
The RARE model consists of two main components working in a unified framework: a Spatial Transformer Network (STN) and a Sequence Recognition Network (SRN).
- Spatial Transformer Network (STN): This component acts as the "rectifier." It uses a Thin-Plate-Spline (TPS) transformation to warp the input image. A localization network predicts a set of "fiducial points" (control points) along the text's boundaries, which the STN uses to map the distorted image into a rectified, rectangular format.
- Sequence Recognition Network (SRN): This is the "reader." It takes the rectified image and treats recognition as a sequence-to-sequence problem. It uses a Convolutional-Recurrent structure (CNN + Bidirectional LSTM) to extract visual features and an attention-based GRU decoder to generate the final character sequence.
Automatic Rectification via TPS
A key innovation in RARE is the use of Thin-Plate-Spline (TPS) transformation. Unlike simple affine transformations (like rotation or shearing), TPS is flexible enough to handle non-linear distortions, such as text on curved surfaces.
Remarkably, the entire model is end-to-end trainable. The STN does not require manual geometric annotations (like labeled curves). Instead, it learns to place fiducial points optimally by minimizing the final recognition error. If the rectification is poor, the SRN cannot read the text, and the resulting loss signal guides the STN to improve its warping.
Performance and Key Results
RARE was evaluated on several benchmarks, showing significant improvements particularly on irregular text:
- Irregular Text: On the CUTE80 dataset (focused on curved text), RARE achieved 59.2% accuracy, a substantial leap over previous state-of-the-art methods. On SVT-Perspective, it reached 71.8% accuracy in lexicon-free scenarios.
- General Performance: Even on standard horizontal text (e.g., IIIT 5K-Words, ICDAR), RARE remained highly competitive, proving that the rectification step does not degrade performance on "easy" samples.
Conclusion
RARE demonstrates that recognition loss is a sufficient proxy for geometric supervision. By integrating a flexible rectification module directly into the recognition pipeline, the model achieves robustness against a wide variety of scene text distortions. While it still faces challenges with extreme overlaps or very sharp angles, it represents a major step toward truly robust "OCR in the wild."
Summary updated