| --- |
| tags: |
| - smart-manufacturing |
| - sft |
| - industrial |
| - vision |
| license: other |
| pretty_name: D20 |
| 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. |
| --- |
| |
| # D20 |
|
|
| One-class 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 |
|
|
| **5,354** records (test=1725 · train=3629). 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, broken_large}`). 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.** MVTec-AD (Bergmann et al., CVPR 2019) — the standard unsupervised industrial anomaly |
| detection & localization benchmark: 15 categories (10 objects + 5 textures), ~48 fine-grained, **per-category** |
| defect types, pixel-precise ground-truth masks. |
|
|
| **Query & answer (this repo's SFT task).** `query` is our own instruction template (the raw dataset ships no |
| natural-language question — only folder labels + masks). It names the object category, asks the model to decide |
| **good vs anomalous**, and, if anomalous, name the defect type **from that category's own closed set** — the |
| valid defect names are 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 or segmentation models). |
|
|
| **Split.** `train` = normal images only; `test` = normal + anomalous (all defect types). MVTec-AD ships **no |
| separate validation split**. Standard unsupervised one-class protocol. |
|
|
| ## Provenance |
|
|
| Underlying dataset: **MVTec-AD**. Upstream license: **CC BY-NC-SA 4.0** (this card is `license: other`; respect the upstream terms). Converted read-only from the raw source into the unified schema; conversion script: `D20/convert_d20.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; do not put both in train+eval. Each record carries `metadata.image_sha256` so overlapping images can be kept entirely on one side of a train/eval split. |
|
|