TL;DR
ViTEraser is a novel, one-stage scene text removal (STR) framework that replaces traditional convolutional architectures with Vision Transformers (ViTs). By leveraging a new pretraining strategy called SegMIM—which combines text segmentation with masked image modeling—the model achieves state-of-the-art performance while simplifying the complex multi-stage pipelines common in current literature.
What Problem Does This Paper Address?
Scene Text Removal (STR) involves erasing text from natural images and realistically inpainting the background. This is vital for privacy (e.g., blurring license plates) and image editing.
Historically, STR has moved from simple one-stage networks to complex two-stage or multi-step paradigms. These newer methods often require explicit text masks and separate localization modules, which increases system complexity, slows down inference, and allows errors in text detection to ruin the final inpainting. Furthermore, most existing methods rely on Convolutional Neural Networks (CNNs), which struggle to capture the long-range global context necessary to reconstruct consistent textures behind large or complex text strings.
Methods
The authors introduce ViTEraser, a streamlined encoder-decoder architecture built entirely on Vision Transformers.
1. The ViTEraser Architecture
Unlike CNN-based models, ViTEraser uses hierarchical ViT blocks (supporting variants like Swin and PVT) to process images.
- Encoder: Hierarchically maps the input image into a hidden space using ViT blocks and patch embedding layers.
- Decoder: Gradually upsamples these features back to the original resolution using ViT blocks and patch splitting layers.
- Lateral Connections: These are used between the encoder and decoder to preserve fine-grained structural details from the original image.
2. SegMIM Pretraining
To overcome the scarcity of high-quality STR training data, the authors propose SegMIM (Segmentation-based Masked Image Modeling). This self-supervised pretraining task uses large-scale scene text detection datasets.
- Encoder Task: Predicts text box segmentation (learning where the text is).
- Decoder Task: Reconstructs randomly masked image patches (learning how to fill in backgrounds).
This dual-task approach forces the model to master both text localization and background recovery before it ever sees a specific STR training sample.
Datasets
The model was evaluated on standard STR benchmarks:
- SCUT-EnsText: A real-world dataset with 2,749 training and 813 testing samples.
- SCUT-Syn: A synthetic dataset containing 8,000 training and 800 testing samples.
For the SegMIM pretraining, the authors aggregated several massive text detection datasets (including ICDAR, LSVT, and TextOCR), totaling over 88,000 valid samples.
Key Insights and Ideas
- Global Context is King: ViTs are inherently better than CNNs for STR because they can "see" the entire image at once. This allows the model to borrow textures from far-away background regions to fill in the gaps left by erased text.
- Implicit Integration: By using a high-capacity ViT, the model can implicitly handle text localization and inpainting in a single pass, removing the need for fragile, explicit text masks.
- Pretraining Synergy: The SegMIM strategy is particularly clever because its two sub-tasks perfectly mirror the two functional requirements of a text eraser: finding the text and imagining the background.
Key Results
ViTEraser achieved new state-of-the-art (SOTA) results across multiple metrics:
- Image Quality: On SCUT-EnsText, it boosted PSNR from the previous best of 35.72 dB to 37.11 dB.
- Erasure Exhaustivity: Using a pretrained text detector (CRAFT) to check for leftover text, ViTEraser reached a milestone where both recall and f-measure dropped below 1%, indicating nearly perfect erasure.
- Generalization: The model also proved effective for Tampered Scene Text Detection, outperforming existing methods on the Tampered-IC13 dataset.
Limitations and Future Work
Despite its performance, ViTEraser has two main drawbacks:
- Model Size: The ViT-based architecture is significantly larger than many CNN counterparts, with the "Base" version reaching 192M parameters.
- Inference Speed: While faster than some multi-stage methods, it runs at 15-24 FPS, which may be too slow for some real-time mobile applications.
The authors suggest that future work should focus on integrating more lightweight and efficient Transformer architectures to bring these SOTA capabilities to edge devices.
Summary updated