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).

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); 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 in ONE of two declared forms, both matching the query form: on 14 categories {label, defect_type}{good, null} or {anomalous, <defect>} where <defect> is the specific per-category defect name (e.g. {anomalous, broken_large}); on toothbrush the one-slot form {good} / {anomalous}, because its only "type" (defective) is a placeholder — see Single-type category below. 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. 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 and asks the model to decide good vs anomalous. On the fourteen categories whose defect set has two or more members it also asks for the defect type from that category's own closed set, enumerated in the query, and the answer form is {label, defect_type} — exactly what annot holds ({good, null} / {anomalous, <defect>}). On toothbrush no type is asked and the answer form is {good} / {anomalous} — see Single-type category below. The query does not ask for a pixel mask.

Two declared answer forms, by category. This repo ships two grammars, and which one a record carries is decidable from its query's directive (and stamped as metadata.query_pool): F2a/label_type → two-slot {label, defect_type} on bottle, cable, capsule, carpet, grid, hazelnut, leather, metal_nut, pill, screw, tile, transistor, wood, zipper (5,252 records); F2c/verdict_only → one-slot {good} / {anomalous} on toothbrush (102 records). One grammar per repo is not a design rule; an undeclared second grammar would be. Any parser of annot across this repo needs a test row for each form.

Single-type category: no type slot on toothbrush (2026-09-17). toothbrush has exactly one defect "type" in the source, defective — and defective is a placeholder, not a name: it restates the verdict and says nothing the verdict does not (a real name states a kind, a place or a mechanism, as opened or crack do). A closed-set type question on a set of one hands the answer over in the prompt; an open naming of a placeholder can never be matched, because a model cannot see from the image that the gold lacks a name. So on those 102 records the query asks for the verdict alone, and annot is the one-slot analogue of the two-slot grammar{good} on 72 records and {anomalous} on 30 — the slot absent, not filled with null (which already means "no defect type applies" on goods) and not with the placeholder (the 2026-09-16 rule admits none in the line). The token defective stays in metadata.defect_type on every record that carried it. Type accuracy is scored only where a category's set has two or more members.

⚠ The answer column changed at this revision. annot moved on 102 records — all of toothbrush — from the two-slot form to the one-slot form: {good, null}{good} on 72 and {anomalous, defective}{anomalous} on 30. No other record's annot moved. This is stated here because a changed query is visible to a consumer (the card renders the query text and its pools) but a changed annot is not — nothing else on the card would differ — so the card is the only place a consumer can learn of it.

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.

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,252 records, 39 gate-verified paraphrases (39 in use, top share 3.0%); template 1 is v1's wording byte for byte.

  • F2c/verdict_only — 102 records, 36 gate-verified paraphrases (33 in use, top share 7.8%); 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 — 1 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: 5,354 records, 72 templates, worst template p = 0.00748, alpha 1.4e-04, 0 flagged; 10 roles, worst role p = 0.109, 0 flagged → PASS.

Role sentence re-drawn. draw 1 (default salt): role 8 = 29.8% anomalous vs 23.5% overall on 551 records, binomial p = 0.0007 < 0.001 (10x2 chi-square p = 0.0043) -> FAIL. draw 2 (salt D20/2): worst role p = 0.109, 0 flagged -> PASS (the independence line above). The roles on this revision come from the second draw (metadata.query_role_salt = D20/2); a re-draw is allowed once and both draws are recorded here — draws: 2 of a maximum of 2.

Frame-size floor (common/lazy_floors.py, the standing (width, height)-only row): balanced accuracy 0.544 vs 0.500 chance (plain 0.433 vs 0.729 majority; permutation p = 0.010, 200 shuffles), 6 distinct frame sizes — a shortcut of +4.4 pp balanced, report against it (5-fold within the test split because the training split holds a single class (all 3,629 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 102 of 5,354 records, and metadata on 5,354 (the added query_pool key; query_template on 101). 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: 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 code under D20/ (with publish/push_to_hf.py) in AI4Manufacturing/forge_model.

Overlap / de-duplication (§8)

Subset of MMAD's image pool; do not put both in train+eval.

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.

Decoded at this revision, and re-derived from the shipped stamps (2026-09-21). Every image was decoded again for this revision — 5,354 images, 5,354 distinct — and the counts below ARE that measurement, re-derived here from this repository's own metadata.pixel_sha256 stamps and asserted equal; they also reproduce the identity block this repository published previously (evidence forge_model/evidence/identity_chains/identity_D20.json, sha16 c31478b23dc3db8f, tracked in forge_model 629c826ef4ff — fetch the exact bytes from git rather than trusting a digest with no history). Corrected 2026-09-21: an earlier revision of this card denied that any image had been decoded for it and named the decoding pass as revision None, which recorded nothing.. A disagreement aborts the build and names the offending records:

images checked 5,354
distinct by decoded pixels 5,354
images carrying more than one record 0
images on both sides of the split 0

Cross-family evaluation lock — metadata.eval_lock (stamped 2026-09-20; manifest revision fe6e286912b0, generated 2026-09-08). Every record of this repository, locked or not, carries metadata.eval_lock, computed by forge_model/common/overlap.py::Overlap.stamp_for against common/overlap_manifest.json at that revision — so within this repository the absence of the key cannot occur. Shape: {"locked": bool, "against": [{"repo": …, "split": …}, …], "own_split": …, "manifest_revision": …, "manifest_generated": …}. locked is true when the image is evaluation material anywhere in the corpus; against names every repository and split in which it is (sorted; [] when not locked; it includes the record's own family where that is so); own_split marks a record locked by its own split. The per-record field is the authority — the count here is quoted once, at this revision, and a later manifest may change it: 1,725 of 5,354 records (1,725 distinct images) are locked — by column: 1,692 by the cross-family manifest, 1,725 by their own split, 1,692 both ways and counted once; counterparts (records per counterpart; a record can appear under several): D05-1-annotated test 1,690 · D05-annotated test 1,690 · D05 test 1,690 · D20 test 1,692; 1,725 locked by their own split: test. In words: 1,725 of the 5,354 records in this repository are evaluation material by their own metadata.split (test: 1,725) and sit inside the HF split named test / train — under the uniform-split convention the HF split name is a container name, and metadata.split together with metadata.eval_lock carries the truth; a train pool must exclude them. A stamp whose manifest_revision differs from the current manifest is stale, not wrong — recompute it (Overlap.stamp_is_current); a record with no stamp has not been checked against the corpus as it now is. Overlap.partition / assert_train_pool_clean read the field: a train pool built from this repository must exclude every locked record.

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 3846e7273d925bb0

Provenance and verification

records 5,354
carrying a geometry block 5,354 / 5,354
instances per record 0: 4,096, 1: 995, 2: 165, 3: 65, 4: 16, 5+: 17
total instances 1,698
image dimensions 1024×1024 (3,595), 800×800 (434), 1000×1000 (351)
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) 700×700 → 700×700, 800×800 → 812×812, 840×840 → 840×840
shipped boxes 1,698
legible at that render (>=16px there) 1,674 (98.6%)

⚠ 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 700×700 is rendered 700×700 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
181