Abstract
Text line detection is a key task in historical document analysis facing many challenges of arbitrary-shaped text lines, dense texts, and text lines with high aspect ratios, etc. In this paper, we propose a general framework for historical document text detection (SegHist), enabling existing segmentation-based text detection methods to effectively address the challenges, especially text lines with high aspect ratios. Integrating the SegHist framework with the commonly used method DB++, we develop DB-SegHist. This approach achieves SOTA on the CHDAC, MTHv2, and competitive results on HDRC datasets, with a significant improvement of 1.19% on the most challenging CHDAC dataset which features more text lines with high aspect ratios. Moreover, our method attains SOTA on rotated MTHv2 and rotated HDRC, demonstrating its rotational robustness.
Introduction
Detecting text in historical documents is significantly more complex than standard "scene text" detection (e.g., street signs or labels). Chinese historical manuscripts present a unique set of structural challenges, including extremely high aspect ratios (long, thin vertical columns), high text density with minimal margins, and complex layouts where the structural arrangement of columns provides vital context.
Existing segmentation-based models often struggle with these documents. A common technique in these models is "shrinking" text regions to create training targets (kernels). However, for the very thin lines typical of ancient manuscripts, standard shrinking often causes the kernel to fragment or disappear entirely, leading to detection failures. Furthermore, standard models often fail to accurately recover the exact boundaries of these long lines during post-processing. To address these issues, we introduce SegHist, a general framework designed to adapt segmentation-based text detection models for the specific demands of historical document analysis.
The SegHist Framework
SegHist is designed as a modular framework that can be integrated into existing segmentation-based detectors. To demonstrate its efficacy, we implemented DB-SegHist, based on the DBNet++ architecture. The framework introduces three primary innovations:
1. Text Kernel Stretching (TKS)
Traditional models apply uniform shrinkage to text regions in all directions. For vertical Chinese text, this often results in the loss of continuity. TKS addresses this by applying different shrinkage scales to the horizontal and vertical axes. By shrinking less along the y-axis for vertical text, TKS ensures the "kernel" remains a single, continuous line even when dealing with extreme aspect ratios.
2. Layout Enhanced Module (LEM)
Historical documents rely heavily on global columnar structures. While Transformers can capture global context, they are often computationally expensive. The LEM provides a lightweight alternative using Decoupled Pooling. By performing max pooling along the horizontal and vertical axes separately, the module captures global layout information and feeds it into a cross-attention mechanism, allowing the model to "understand" the page structure without excessive overhead.
3. Iterative Expansion Distance Post-processor (IEDP)
Standard models typically use a fixed "unclip ratio" to expand predicted kernels back to full text lines. This often lacks precision. IEDP replaces this with a hyperparameter-free iterative algorithm. It mathematically aligns the expansion process with the specific shrinkage used during training, resulting in significantly higher boundary precision and better Intersection over Union (IoU) scores.
Experimental Results
We evaluated SegHist across three major Chinese historical document benchmarks: CHDAC (dense and distorted lines), MTHv2 (Buddhist sutras), and HDRC (family records).
Performance and Precision
DB-SegHist achieved state-of-the-art (SOTA) performance on the CHDAC dataset with an F-measure of 97.11%, representing a 1.19% improvement over the previous leading method, HisDoc R-CNN. The impact of TKS was particularly evident in precision metrics; on the CHDAC dataset, TKS improved the F-measure at a strict 0.75 IoU threshold by 25.55% compared to the baseline, highlighting its ability to maintain line integrity.
Rotational Robustness
Historical documents are not always perfectly aligned. We tested SegHist on rotated versions of the MTHv2 and HDRC datasets. Unlike regression-based models that often fail when text is not axis-aligned, SegHist maintained high performance. For instance, on rotated MTHv2, SegHist achieved a 97.38% F-measure, vastly outperforming specialized models like Mask R-CNN, which dropped to 40.69%.
Discussion and Insights
Our analysis revealed a significant "Aspect Ratio Gap" between scene text and historical documents. While scene text aspect ratios rarely exceed 10, historical documents exhibit a bimodal distribution where many lines exceed 30. This data-driven insight justifies the need for specialized frameworks like SegHist. Furthermore, the success of the LEM demonstrates that global context can be captured efficiently through simple geometric pooling rather than dense self-attention.
Conclusion
SegHist provides a robust solution for the unique challenges of historical Chinese text detection. While the model excels at detecting main text bodies, future work will focus on improving the detection of small interlinear annotations or notes, which currently present a challenge due to their low aspect ratios and small font sizes. Additionally, we aim to explore how SegHist's high-precision detection can better support downstream Optical Character Recognition (OCR) tasks.
Summary updated