Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

DocSAM: Unified Document Image Segmentation via Query Decomposition and Heterogeneous Mixed Learning

About

Document image segmentation is crucial for document analysis and recognition but remains challenging due to the diversity of document formats and segmentation tasks. Existing methods often address these tasks separately, resulting in limited generalization and resource wastage. This paper introduces DocSAM, a transformer-based unified framework designed for various document image segmentation tasks, such as document layout analysis, multi-granularity text segmentation, and table structure recognition, by modelling these tasks as a combination of instance and semantic segmentation. Specifically, DocSAM employs Sentence-BERT to map category names from each dataset into semantic queries that match the dimensionality of instance queries. These two sets of queries interact through an attention mechanism and are cross-attended with image features to predict instance and semantic segmentation masks. Instance categories are predicted by computing the dot product between instance and semantic queries, followed by softmax normalization of scores. Consequently, DocSAM can be jointly trained on heterogeneous datasets, enhancing robustness and generalization while reducing computational and storage resources. Comprehensive evaluations show that DocSAM surpasses existing methods in accuracy, efficiency, and adaptability, highlighting its potential for advancing document image understanding and segmentation across various applications. Codes are available at https://github.com/xhli-git/DocSAM.

Xiao-Hui Li, Fei Yin, Cheng-Lin Liu• 2025

Related benchmarks

TaskDatasetResultRank
Scene Text DetectionTotalText (test)
Recall82.6
106
Scene Text DetectionCTW1500 (test)
TIOU-R88.1
23
Instance SegmentationM6Doc
mAP66.1
7
Object DetectionM6Doc
mAP66.3
7
Instance SegmentationSCUT-CAB Physical (test)
mAP81.1
6
Instance SegmentationSCUT-CAB Logical (test)
mAP57.5
6
Object DetectionSCUT-CAB Physical (test)
mAP77.4
6
Object DetectionSCUT-CAB Logical (test)
mAP0.548
6
Showing 8 of 8 rows

Other info

Code

Follow for update