You need to agree to share your contact information to access this dataset
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This dataset is released for research use. Access is reviewed and granted manually by the maintainers. Please state your name, affiliation, and intended use.
Log in or Sign Up to review the conditions and access this dataset content.
Roles
Roles: canon repo — annot is the source label, kept machine-parseable as the gold for verification and reward parsing; there is no reasoning column and this repo is not itself a training view. Derived repos (-annotated, -grounding, -region, -mcq) each state their own regime on their own card. Geometry for every record lives in metadata.geometry (below).
D22
Supermarket-goods anomaly detection with per-category defect naming. Category B, task T-B1, in the unified Smart-Manufacturing SFT schema.
The repository name is an internal task code. See Provenance below for the underlying dataset.
Records
6,124 records (test=2987 · train=3137). Pixel masks are embedded as a mask image column.
Unified SFT schema
| field | type | meaning |
|---|---|---|
query |
str | the question / instruction (model input) |
image |
Image | the input image (bytes embedded); for multi-image rows, a preview of the first view |
images |
list[Image] | (multi-image rows) all input views / modalities for the row, bytes embedded |
annot |
str | the answer — for this dataset: plain-text {label, defect_type} matching the query form — {good, null} or {anomalous, <defect>} where <defect> is the specific per-category defect name (e.g. {anomalous, opened}). The mask column is localization ground truth for a separate, deferred task — see Task, mask & split below |
reasoning |
null | no native CoT in these datasets |
cate |
"B" | SFT category |
task |
"T-xx" | unified task id |
metadata |
str (JSON) | split, provenance, image_path, image_sha256 (dedup key) |
mask |
Image | null | (T-B1/T-B2 only) the pixel ground-truth mask, bytes embedded |
masks |
list[Image] | (multi-image T-B1 / D21) per-view masks aligned with images (None where a view has no defect), or multi-region masks |
Task, mask & split
What this is. PKU-GoodsAD (Zhang et al., IEEE RA-L 2024, arXiv:2307.04956) — unsupervised anomaly detection
& segmentation over 6 supermarket-goods categories, each with real per-category defect types
(deformation, surface_damage, opened, cap_open, cap_half_open, straw_missing, broken,
surface_anomaly), pixel-precise ground-truth masks.
Query & answer (this repo's SFT task). query is our own instruction template (the AD benchmark ships no
natural-language question — only folder labels + masks). It names the good's category and asks the model to decide
good vs anomalous. On the five categories whose defect set has two or three members it also asks for the defect
type from that category's own closed set (enumerated in the query). On cigarette_box, whose set has exactly
one member, the closed-set type question is not asked — see Single-type categories below — and the query asks
for the verdict, with the defect type to be named from what is seen rather than chosen from a list. The answer
form is {label, defect_type} on every record — exactly what annot holds ({good, null} /
{anomalous, <defect>}) — and the gold carries its type token under both forms. The query does not ask for a
pixel mask.
Mask (localization ground truth for a separate, deferred task). Each anomalous image ships a single binary
ground-truth mask (mask column; 1 = defect, 0 = background); normal images have mask=null. A text-output
model cannot emit a pixel mask directly, so this release keeps the masks as ground truth but does not frame
localization as the query task (deferred; masks remain for pixel-level evaluation / segmentation models).
Split. train = normal images only; test = normal + anomalous (all defect types). Standard unsupervised
one-class protocol. 22 images appear in both train and test upstream (source duplication) — de-duplicate via
metadata.image_sha256 before building any split.
Note. The raw PKU-GoodsAD folder also carries an added MMAD-style VQA layer (QA.json) and captions (.txt);
those belong to the aggregated-VQA (MMAD) dataset, not this anomaly-detection task, and are not used here.
Evaluation status
This repo's test split is an evaluation set for the whole corpus and must never enter a training pool.
2,968 of D22's images are also MMAD/D05 images, where they are test; the corpus rule is that an image
that is test or validation in any repo is eval-locked in every repo
(forge_model/common/overlap_manifest.json). Measured over all 6,124 records:
| split | label | locked by the manifest | locked, any reason | free to train | total |
|---|---|---|---|---|---|
| test | anomalous | 1,659 | 1,659 | 0 | 1,659 |
| test | good | 1,309 | 1,328 | 0 | 1,328 |
| train | good | 22 | 22 | 3,115 | 3,137 |
The 22 locked train records are the 22 images this source ships in both splits (identical
image_sha256, both copies labelled good, no label or type conflict anywhere in the repo); they are
locked because their test copies are, and the source split is not rewritten. The 19 test goods the
manifest does not hold are missing from it only because D05 does not happen to hold those images —
they are locked anyway, by their own test split: the manifest indexes cross-family duplicates, and a
record whose own split is an evaluation split is locked before the manifest is consulted
(forge_model/common/overlap.py, 2026-09-17). Which D22 records may train is declared on the
D22-goods card, not here.
Consequently the verdict-and-defect-type task on this repo's test split is the D22 evaluation set:
there is no separate D22-verdict repo, and the derived D22-grounding and D22-mcq rungs are built
from this split as evaluation sets.
Single-type categories
cigarette_box has exactly one defect type in this source (opened); the other five categories carry two or
three. On a category with one type the closed-set type question is not asked. With a set of one the query
hands the answer over, and the type slot's accuracy is 100% by construction however the sentence is worded —
measured on the previous revision, all 612 of that category's queries named opened. So those 612 queries
now ask for the verdict, and ask the defect type to be named from what is seen rather than chosen from a
list.
What does not change: the answer form stays {label, defect_type} and the gold stays {anomalous, opened}.
This repo has no reasoning column, so annot is the output-format target and the query must request the form
annot holds (see Roles above); a bare verdict ask over a two-slot gold would be a query/gold mismatch.
opened is a real name — it states a mechanism the verdict does not — so the type slot is kept; a category
whose only "type" merely restates the verdict (defect, defective, a bare id) drops the slot instead.
Type accuracy is scored only where the category's defect set has two or more members.
This rule is why this revision's query differs from the previous one on exactly those 612 records, and on no
others.
Query text — pooled paraphrases (v2)
This repository ships 2 question forms over the same images, and each draws from its own pool in common/vision_query_pools.json (metadata.query_template is the index within that form's pool; metadata.query_pool says which form a record is):
F2a/label_type— 5,512 records, 39 gate-verified paraphrases (39 in use, top share 3.2%); template 1 is v1's wording byte for byte.F2b/label_type_open— 612 records, 36 gate-verified paraphrases (36 in use, top share 4.2%); this form has never been published before, so it has no earlier wording to reproduce and every template in its pool was gated as new.
The opening role sentence is drawn separately (metadata.query_role, a 10-way hand-written pool _role/sentence; index 0 is this repository's own sentence, index 1 is none); the subject sentence is this repository's own, verbatim, on every record. Role and ask are hashed independently.
Both pools clear the 30-variant floor on their own (39 and 36 gate-verified paraphrases), so neither form's diversity rests on the other's count. The two are separate index spaces: metadata.query_pool is stamped on every record because a template index alone does not say which pool it indexes — 14 of the re-drawn records land on the same index NUMBER in the new pool as they carried in the old.
Template ↔ gold independence on this build: 6,124 records, 75 templates, worst template p = 0.0381, alpha 1.3e-04, 0 flagged; 10 roles, worst role p = 0.0979, 0 flagged → PASS.
Frame-size floor (common/lazy_floors.py, the standing (width, height)-only row): balanced accuracy 0.512 vs 0.500 chance (plain 0.555 vs 0.555 majority; permutation p = 0.030, 200 shuffles), 2 distinct frame sizes — a shortcut of +1.2 pp balanced, report against it (5-fold within the test split because the training split holds a single class (all 3,137 records), so a train→test probe can only predict that class; not comparable to train→test rows on other cards).
image, mask, annot, reasoning, cate, task and the split are byte-identical to the previous revision — this revision was issued from the published parquet itself (tools/requery_repool.py re-draws the text, tools/requery_stream.py --push carries every other column out of the live shard). What moved: query on 612 of 6,124 records, and metadata on 6,124 (the added query_pool key; query_template on 598). The image identities in §8 were carried from the previous pass and re-measured from the metadata.pixel_sha256 this repository already ships — no image was decoded again, because none was touched.
Provenance
Underlying dataset: PKU-GoodsAD. Upstream license: GPL-3.0 (this card is license: other; respect the upstream terms). Converted read-only from the raw source into the unified schema; conversion code under D22/ (with publish/push_to_hf.py) in AI4Manufacturing/forge_model.
Overlap / de-duplication (§8)
Subset of MMAD's image pool; 22 images appear in both train & test (source duplication) -> dedup downstream.
Two identities, and they answer different questions. metadata.image_sha256 hashes the file bytes: it finds byte-identical copies and is blind to a re-encode. metadata.pixel_sha256 hashes the decoded image (mode | size | pixels): it finds the same photograph saved twice. Only the second one settles whether an image is duplicated.
Carried forward and re-measured, not decoded again. This revision changed text columns only, so no image was touched; the identities below are the ones this repository already ships in metadata.pixel_sha256, re-counted from them here and asserted equal to the pass that decoded them (revision db18059aeac8). A disagreement aborts the build and names the offending records:
| images checked | 6,124 |
| distinct by decoded pixels | 6,102 |
| images carrying more than one record | 22 |
| images on both sides of the split | 22 |
⚠ This dataset declares a exempt image-identity policy, so the row above is expected to be non-zero: UPSTREAM (GoodsAD release): 22 good test images are byte-identical copies of train images under the same file name (drink_bottle 14, food_bottle 8 — e.g. drink_bottle/test/good/023_015.jpg = drink_bottle/train/good/023_015.jpg); labels agree (all good). The split is published exactly as released so the official protocol stays reproducible; drop the 22 test copies (metadata.pixel_sha256) before evaluating. Recorded for the next data revision Images are still forbidden from crossing the split — and that rule too is exempted here, which is why the last row may be non-zero.
Geometry (metadata.geometry)
Every record carries a geometry block inside the existing metadata JSON string, so that its
gold can be re-derived at any render size. No schema column changed; existing loaders are
unaffected.
Coordinates are native pixels of the image in that record (coords_frame: "record_image"). scale is 1.0 throughout — this repo publishes at source resolution, nothing was downscaled at publish time.
"geometry": {
"image_wh": [W, H], // dims of the image in THIS record
"source_wh": [W, H], // dims of the original source image
"scale": 1.0, // image_wh / source_wh; < 1.0 would disclose a publish-time downscale
"n_instances": 2,
"instances": [
{ "instance_id": 1, "bbox_xywh": [x, y, w, h], "min_side_px": 65, "class": null }
],
"n_dropped_subminimum": 0, // components removed by the filters below
"union_box_fallback": false,// true => boxes are per-class unions, NOT real instances
"conventions": { ... } // see table
}
instances is present even when empty. [] means the record genuinely has no defects; an
absent block would mean geometry could not be recovered. Those are different states and are never
conflated.
Conventions used to derive it
There is no universal definition of "one defect instance" — it depends on the mask the source shipped. This repo's is stated, not implied:
| field | value |
|---|---|
algorithm |
dilate_cc |
binarisation |
gt:0 |
connectivity |
4 |
merge |
mask_dilate:1pct |
min_area_px |
15 |
max_instances |
None |
artifact |
fine |
fill_floor |
None |
legibility_floor_px |
None |
min_side_floor_px |
None |
spec_sha |
402e374580ddb91c |
Provenance and verification
| records | 6,124 |
| carrying a geometry block | 6,124 / 6,124 |
| instances per record | 0: 4,465, 1: 1,560, 2: 93, 3: 2, 4: 2, 5+: 2 |
| total instances | 1,774 |
| image dimensions | 3000×3000 (5,301), 3024×3024 (823) |
scale values present |
[1.0] |
Computed from this repo's own masks and verified against this repo's own published answers before it was written — a recomputation that disagreed with the shipped gold would have aborted the update rather than overwritten it.
⚠ The 16px floor applies at the RENDER, not at native
min_side_px is in native pixels. The model does not see native: Qwen2-VL caps by megapixels
AND snaps each dimension to a multiple of 28. So min_side_px >= 16 is the floor tested in the
wrong frame. Measured on this repo:
| native → rendered (qwen2_vl @ 2.36MP) | 3000×3000 → 1512×1512, 3024×3024 → 1512×1512 |
| shipped boxes | 1,774 |
| legible at that render (>=16px there) | 1,752 (98.8%) |
⚠ An earlier version of this section reported the inverse — boxes clearing 16px at native and failing at the render — and that number was misleading. It is frame-relative: publishing at a larger native size lets more boxes clear 16 in the published frame, so more can "fail", which penalises exactly the choice that helps. Measured on 179: publishing native (3024) means a box needs >=32px native to be legible at the render and 86.7% qualify; the previous 1024 publish needed >=47px native and only 69.5% qualified. The native republish improved rendered legibility by 17 points while the old metric scored it as 12.5% "broken". The figure above is the comparable one.
Nothing in the data is frame-dependent — geometry is native and complete. Use
forge_model/common/adapt_engine.py, which applies the floor at whatever size the consumer renders.
Using it
Coordinates only stay correct if they are rescaled with the image. A patch-based VLM does not
render at native size: Qwen2-VL's processor snaps both dimensions to a multiple of 28, so this repo's
3000×3000 is rendered 1512×1512 and native-pixel boxes are then wrong by a few pixels.
forge_model/common/adapt_engine.py regenerates coordinates for a target render size, re-derives counts, and drops records whose
gold no longer holds there.
- Downloads last month
- 150