Joint Low-level and High-level Textual Representation Learning with Multiple Masking Strategies

Zhengmi Tang, Yuto Mitsui, Tomo Miyazaki, Shinichiro OmachiarXiv 2025

TL;DR

Standard Masked Autoencoders (MAEs) using random patch masking tend to focus on low-level pixel interpolation rather than high-level semantics. This paper introduces the Multi-Masking Strategy (MMS), which combines random patch, blockwise, and span masking to force models to learn both low-level text strokes and high-level linguistic context. When fine-tuned on real-world data, MMS achieves state-of-the-art performance across scene text recognition, segmentation, and super-resolution tasks.

What Problem Does This Paper Address?

Most scene text recognition (STR) models are trained on massive synthetic datasets because labeled, real-world text images are scarce. However, synthetic data cannot perfectly replicate real-world challenges like uneven lighting, complex layouts, blur, and occlusions. This creates a significant domain gap when deploying models in the wild.

To bridge this gap, researchers have turned to self-supervised learning (SSL) using unlabeled real images. Masked Image Modeling (MIM)—popularized by architectures like Masked Autoencoders (MAE)—is a dominant SSL approach. However, the authors point out a critical flaw when applying standard MAE to text: random patch masking mostly captures low-level textural features (like stroke edges). Because text is sequential and semantic, simply interpolating missing local pixels doesn't force the network to understand character-level context or linguistic relationships.

Methods

The authors propose the Multi-Masking Strategy (MMS) framework to jointly capture low-level visual features and high-level semantic context.

The MMS framework uses three parallel masking branches sharing a single ViT encoder.

Instead of relying on a single masking method, MMS processes an input image through three distinct masking branches:

  1. Random Patch Masking: Standard uniform patch removal. This excels at capturing low-level stroke and texture details.
  2. Blockwise Masking: Removes larger, variable-sized rectangular blocks, creating an intermediate challenge between local pixel interpolation and full character removal.
  3. Span Masking: Removes continuous horizontal columns of patches. This completely obliterates entire characters or multi-character sequences, forcing the model to rely on surrounding linguistic context to predict the missing text.
Visual comparison of Random, Block, and Span masking strategies on sample text images.

To keep the architecture computationally efficient, a single Vision Transformer (ViT) encoder shares weights across all three branches and processes only the unmasked (visible) patches. A lightweight decoder then attempts to reconstruct the original image. The system is optimized using a joint Mean Squared Error (MSE) loss calculated exclusively on the masked patches across all three branches.

Datasets

The model was pre-trained and evaluated using several large-scale datasets:

  • Unlabeled Real Data (URD): 15.77M unlabeled real-world images extracted from the Conceptual Caption Dataset via Microsoft Azure OCR.
  • Synthetic Text Data (STD): 17M synthetic images combining Synth90k and SynthText.
  • Annotated Real Data (ARD): 2.78M labeled real-world images from TextOCR and Open Images v5.
  • Evaluation Benchmarks: 11 standard scene text recognition benchmarks categorized into Regular (e.g., IIIT5K, SVT, IC13), Irregular (e.g., IC15, COCOText, Total-Text), and Occluded (HOST, WOST) datasets.
  • Downstream Tasks: TextSeg (10,421 training images for text segmentation) and TextZoom (17,367 image pairs for text super-resolution).

Key Insights and Ideas

  • Masking Shape Dictates Feature Level: Random patch masking acts like local pixel interpolation (similar to image blurring tools), which only teaches the model basic stroke boundaries. In contrast, span masking acts as a language-modeling challenge, forcing the network to learn character-level semantics and sequence context.
  • MMS Learns True Semantic Features: By visualizing the attention maps of the [CLS] token, the authors demonstrated that MMS explicitly focuses on text regions and character structures more cleanly than standard single-strategy MAEs.
Fig. 5. Visualization results of the attention map of the [CLS] token.
  • Robustness to Occlusion: Because the model is trained to predict entirely missing chunks of text (via span masking), it becomes inherently superior at recognizing heavily occluded real-world text.

Key Results

When fine-tuned on real-world data (ARD), MMS consistently outperformed existing state-of-the-art self-supervised methods like DiG and CCD:

  • Scene Text Recognition: MMS-ViT-Base achieved top-tier performance, outperforming the visual-only SOTA method (SIGA) by 2.26% on regular text benchmarks and 2.94% on irregular benchmarks, while using significantly fewer parameters (52M vs 113M).
  • Data Efficiency: In low-data regimes—fine-tuning with only 1% of labeled real data—MMS-ViT-Small outperformed the previous best method (CCD) by 6.6%, proving the robustness of its self-supervised representations.
  • Occluded Text Performance: MMS showed massive improvements on occluded text benchmarks, beating CCD by 10.5% on the Weakly Occluded (WOST) dataset and 7.4% on the Heavily Occluded (HOST) dataset.
  • Downstream Versatility: MMS achieved a 85.0% IoU on the TextSeg benchmark (outperforming Scratch and DiG) and set new state-of-the-art PSNR and SSIM scores on the TextZoom super-resolution benchmark.

Limitations and Future Work

While MMS scales effectively from smaller to larger models, the authors noticed that the performance gains slightly plateaued when moving from ViT-Small to ViT-Base. They attribute this to the fact that they used the exact same small reconstruction decoder across all model sizes, which likely created a bottleneck for the larger backbone.

Additionally, hyperparameters like the maximum span width are tied to the average character width of the pre-training dataset. The authors note that these parameters would need to be re-evaluated and tuned if applying MMS to vastly different text styles, such as handwritten documents.

Summary updated

BibTeX
@misc{tang2025joint,
  author = {Zhengmi Tang and Yuto Mitsui and Tomo Miyazaki and Shinichiro Omachi},
  title = {{Joint Low-level and High-level Textual Representation Learning with Multiple Masking Strategies}},
  year = {2025},
  eprint = {2505.06855},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.06855},
}
Figure