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).
D15
Multi-label defect detection & classification (semantic mask GT deferred). Category B, task T-B2, in the unified Smart-Manufacturing SFT schema.
The repository name is an internal task code. See Provenance below for the underlying dataset.
Records
2,685 records (train=2685). Pixel masks are embedded as a mask image column.
Correction (2026-07-08): 26 upstream-mislabeled records were removed — DefectSpectrum's
DS-MVTec/pill/image/good/folder contains misplaced metal-nut photos (verified against original MVTec-AD; none match any real pill image). The same photos remain as correctmetal_nutrecords. SeeSOURCE_DATA_ISSUES.md.
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_types]} — {good, null} or {anomalous, [type1, type2, ...]}, the defect classes present (multi-label), derived from the semantic mask's class indices via the per-category legend. The class-indexed semantic mask is localization ground truth for a separate, deferred task; the legend is in metadata.defect_legend — 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. Defect Spectrum (EnVision-Research, ECCV 2024, arXiv:2310.17316) — fine-grained, multi-class semantic re-annotation of 4 defect datasets (DS-MVTec, DS-VISION, DS-DAGM, DS-Cotton-Fabric). One image can contain several defect types; a class-indexed semantic mask marks each, and a per-category legend maps a mask index to a defect name.
Query & answer (this repo's SFT task). query is our own instruction template (the raw dataset ships no
natural-language question). It names the source/category, lists that category's possible defect classes, and asks
the model to decide good vs defective and, if defective, list all defect types present — answering in the
form {label, [defect_types]} (multi-label), exactly what annot holds ({good, null} /
{anomalous, [type1, type2, ...]}). The defect types are derived from the semantic mask + the legend, so
DS-VISION / DS-DAGM (which have no per-defect folders) get real types too. The query does not ask for a mask.
Mask & legend (deferred localization ground truth). The mask column is the class-indexed semantic
segmentation mask (pixel value = defect-class index; 0 = background); normal images have mask=null. The
per-category legend (index -> defect name) is in metadata.defect_legend, and the derived classes in
metadata.defect_types. A text-output model cannot emit a pixel mask, so localization is deferred (mask kept as GT).
Defect classes. The legend (defects_dict from each source's DS-*.md) defines 98 per-category defect
classes (58 distinct names): DS-MVTec 15 categories / 71, DS-VISION 6 / 20, DS-DAGM 1 / 5, DS-Cotton-Fabric 1 / 2.
Split & notes. No upstream train/val split -> single train. Re-annotates MVTec/VISION/DAGM/Cotton (keep on
one side of any split vs the raw sets). synthetic_* (generated augmentation) is excluded, and the paper's
per-sample captions are not included here. A few images are labeled anomalous but have an all-zero mask (source
contradiction) -> {anomalous, []}.
Provenance
Underlying dataset: DefectSpectrum. Upstream license: MIT (upstream MVTec/VISION/DAGM/Cotton) (this card is license: other; respect the upstream terms). Converted read-only from the raw source into the unified schema; conversion script: D15/convert_d15.py, published with publish/push_to_hf.py, both in AI4Manufacturing/forge_model.
Training-mixture notes (2026-07-17 certification)
- One photo appears in up to 5 family artifacts (family mean ≈6.3 items/photo). Carve any train/eval
split PHOTO-WISE on
metadata.image_sha256across ALL D15-family repos simultaneously (this base repo plusD15-annotated,D15-mcq,D15-region,D15-grounding). - Global label prior: 85.6% of photos are defective — a blind guesser scores ≈90% on good-vs-defective labels. Counterweight with good-heavy sources in your mixture; this is a structural property of DefectSpectrum, not a leak (text-only blind probe on shipped queries: MCQ at exact chance 25%; region at prior level).
- 641 VISION photos in this family are byte-shared with
AI4Manufacturing/D23under a MATERIALLY DIFFERENT label policy (DS masks confirm only 88.5% of VISION boxes; worst subset coverage 0.03). Take each shared image from exactly ONE side — machine-readable keys:overlap_with_D23.jsonon this repo. Full sibling-overlap table: §8 below. - The known source contradiction (anomalous label + empty mask, sha 4be393b8...) is RETAINED here for faithfulness but excised from all derived rungs as of 2026-07-17.
Overlap / de-duplication (§8)
D15 re-annotates images that also exist (byte-identical, sha-verified 2026-07-08) in sibling repos — do not use those repos' held-out splits as evaluation for a model trained on D15:
| D15 slice | overlaps | where they sit in the sibling's official split |
|---|---|---|
| DS-MVTec (1,616 unique) | D20 (MVTec-AD) |
all in test — 94% of D20's test split (1,616/1,725); the same MVTec images also appear in D05 (MMAD) |
| DS-DAGM (270) | 181 (DAGM2007) |
150 train / 120 test (11.4% of 181's test anomalies) |
| DS-VISION (717) | D23 (VISION) |
315 train / 326 val / 76 unlabeled-inference |
| DS-Cotton-Fabric (86) | — | no sibling repo |
Each record carries metadata.image_sha256, so any overlap set can be reconstructed or excluded exactly.
DS-VISION ↔ D23: labels disagree on shared images, and the overlap is machine-readable. The two lineages follow different upstream annotation policies (VISION preserves the original sparse crowd-sourced defect decisions; DefectSpectrum re-annotated exhaustively): measured on the 641 shared published records, DS masks confirm 88.5% of VISION's boxes, a median 68% of DS defect pixels fall inside the VISION-box union, and on 259/641 images it is under half (worst: Groove). Build mixtures with each shared image from exactly one repo — prefer D15 for detection-shaped supervision (finer, exhaustive lineage). Key list: overlap_with_D23.json (641 shared sha256 keys + the 76 inference-split keys), joinable to metadata.image_sha256; generated by annotate/D23/overlap_sidecar.py in forge_model.
Cross-family evaluation lock — metadata.eval_lock (stamped 2026-09-19; 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: 2,058 of 2,685 records (2,058 distinct images) are locked — by column: 2,058 by the cross-family manifest, 0 by their own split, 0 both ways and counted once; counterparts (records per counterpart; a record can appear under several): 181-annotated test 120 · 181-grounding test 120 · 181-mcq test 107 · 181-region test 120 · 181 test 120 · D05-1-annotated test 1,610 · D05-annotated test 1,610 · D05 test 1,610 · D20 test 1,612 · D23 validation 326. 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 |
class_index |
connectivity |
4 |
merge |
mask_dilate:1pct |
min_area_px |
15 |
max_instances |
8 |
artifact |
fine |
fill_floor |
None |
legibility_floor_px |
None |
min_side_floor_px |
None |
spec_sha |
f366c0519bb2a2f3 |
Provenance and verification
| records | 2,685 |
| carrying a geometry block | 2,685 / 2,685 |
| instances per record | 0: 387, 1: 1,231, 2: 430, 3: 227, 4: 136, 5+: 274 |
| total instances | 4,972 |
| image dimensions | 1024×1024 (1,075), 512×512 (356), 1280×1024 (178) |
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) | 512×512 → 504×504, 640×480 → 644×476, 700×700 → 700×700 |
| shipped boxes | 4,972 |
| legible at that render (>=16px there) | 3,553 (71.5%) |
⚠ 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
512×512 is rendered 504×504 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.
Query text — pooled paraphrases (v2)
Every record's query is drawn from common/vision_query_pools.json[D15/label_types], a pool of 37 gate-verified paraphrases of the shipped wording, assigned by a stable hash of the source image path and recorded as metadata.query_template (37 templates in use, top share 3.4%).
⚠ Approved deviation — v1 named the source dataset ('DS-MVTec/'), which the LEAK rule forbids; v2 names the product. Found defect, not a tidy-up: v1's query carried the dataset identifier DS-MVTec/<product>, which violates the corpus's own LEAK rule (the canon predates it); v2 removes it and says The image shows a <product>. The product noun per category is the D15 family's own table (annotate/D15/annotate_d15.py::PRODUCT: DAGM → textured industrial surface, Cotton-Fabric → woven cotton fabric, Groove → machined groove surface, Ring → metal ring, VISION Wood → wood panel, Capacitor / Screw → the bare noun; MVTec objects keep their category name, metal_nut → metal nut). Wording ours (grammar only, so that the templates saying a <product> read as English; change at will): MVTec carpet / leather / tile / wood → carpet surface / leather surface / tile surface / wood surface, MVTec grid → metal grid, VISION Console → console housing (the family table says electronics console housing). The map is common/query_pools.py::D15_PRODUCT.
Template ↔ gold independence on this build: 2,685 records, 37 templates, worst template p = 0.0155, alpha 2.7e-04, 0 flagged → PASS.
Frame-size floor (common/lazy_floors.py, the standing (width, height)-only row): balanced accuracy 0.715 vs 0.500 chance (plain 0.555 vs 0.856 majority; permutation p = 0.005, 200 shuffles), 13 distinct frame sizes — a shortcut of +21.5 pp balanced, report against it (5-fold cross-validation: the repository ships one split). Mechanism, not noise: DefectSpectrum is assembled from four sources whose frames differ in size and whose label priors differ — every DAGM, Cotton-Fabric and VISION frame (512×512, 1280×1024, 3840×2748, 1080×1440, 640×480, 1292×964, 1920×1280; 1,073 records, 40%) is defective, and so is every MVTec 800×800 frame (132); all 386 good images sit in MVTec's 1024 / 840 / 700 / 900 / 1000-px frames (71–76% defective there, 96.5% at 1000 px). The frame size therefore names the source and, for 45% of the records, fixes the answer outright; any number reported on the shipped split must beat this, and a per-source breakdown is the honest way to report.
Answers, images, masks, split and every other field are byte-identical to v1: this revision was issued from the published parquet itself (tools/requery_published.py), not rebuilt from source, and the pixel-identity guard ran on the embedded images (§8 below).
Image identity — measured at this republish
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.
Measured at build time, not asserted afterwards — a violation aborts the build and names the offending records:
| images checked | 2,685 |
| distinct by decoded pixels | 2,685 |
| images carrying more than one record | 0 |
| images on both sides of the split | 0 |
- Downloads last month
- 133