193-grounding / README.md
weipang142857's picture
card: document metadata.geometry (auto-generated numbers)
f1b12ee verified
|
Raw
History Blame Contribute Delete
11.8 kB
---
tags:
- smart-manufacturing
- sft
- industrial
- vision
license: other
pretty_name: 193-grounding
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.
dataset_info:
features:
- name: query
dtype: string
- name: image
dtype: image
- name: annot
dtype: string
- name: reasoning
dtype: 'null'
- name: cate
dtype: string
- name: task
dtype: string
- name: metadata
dtype: string
splits:
- name: train
num_examples: 12420
---
# 193-grounding
Detection-format **surface-defect localization** on Severstal cold-rolled steel-strip imagery —
**12,420 records** (all `train`), derived **deterministically** (no LLM/teacher) from the base
[`AI4Manufacturing/193`](https://huggingface.co/datasets/AI4Manufacturing/193) masks. The model
outputs **boxes as text**: `annot` is a native-pixel JSON list
`[{"bbox_xywh": [x, y, w, h]}]` (origin top-left, sorted by x then y), one box per surviving defect
region — or `[]` when the strip is good (rejection is in-task). Anonymous class (box-only, no `type`
token), matching [`181-grounding`](https://huggingface.co/datasets/AI4Manufacturing/181-grounding).
## Task
**Locate every defect region** on the strip -> boxes. Composition:
- **6,518** positive images carrying **15,646** boxes total (transitive-merge components that survive
the legibility + fill floors).
- **5,902** good images shipped as **empty-answer `[]` negatives** (~1:1) — the goods carve-out.
- **Empty-answer prior: 47.5%** (5,902 of 12,420).
Boxes-per-positive-image (frozen battery): mean **2.4709**, median **2**, p90
**5**, max **15**.
## Schema (7 columns, answer-only)
| field | type | meaning |
|---|---|---|
| `query` | str | student question — domain-conditioned steel-strip surface QC; **34** pooled variants; ends with a verbatim box-output directive |
| `image` | Image | the raw steel-strip surface photo (bytes; never cropped) |
| `annot` | str | machine-parseable **gold**: JSON box list `[{"bbox_xywh":[x,y,w,h]}]` (native px), or `[]` on goods |
| `reasoning` | null | none — deterministic derivation, answer-only |
| `cate` / `task` | str | `B` / `T-B1` (inherited from parent 193) |
| `metadata` | str (JSON) | `image_sha256`, `negative`, `n_boxes`, `gold_boxes_xywh` (== `annot`), `derivation`, `legibility_floor`, `fill_floor`, `gold_scope`, `goods_carveout`, `anonymous_class`, `disclosures`, family + gate provenance |
## Roles (regime 3)
**Roles:** this is an **answer-only** tier — there is no reasoning content (`reasoning` is `null` on every
record). `annot` is both the machine-parseable **gold** AND the **direct-answer SFT target** in the exact
format the `query` specifies (regime 3: the final format the query requests == the `annot` format); it is
also the exact-match / IoU **reward key** for RLVR.
## Gold scope — legible components only (disclosed)
Golds derive from the class-indexed mask by a **transitive union-find merge @12px** of connected
components. A component is kept only if it clears the **legibility floor** (16px short side @ native/2.36MP (scale 1.0); counting all-components-legible margin @1568 long-side) **and** a fill-ratio
floor (mask-pixels / bbox-area >= 0.05). Sub-floor components are **unlearnable-by-render** and are
excluded: **5.0%** of components fall below the floor at the native/2.36MP production
reference. The gold is therefore **legible-components-only** (render-relative) — an answer never silently
omits a *legible* box. Goods `[]` is an **absence VERDICT** ("no defect region under this standard"), not
an exhaustiveness claim.
## Grounding is not a saliency task (round-2 self-test)
Because goods ship as **`[]`**, the model must perform real **defect-vs-benign discrimination**, not
generic saliency. The frozen round-2 CONVERGED self-test confirms this decisively: a saliency detector
actually *prefers to box goods* — std **AUC 0.415**; **89.3%** of
goods false-fire at 80% defect recall; the MCQ-killing low-level texture shortcut
compounds to **67% goods-FP**. Empty-on-goods forces the discrimination a
pure saliency model cannot fake. (An MCQ rung was measured **NOT-VIABLE** — a saliency task — and dropped;
grounding survives because coverage + empty-on-goods make it real.)
## Anonymous defect classes
Severstal's four surface-defect classes are **anonymous**: the maker never released what they
physically mean (the labels are only the numeric ids 1-4; typology not given — see Carvalho et al.,
[arXiv:2305.13261](https://arxiv.org/abs/2305.13261)). With no released semantics, this rung is
**defect-agnostic** — no defect *type* token appears anywhere in `query` or `annot` (matching the
sibling [`181-grounding`](https://huggingface.co/datasets/AI4Manufacturing/181-grounding), also an
anonymous-class, box-only rung with no `type` field). The build-gate asserts **0** query/annot cells
carry a phenomenon-noun/type token. (The "pitted / crazing / scratches / patches" names that
circulate online are **NEU-DET's** and are mis-attributed to Severstal; they are not used here.)
## Query design (build-gate 9)
The `query` is drawn from a fixed **34-variant** domain-conditioned pool (selected by an
independent salted per-image hash). Each variant names the domain (cold-rolled steel-strip surface
inspection) and defers to *"this line's / this setting's defect standard"* **without enumerating which
phenomena count as defects** — the model learns the good/anomalous boundary from the data, not the
prompt. The pool reuses the parent `query_pool._FORBIDDEN` guard: a machine gate confirms **0** variants
leak a phenomenon noun and every variant ends with the verbatim answer-format directive
`Output a JSON list [{"bbox_xywh": [x, y, w, h]}] in native pixels, origin top-left, one box per defect region, sorted by x then y; output [] if none.`
## Provenance / reproduction
Derived **read-only** from the class-indexed segmentation masks of base
[`AI4Manufacturing/193`](https://huggingface.co/datasets/AI4Manufacturing/193) (Severstal Steel Defect
Detection, Kaggle 2019). Answers are a **pure function of the mask****$0 teacher, no LLM anywhere** in
this rung: each box list / count is recomputed by a **transitive union-find merge @12px** of the mask's
connected components to a growing-extent fixpoint. Built by
[`forge_model`](https://github.com/AI4Manufacturing/forge_model) `annotate/193/rungs/`
(`build_rungs.py`, `query_pool_rungs.py`, `prebuild_gates_v2.py`; cards by `gen_cards.py`, all numbers
read from frozen reports). Every choice is salted-hash seeded; a rerun reproduces the artifact exactly.
- **Derivation script** `build_rungs.py` sha256 `bf42ab24790ce37bc2d791023880c853a1b23bcbbb343a8c94d825797f76185e`.
- **11 deterministic checks (re-derived from the written parquet's mask)** re-derived every gold from the *written* parquet's mask: grounding boxes —
**0 mismatches vs mask re-derivation; 15646 boxes total**; counting FINAL count — **0 mismatches vs mask re-derivation (FINAL == component count)**.
- Boxes are canonical **native-px COCO xywh**. Convert to your model's grounding convention at train
time — regenerate, don't regex; see `common/box_convert.py` in forge_model.
Upstream license **other** — respect the upstream terms. Public, **manual access review**
(`gated=manual`).
## Split & family carve manifest
**Train-only** — every record is `split=train` (no val split; uniform-split policy). Eval carving is
fully **downstream**, keyed on `metadata.image_sha256` across the whole **193 family** (parent 193 +
grounding + counting share images), so a machine-checkable carve manifest is shipped alongside the
build (`outputs/193/rungs/family_carve_manifest.json`, keyed on `image_sha256`):
| member | records |
|---|---|
| parent `193` | 12,568 |
| `193-grounding` | 12,420 |
| `193-counting` | 10,870 |
| in **both** rungs | 10,870 |
Family size (distinct images) = **12,568**. The two rungs pose **different questions**
(boxes vs count) over **overlapping images** — same evidence: carve them **jointly** on `image_sha256`,
and never place the same image on both sides of a train/eval split.
## Overlap / de-duplication (§8)
Inherits base `193`'s image relationships (Kaggle **test** GT withheld and the mirror's derived YOLO
labels are excluded upstream). Every record carries `metadata.image_sha256`; the grounding and counting
rungs share images with each other and the parent — reconstruct any overlap and carve jointly via the
family manifest above.
## Companions
[`193`](https://huggingface.co/datasets/AI4Manufacturing/193) (base binary good/anomalous),
[`193-counting`](https://huggingface.co/datasets/AI4Manufacturing/193-counting) (separated-region count).
<!-- GEOMETRY-BLOCK:BEGIN -->
## 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. `scale` is `1.0` throughout — this
repo publishes at source resolution, nothing was downscaled at publish time.
```jsonc
"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` | `transitive_box_merge` |
| `binarisation` | `gt:0` |
| `connectivity` | `8` |
| `merge` | `box_transitive:12` |
| `min_area_px` | `0` |
| `max_instances` | `None` |
| `artifact` | `fine` |
| `fill_floor` | `0.05` |
| `legibility_floor_px` | `16` |
| `min_side_floor_px` | `None` |
| `spec_sha` | `89cb21949c0ccbfa` |
### Provenance and verification
| | |
|---|---|
| records | 12,420 |
| carrying a geometry block | **12,420 / 12,420** |
| instances per record | `0`: 5,902, `1`: 2,569, `2`: 1,764, `3`: 929, `4`: 511, `5+`: 745 |
| total instances | 15,646 |
| image dimensions | 1600×256 (12,420) |
| `scale` values present | [1.0] |
Derived from the [`AI4Manufacturing/193`](https://huggingface.co/datasets/AI4Manufacturing/193)
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.
### 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 a
1600×256 strip is rendered 1596×252 and native-pixel boxes are then wrong by a few pixels.
`forge_model/193/adapt.py` regenerates coordinates for a target render size, re-derives counts, and
drops records whose gold no longer holds there.
<!-- GEOMETRY-BLOCK:END -->