Pengyu965 commited on
Commit
98a9819
Β·
verified Β·
1 Parent(s): 71f4df8

Add dataset card

Browse files
Files changed (1) hide show
  1. README.md +117 -0
README.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: StructHub
3
+ license: other
4
+ license_name: structhub-mixed-sources
5
+ language:
6
+ - en
7
+ task_categories:
8
+ - image-to-text
9
+ tags:
10
+ - svg
11
+ - xml
12
+ - structured-images
13
+ - diagrams
14
+ - charts
15
+ - flowcharts
16
+ - vector-graphics
17
+ - image-to-svg
18
+ - multimodal
19
+ size_categories:
20
+ - 10K<n<100K
21
+ ---
22
+
23
+ # StructHub
24
+
25
+ **StructHub** is a large-scale dataset of **structured images paired with their editable
26
+ SVG / XML source code**, built for the *image-to-SVG* (and *text-to-SVG*) task introduced
27
+ in **Back2Struct: Making Structured Images Editable Again**. Each raster image (a diagram,
28
+ chart, flowchart, architecture figure, UML diagram, schema, etc.) is paired with
29
+ **object-level** vector code that explicitly encodes text, shapes, topology, and layout β€”
30
+ supporting supervised and reward-based training for models that "make structured images
31
+ editable again."
32
+
33
+ - πŸ“„ Paper: *Back2Struct: Making Structured Images Editable Again*
34
+ - πŸ”— Project page: https://pengyu965.github.io/Back2Struct.github.io/
35
+ - πŸ€– Model: [`Pengyu965/Back2Struct-Image2SVG-7B`](https://huggingface.co/Pengyu965/Back2Struct-Image2SVG-7B)
36
+
37
+ ## Composition
38
+
39
+ | Subset | Train (full) | Train (≀ 8,192 tok) | Retention | Benchmark |
40
+ |--------|-------------:|--------------------:|----------:|----------:|
41
+ | **StarDiag-HQ** | 52,875 | 52,875 | 100.0% | 569 |
42
+ | **OpenDiag** | 27,953 | 18,800 | 67.3% | 334 |
43
+ | **NNArch** | 3,293 | 1,453 | 46.6% | 97 |
44
+ | **Total** | **84,121** | **73,128** | **86.9%** | **1,000** |
45
+
46
+ - **StarDiag-HQ** β€” high-quality synthetic structured diagrams.
47
+ - **OpenDiag** β€” crawled open-domain structured graphics (broad style/topic coverage).
48
+ - **NNArch** β€” neural-network / system architecture diagrams (long, complex SVGs).
49
+
50
+ Training uses examples with **≀ 8,192 tokens** of ground-truth SVG (73,128 pairs) for
51
+ stable long-context generation.
52
+
53
+ ## StructHub Benchmark (1,000 samples)
54
+
55
+ A held-out **1,000-sample** evaluation benchmark (569 StarDiag-HQ + 334 OpenDiag +
56
+ 97 NNArch), split by ground-truth SVG length into three difficulty tiers:
57
+
58
+ | Tier | GT SVG length | # samples |
59
+ |------|---------------|----------:|
60
+ | Easy | ≀ 2,048 tokens | 333 |
61
+ | Medium | 2,048 – 4,096 tokens | 333 |
62
+ | Hard | > 4,096 tokens | 334 |
63
+
64
+ This enables evaluation across levels of structural complexity.
65
+
66
+ ## Data fields
67
+
68
+ Each example contains:
69
+
70
+ | Field | Type | Description |
71
+ |-------|------|-------------|
72
+ | `id` | string | Unique example id (source-prefixed, e.g. `starvector_…`, `crawled_…`) |
73
+ | `image` | image | The rendered structured raster image (input) |
74
+ | `svg` | string | Ground-truth object-level SVG / XML code (target) |
75
+ | `source` | string | `StarDiag-HQ` \| `OpenDiag` \| `NNArch` |
76
+ | `num_tokens` | int | Token length of the ground-truth SVG |
77
+ | `difficulty` | string | `easy` \| `medium` \| `hard` (benchmark split only) |
78
+
79
+ > Adjust the field names above to match the files you upload.
80
+
81
+ ## Usage
82
+
83
+ ```python
84
+ from datasets import load_dataset
85
+
86
+ ds = load_dataset("Pengyu965/StructHub")
87
+ train = ds["train"]
88
+ bench = ds["benchmark"]
89
+
90
+ ex = bench[0]
91
+ ex["image"].save("input.png")
92
+ print(ex["svg"][:500]) # ground-truth SVG/XML
93
+ ```
94
+
95
+ ## Evaluation
96
+
97
+ Predictions are scored with **image-level** metrics (render success rate, DINOv2 similarity,
98
+ LPIPS, SSIM between the rendered prediction and the input image) and a **text-level**
99
+ GPTScore over the SVG code (Structure / Flow / Style, 0–5 each; Overall 0–100). See the
100
+ paper for the render-gated evaluation protocol.
101
+
102
+ ## Licensing
103
+
104
+ StructHub aggregates multiple sources, including crawled open-domain graphics. Per-source
105
+ terms may differ; the dataset is released for **research use**. Please review and respect the
106
+ licenses of the original content. *(Confirm and update this field before publishing.)*
107
+
108
+ ## Citation
109
+
110
+ ```bibtex
111
+ @article{yan2026back2struct,
112
+ title = {Back2Struct: Making Structured Images Editable Again},
113
+ author = {Yan, Pengyu and Wu, Yixin and Tian, Yunjie and Doermann, David},
114
+ year = {2026},
115
+ note = {Preprint}
116
+ }
117
+ ```