D21 / README.md
Y-xvan's picture
D21: MVTec-LOCO-AD -> T-B1 (unified SFT; viewer-friendly row groups)
a0d1b7c verified
|
Raw
History Blame Contribute Delete
3.93 kB
---
tags:
- smart-manufacturing
- sft
- industrial
- vision
license: other
pretty_name: D21
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.
---
# D21
Logical & structural anomaly detection (multi-region localization GT). 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
**3,651** records (test=1568 · train=1778 · validation=305). Pixel masks are embedded as a `mask` image column (multi-region `masks`).
## 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}` / `{anomalous, logical}` / `{anomalous, structural}` (not a JSON object). The pixel masks (`mask`/`masks`) are 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-LOCO-AD (Bergmann et al., IJCV 2022, *"Beyond Dents and Scratches"*) — unsupervised
anomaly detection over 5 product categories, distinctive for splitting anomalies into **logical** (violations
of logical constraints: missing / extra / misplaced components, wrong count or arrangement) and **structural**
(local defects: scratches, dents, contamination).
**Query & answer (this repo's SFT task).** `query` is our own instruction template (the raw dataset ships no
natural-language question). It asks the model to decide **good vs anomalous** and, if anomalous, classify the
defect type as **logical** or **structural**, answering in the form `{label, defect_type}` — exactly what
`annot` holds. **The query does not ask for a pixel mask.**
**Masks (localization ground truth for a separate, deferred task).** Every anomalous image ships pixel-precise
ground-truth masks: `mask` = the first anomalous region, `masks` = the list of all regions. One image can have
several **disjoint** anomalous regions — most have 1, but some logical anomalies have up to 15 (e.g. each wrong
compartment is its own region). Normal images have `mask`=null, `masks`=[]. Producing a pixel mask is not
something a text-output model emits directly, so this release keeps the masks as ground truth but does **not**
frame localization as the query task (it is deferred; the masks remain available for pixel-level evaluation or
segmentation models).
**Split.** `train` = normal only; `validation` = normal only; `test` = normal + anomalous (logical + structural).
See **Records** for exact counts. Standard unsupervised protocol with a real held-out validation split.
## Provenance
Underlying dataset: **MVTec-LOCO-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: `D21/convert_d21.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. Each record carries `metadata.image_sha256` so overlapping images can be kept entirely on one side of a train/eval split.