<p>Handwritten text line segmentation underpins document digitization, historical archive processing, intelligent annotation, and handwriting recognition. It remains challenging due to complex layouts, thin and discontinuous strokes, bleed-through, and merged or curved lines. We present TextSAM, a Segment Anything Model (SAM)–based framework adapted to handwritten text line segmentation. TextSAM integrates three components: (i) a Dual Path Adapter (DPAdapter) inserted into the ViT encoder to preserve global layout while enhancing local sensitivity; (ii) a Dynamic Feature Enhancement (DFE) branch with dynamic attention to strengthen strokes and textures; and (iii) a prompt-guided Cross-Branch Feature Fusion (CBF) module that aligns ViT global context and CNN local cues using spatial priors from Grounding DINO. We evaluate on three representative datasets– our self-constructed Dunhuang Handwritten Text Dataset (DHTD) and two public benchmarks, ICDAR2013-HSC and cBAD (ICDAR 2017 Competition on Baseline Detection). Experimental results demonstrate that TextSAM outperforms state-of-the-art methods across metrics, delivering superior segmentation performance and stronger generalization. These results substantiate the importance of explicit global–local decomposition and prompt-aware fusion when adapting foundation models to handwriting text.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Handwritten text line segmentation with TextSAM: An enhanced segment anything model via multi-module fusion

  • Yunjie Xiang,
  • Yukai Xian,
  • Xianmu Cairang,
  • Gesang Dorji,
  • Pubu Danzeng,
  • Qijun Zhao

摘要

Handwritten text line segmentation underpins document digitization, historical archive processing, intelligent annotation, and handwriting recognition. It remains challenging due to complex layouts, thin and discontinuous strokes, bleed-through, and merged or curved lines. We present TextSAM, a Segment Anything Model (SAM)–based framework adapted to handwritten text line segmentation. TextSAM integrates three components: (i) a Dual Path Adapter (DPAdapter) inserted into the ViT encoder to preserve global layout while enhancing local sensitivity; (ii) a Dynamic Feature Enhancement (DFE) branch with dynamic attention to strengthen strokes and textures; and (iii) a prompt-guided Cross-Branch Feature Fusion (CBF) module that aligns ViT global context and CNN local cues using spatial priors from Grounding DINO. We evaluate on three representative datasets– our self-constructed Dunhuang Handwritten Text Dataset (DHTD) and two public benchmarks, ICDAR2013-HSC and cBAD (ICDAR 2017 Competition on Baseline Detection). Experimental results demonstrate that TextSAM outperforms state-of-the-art methods across metrics, delivering superior segmentation performance and stronger generalization. These results substantiate the importance of explicit global–local decomposition and prompt-aware fusion when adapting foundation models to handwriting text.