Abstract
Text instance segmentation is a critical component for downstream applications such as scene text removal, font style transfer, and interactive image editing. However, the high cost of pixel-level annotations and the inherent complexity of text structures—characterized by diverse textures and non-convex contours—present significant challenges. This paper presents a novel weakly-supervised framework that performs instance-level segmentation using only text-level labels. By utilizing an iterative Text Adaptive Refinement (TAR) module and mask-augmented contrastive learning, the proposed method bridges the gap between text recognition and segmentation. Experimental results demonstrate that the framework outperforms existing weakly-supervised methods by significant margins, achieving over 82% of the performance of fully-supervised models.
Introduction
The ability to isolate text at the pixel level is essential for modern image manipulation. While semantic segmentation treats all text as a single class, instance-level segmentation distinguishes between individual words or lines, providing the granularity required for sophisticated editing tasks. Despite its utility, the field is hindered by the labor-intensive nature of creating pixel-perfect masks for training. Furthermore, generic weakly-supervised object segmentation methods often struggle with the intricate details and varied fonts of text.
To address these issues, this research proposes a framework that treats text recognition as a "seed" for segmentation. By leveraging the attention mechanisms already present in modern text recognizers, the model can identify rough text locations without explicit pixel-level supervision.
Methodology
The proposed architecture consists of three primary components: a text recognition module, a Text Adaptive Refinement (TAR) module, and a segmentation head, integrated within a contrastive learning framework.
Text Recognition and Initial Priors
The framework utilizes an attention-based recognizer (SAR) to predict text content. A key insight of this work is that the attention maps generated during the recognition process serve as a valuable location prior. Although these maps are often too coarse for direct segmentation, they provide a reliable starting point for identifying where text instances reside within an image.
Text Adaptive Refinement (TAR)
The TAR module is the central innovation of the framework, designed to transform "rough" attention maps into high-quality pseudo-labels through a two-stage iterative process:
- Feature-Guided Expansion: In the first stage, the module utilizes high-level backbone features to expand the initial attention map to the effective receptive field of the text. This ensures the entire instance is covered.
- RGB-Guided Boundary Refinement: The second stage uses the raw RGB image as a guide to snap the boundaries of the mask to the fine-grained edges of the characters. This stage is crucial for handling the complex contours of diverse fonts.
This refinement process is highly efficient, achieving a 30x speed-up compared to traditional methods like DenseCRF, with an inference time of only 2.6ms.
Mask-Augmented Contrastive Learning
To further enhance the model's robustness, the authors introduce a mask-augmented contrastive learning strategy. The generated segmentation masks are used to create augmented versions of the input images. By comparing the features of the original image with the segmented version, the model learns to focus on text-relevant features while ignoring complex backgrounds. This symbiotic relationship allows the segmentation masks to improve the accuracy of the recognizer itself.
Experimental Evaluation
The model was evaluated on five major public text segmentation benchmarks: ICDAR2013-FST, TextSeg, Total-Text, MLT-S, and COCO-TS. Unlike previous state-of-the-art methods, this model was trained using only text labels and bounding boxes, significantly reducing the annotation burden.
Results and Discussion
The proposed method demonstrates substantial improvements over existing weakly-supervised instance segmentation techniques. Specifically, it achieved a performance increase of 18.95% on ICDAR13-FST and 17.80% on TextSeg in terms of fIoU. Remarkably, the framework reaches approximately 82% of the performance of current state-of-the-art fully-supervised models.
Beyond segmentation accuracy, the mask-augmented contrastive learning strategy was shown to be "plug-and-play," improving the recognition accuracy of popular models like CRNN and ABINet by an average of 2%.
Limitations
Despite its success, the framework has limitations. The TAR module relies heavily on the initial alignment of the recognizer's attention. If the recognizer fails to locate the text during the early stages of training, the resulting pseudo-labels will be poor, necessitating a "warm-up" phase. Additionally, characters with "hollow" structures (e.g., 'O' or 'D') can occasionally pose challenges for the refinement process, though joint training helps mitigate this issue.
Conclusion
This research provides a robust solution for weakly-supervised text instance segmentation, effectively bridging the gap between recognition and pixel-level isolation. By utilizing iterative refinement and contrastive learning, the framework offers a high-performance, efficient alternative to labor-intensive fully-supervised methods. Future work may extend this instance-wise approach to video text segmentation and more complex document analysis tasks.
Summary updated