SimAN: Exploring Self-Supervised Representation Learning of Scene Text via Similarity-Aware Normalization

Canjie Luo, Lianwen Jin, Jingdong Chen

Abstract

Scene Text Recognition (STR) typically requires massive amounts of labeled data to account for diverse environmental conditions and font styles. While self-supervised learning (SSL) has proven effective in general computer vision, standard contrastive approaches often fail to capture the fine-grained, sequential nature of text. We introduce SimAN, a generative SSL framework that leverages the "style consistency" inherent in scene text. By employing a Similarity-Aware Normalization module, the model learns to reconstruct corrupted text patches by borrowing style statistics from neighboring regions. SimAN significantly outperforms previous contrastive methods in representation quality and enables advanced applications like text editing and font interpolation.

Introduction

Reading text in natural scenes is a fundamental task in computer vision, yet it remains "data-hungry." Supervised models rely on millions of manually annotated images to generalize across various backgrounds and lighting. Traditional SSL methods, such as SimCLR, treat an entire image as a single entity for contrastive learning. However, text is inherently sequential and fine-grained. Applying holistic contrastive methods often leads to "representation deterioration" because they ignore local properties like consistent stroke widths and uniform colors within a single text line.

Comparison between (a) traditional contrastive representation learning and (b) the proposed generative representation learning approach.

To address this, SimAN pivots from contrastive learning to a generative framework that emphasizes the inductive bias of style consistency: neighboring characters in a word usually share the same font, color, and texture.

Methodology: Similarity-Aware Normalization

The core of the approach is the Similarity-Aware Normalization (SimAN) module, which facilitates the learning of decoupled content and style representations.

The Training Pipeline

The training process involves several key steps designed to force the model to understand the relationship between different parts of a text image:

  1. Sampling and Augmentation: Two neighboring patches are cropped from an unlabeled text line: a "style" patch ($I_s$) and a "content" patch ($I_c$). The content patch is then heavily corrupted (e.g., blurred or noisy) to create $I_{aug}$.
  2. Feature Decoupling: Using Instance Normalization (IN), the encoder strips the style (mean and variance) from the features of both patches, isolating the underlying character shapes (content).
  3. Similarity-Aware Alignment: The SimAN module calculates the similarity between the content of the corrupted patch and the style patch. It then "borrows" the appropriate style statistics from the neighbor to reconstruct the original, uncorrupted image.
  4. Optimization: The system is trained using a combination of a standard $L_2$ reconstruction loss and an adversarial loss to ensure high-fidelity image recovery.
Detailed architecture of the SimAN framework, illustrating the flow from input patches through the encoder, the Similarity-Aware Normalization module, and the final decoder for image recovery.

Crucially, the authors avoid spatial augmentations like stretching, which would disrupt the style consistency (such as stroke width) that the model relies on for learning.

Experiments and Key Insights

The model was evaluated using a new unlabeled dataset, Real-300K, alongside the standard SynthText dataset. Performance was measured across multiple benchmarks including IIIT5K, IC13, and SVT.

Superior Representations

In linear probe evaluations, where a classifier is trained on top of frozen features, SimAN significantly outperformed SeqCLR, the previous state-of-the-art contrastive method for text. This suggests that reconstructing pixels forces the encoder to learn much finer details—such as the specific curvature of characters—compared to simply separating embeddings in a latent space.

Downstream Impact

  • Semi-Supervised Learning: When fine-tuned with only 10,000 labeled samples, SimAN improved recognition accuracy by over 5% compared to a purely supervised baseline.
  • Creative Applications: Because the model learns to decouple content from style, it can perform complex image manipulations. This includes text editing (changing words in a real image while preserving font/background) and font interpolation (smoothly transitioning styles between different fonts).

Conclusion

SimAN demonstrates that generative pre-training, guided by the inductive bias of style consistency, is highly effective for scene text representation learning. By focusing on reconstruction rather than contrast, the model captures the fine-grained details necessary for robust recognition and creative editing. While currently optimized for scene text, future work may explore hybrid approaches that combine generative texture learning with contrastive structural learning to better handle the complexities of handwritten text.

Summary updated

BibTeX
@inproceedings{luo2022siman,
  author = {Canjie Luo and Lianwen Jin and Jingdong Chen},
  title = {{SimAN: Exploring Self-Supervised Representation Learning of Scene Text via Similarity-Aware Normalization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure