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
4949e29
4d71c64
 
 
 
4949e29
 
 
 
 
 
 
 
 
 
 
 
 
4d71c64
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
---
license: other
license_name: mixed-source-specific
license_link: https://huggingface.co/datasets/D2I-CUHK-Shenzhen/FormStruct-Bench/blob/main/DATA_LICENSE.md
pretty_name: FormStruct-Bench
language:
  - ar
  - de
  - en
  - es
  - ja
  - pt
  - zh
task_categories:
  - image-to-text
  - document-question-answering
  - object-detection
tags:
  - document-ai
  - form-understanding
  - key-information-extraction
  - layout-analysis
  - multilingual
  - structured-prediction
size_categories:
  - 1K<n<10K
---

# FormStruct-Bench

## Dataset Description

FormStruct-Bench is a multilingual benchmark for extracting the semantic and
spatial structure of forms from document images. The repository combines a
7,000-page main benchmark, a controlled visual-degradation set, and
template-level layout annotations. It supports evaluation of vision-language
models and document AI systems on hierarchical key-value extraction, document
structure recovery, region localization, table and line-item understanding,
and selection-widget interpretation.

The main task takes a single form image as input and predicts its complete
hierarchical answer tree. Template annotations provide complementary pixel-space
regions and layout metadata for structure-aware evaluation.

> **Rights-audit notice (2026-07-23):** Apache-2.0 applies to the associated
> software repository only, not to this dataset. The source, rights, and privacy
> evidence needed to authorize redistribution has not yet been verified for
> every template. Consult `DATA_LICENSE.md` and
> `provenance/template_rights.csv` before accessing or redistributing files.
> Rows marked `UNVERIFIED_DO_NOT_REDISTRIBUTE` are not cleared for
> redistribution. Some source material is reported under CC BY-NC-SA 4.0 or
> other terms; those terms apply only where the per-template record links
> verifiable evidence.

## Repository Contents

| Component | Scope | Description |
| --- | ---: | --- |
| `datasets/` | 70 canonical templates + 10 redundant directories | 7,000 official benchmark pages; redundant directories are excluded |
| `dataset-augment/` | 1,216 degraded pages | Controlled visual robustness data |
| `template_annotation/` | 70 benchmark templates + 10 redundant templates | Template-level fields, boxes, and layout metadata |
| `splits/template_stratified_seed42/` | 70 templates, 7,000 indexed pages | Official train/validation/test assignments |
| `provenance/template_rights.csv` | 80 template records | Per-template source, rights, privacy, and redistribution audit status |

The repository currently retains directories for 80 templates, but the main
benchmark contains 100 filled instances for each of 70 canonical templates
(7,000 pages). The 10 additional directories correspond to the redundant
templates listed below and are excluded from the official benchmark and all
splits. The augmentation data contains
degraded variants of selected source pages. The template annotations contain
annotations for all 70 main-benchmark templates plus 10 redundant templates.
The 70 templates in `datasets/` define the canonical dataset scope. The extra
annotation files are retained only as redundant data and are not part of the
formal benchmark.

## Main Benchmark

### Statistics

| Property | Value |
| --- | ---: |
| Templates | 70 |
| Instances per template | 100 |
| Total document pages | 7,000 |
| Valid PNG and `answer.json` pairs | 7,000 |
| Total leaf fields | 256,806 |
| Empty leaf fields | 0 |
| Unique canonical answers | 6,921 |
| Unique image pixel hashes | 6,946 |

Each main sample contains the same answer in three representations:

- `answer.json`: machine-readable hierarchical key-value data;
- `answer.md`: a human-readable nested list; and
- `answer.html`: a browser-renderable hierarchical view.

### Language Distribution

| Language | Script | Direction | Templates | Instances |
| --- | --- | --- | ---: | ---: |
| Japanese | Han, Hiragana, Katakana | LTR | 22 | 2,200 |
| English | Latin | LTR | 19 | 1,900 |
| Chinese | Han | LTR | 11 | 1,100 |
| Arabic | Arabic | RTL | 8 | 800 |
| Spanish | Latin | LTR | 3 | 300 |
| Portuguese | Latin | LTR | 3 | 300 |
| German | Latin | LTR | 2 | 200 |
| Chinese-English | Han and Latin | LTR | 2 | 200 |
| **Total** | | | **70** | **7,000** |

The filename prefix `zn` is retained from the original data and denotes
Chinese; it is not an ISO 639 language code. `zn_en` denotes bilingual
Chinese-English templates.

### Directory Structure

```text
datasets/
  {template_name}/
    {instance_id}/
      {template_name}-{instance_id}.png
      answer.json
      answer.md
      answer.html
```

Example:

```text
datasets/en_1/01/
  en_1-01.png
  answer.json
  answer.md
  answer.html
```

### Answer Format

`answer.json` stores the semantic answer as a nested JSON object. Internal
objects represent sections or semantic groups, while leaf values contain the
text associated with individual form fields.

```json
{
  "PRODUCT SPECIFICATION": {
    "Brand": "Marlboro",
    "Company": "Philip Morris International",
    "Country": "United States"
  },
  "Prepared by": "Laura Bennett",
  "Date": "28/02/2024"
}
```

The schema varies by template and can also vary across instances of the same
template. Systems should therefore predict the full hierarchy instead of
assuming one fixed global field schema.

## Template Annotations

`template_annotation/` contains 80 standalone JSON files with one reviewed
template annotation per file. Exactly 70 files correspond to the canonical
templates in the main dataset. The following 10 files are redundant data and
must be excluded from official dataset statistics, splits, training scope, and
evaluation:

```text
de_3.json
de_4.json
es_4.json
ja_23.json
ja_24.json
ja_25.json
ja_26.json
ja_27.json
ja_28.json
zn_12.json
```

The annotation directory as a whole covers Arabic, German, English, Spanish,
Japanese, Portuguese, Chinese, and bilingual Chinese-English forms. Unless a
separate exploratory use explicitly requires the redundant files, consumers
should join annotations against the 70 template names present in `datasets/`.

### Annotation Statistics

The structural statistics below use only the 70 canonical benchmark
annotations and exclude the 10 redundant files.

| Property | Value |
| --- | ---: |
| Annotation files | 80 |
| Canonical benchmark annotations | 70 |
| Redundant annotations | 10 |
| Regions per canonical template | 1-9 (mean 4.59) |
| Fields per canonical template | 14-86 (mean 42.69) |
| Local grids per canonical template | 0-2 (mean 0.20) |
| Canonical portrait templates (`864 x 1232`) | 63 |
| Canonical landscape templates (`1232 x 864`) | 7 |

### Annotation Schema

Each file contains:

- `id`: template identifier;
- `img`: source-image reference from the annotation environment;
- `original_width`, `original_height`: page dimensions in pixels;
- `fields`: recursive field annotations;
- `semantic_key`: normalized semantic field name;
- `original_label`: label in the source document language;
- `bbox`: pixel-space box in `[x_min, y_min, x_max, y_max]` format;
- `data_type`: types such as `text`, `number`, `checkbox`, and
  `checkbox_multi`;
- `value` or `values`: one or more associated value or option regions;
- `keys`: nested child fields; and
- `metadata`: structural, visual, domain, language, difficulty, section,
  region, table-region, and line-item-group metadata.

Shortened example:

```json
{
  "id": 182,
  "img": "/data/upload/2/49a188a5-en_1.jpg",
  "original_width": 864,
  "original_height": 1232,
  "fields": [
    {
      "semantic_key": "Brand",
      "original_label": "Brand",
      "bbox": [84, 192, 129, 208],
      "data_type": "text",
      "value": {
        "bbox": [142, 190, 335, 207],
        "data_type": "text"
      }
    }
  ],
  "metadata": {
    "language": "English",
    "domain": "business",
    "layout_structure": {
      "page_bbox": [0, 0, 864, 1232]
    }
  }
}
```

The `img` entries are internal annotation-system paths, not downloadable URLs.
Use the JSON filenames to associate template annotations with matching template
names in the main benchmark.

## Visual-Degradation Data

`dataset-augment/` supports controlled robustness evaluation. It contains 76
source pages with:

- 1,140 factorial variants from five degradation families at three severity
  levels; and
- 76 additional `combined` degradation images.

The five factorial degradation families are:

| Variant | Effect |
| --- | --- |
| `blur_noise` | Blur, image noise, salt-and-pepper noise, motion blur, and JPEG artifacts |
| `dilate` | Thickened foreground ink or table lines with controlled local bending |
| `erode` | Thinned or faded foreground ink and table lines |
| `perspective_skew` | Rotation, translation, scale, and perspective displacement |
| `occlusion_stain` | Stains, shadows, creases, and partial occlusion |

Factorial variants use `low`, `medium`, and `high` severity levels. Their
directory structure is:

```text
dataset-augment/
  {template_name}/
    {source_instance_id}/
      {variant}/
        {level}/
          {template_name}-{source_instance_id}.png
          answer.json
          augment_meta.json
```

Each `augment_meta.json` records the deterministic seed, transformation
parameters, source and output sizes, before/after image metrics, and pixel
difference statistics. The 76 top-level `combined` images have image and
augmentation metadata but do not include an `answer.json` sidecar. Evaluation
code should pair only samples that have the required clean source and answer.

## Loading the Data

The repository uses a task-specific directory structure rather than a single
tabular file. A minimal Python loader for the main benchmark is:

```python
import json
from pathlib import Path

root = Path("datasets")
samples = []

for image_path in sorted(root.glob("*/*/*.png")):
    answer_path = image_path.parent / "answer.json"
    if not answer_path.is_file():
        continue
    samples.append(
        {
            "template": image_path.parent.parent.name,
            "instance_id": image_path.parent.name,
            "image_path": str(image_path),
            "answer": json.loads(answer_path.read_text(encoding="utf-8")),
        }
    )

print(len(samples))  # 7000
```

Template annotations can be loaded independently:

```python
annotation_root = Path("template_annotation")
annotations = {
    path.stem: json.loads(path.read_text(encoding="utf-8"))
    for path in sorted(annotation_root.glob("*.json"))
}
```

## Tasks and Evaluation

The repository is suitable for:

- image-to-hierarchical-JSON extraction;
- form key-value extraction with full semantic paths;
- document schema and hierarchy recovery;
- region and line-item-group localization;
- table, widget, and key-value relation analysis;
- multilingual and right-to-left form understanding; and
- robustness evaluation under controlled visual degradation.

Relevant evaluation families include whole-page exact match, normalized schema
tree-edit similarity, normalized value edit similarity, path-sensitive field
accuracy, region F1 at an IoU threshold, line-item-group F1, and widget answer
accuracy. Evaluation code and exact metric definitions are maintained in the
associated FormStruct-Bench project repository.

## Splits

FormStruct-Bench defines one official, fixed, template-disjoint split generated
with seed 42. The split used in the paper is:

| Split | Templates | Pages | Human-review status |
| --- | ---: | ---: | --- |
| Train | 49 | 4,900 | Not claimed as fully reviewed |
| Validation | 10 | 1,000 | Not claimed as fully reviewed |
| Test | 11 | 1,100 | Fully reviewed |

The authoritative release files are:

- `splits/template_stratified_seed42/train_index.jsonl`;
- `splits/template_stratified_seed42/val_index.jsonl`;
- `splits/template_stratified_seed42/test_index.jsonl`.

The JSONL paths use the public repository's normalized template directory names
and resolve from the repository root. The 10 redundant templates are excluded
from every split. Do not randomly split pages: instances from the same template
share substantial visual and semantic structure and would leak across
partitions. Results should report the dataset revision and use these manifests.

## Data Creation and Provenance

The repository contains populated form pages, hierarchical answer sidecars,
reviewed template annotations, and deterministic visual augmentations. The
augmentation metadata records seeds and parameters for reproducibility.

`provenance/template_rights.csv` is the controlling, per-template audit record
for source title and URL, rightsholder, source license and evidence, privacy
review, and redistribution status. It covers all 70 canonical templates and
the 10 redundant templates. Blank evidence fields mean that the fact has not
been established; they do not mean public domain or unrestricted use.

At the 2026-07-23 release audit, the repository metadata did not contain enough
machine-readable evidence to close these fields for any template. Those rows
are conservatively marked `UNVERIFIED_DO_NOT_REDISTRIBUTE`. The paper reports
that some materials are subject to CC BY-NC-SA 4.0 or mixed copyright terms,
but an aggregate statement cannot establish which terms govern an individual
file. A row may be changed to `CLEARED` only after it names the source,
rightsholder, applicable license, evidence URL or archived permission, and a
completed privacy review. See `provenance/README.md` for the audit procedure.

## Data Quality and Limitations

- The benchmark contains many pages per template but only 70 main templates.
  Page-level results are therefore clustered and should not be interpreted as
  7,000 independent document designs.
- The language and domain distributions are imbalanced. Japanese and English
  account for most main templates.
- Exact pixel hashing finds 6,946 unique images among 7,000 pages. Duplicate or
  near-duplicate images can affect evaluation if splits are created without
  template and duplicate controls.
- Some source `answer.json` files contain repeated object keys. Standard JSON
  parsers retain only the last repeated key, while the Markdown and HTML
  sidecars may preserve all repeated entries. Consumers should audit this
  behavior for their task.
- The 1,216 augmented images form a selected robustness collection, not a
  degradation of all 7,000 main pages. Downstream evaluation may use a smaller
  subset after clean-pair validation.
- The 10 redundant annotation files listed above are outside the canonical
  70-template scope. They must not be included in official benchmark results;
  join components by template name rather than assuming identical coverage.
- The repository currently also retains `datasets/` directories for those 10
  redundant templates. Their presence is archival only: they are excluded from
  the official 7,000-page count and every released split.
- Template annotation `img` values are non-portable internal paths.
- Automatically derived difficulty and visual metadata should not be treated
  as independently validated human judgments.
- Form fields and populated values may resemble personal, financial, medical,
  employment, or government information. The data must not be used to make
  decisions about real individuals.

## Privacy and Responsible Use

The forms include identity-like names and values as well as fields associated
with potentially sensitive domains. The current release records do not
establish that every value is synthetic or anonymized. This is tracked per
template in `provenance/template_rights.csv`; an unverified row is not
privacy-cleared. Report suspected personal or sensitive information through
the repository's Community tab and identify the template and instance so
maintainers can remove or quarantine it.

FormStruct-Bench is intended for document AI research and system evaluation.
It is not intended for identity verification, eligibility decisions,
surveillance, or automated decisions that affect individuals.

## License and Rights

This dataset has no blanket Apache-2.0 license. Hugging Face metadata uses
`license: other` because rights are mixed and source-specific:

- Apache-2.0 covers only code in the associated software repository.
- CC BY-NC-SA 4.0 applies only to files whose per-template audit row cites
  evidence for that license; its attribution, non-commercial, and share-alike
  conditions remain in force.
- Base images and document designs under other terms remain subject to those
  source terms.
- Answers and annotations may be derivative of the underlying form, and
  augmented images inherit restrictions from their clean source image.
- `UNVERIFIED_DO_NOT_REDISTRIBUTE` means that the release does not provide a
  verified grant of redistribution rights for that row.

`DATA_LICENSE.md` defines the component-level policy and
`provenance/template_rights.csv` is the controlling per-template record. Access
to repository files does not itself grant copyright, privacy, publicity,
trademark, database, or other rights.

## Citation

No canonical citation is included in the current repository. When reporting
results, cite the Hugging Face dataset repository and record the exact commit
or revision used. Add the associated paper's BibTeX entry here when it becomes
available.

## Maintenance

Questions, corrections, and data-quality reports should be submitted through
the Hugging Face dataset repository's Community tab. Versioned releases should
document changes to template coverage, answer files, annotations, and
augmentation metadata.