jnaiman commited on
Commit
96bee4c
·
1 Parent(s): f61e5f9
Files changed (2) hide show
  1. README.md.bak +0 -423
  2. SCHEMA.md.bak +0 -267
README.md.bak DELETED
@@ -1,423 +0,0 @@
1
- ---
2
- license: apache-2.0
3
- pretty_name: Astro Sky Image VQA
4
- language:
5
- - en
6
- task_categories:
7
- - visual-question-answering
8
- - image-to-text
9
- tags:
10
- - astronomy
11
- - scientific-figures
12
- - chart-understanding
13
- - synthetic
14
- - matplotlib
15
- - document-understanding
16
- size_categories:
17
- - 1K<n<10K
18
- viewer: false
19
- ---
20
-
21
- # Astro Sky Image VQA
22
-
23
- A visual-question-answering benchmark of **synthetic astronomical figures** with
24
- exact, machine-generated ground truth.
25
-
26
- Alongside the figures, the repo ships the **raw responses of three
27
- vision-language models** on a 150-figure subset, run twice: once on the clean
28
- figures and once on the same figures artificially aged to look like a scanned
29
- page from a mid-century journal.
30
-
31
-
32
- ---
33
-
34
- ## At a glance
35
-
36
- | | |
37
- |---|---|
38
- | Figures | **2,001** (1 panel each) |
39
- | Categories | 667 `contour` / 667 `sky-gmm` / 667 `sky-real` — exactly balanced |
40
- | Questions | **47,357** (21 per contour figure, 25 per sky figure) |
41
- | Images | 2,001 JPEG, RGB, ~2000–2700 px wide |
42
- | Model responses | 3 models x 150 figures x 2 conditions = **21,300** answered questions |
43
- | Ground truth | Generator-exact, not human-annotated |
44
- | Download size | ~8 GB of data |
45
- | License | Apache 2.0 (see [Provenance](#provenance-and-attribution) for the sky cutouts) |
46
-
47
- Each figure's metadata includes precise bounding boxes and location of all data points:
48
-
49
- <table style="width: 75%; border-collapse: collapse; border: none;">
50
- <tr style="border: none;">
51
- <td style="width: 50%; padding: 5px; border: none;">
52
- <img src="https://huggingface.co/datasets/ReadingTimeMachine/astro_sky_image_vqa/resolve/main/example_data/imgs/Picture_200601.jpeg" alt="First Image Description" style="width: 100%; height: auto;">
53
- </td>
54
- <td style="width: 50%; padding: 5px; border: none;">
55
- <img src="https://huggingface.co/datasets/ReadingTimeMachine/astro_sky_image_vqa/resolve/main/example_data/diags/Picture_200601.jpeg" alt="Second Image Description" style="width: 100%; height: auto;">
56
- </td>
57
- </tr>
58
- </table>
59
-
60
- For the 150 figures sent to LMMs, there are aged versions as well:
61
-
62
- <table style="width: 75%; border-collapse: collapse; border: none;">
63
- <tr style="border: none;">
64
- <td style="width: 50%; padding: 5px; border: none;">
65
- <img src="https://huggingface.co/datasets/ReadingTimeMachine/astro_sky_image_vqa/resolve/main/VQA_full/imgs/vqa_000004.jpeg" alt="First Image Description" style="width: 100%; height: auto;">
66
- </td>
67
- <td style="width: 50%; padding: 5px; border: none;">
68
- <img src="https://huggingface.co/datasets/ReadingTimeMachine/astro_sky_image_vqa/resolve/main/LMM_outputs_n150_archive_light/aged_imgs/vqa_000004.jpeg" alt="Second Image Description" style="width: 100%; height: auto;">
69
- </td>
70
- </tr>
71
- </table>
72
-
73
- ---
74
-
75
- ## Repository layout
76
-
77
- ```
78
- VQA_full/
79
- imgs/ vqa_NNNNNN.jpeg 2001 rendered figures
80
- qa_jsons/ vqa_NNNNNN_qa.json 2001 records: figure params + bounding
81
- boxes + underlying data + the questions
82
-
83
- LMM_outputs_n150/ RUN 1 -- the clean figures
84
- chatgpt_api/ vqa_NNNNNN_qa.pickle 150 per model: every question, with
85
- claude_haiku/ the raw response the model gave
86
- gemini/
87
-
88
- LMM_outputs_n150_archive_light/ RUN 2 -- the SAME 150 figures, aged
89
- aged_imgs/ vqa_NNNNNN.jpeg the degraded images actually sent
90
- archive_manifest.json which effects fired, per figure
91
- chatgpt_api/ vqa_NNNNNN_qa.pickle responses, as above
92
- vqa_NNNNNN_qa_archive.json that figure's aging recipe
93
- claude_haiku/
94
- gemini/
95
-
96
- example_data/ 3 illustrative figures shown twice: as
97
- imgs/ Picture_N00089.jpeg rendered, and with every bounding box
98
- diags/ Picture_N00089.jpeg drawn on in red, so the annotations can
99
- be checked by eye. Generator naming, NOT
100
- part of the 2001 indexed figures.
101
- ```
102
-
103
- `example_data/diags/` is the quickest way to see what is annotated: each red
104
- box in those images is one entry in the corresponding `plot0` record — the plot
105
- area, every tick label, the axis labels, the colorbar, its ticks and its label.
106
- The three examples are illustrative only; they predate the `vqa_NNNNNN`
107
- numbering and are not part of the 2,001.
108
-
109
- ---
110
-
111
- ## Citation
112
-
113
- <!-- TODO: replace with the WASP 2026 paper reference once it is public. -->
114
-
115
- ```bibtex
116
- tbd
117
- ```
118
-
119
- **If you publish work using the `sky-real` figures, you inherit the
120
- acknowledgement obligations of the underlying surveys**, which are not waived
121
- by this repo's Apache 2.0 license. In particular SkyView asks to be cited, and
122
- the Digitized Sky Surveys — the largest single source here — carry their own
123
- acknowledgement requirements from STScI and the originating plate collections.
124
- Check the terms for the specific surveys in your subset; the metadata above
125
- tells you which those are.
126
-
127
- The Apache 2.0 license applies to the dataset as assembled: the synthetic
128
- figures, the generated questions and ground truth, and the model responses.
129
-
130
- ---
131
-
132
- ## Generating code
133
-
134
- The figures and questions are produced by the
135
- [`SkyImagesWASP2026`](https://anonymous.4open.science/r/SkyImagesWASP2026-027E) repository.
136
-
137
- ---
138
-
139
- # Extended Information
140
-
141
- ---
142
-
143
- ## The figures
144
-
145
- Three categories, **667 of each**:
146
-
147
- | Category | `plot0.type` | `plot0.distribution` | What it is |
148
- |---|---|---|---|
149
- | `contour` | `contour` | `random` / `linear` / `gmm` | A contour plot of synthetic data |
150
- | `sky-gmm` | `image of the sky` | `gmm` | A **synthetic** sky image: a Gaussian mixture, deposited to sky coordinates |
151
- | `sky-real` | `image of the sky` | `sky` | A **real** survey cutout, plotted the same way |
152
-
153
- The last two are rendered identically and are
154
- distinguishable only by the structure of the data itself. A model that answers
155
- the provenance question correctly has to tell a real astronomical field from a
156
- plausible-looking fake.
157
-
158
- Everything else about each figure is randomised independently — plot style,
159
- colormap, dpi, aspect ratio, font sizes, colorbar placement, tick formats,
160
- label text, coordinate epoch.
161
-
162
-
163
- ---
164
-
165
- ## The questions
166
-
167
- Questions are organized by the conceptual level model developed by [Lundgard et. al 2022](https://arxiv.org/abs/2110.04406):
168
-
169
- | Level | What it asks for | Examples |
170
- |---|---|---|
171
- | **Level 1** | Things *displayed on the figure* — readable directly off the page | plot style, colormap, axis limits, tick values, titles, coordinate epoch |
172
- | **Level 2** | Things requiring *estimation from the rendered data* | min/max/median/mean of the colour axis, angular field width and height |
173
- | **Level 3** | Things requiring *inference about how the data was made* | which distribution generated it; real sky vs. Gaussian mixture; pixel scale |
174
-
175
- Level 4 requires domain-specific expertise and is not covered by this dataset.
176
-
177
- ### Full question inventory
178
-
179
- **Asked of every figure (10 figure-level, Level 1):**
180
-
181
- | Name | Question |
182
- |---|---|
183
- | `plot style` | What is the plot style used in this figure? |
184
- | `colormap` | What is the colormap that was used in this figure? |
185
- | `aspect ratio` | What is the aspect ratio of this figure? |
186
- | `titles` | What is the title of the plot in this figure? |
187
- | `xlabels` / `ylabels` | What is the x/y-axis title of the plot in this figure? |
188
- | `xtick values` / `ytick values` | What are the values for each of the tick marks on the x/y-axis? |
189
- | `plot types` | What is the plot type of the plot in this figure? *(open-ended)* |
190
- | `plot types (list)` | Same question, but offering `[contour, image of the sky]` |
191
-
192
- `plot types` is asked **twice on purpose** — once open-ended and once as a
193
- multiple choice. Only the list variant measures recognition; the open-ended one
194
- scores near zero for every model because they answer things like "astronomical
195
- survey image", which never string-matches the ground truth. Score the list
196
- variant unless you specifically want to measure phrasing.
197
-
198
- **Contour figures only (11 plot-level):**
199
-
200
- | Level | Name | Question |
201
- |---|---|---|
202
- | 1 | `image or lines (list)` | Is the contour plot drawn as an image, lines, or both? |
203
- | 1 | `minimum/maximum x axis limit` | Lower/upper limit of the x **axis** (not of the data) |
204
- | 1 | `minimum/maximum y axis limit` | Lower/upper limit of the y axis |
205
- | 2 | `minimum/maximum/median/mean color` | Statistics of the colour-axis data |
206
- | 3 | `distribution-color + list)` | Which distribution generated the colour data? `[random, linear, gaussian mixture model]` |
207
- | 3 | `distribution-x/y + list)` | Same, for the x/y-plane |
208
-
209
- **Sky figures only (15 plot-level):**
210
-
211
- | Level | Name | Question |
212
- |---|---|---|
213
- | 1 | `epoch` | Which coordinate epoch is on the axis labels? (`"none"` if absent) |
214
- | 1 | `finest unit right ascension` | Smallest unit on the RA ticks: `[hours, minutes, seconds]` |
215
- | 1 | `finest unit declination` | Smallest unit on the Dec ticks: `[degrees, arcminutes, arcseconds]` |
216
- | 1 | `minimum/maximum right ascension axis limit` | RA axis limits |
217
- | 1 | `minimum/maximum declination axis limit` | Dec axis limits |
218
- | 2 | `field width` / `field height` | Angular size of the sky region, along RA / Dec |
219
- | 2 | `minimum/maximum/median/mean color` | Statistics of the colour-axis data |
220
- | 3 | `distribution-image + list)` | `[gaussian mixture model, real image of the sky]` — **the provenance question** |
221
- | 3 | `pixel scale` | Angular size one pixel spans, in arcseconds |
222
-
223
- Totals: **21** questions per contour figure, **25** per sky figure —
224
- `667 x 21 + 1334 x 25 = 47,357`.
225
-
226
- ---
227
-
228
- ## What a `qa_json` contains
229
-
230
- Each file in `VQA_full/qa_jsons/` is a **JSON-encoded string**, so it takes two
231
- decodes:
232
-
233
- ```python
234
- import json
235
- with open('VQA_full/qa_jsons/vqa_000001_qa.json') as f:
236
- record = json.loads(json.load(f)) # note: twice
237
- record.keys() # ['figure', 'plot0', 'VQA', 'vqa_id']
238
- ```
239
-
240
- | Key | Contents |
241
- |---|---|
242
- | `figure` | Figure-wide render parameters: `dpi`, `figsize`, `aspect ratio`, `plot style`, `color map`, font sizes, `facecolor`, pixel dimensions |
243
- | `plot0` | The single panel — its type, distribution, the underlying data, and **pixel bounding boxes** for the plot area, every tick label, axis labels, title, colorbar and colorbar ticks |
244
- | `VQA` | The questions, as `VQA[level][kind][name]` |
245
- | `vqa_id` | e.g. `"vqa_000001"` — matches the filename and the image |
246
-
247
- Because `plot0` carries bounding boxes for every element, this doubles as
248
- labelled training data for **figure-element detection**, not just VQA.
249
-
250
- ### Reading the questions — mind the nesting
251
-
252
- The two question kinds nest differently, which is the single most common thing
253
- to get wrong:
254
-
255
- ```python
256
- VQA['Level 1']['Figure-level questions']['plot style'] # -> the entry
257
- VQA['Level 2']['Plot-level questions']['mean color']['plot0'] # -> the entry
258
- ^^^^^^^^
259
- ```
260
-
261
- Plot-level questions are keyed **by panel** underneath the question name. Every
262
- figure in this release has exactly one panel (`plot0`), so it is easy to miss —
263
- and code that skips the panel level will silently return a dict instead of a
264
- question. A safe accessor:
265
-
266
- ```python
267
- def question_entries(node):
268
- """Yield (panel, entry) whether or not the question is per-panel."""
269
- if 'Q' in node: # figure-level: the entry itself
270
- yield None, node
271
- else: # plot-level: {panel: entry}
272
- for panel, entry in node.items():
273
- yield panel, entry
274
- ```
275
-
276
- Each entry holds the prompt in assembled and component form:
277
-
278
- | Field | Meaning |
279
- |---|---|
280
- | `Q` | The full assembled prompt: persona + context + question + format |
281
- | `A` | **Ground truth**, from the generator. Always a `dict` here, e.g. `{"plot style": "seaborn-v0_8-muted"}` |
282
- | `persona` | e.g. `"You are a helpful assistant that can analyze images."` |
283
- | `context` | Framing, and the multiple-choice list when one is offered |
284
- | `question` | The question alone |
285
- | `format` | The requested JSON answer shape, e.g. `{"plot style":""}` |
286
-
287
- The `format` field is worth using rather than hard-coding key names: it states
288
- exactly which JSON key the model was asked to fill, so parsing can be driven
289
- from the prompt instead of drifting from it.
290
-
291
- ---
292
-
293
- ## The model runs
294
-
295
- Three low-tier vision models, the same 150 figures (50 per category,
296
- `vqa_000001`–`vqa_000157`), asked all 25/21 of each figure's questions:
297
-
298
- | Directory | Model id as run |
299
- |---|---|
300
- | `chatgpt_api/` | `gpt-5.4-nano-2026-03-17` |
301
- | `claude_haiku/` | `claude-haiku-4-5` |
302
- | `gemini/` | `gemini-3.5-flash-lite` |
303
-
304
- Both runs use **identical figures and identical questions**; they differ only
305
- in whether the image was aged before being sent. Any gap between them is an
306
- effect of the degradation, not of the sample.
307
-
308
- ### Reading a response pickle
309
-
310
- ```python
311
- import pickle
312
- with open('LMM_outputs_n150/gemini/vqa_000001_qa.pickle', 'rb') as f:
313
- qa_list, model_id = pickle.load(f)
314
-
315
- qa_list[0]['question'] # what was asked
316
- qa_list[0]['A'] # ground truth
317
- qa_list[0]['raw answer'] # what the model said, verbatim
318
- ```
319
-
320
- Fields present for **every** model: `Q`, `A`, `Level`, `type`, `persona`,
321
- `context`, `question`, `format`, `reasoning`, `prompt`, `Response`,
322
- `Response String`, `raw answer`.
323
-
324
- Provider-specific extras: `fac` (GPT); `usage` and `system prompt` (Claude,
325
- Gemini); `Response (raw)` (Gemini).
326
-
327
- > **Unpickling needs the vendor SDKs.** Each pickle stores the provider's own
328
- > response object next to the text, so a plain `pickle.load` raises
329
- > `ModuleNotFoundError` without `anthropic` / `google-genai` installed. If you
330
- > only want the text — and the fields above are all plain strings — substitute
331
- > a stub for unknown classes:
332
- >
333
- > ```python
334
- > class _Stub:
335
- > def __init__(self, *a, **k): pass
336
- > def __setstate__(self, s): self.__dict__.update(s if isinstance(s, dict) else {})
337
- >
338
- > class TolerantUnpickler(pickle.Unpickler):
339
- > def find_class(self, module, name):
340
- > try:
341
- > return super().find_class(module, name)
342
- > except (ImportError, AttributeError):
343
- > return type(name, (_Stub,), {})
344
- > ```
345
-
346
- ### The archive-light condition
347
-
348
- `LMM_outputs_n150_archive_light/` asks the same questions of the same figures
349
- after degrading each one to resemble a scanned page from an old journal —
350
- ink bleed and mottling, paper colouring and texture, stains, folding, subtle
351
- noise, JPEG artefacts, and a 2-in-3 chance of being converted to grayscale.
352
-
353
- The aging is **reproducible and shared across models**: each figure's random
354
- draw is seeded from its own id, so GPT, Claude and Gemini all saw the byte-identical
355
- aged image. Comparing the three models would otherwise be confounded by each
356
- having been shown a differently-damaged page.
357
-
358
- `archive_manifest.json` records the draw for all 150 figures; the same record
359
- is repeated per figure as `<id>_qa_archive.json`:
360
-
361
- | Field | Meaning |
362
- |---|---|
363
- | `preset` | `"archive-light"` |
364
- | `base_seed` / `seed` | Run-wide seed, and this figure's derived seed |
365
- | `effects` | Which effects fired, in order |
366
- | `effects_by_phase` | The same, split into `ink` / `paper` / `post` |
367
- | `grayscale`, `gray_prob` | Whether this figure went gray, and with what probability |
368
- | `page background` | RGB of the simulated paper |
369
-
370
- The aged images themselves are in `aged_imgs/` — you do not need to re-run the
371
- aging to reproduce the experiment.
372
-
373
- ---
374
-
375
- ## Known issues and caveats
376
-
377
- Read these before reporting numbers.
378
-
379
- - **Score the list variant of `plot types`.** The open-ended variant scores
380
- near zero for all models for phrasing reasons, not vision reasons. See above.
381
- - **Two different "distribution" questions exist.** For contour figures,
382
- `distribution-color` and `distribution-x/y` over `[random, linear, gaussian
383
- mixture model]`. For sky figures, `distribution-image` over `[gaussian
384
- mixture model, real image of the sky]`. They are not comparable and should
385
- not be pooled — match on the full question text, not on the substring
386
- "underlying distribution".
387
- - **Ground truth is shaped differently in the two file types.** In the released
388
- qa jsons `A` is *always* a `dict` (all 47,357 of them). In the run pickles it
389
- is a `dict` for figure-level questions but **unwrapped to a bare `str` or
390
- `float`** for plot-level ones. Each question is consistent in its own type,
391
- but code that reads both file types must handle both shapes.
392
- - **Models rename the answer key.** Claude commonly answers `plot_types` when
393
- asked for `plot types`. Match keys up to spacing, underscores and case, or
394
- you will score a correct answer as a parse failure.
395
- - **A small number of responses are unparsable** — about 0.14% (30 of 21,300),
396
- split between prose-instead-of-JSON and valid JSON containing an explicit
397
- `null` refusal. Decide deliberately whether those count as wrong or as
398
- excluded; the two failure modes arguably differ.
399
- - **Level 2 answers are often wrong by orders of magnitude.** Bounded metrics
400
- (e.g. sSMAPE) saturate here. `log10(predicted/true)` is the more informative
401
- summary for the angular-size and colour-statistic questions.
402
- - **The dataset viewer is disabled** (`viewer: false`). The JSON records are
403
- deeply nested rather than tabular, so the viewer cannot render them
404
- meaningfully.
405
-
406
- ---
407
-
408
- ## Provenance and attribution
409
-
410
- The **`sky-real`** figures are plotted from real survey cutouts retrieved via
411
- [NASA SkyView](https://skyview.gsfc.nasa.gov/). Across the 667 real-sky
412
- figures: 659 distinct astronomical objects, drawn from 14 SkyView survey
413
- categories — predominantly optical (`OtherOptical`, `Optical:DSS`), with
414
- infrared (`IRAS`, `WISE`, `2MASS`, `AKARI`, `Planck`, `WMAP&COBE`, `UKIDSS`),
415
- radio (`Radio:MHz`, `Radio:GHz`, `GLEAM`) and X-ray (`ROSATDiffuse`)
416
- representative among them.
417
-
418
- Each figure's `plot0.data['data params']['sky image params']` keeps the full
419
- provenance: source `filename`, the original FITS `header`, `survey`,
420
- `telescope`, `instrument`, `object`, `bunit`, and the ADS-style bibcode of the
421
- paper the field was taken from (411 distinct source papers).
422
-
423
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
SCHEMA.md.bak DELETED
@@ -1,267 +0,0 @@
1
- # Field reference
2
-
3
- Field-by-field detail for every file type in this repo. The
4
- [README](README.md) is the overview; this is the part you read when writing a
5
- parser.
6
-
7
- ---
8
-
9
- ## 1. `VQA_full/qa_jsons/vqa_NNNNNN_qa.json`
10
-
11
- **Encoding gotcha:** the file is a JSON-encoded *string*, so it needs two
12
- decodes — `json.loads(json.load(f))`. A single decode silently hands you a
13
- `str`, not a `dict`.
14
-
15
- Top level: `figure`, `plot0`, `VQA`, `vqa_id`.
16
-
17
- ### 1.1 `figure` — render parameters
18
-
19
- | Field | Type | Notes |
20
- |---|---|---|
21
- | `dpi` | int | |
22
- | `base` | int | base figure size before aspect scaling |
23
- | `aspect ratio` | float | width / height |
24
- | `nrows`, `ncols` | int | always `1` in this release |
25
- | `plot style` | str | matplotlib style name, e.g. `seaborn-v0_8-muted` — ground truth for the `plot style` question |
26
- | `color map` | str | e.g. `rainbow_r` — ground truth for `colormap` |
27
- | `title fontsize`, `xlabel fontsize`, `ylabel fontsize`, `xlabel ticks fontsize`, `ylabel ticks fontsize` | int | |
28
- | `plot indexes` | list | grid position of each panel, e.g. `[[0, 0]]` |
29
- | `pixel width`, `pixel height` | int | rendered size; matches the JPEG |
30
- | `figsize` | [float, float] | inches |
31
- | `facecolor` | [r, g, b, a] | 0–1 floats |
32
- | `figure_params` | dict | the fuller randomisation record: panel style, layout pads, `tight_layout`, `flipped font/face colors`, `fontcolor` |
33
- | `font_params` | dict | per-element font sizes plus `csfont` (the chosen font family) |
34
-
35
- ### 1.2 `plot0` — the panel
36
-
37
- | Field | Type | Notes |
38
- |---|---|---|
39
- | `type` | str | `contour` or `image of the sky` |
40
- | `distribution` | str | `random` / `linear` / `gmm` for contour; `gmm` or `sky` for sky images |
41
- | `data` | dict | `xs`, `ys`, `colors`, `data params` — see below |
42
- | `data pixels` | dict | the same data in **pixel** coordinates, under `image` and/or `contour` |
43
- | `data from plot` | dict | values read back off the rendered artists; non-serialisable entries are the string `"non serializable entry"` |
44
- | `color bar` | dict | bounding box `xmin/ymin/xmax/ymax` plus placement `params` |
45
- | `xticks`, `yticks`, `color bar ticks` | list of dict | one per tick: `data` (the label as typeset, LaTeX included), its box, and anchor `tx`/`ty` |
46
- | `square` | dict | bounding box of the plot area itself |
47
- | `title`, `xlabel`, `ylabel` | dict | box plus `words`; `title` is absent when the figure has none |
48
-
49
- **Coordinate convention:** boxes are in pixels, origin bottom-left, matching
50
- the rendered JPEG's `pixel width` / `pixel height`. Flip `y` for
51
- image-library conventions with the origin at the top.
52
-
53
- #### `plot0.data.data params`
54
-
55
- For **synthetic** panels: the generating parameters.
56
-
57
- For **real sky** panels (`distribution == "sky"`) it additionally carries:
58
-
59
- | Field | Notes |
60
- |---|---|
61
- | `WCS` | `"non serializable entry"` — use the header strings instead |
62
- | `WCS header string` | FITS WCS of the panel **as plotted** |
63
- | `WCS header string (fetched)` | FITS WCS of the cutout **as retrieved** (before resampling) |
64
- | `sky image params` | full provenance — see below |
65
-
66
- #### `sky image params` (real sky panels only)
67
-
68
- A dict — note it may be stored as its `repr`, in which case
69
- `ast.literal_eval` recovers it.
70
-
71
- | Field | Notes |
72
- |---|---|
73
- | `filename` | source FITS name; encodes bibcode, object, survey and cutout size |
74
- | `header` | the original FITS header, verbatim |
75
- | `survey header` | SkyView's survey descriptor |
76
- | `survey` | SkyView category, e.g. `['Optical:DSS class=']` (a list) |
77
- | `object` | resolved object name, e.g. `NAME Cas A`, `M 31` (SIMBAD spacing preserved) |
78
- | `telescope`, `instrument` | often `None` for optical plate surveys |
79
- | `bunit`, `btype` | physical units of the pixel values, e.g. `MJY/SR`, `JY/BEAM`, `K` |
80
- | `pdf` | ADS-style bibcode of the source paper, e.g. `1995ApJS___97__347G` |
81
- | `original img size`, `fetched img size` | pixel dimensions before/after retrieval |
82
- | `resample transform` | how the cutout was resampled onto the panel grid |
83
-
84
- ### 1.3 `VQA` — the questions
85
-
86
- Addressed as `VQA[level][kind][name]`, where `level` is `Level 1` / `Level 2` /
87
- `Level 3` and `kind` is `Figure-level questions` or `Plot-level questions`.
88
-
89
- **The two kinds nest differently:**
90
-
91
- ```
92
- VQA['Level 1']['Figure-level questions']['plot style'] -> entry
93
- VQA['Level 2']['Plot-level questions' ]['mean color']['plot0'] -> entry
94
- ^^^^^^^^ panel key
95
- ```
96
-
97
- Plot-level questions are keyed by panel underneath the question name. Every
98
- figure here is single-panel, so the extra level is easy to miss; code that
99
- omits it gets a `dict` where it expected a question. Detect by testing for the
100
- `Q` key rather than by assuming depth:
101
-
102
- ```python
103
- def question_entries(node):
104
- if 'Q' in node:
105
- yield None, node
106
- else:
107
- for panel, entry in node.items():
108
- yield panel, entry
109
- ```
110
-
111
- A question **entry**:
112
-
113
- | Field | Notes |
114
- |---|---|
115
- | `Q` | the assembled prompt: `persona + context + question + format` |
116
- | `A` | **ground truth**. In the qa jsons this is *always* a one-key `dict`, e.g. `{"plot style": "seaborn-v0_8-muted"}`. (It is **not** always a dict in the run pickles — see §3.) |
117
- | `persona` | system framing |
118
- | `context` | scene-setting, and the multiple-choice list when one is offered |
119
- | `question` | the question alone, without persona/context/format |
120
- | `format` | the requested answer shape, e.g. `{"plot style":""}` |
121
-
122
- **Parse `format` rather than hard-coding key names.** It states the exact JSON
123
- key the model was asked to fill, so extraction can never drift from the prompt:
124
-
125
- ```python
126
- def expected_key(fmt):
127
- if not fmt or '{' not in fmt:
128
- return None
129
- inner = fmt.split('{', 1)[1].split('}', 1)[0]
130
- return inner.split(':', 1)[0].strip().strip('"\'') if ':' in inner else None
131
- ```
132
-
133
- Question counts: **21** per contour figure, **25** per sky figure. The
134
- difference is the plot-level set — contour figures get x/y axis limits, colour
135
- statistics and two distribution questions; sky figures get RA/Dec limits and
136
- units, epoch, angular field size, colour statistics, provenance and pixel
137
- scale.
138
-
139
- ---
140
-
141
- ## 2. `VQA_full/imgs/vqa_NNNNNN.jpeg`
142
-
143
- JPEG, RGB, one per record, filename matching the `vqa_id`. Dimensions vary per
144
- figure (roughly 2000–2700 px wide) and always equal `figure['pixel width']` x
145
- `figure['pixel height']`.
146
-
147
- ---
148
-
149
- ## 3. `LMM_outputs_n150*/MODEL/vqa_NNNNNN_qa.pickle`
150
-
151
- A 2-tuple: `(qa_list, model_id)`.
152
-
153
- - `qa_list` — one dict per question asked of that figure, in ask order
154
- - `model_id` — the exact model string used, e.g. `gpt-5.4-nano-2026-03-17`
155
-
156
- ### Entry fields, present for every model
157
-
158
- | Field | Notes |
159
- |---|---|
160
- | `Q`, `persona`, `context`, `question`, `format` | copied verbatim from the qa json |
161
- | `A` | ground truth, but **reshaped**: a `dict` for figure-level questions, unwrapped to a bare `str` or `float` for plot-level ones (see below) |
162
- | `Level`, `type` | which level and kind the question came from |
163
- | `reasoning` | the appended instruction asking for a separate explanation JSON |
164
- | `prompt` | the full text sent to the API, including the reasoning instruction |
165
- | `raw answer` | **the model's response, verbatim** — parse this |
166
- | `Response`, `Response String` | the same text after light handling |
167
-
168
- #### Ground-truth shape differs from the qa json
169
-
170
- The qa json stores every `A` as a one-key dict. The runs unwrapped the
171
- plot-level ones when assembling prompts, so in the pickles:
172
-
173
- | Question kind | `A` type | Example |
174
- |---|---|---|
175
- | Figure-level (plot style, colormap, titles, labels, ticks, plot type) | `dict` | `{'plot style': 'seaborn-v0_8-muted'}` |
176
- | Plot-level, categorical (epoch, finest unit, contour style, distribution) | `str` | `'gaussian mixture model'` |
177
- | Plot-level, numeric (axis limits, colour stats, field size, pixel scale) | `float` | `-16.47` |
178
-
179
- Two exceptions to keep in mind:
180
-
181
- - **RA axis limits are `str`, not `float`** — they are sexagesimal, e.g.
182
- `'18h52m45.57s'`. Dec limits *are* floats, in degrees. Do not assume the two
183
- coordinate axes parse the same way.
184
- - **Tick-value answers are lists, and double-nested**: `A` is
185
- `{'xtick values': [[label, label, ...]]}` — a list containing one list of
186
- tick labels, each a typeset string with LaTeX intact
187
- (`'18$\\mathregular{^h}$52$\\mathregular{^m}$'`). Unwrapping once gets you
188
- the inner list, which is the answer; these questions are not scalar-valued.
189
-
190
- Each question is internally consistent in its type, so you can key the expected
191
- shape off the question — but do not assume dict:
192
-
193
- ```python
194
- def ground_truth(entry):
195
- a = entry.get('A')
196
- if isinstance(a, dict):
197
- a = next(iter(a.values()), None)
198
- return a[0] if isinstance(a, list) and a else a
199
- ```
200
-
201
- ### Provider-specific extras
202
-
203
- | Field | Present for |
204
- |---|---|
205
- | `fac` | GPT — image downscale factor applied before sending |
206
- | `usage` | Claude, Gemini — token accounting |
207
- | `system prompt` | Claude, Gemini |
208
- | `Response (raw)` | Gemini — the untouched SDK payload |
209
-
210
- ### Unpickling without the vendor SDKs
211
-
212
- The pickles embed the provider's own response object, so a plain
213
- `pickle.load` needs `anthropic` / `google-genai` importable. Every field listed
214
- above is a plain string, so unknown classes can be stubbed:
215
-
216
- ```python
217
- import pickle
218
-
219
- class _Stub:
220
- def __init__(self, *a, **k): pass
221
- def __setstate__(self, s): self.__dict__.update(s if isinstance(s, dict) else {})
222
-
223
- class TolerantUnpickler(pickle.Unpickler):
224
- def find_class(self, module, name):
225
- try:
226
- return super().find_class(module, name)
227
- except (ImportError, AttributeError):
228
- return type(name, (_Stub,), {})
229
-
230
- with open(path, 'rb') as f:
231
- qa_list, model_id = TolerantUnpickler(f).load()
232
- ```
233
-
234
- ### Parsing a response
235
-
236
- Responses are two JSON objects back to back — the answer, then the
237
- explanation — and models are not reliable about it. Observed in these runs:
238
- the requested key renamed (`plot_types` for `plot types`), trailing commas,
239
- single quotes, unescaped LaTeX backslashes, mismatched braces, fenced code
240
- blocks, and answer and explanation merged into one object.
241
-
242
- A robust reader should: strip code fences; extract balanced `{...}` objects;
243
- match the key from `format` up to spacing, underscores and case; treat the
244
- non-`explanation` value as the answer if the key is absent entirely; and
245
- distinguish "no answer recoverable" from "wrong answer". About 0.14% of
246
- responses (30 of 21,300) yield no answer at all.
247
-
248
- ---
249
-
250
- ## 4. `LMM_outputs_n150_archive_light/archive_manifest.json`
251
-
252
- `{vqa_id: recipe}` for all 150 aged figures. The identical recipe is also
253
- written per figure as `MODEL/vqa_NNNNNN_qa_archive.json`.
254
-
255
- | Field | Notes |
256
- |---|---|
257
- | `preset` | `"archive-light"` |
258
- | `base_seed` | run-wide seed (`20260914`) |
259
- | `seed` | this figure's seed, derived from its id — the reason all three models saw the same aged image |
260
- | `effects` | effect names that fired, in order |
261
- | `effects_by_phase` | the same, split into `ink`, `paper`, `post` |
262
- | `grayscale` | whether this figure was converted to gray |
263
- | `gray_prob` | the probability used for that draw (`0.6667`) |
264
- | `page background` | RGB of the simulated paper |
265
-
266
- `aged_imgs/vqa_NNNNNN.jpeg` holds the resulting images — the exact bytes sent
267
- to the models. Re-running the aging is unnecessary.