File size: 6,695 Bytes
4703981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e31de5
4703981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e31de5
 
 
4703981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
---
license: cdla-permissive-2.0
task_categories:
- object-detection
- document-layout-analysis
tags:
- document-ai
- layout-analysis
- object-detection
- doclaynet
- filtered
size_categories:
- 10K<n<100K
---

# DocLayNet 6-Class Filtered Dataset

## Dataset Description

This is a filtered version of the [DocLayNet dataset](https://huggingface.co/datasets/docling-project/DocLayNet) containing only 6 most relevant layout element classes for document layout analysis tasks.

### Original Dataset

DocLayNet is a human-annotated document layout segmentation dataset containing 80,863 pages from diverse sources with 11 distinct layout categories.

**Citation:**
```
@article{doclaynet2022,
  title = {DocLayNet: A Large Human-Annotated Dataset for Document-Layout Analysis},
  author = {Pfitzmann, Birgit and Auer, Christoph and Dolfi, Michele and Nassar, Ahmed S and Staar, Peter W J},
  year = {2022},
  doi = {10.1145/3534678.3539043},
}
```

### Filtering Methodology

**Classes Retained (6):**
1. **Text** - Body text paragraphs
2. **List-item** - List elements (bulleted, numbered)
3. **Section-header** - Section and subsection titles
4. **Picture** - Images, figures, diagrams
5. **Table** - Tabular data structures
6. **Caption** - Image and table captions

**Classes Removed (5):**
- Footnote
- Formula
- Page-footer
- Page-header
- Title

**Rationale:** Focus on the most common and semantically important layout elements for general document understanding tasks. The 6 retained classes represent 85.1% of all annotations in the original dataset.

## Dataset Statistics

### Split Distribution

| Split | Images | Annotations | Classes |
|-------|--------|-------------|---------|
| Train | 68,673 | 800,614 | 6 |
| Validation | 6,446 | 85,057 | 6 |
| Test | 4,952 | 56,483 | 6 |
| **Total** | **80,071** | **942,154** | **6** |

### Class Distribution (Training Set)

Based on 800,614 annotations:

| Class ID | Class Name | Count | Percentage |
|----------|------------|-------|------------|
| 0 | Caption | 19,218 | 2.4% |
| 1 | List-item | 161,818 | 20.2% |
| 2 | Picture | 39,667 | 5.0% |
| 3 | Section-header | 118,590 | 14.8% |
| 4 | Table | 30,070 | 3.8% |
| 5 | Text | 431,251 | 53.9% |

### Retention from Original Dataset

- **Images retained:** 99.0%
- **Annotations retained:** 85.1%

## Dataset Structure

### Format

Annotations are provided in **COCO JSON format**:

```
DocLayNet_6class/
├── coco/
│   ├── train.json      # Training annotations
│   ├── val.json        # Validation annotations
│   └── test.json       # Test annotations
└── README.md           # This file
```

Images are **NOT included** - use the original DocLayNet image files from:
- HuggingFace: `docling-project/DocLayNet`
- Official source: https://github.com/DS4SD/DocLayNet

### Loading the Dataset

#### Using HuggingFace Datasets

```python
from datasets import load_dataset

# Load the filtered annotations
dataset = load_dataset("kbang2021/doclaynet-6class")

# Access splits
train_data = dataset["train"]
val_data = dataset["validation"]
test_data = dataset["test"]
```

#### Manual Loading

```python
import json
from pathlib import Path

# Load COCO annotations
with open("coco/train.json") as f:
    train_coco = json.load(f)

# Categories
categories = train_coco["categories"]  # 6 classes with IDs 0-5

# Images
images = train_coco["images"]  # Image metadata

# Annotations
annotations = train_coco["annotations"]  # Bounding boxes
```

### Annotation Format

Each annotation follows the COCO format:

```json
{
  "id": 12345,
  "image_id": 123,
  "category_id": 5,  // 0-5 (remapped from original 11 classes)
  "bbox": [x_min, y_min, width, height],  // In pixels
  "area": 12345.67,
  "iscrowd": 0
}
```

### Category Mapping

Original DocLayNet → 6-Class Filtered:

| Original ID | Original Name | Filtered ID | Filtered Name | Status |
|-------------|---------------|-------------|---------------|--------|
| 0 | Caption | 0 | Caption | ✅ Kept |
| 1 | Footnote | - | - | ❌ Removed |
| 2 | Formula | - | - | ❌ Removed |
| 3 | List-item | 1 | List-item | ✅ Kept |
| 4 | Page-footer | - | - | ❌ Removed |
| 5 | Page-header | - | - | ❌ Removed |
| 6 | Picture | 2 | Picture | ✅ Kept |
| 7 | Section-header | 3 | Section-header | ✅ Kept |
| 8 | Table | 4 | Table | ✅ Kept |
| 9 | Text | 5 | Text | ✅ Kept |
| 10 | Title | - | - | ❌ Removed |

## Use Cases

This filtered dataset is ideal for:

- **Document layout analysis** with focus on content structure
- **Information extraction** from documents (text, tables, figures)
- **Object detection** model training for document AI
- **Multi-scale document understanding** tasks
- **Transfer learning** from general object detection to document analysis

## Limitations

1. **Images not included**: You must obtain images from the original DocLayNet dataset
2. **Class imbalance**: Text class dominates (53.9% of annotations)
3. **Domain specific**: Focused on document layout, may not generalize to other domains
4. **Annotation quality**: Inherits any annotation errors from original DocLayNet

## Ethical Considerations

- Dataset maintains the original DocLayNet license (CDLA-Permissive-2.0)
- No personal or sensitive information in annotations
- Source documents from diverse domains (financial, scientific, patents, manuals)
- Should not be used to discriminate based on document type or origin

## Citation

If you use this filtered dataset, please cite both:

1. **Original DocLayNet paper:**
```bibtex
@article{doclaynet2022,
  title = {DocLayNet: A Large Human-Annotated Dataset for Document-Layout Analysis},
  author = {Pfitzmann, Birgit and Auer, Christoph and Dolfi, Michele and Nassar, Ahmed S and Staar, Peter W J},
  year = {2022},
  doi = {10.1145/3534678.3539043},
}
```

2. **This filtered version:**
```bibtex
@misc{doclaynet6class2024,
  title = {DocLayNet 6-Class: Filtered Document Layout Analysis Dataset},
  author = {[Keng Boon, Ang]},
  year = {2026},
  howpublished = {\url{https://huggingface.co/datasets/kbang2021/doclaynet-6class}},
  note = {Filtered subset of DocLayNet containing 6 primary layout element classes}
}
```

## License

This filtered dataset maintains the original license:

**CDLA-Permissive-2.0** (Community Data License Agreement – Permissive – Version 2.0)

See: https://cdla.dev/permissive-2-0/

## Acknowledgments

- Original DocLayNet dataset: IBM Research
- Built using the layout-for-tools evaluation framework

## Contact

For questions or issues with this filtered dataset, please open an issue on the repository.

For questions about the original DocLayNet dataset, see: https://github.com/DS4SD/DocLayNet