kbang2021 commited on
Commit
4703981
·
verified ·
1 Parent(s): daf268b

Upload DocLayNet 6-class filtered dataset

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -60
  2. README.md +253 -0
  3. coco/test.json +3 -0
  4. coco/train.json +3 -0
  5. coco/val.json +3 -0
  6. dataset_infos.json +49 -0
.gitattributes CHANGED
@@ -1,60 +1 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.avro filter=lfs diff=lfs merge=lfs -text
4
- *.bin filter=lfs diff=lfs merge=lfs -text
5
- *.bz2 filter=lfs diff=lfs merge=lfs -text
6
- *.ckpt filter=lfs diff=lfs merge=lfs -text
7
- *.ftz filter=lfs diff=lfs merge=lfs -text
8
- *.gz filter=lfs diff=lfs merge=lfs -text
9
- *.h5 filter=lfs diff=lfs merge=lfs -text
10
- *.joblib filter=lfs diff=lfs merge=lfs -text
11
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
- *.lz4 filter=lfs diff=lfs merge=lfs -text
13
- *.mds filter=lfs diff=lfs merge=lfs -text
14
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
- *.model filter=lfs diff=lfs merge=lfs -text
16
- *.msgpack filter=lfs diff=lfs merge=lfs -text
17
- *.npy filter=lfs diff=lfs merge=lfs -text
18
- *.npz filter=lfs diff=lfs merge=lfs -text
19
- *.onnx filter=lfs diff=lfs merge=lfs -text
20
- *.ot filter=lfs diff=lfs merge=lfs -text
21
- *.parquet filter=lfs diff=lfs merge=lfs -text
22
- *.pb filter=lfs diff=lfs merge=lfs -text
23
- *.pickle filter=lfs diff=lfs merge=lfs -text
24
- *.pkl filter=lfs diff=lfs merge=lfs -text
25
- *.pt filter=lfs diff=lfs merge=lfs -text
26
- *.pth filter=lfs diff=lfs merge=lfs -text
27
- *.rar filter=lfs diff=lfs merge=lfs -text
28
- *.safetensors filter=lfs diff=lfs merge=lfs -text
29
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
- *.tar.* filter=lfs diff=lfs merge=lfs -text
31
- *.tar filter=lfs diff=lfs merge=lfs -text
32
- *.tflite filter=lfs diff=lfs merge=lfs -text
33
- *.tgz filter=lfs diff=lfs merge=lfs -text
34
- *.wasm filter=lfs diff=lfs merge=lfs -text
35
- *.xz filter=lfs diff=lfs merge=lfs -text
36
- *.zip filter=lfs diff=lfs merge=lfs -text
37
- *.zst filter=lfs diff=lfs merge=lfs -text
38
- *tfevents* filter=lfs diff=lfs merge=lfs -text
39
- # Audio files - uncompressed
40
- *.pcm filter=lfs diff=lfs merge=lfs -text
41
- *.sam filter=lfs diff=lfs merge=lfs -text
42
- *.raw filter=lfs diff=lfs merge=lfs -text
43
- # Audio files - compressed
44
- *.aac filter=lfs diff=lfs merge=lfs -text
45
- *.flac filter=lfs diff=lfs merge=lfs -text
46
- *.mp3 filter=lfs diff=lfs merge=lfs -text
47
- *.ogg filter=lfs diff=lfs merge=lfs -text
48
- *.wav filter=lfs diff=lfs merge=lfs -text
49
- # Image files - uncompressed
50
- *.bmp filter=lfs diff=lfs merge=lfs -text
51
- *.gif filter=lfs diff=lfs merge=lfs -text
52
- *.png filter=lfs diff=lfs merge=lfs -text
53
- *.tiff filter=lfs diff=lfs merge=lfs -text
54
- # Image files - compressed
55
- *.jpg filter=lfs diff=lfs merge=lfs -text
56
- *.jpeg filter=lfs diff=lfs merge=lfs -text
57
- *.webp filter=lfs diff=lfs merge=lfs -text
58
- # Video files - compressed
59
- *.mp4 filter=lfs diff=lfs merge=lfs -text
60
- *.webm filter=lfs diff=lfs merge=lfs -text
 
1
+ *.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cdla-permissive-2.0
3
+ task_categories:
4
+ - object-detection
5
+ - document-layout-analysis
6
+ tags:
7
+ - document-ai
8
+ - layout-analysis
9
+ - object-detection
10
+ - doclaynet
11
+ - filtered
12
+ size_categories:
13
+ - 10K<n<100K
14
+ ---
15
+
16
+ # DocLayNet 6-Class Filtered Dataset
17
+
18
+ ## Dataset Description
19
+
20
+ 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.
21
+
22
+ ### Original Dataset
23
+
24
+ DocLayNet is a human-annotated document layout segmentation dataset containing 80,863 pages from diverse sources with 11 distinct layout categories.
25
+
26
+ **Citation:**
27
+ ```
28
+ @article{doclaynet2022,
29
+ title = {DocLayNet: A Large Human-Annotated Dataset for Document-Layout Analysis},
30
+ author = {Pfitzmann, Birgit and Auer, Christoph and Dolfi, Michele and Nassar, Ahmed S and Staar, Peter W J},
31
+ year = {2022},
32
+ doi = {10.1145/3534678.3539043},
33
+ }
34
+ ```
35
+
36
+ ### Filtering Methodology
37
+
38
+ **Classes Retained (6):**
39
+ 1. **Text** - Body text paragraphs
40
+ 2. **List-item** - List elements (bulleted, numbered)
41
+ 3. **Section-header** - Section and subsection titles
42
+ 4. **Picture** - Images, figures, diagrams
43
+ 5. **Table** - Tabular data structures
44
+ 6. **Caption** - Image and table captions
45
+
46
+ **Classes Removed (5):**
47
+ - Footnote
48
+ - Formula
49
+ - Page-footer
50
+ - Page-header
51
+ - Title
52
+
53
+ **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.
54
+
55
+ ## Dataset Statistics
56
+
57
+ ### Split Distribution
58
+
59
+ | Split | Images | Annotations | Classes |
60
+ |-------|--------|-------------|---------|
61
+ | Train | 68,673 | 800,614 | 6 |
62
+ | Validation | 6,446 | 85,057 | 6 |
63
+ | Test | 4,952 | 56,483 | 6 |
64
+ | **Total** | **80,071** | **942,154** | **6** |
65
+
66
+ ### Class Distribution (Training Set)
67
+
68
+ Based on 800,614 annotations:
69
+
70
+ | Class ID | Class Name | Count | Percentage |
71
+ |----------|------------|-------|------------|
72
+ | 0 | Caption | 19,218 | 2.4% |
73
+ | 1 | List-item | 161,818 | 20.2% |
74
+ | 2 | Picture | 39,667 | 5.0% |
75
+ | 3 | Section-header | 118,590 | 14.8% |
76
+ | 4 | Table | 30,070 | 3.8% |
77
+ | 5 | Text | 431,251 | 53.9% |
78
+
79
+ ### Retention from Original Dataset
80
+
81
+ - **Images retained:** 99.0%
82
+ - **Annotations retained:** 85.1%
83
+
84
+ ## Dataset Structure
85
+
86
+ ### Format
87
+
88
+ Annotations are provided in **COCO JSON format**:
89
+
90
+ ```
91
+ DocLayNet_6class/
92
+ ├── coco/
93
+ │ ├── train.json # Training annotations
94
+ │ ├── val.json # Validation annotations
95
+ │ └── test.json # Test annotations
96
+ └── README.md # This file
97
+ ```
98
+
99
+ Images are **NOT included** - use the original DocLayNet image files from:
100
+ - HuggingFace: `docling-project/DocLayNet`
101
+ - Official source: https://github.com/DS4SD/DocLayNet
102
+
103
+ ### Loading the Dataset
104
+
105
+ #### Using HuggingFace Datasets
106
+
107
+ ```python
108
+ from datasets import load_dataset
109
+
110
+ # Load the filtered annotations
111
+ dataset = load_dataset("YOUR_USERNAME/doclaynet-6class")
112
+
113
+ # Access splits
114
+ train_data = dataset["train"]
115
+ val_data = dataset["validation"]
116
+ test_data = dataset["test"]
117
+ ```
118
+
119
+ #### Manual Loading
120
+
121
+ ```python
122
+ import json
123
+ from pathlib import Path
124
+
125
+ # Load COCO annotations
126
+ with open("coco/train.json") as f:
127
+ train_coco = json.load(f)
128
+
129
+ # Categories
130
+ categories = train_coco["categories"] # 6 classes with IDs 0-5
131
+
132
+ # Images
133
+ images = train_coco["images"] # Image metadata
134
+
135
+ # Annotations
136
+ annotations = train_coco["annotations"] # Bounding boxes
137
+ ```
138
+
139
+ ### Annotation Format
140
+
141
+ Each annotation follows the COCO format:
142
+
143
+ ```json
144
+ {
145
+ "id": 12345,
146
+ "image_id": 123,
147
+ "category_id": 5, // 0-5 (remapped from original 11 classes)
148
+ "bbox": [x_min, y_min, width, height], // In pixels
149
+ "area": 12345.67,
150
+ "iscrowd": 0
151
+ }
152
+ ```
153
+
154
+ ### Category Mapping
155
+
156
+ Original DocLayNet → 6-Class Filtered:
157
+
158
+ | Original ID | Original Name | Filtered ID | Filtered Name | Status |
159
+ |-------------|---------------|-------------|---------------|--------|
160
+ | 0 | Caption | 0 | Caption | ✅ Kept |
161
+ | 1 | Footnote | - | - | ❌ Removed |
162
+ | 2 | Formula | - | - | ❌ Removed |
163
+ | 3 | List-item | 1 | List-item | ✅ Kept |
164
+ | 4 | Page-footer | - | - | ❌ Removed |
165
+ | 5 | Page-header | - | - | ❌ Removed |
166
+ | 6 | Picture | 2 | Picture | ✅ Kept |
167
+ | 7 | Section-header | 3 | Section-header | ✅ Kept |
168
+ | 8 | Table | 4 | Table | ✅ Kept |
169
+ | 9 | Text | 5 | Text | ✅ Kept |
170
+ | 10 | Title | - | - | ❌ Removed |
171
+
172
+ ## Use Cases
173
+
174
+ This filtered dataset is ideal for:
175
+
176
+ - **Document layout analysis** with focus on content structure
177
+ - **Information extraction** from documents (text, tables, figures)
178
+ - **Object detection** model training for document AI
179
+ - **Multi-scale document understanding** tasks
180
+ - **Transfer learning** from general object detection to document analysis
181
+
182
+ ## Evaluation Benchmarks
183
+
184
+ ### Zero-Shot Performance (COCO Pretrained Models)
185
+
186
+ Models pretrained on COCO and evaluated without fine-tuning on DocLayNet 6-class:
187
+
188
+ | Model | mAP@0.5 | mAP@0.5:0.95 | Inference (ms) | Parameters |
189
+ |-------|---------|--------------|----------------|------------|
190
+ | YOLOv11n | TBD | TBD | TBD | 2.6M |
191
+ | YOLOv11m | TBD | TBD | TBD | 20M |
192
+ | RT-DETR-L | TBD | TBD | TBD | 32M |
193
+
194
+ *Evaluation in progress on test set (4,952 images at 1024×1024 resolution)*
195
+
196
+ ## Limitations
197
+
198
+ 1. **Images not included**: You must obtain images from the original DocLayNet dataset
199
+ 2. **Class imbalance**: Text class dominates (53.9% of annotations)
200
+ 3. **Domain specific**: Focused on document layout, may not generalize to other domains
201
+ 4. **Annotation quality**: Inherits any annotation errors from original DocLayNet
202
+
203
+ ## Ethical Considerations
204
+
205
+ - Dataset maintains the original DocLayNet license (CDLA-Permissive-2.0)
206
+ - No personal or sensitive information in annotations
207
+ - Source documents from diverse domains (financial, scientific, patents, manuals)
208
+ - Should not be used to discriminate based on document type or origin
209
+
210
+ ## Citation
211
+
212
+ If you use this filtered dataset, please cite both:
213
+
214
+ 1. **Original DocLayNet paper:**
215
+ ```bibtex
216
+ @article{doclaynet2022,
217
+ title = {DocLayNet: A Large Human-Annotated Dataset for Document-Layout Analysis},
218
+ author = {Pfitzmann, Birgit and Auer, Christoph and Dolfi, Michele and Nassar, Ahmed S and Staar, Peter W J},
219
+ year = {2022},
220
+ doi = {10.1145/3534678.3539043},
221
+ }
222
+ ```
223
+
224
+ 2. **This filtered version:**
225
+ ```bibtex
226
+ @misc{doclaynet6class2024,
227
+ title = {DocLayNet 6-Class: Filtered Document Layout Analysis Dataset},
228
+ author = {[Your Name]},
229
+ year = {2024},
230
+ howpublished = {\url{https://huggingface.co/datasets/YOUR_USERNAME/doclaynet-6class}},
231
+ note = {Filtered subset of DocLayNet containing 6 primary layout element classes}
232
+ }
233
+ ```
234
+
235
+ ## License
236
+
237
+ This filtered dataset maintains the original license:
238
+
239
+ **CDLA-Permissive-2.0** (Community Data License Agreement – Permissive – Version 2.0)
240
+
241
+ See: https://cdla.dev/permissive-2-0/
242
+
243
+ ## Acknowledgments
244
+
245
+ - Original DocLayNet dataset: IBM Research
246
+ - Filtering and curation: [Your Name/Organization]
247
+ - Built using the layout-for-tools evaluation framework
248
+
249
+ ## Contact
250
+
251
+ For questions or issues with this filtered dataset, please open an issue on the repository.
252
+
253
+ For questions about the original DocLayNet dataset, see: https://github.com/DS4SD/DocLayNet
coco/test.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a810b84b2ad68596f32ae76f6180f3ce0577816f6ced90e3dbdc85c11b04946
3
+ size 34044753
coco/train.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0aff07aa8f6a74a442b657995e3ce7e1f077796db8d1d3897cb11d7f05237aa2
3
+ size 483830323
coco/val.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd134fda7735cccd2b676cdf1e36a48675fe0edf564a5017fc24e57053bab9f7
3
+ size 50922848
dataset_infos.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "default": {
3
+ "description": "DocLayNet 6-class filtered dataset for document layout analysis",
4
+ "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}}",
5
+ "homepage": "https://github.com/DS4SD/DocLayNet",
6
+ "license": "CDLA-Permissive-2.0",
7
+ "features": {
8
+ "image_id": {
9
+ "dtype": "int32"
10
+ },
11
+ "file_name": {
12
+ "dtype": "string"
13
+ },
14
+ "width": {
15
+ "dtype": "int32"
16
+ },
17
+ "height": {
18
+ "dtype": "int32"
19
+ },
20
+ "annotations": [
21
+ {
22
+ "id": {
23
+ "dtype": "int32"
24
+ },
25
+ "category_id": {
26
+ "dtype": "int32"
27
+ },
28
+ "bbox": {
29
+ "dtype": "list"
30
+ },
31
+ "area": {
32
+ "dtype": "float32"
33
+ }
34
+ }
35
+ ]
36
+ },
37
+ "splits": {
38
+ "train": {
39
+ "num_examples": 68673
40
+ },
41
+ "validation": {
42
+ "num_examples": 6446
43
+ },
44
+ "test": {
45
+ "num_examples": 4952
46
+ }
47
+ }
48
+ }
49
+ }