Abstract
Document Layout Analysis (DLA) is a critical component of intelligent document processing, yet high-performing models typically depend on massive human-annotated datasets or multi-modal self-supervised learning (SSL) that requires expensive and error-prone Optical Character Recognition (OCR). We propose SelfDocSeg, a vision-only SSL framework that eliminates the need for textual cues. SelfDocSeg utilizes classical image processing to generate "pseudo-layouts," providing a spatial prior that guides the model in learning document structure. By integrating a localization objective with representation learning, SelfDocSeg achieves state-of-the-art performance across multiple benchmarks, including DocLayNet and PRImA, often surpassing multi-modal models like LayoutLMv3.
Introduction
Identifying and categorizing document regions—such as text blocks, tables, and figures—is essential for downstream tasks like information extraction. While deep learning has significantly advanced DLA, the reliance on large-scale labeled data remains a bottleneck. Self-supervised learning offers a solution, but most current document SSL methods are multi-modal, requiring OCR to align visual features with text. This dependency makes pre-training slow and susceptible to OCR failures.
Purely vision-based SSL has historically struggled with DLA because standard contrastive methods excel at global object identification but fail to capture the precise spatial localization required for complex page layouts. SelfDocSeg addresses this by introducing a localization-aware pre-training objective.
Methodology
The SelfDocSeg framework operates in two primary stages: pseudo-layout generation and self-supervised pre-training.
Pseudo-Layout Generation
To provide the model with a structural prior without manual labels, the authors employ classical image processing. Document images undergo grayscale conversion, thresholding, and erosion. The erosion step is particularly vital as it merges individual characters and lines into cohesive "blobs," creating a rough physical map of the document's layout. These blobs serve as the targets for the model's localization tasks.
Architecture and Training
Inspired by the BYOL (Bootstrap Your Own Latent) framework, SelfDocSeg utilizes a dual-branch architecture consisting of an online network and a momentum network.
- Representation Learning: The model employs "Mask Pooling" to extract feature vectors for every individual blob identified in the pseudo-layout. The training objective minimizes the distance between these vectors across different augmented views of the same document, ensuring robust feature representations.
- Localization (Layout Prediction Module): To ensure the encoder understands spatial structure, an auxiliary module predicts the layout mask directly from the feature maps. This module is trained using Focal Loss against the generated pseudo-masks, forcing the model to learn where objects are located.
The pre-trained ResNet-50 backbone is subsequently used to initialize a Mask R-CNN for fine-tuning on specific DLA tasks.
Experimental Results
SelfDocSeg was evaluated on several diverse datasets, including DocLayNet, PubLayNet, PRImA, and Historic Japanese documents.
- State-of-the-Art Performance: On the DocLayNet dataset, SelfDocSeg achieved 74.3 mAP, outperforming both the vanilla BYOL baseline (63.5 mAP) and a fully supervised Mask R-CNN (72.4 mAP).
- Surpassing Multi-modal Models: Notably, on the PRImA dataset, SelfDocSeg reached 52.1 mAP, significantly exceeding LayoutLMv3 (40.3 mAP), despite the latter's use of both text and layout cues.
- Data Efficiency: The model demonstrated strong performance in low-data regimes, maintaining a 41.3 mAP on DocLayNet using only 10% of labeled data for fine-tuning. This highlights the effectiveness of the features learned during the unlabeled pre-training phase.
Conclusion
SelfDocSeg demonstrates that vision-only self-supervised learning is a powerful and efficient alternative for Document Layout Analysis. By substituting textual cues with a spatial prior derived from pseudo-layouts, the model achieves superior localization and representation. While the current reliance on classical thresholding for mask generation may face challenges with noisy or low-contrast documents, future work exploring Vision Transformers (ViTs) and more advanced pseudo-labeling techniques holds promise for further enhancing document understanding.
Summary updated