| --- |
| tags: |
| - smart-manufacturing |
| - sft |
| - industrial |
| - vision |
| license: other |
| pretty_name: D22 |
| extra_gated_fields: |
| Name: text |
| Affiliation: text |
| Intended use: text |
| extra_gated_prompt: >- |
| This dataset is released for **research use**. Access is reviewed and granted |
| **manually** by the maintainers. Please state your name, affiliation, and intended use. |
| --- |
| |
| # 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) | |
| | `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] | *(D21 only)* 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, asks the model to decide |
| **good vs anomalous**, and, if anomalous, name the defect type **from that category's own closed set** (enumerated |
| in the query). The answer form is `{label, defect_type}` — exactly what `annot` holds (`{good, null}` / |
| `{anomalous, <defect>}`). **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. |
|
|
| ## 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 script: `D22/convert_d22.py`, published with `publish/push_to_hf.py`, both in [`AI4Manufacturing/forge_model`](https://github.com/AI4Manufacturing/forge_model). |
|
|
| ## Overlap / de-duplication (§8) |
|
|
| Subset of MMAD's image pool; 22 images appear in both train & test (source duplication) -> dedup downstream. Each record carries `metadata.image_sha256` so overlapping images can be kept entirely on one side of a train/eval split. |
|
|