Scene Text Eraser

Toshiki Nakamura, Anna Zhu, Keiji Yanai, Seiichi UchidaarXiv 2017

TL;DR

This paper introduces a "Scene Text Eraser" designed to protect privacy by automatically removing text from natural scene images using an inpainting deep neural network. By framing text erasure as an image transformation task with skip-connected convolution-deconvolution layers, the method naturally blends text regions into the surrounding background, drastically reducing the detectability of private information.

What Problem Does This Paper Address?

Natural scene images uploaded to the internet frequently contain sensitive personal data, such as phone numbers, home addresses, and license plates. If left exposed, this text can be automatically scraped by malicious actors or machines.

Traditional image obfuscation techniques, like Gaussian blurring, are easily bypassed or only work on specific text shapes and fonts. Real-world scene text is highly diverse in font, color, orientation, and size, and it is often embedded in complex, cluttered backgrounds. The authors tackle the challenge of cleanly and naturally erasing this text without distorting the non-text background regions.

Methods

The authors treat text erasing as an image-to-image translation problem, transforming a source image containing text into a target image where the text is replaced by background pixels.

  • Network Architecture: The core model is a feedforward Deep Neural Network (DNN) consisting of four convolutional layers followed by four symmetric deconvolutional layers. To prevent the loss of fine-grained spatial details during downsampling, the authors introduce skip connections that element-wise sum the feature maps from the convolutional layers directly into their corresponding deconvolutional layers.
  • Sliding Window Processing: The system processes images using a sliding window approach with $64 \times 64$ pixel patches and a 32-pixel stride. To avoid edge artifacts in overlapping regions, only the center $32 \times 32$ pixels of each output patch are retained as valid data.
Fig. 2. The proposed method for scene text erasing.
  • Automatic Ground Truth Generation: To train the network without manual pixel-level painting, the authors leverage existing datasets with character bounding boxes. They apply a dilation operator (1x or 3x) to ensure the text boundaries are fully covered, and then use standard image inpainting to automatically generate clean, text-free target images for training.
Fig. 3. The architecture of DNN in our proposed method.

Datasets

  • Flickr Dataset: A dataset containing more than 3,000 scene images used to provide diverse backgrounds and text styles for training.
  • ICDAR 2013: A standard benchmark dataset for scene text. The training set (229 images) was used to train the model, and the test set was used to evaluate the text-erasing performance against state-of-the-art text detectors.

Key Insights and Ideas

  • Inversion of Evaluation: Instead of evaluating the model using standard image reconstruction metrics (like PSNR), the authors evaluate it by running a state-of-the-art text detector on the output. A successful erasure is defined by a catastrophic drop in the detector's performance.
  • The Power of Dilation: Simply inpainting the exact character pixels leaves sharp edge artifacts that text detectors can still exploit. Applying a dilation step (especially 3x) before generating the ground truth forces the network to smooth out boundaries, resulting in much more natural-looking and harder-to-detect erasures.
  • Skip Connections for Inpainting: Pure encoder-decoder networks lose high-resolution background textures. Summing early convolutional features into late deconvolutional features ensures the background remains sharp and unaltered.

Key Results

When evaluated using a modified Single Shot MultiBox Detector (SSD) text detection method on the ICDAR 2013 dataset, the results showed a massive drop in text detectability:

  • F-Score Drop: On original ICDAR 2013 images, the text detector achieved an F-score of 83.13%. After applying the Scene Text Eraser trained with 3x dilation, the detector's F-score plummeted to 14.46%.
  • Recall Reduction: The recall rate dropped from 82.56% to just 8.35%, proving that the vast majority of text regions were rendered completely undetectable to machines.

Qualitative results demonstrate that text is seamlessly replaced by background textures, making the edits look smooth and natural to the human eye.

Qualitative comparison of text erasure results across different training configurations

Limitations and Future Work

  • Scale Limitations: Because the network relies on a fixed $64 \times 64$ sliding window, it struggles to erase text characters that are significantly larger than the window size. In these cases, the network perceives the interior of a large character stroke as background and leaves it untouched.
  • Future Directions: The authors plan to transition from a patch-based sliding window approach to a true end-to-end, full-image architecture capable of handling multi-scale text natively. They also aim to develop specialized evaluation metrics tailored specifically for text erasure quality rather than relying solely on text detection degradation.

Summary updated

BibTeX
@misc{nakamura2017scene,
  author = {Toshiki Nakamura and Anna Zhu and Keiji Yanai and Seiichi Uchida},
  title = {{Scene Text Eraser}},
  year = {2017},
  eprint = {1705.02772},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1705.02772},
}

Loading related content...

Figure