Document border recognition and segmentation for complex scenes: co-optimization of data enhancement and geometric adaptation

Yiying Tao, Tianhui Meng · 2025

Document recognition and segmentation are important foundations for document-based processing tasks. Recent research reveals that it is challenging due to the lack of publicly available datasets, the complexity of the background, and perspective correction of the segmentation results. To address these challenges, we propose a multi-strategy augmented dataset based on real documents with a negative-sample background, combined with background replacement, noise injection, and rotation techniques to enhance the model generalization ability and suppress overfitting. By improving the mask generation mechanism of the YOLOv5s-seg model to realize the pixel-level text area segmentation, supplemented by the adaptive rectangle fitting algorithm to dynamically adjust the coordinates of the document vertices, the proposed method effectively solves the problem of complex text boundary and perspective distortion. Experimental results show that the proposed method achieves an overall accuracy of 92% in multiple scenarios, such as A4 documents and book covers, and the boundary localization accuracy is improved by 12.7% compared with that of traditional computer vision methods, which significantly enhances the robustness of document localization under the complex occlusion and background interference.

Read the paper · More papers on PaperTik