ConText: Driving In-context Learning for Text Removal and Segmentation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Fei, Zhang, Pei, Yang, Baosong, Huang, Fei, Wang, Yanfeng, Zhang, Ya
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912412971565056
author Zhang, Fei
Zhang, Pei
Yang, Baosong
Huang, Fei
Wang, Yanfeng
Zhang, Ya
author_facet Zhang, Fei
Zhang, Pei
Yang, Baosong
Huang, Fei
Wang, Yanfeng
Zhang, Ya
contents This paper presents the first study on adapting the visual in-context learning (V-ICL) paradigm to optical character recognition tasks, specifically focusing on text removal and segmentation. Most existing V-ICL generalists employ a reasoning-as-reconstruction approach: they turn to using a straightforward image-label compositor as the prompt and query input, and then masking the query label to generate the desired output. This direct prompt confines the model to a challenging single-step reasoning process. To address this, we propose a task-chaining compositor in the form of image-removal-segmentation, providing an enhanced prompt that elicits reasoning with enriched intermediates. Additionally, we introduce context-aware aggregation, integrating the chained prompt pattern into the latent query representation, thereby strengthening the model's in-context reasoning. We also consider the issue of visual heterogeneity, which complicates the selection of homogeneous demonstrations in text recognition. Accordingly, this is effectively addressed through a simple self-prompting strategy, preventing the model's in-context learnability from devolving into specialist-like, context-free inference. Collectively, these insights culminate in our ConText model, which achieves new state-of-the-art across both in- and out-of-domain benchmarks. The code is available at https://github.com/Ferenas/ConText.
format Preprint
id arxiv_https___arxiv_org_abs_2506_03799
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle ConText: Driving In-context Learning for Text Removal and Segmentation
Zhang, Fei
Zhang, Pei
Yang, Baosong
Huang, Fei
Wang, Yanfeng
Zhang, Ya
Computer Vision and Pattern Recognition
This paper presents the first study on adapting the visual in-context learning (V-ICL) paradigm to optical character recognition tasks, specifically focusing on text removal and segmentation. Most existing V-ICL generalists employ a reasoning-as-reconstruction approach: they turn to using a straightforward image-label compositor as the prompt and query input, and then masking the query label to generate the desired output. This direct prompt confines the model to a challenging single-step reasoning process. To address this, we propose a task-chaining compositor in the form of image-removal-segmentation, providing an enhanced prompt that elicits reasoning with enriched intermediates. Additionally, we introduce context-aware aggregation, integrating the chained prompt pattern into the latent query representation, thereby strengthening the model's in-context reasoning. We also consider the issue of visual heterogeneity, which complicates the selection of homogeneous demonstrations in text recognition. Accordingly, this is effectively addressed through a simple self-prompting strategy, preventing the model's in-context learnability from devolving into specialist-like, context-free inference. Collectively, these insights culminate in our ConText model, which achieves new state-of-the-art across both in- and out-of-domain benchmarks. The code is available at https://github.com/Ferenas/ConText.
title ConText: Driving In-context Learning for Text Removal and Segmentation
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2506.03799