Exploring Stroke-Level Modifications for Scene Text Editing

Yadong Qu, Qingfeng Tan, Hongtao Xie, Jianjun Xu, YuXin Wang, Yongdong Zhang

Scene Text Editing (STE) is a specialized computer vision task that involves replacing text within an image—such as a street sign, product label, or advertisement—while seamlessly preserving the original font style, color, and background texture. Despite its potential, current STE models often struggle with two primary issues: "ghosting" artifacts caused by poor decoupling of text and background, and a significant performance drop when moving from clean synthetic training data to complex real-world environments.

To address these challenges, researchers have introduced MOSTEL (MOdifying Scene Text image at strokE Level), a framework that shifts the focus from whole-image pixel manipulation to explicit stroke-level modifications.

The MOSTEL Framework

MOSTEL moves away from the traditional "all-at-once" approach of existing models. Instead, it employs a modular architecture designed to handle background preservation and text generation as distinct, explicit processes.

Figure 4: The detailed architecture of MOSTEL, highlighting the Background Reconstruction Module (BRM) and the Text Modification Module (TMM) with explicit stroke-level guidance.

Core Components:

  • Stroke-Level Modification (SLM): Rather than predicting raw pixels, the model generates "stroke guidance maps." These maps act as a high-precision stencil, defining exactly where new text strokes should be placed on the background. This prevents the blurry "blobby" characters common in previous methods.
  • Background Reconstruction Module (BRM): This module follows an "erase-and-write" paradigm, first learning to remove original text to create a clean, texture-consistent background.
  • Text Modification Module (TMM): The TMM takes the target text and uses a Thin Plate Spline (TPS) module to match the original text's orientation and geometry before applying the source style.

Bridging the Domain Gap

A major hurdle in STE is the lack of paired ground-truth data for real-world images. MOSTEL overcomes this through Semi-supervised Hybrid Learning (SHL). By training on both labeled synthetic data and unlabeled real-world images, the model learns to generalize better.

To prevent the model from simply copying inputs during real-world training (the "Identity Mapping" trap), the authors implemented Style Augmentation. By randomly scrambling styles during training, the network is forced to learn the underlying rules of text rendering rather than relying on simple pixel replication. Furthermore, by blocking gradient flow between the background and text modules, the researchers ensured that background features do not "leak" into the text generation process, resulting in much sharper character edges.

Performance and Results

MOSTEL demonstrates a significant leap in both legibility and visual fidelity compared to previous state-of-the-art methods like SRNet and SwapText.

Figure 3: (a) A conceptual comparison between previous methods and the MOSTEL approach. (b) Qualitative results showing MOSTEL's superior ability to handle complex fonts and maintain background integrity.

Key Metrics:

  • Legibility: On the real-world Tamper-Scene dataset, MOSTEL achieved a 76.79% Sequence Accuracy (via pre-trained OCR), vastly outperforming SwapText’s 60.63%.
  • Image Quality: The framework achieved the lowest Mean Squared Error (MSE) and Fréchet Inception Distance (FID) across benchmarks, indicating that the edited images are both more accurate to the target and more realistic to the human eye.

Conclusion and Future Work

By prioritizing explicit stroke-level guidance over implicit pixel learning, MOSTEL effectively solves the common issues of text blurring and background corruption in scene text editing. While the current system requires pre-cropped text images, future iterations could integrate MOSTEL with scene text detection networks to create a fully automated, end-to-end "search and replace" tool for complex visual environments.

Summary updated

BibTeX
@inproceedings{qu2023exploring,
  author = {Yadong Qu and Qingfeng Tan and Hongtao Xie and Jianjun Xu and YuXin Wang and Yongdong Zhang},
  title = {{Exploring Stroke-Level Modifications for Scene Text Editing}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i2.25305},
}
Figure