TL;DR
TPFNet is a novel, end-to-end text removal network that splits the task into low-resolution feature synthesis and high-resolution image generation. By combining a Pyramidal Vision Transformer (PVT) with a multi-headed decoder and a segmentation-conditional adversarial loss, it achieves state-of-the-art text erasure and image in-painting performance without destroying background details.
What Problem Does This Paper Address?
Text removal (or text erasure) from images is a crucial task for privacy preservation (e.g., redacting sensitive information like phone numbers or addresses from street views) and image editing (e.g., translating text on signs).
Unlike standard image in-painting where the user manually provides a mask of the region to fill, automatic text removal requires the network to both locate the text and erase it seamlessly. This is highly challenging because text lacks clear border lines, varies wildly in font, size, color, and orientation, and often blends into complex background textures. Existing methods frequently suffer from blurred outputs, fail to completely erase text strokes, or accidentally delete text-like background objects such as logos and symbols.
Methods
TPFNet introduces a progressive, two-part architecture trained in an end-to-end framework:
- Part 1: Feature Synthesis (Low-Resolution): Because it is simpler to eliminate noise and text features from lower-dimensional spaces, the input $512 \times 512$ image is first downsampled to $256 \times 256$. A Pyramidal Vision Transformer (PVT) serves as the encoder to capture multi-scale feature maps. The decoder features a novel multi-headed structure with three distinct branches that simultaneously predict:
- A binary segmentation map (to precisely locate text).
- A high-pass filtered image (using a Laplacian filter to capture structural edges).
-
A low-resolution text-free image. An attention block fuses the knowledge from the segmentation and edge branches back into the main text-free generation branch.
-
Part 2: Image Generation (High-Resolution): This stage takes the synthesized features from Part 1 and uses transpose convolutions alongside Conv blocks with Squeeze-and-Excitation (SE) blocks to upscale the image back to a clean, high-quality $512 \times 512$ text-free output.
Novel Loss Function: Standard conditional GANs condition their discriminator on the original input image. TPFNet instead conditions its PatchGAN discriminator on the predicted segmentation map. This forces the adversarial loss to focus strictly on the regions where text was removed, ensuring realistic texture generation.
Datasets
The authors evaluated TPFNet on three open-source datasets:
- Oxford Synthetic Real Scene Text Detection Dataset: Approximately 800,000 synthetic images combining natural backgrounds with diverse text properties. Used primarily for pre-training.
- SCUT Synthetic Text Removal Dataset (SCUT-8K): Contains 8,000 training and 800 test images.
- SCUT-EnsText Dataset: A real-world dataset containing 3,562 images with highly diverse, naturally occurring text.
Key Insights and Ideas
- Resolution-Staged In-painting: Operating on a lower resolution ($256 \times 256$) first allows the network to focus on the semantic task of text erasure without getting bogged down by high-frequency texture details. Part 2 can then focus purely on super-resolution and texture reconstruction.
- Multi-Task Synergy: Forcing the decoder to learn text segmentation and edge detection simultaneously provides powerful structural priors. The high-pass filter branch acts as a guide to preserve background geometry, preventing the "blurry smudge" effect common in older models.
- Targeted Discriminator Conditioning: By conditioning the discriminator on the segmentation mask rather than the full input image, the network receives much sharper gradient signals regarding how well the text regions specifically have been inpainted.
Key Results
TPFNet significantly outperformed previous state-of-the-art models (such as EnsNet and EraseNet) across nearly all quantitative metrics:
- SCUT-EnsText Benchmarks: TPFNet achieved a Peak Signal-to-Noise Ratio (PSNR) of 39.00 and an SSIM of 0.9730, drastically beating EraseNet (PSNR: 32.29, SSIM: 0.9542).
- Erasure Cleanliness: To measure how thoroughly text was removed, the authors ran an independent text detector on the output images. A lower detection precision means cleaner erasure. TPFNet dropped text detection precision to 21.12% on SCUT-EnsText, compared to EraseNet's 53.20%.
- Qualitative Performance: Visually, TPFNet successfully differentiates between actual text and text-like background elements. For instance, it leaves warning symbols and logos intact while cleanly wiping out adjacent text characters.
Limitations and Future Work
Despite its strong performance, the authors note a few remaining challenges:
- Extreme Angles & Overlapping Text: TPFNet still struggles to perfectly segment and erase heavily overlapping characters or text captured at highly oblique camera angles.
- Multilingual Generalization: The model is bound by its training data languages. The authors plan to explore unsupervised learning approaches in the future to enable the network to remove text in languages it has never seen during training.
Summary updated