193 / README.md
weipang142857's picture
card: document metadata.geometry (auto-generated numbers)
b3df668 verified
|
Raw
History Blame Contribute Delete
8.06 kB
---
tags:
- smart-manufacturing
- sft
- industrial
- vision
license: other
pretty_name: "193"
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.
---
# 193
Steel-sheet surface anomaly detection (binary; 4 anonymous class ids + segmentation kept as 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
**12,568** records (train=12568). 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: the plain-text image-level label `good` or `anomalous`. Severstal's 4 official defect classes are UNNAMED (numeric ids only), so — following the same principle as DAGM — the anonymous class id is NOT asked of the model; the per-image class-id list and the RLE-decoded class-indexed segmentation `mask` are kept as deferred ground truth in `metadata.defect_classes` and the `mask` column — 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.** Severstal Steel Defect Detection (Kaggle 2019) — originally pixel-level **4-class defect
segmentation** of steel-sheet surfaces (1600×256). The four defect classes are official but **UNNAMED**:
Severstal (the steel maker) never released what they physically mean — the labels are only the numeric ids
**1–4**. Data is obtained from the public HF mirror `rohanath/severstal-steel-detection`.
**Query & answer — why BINARY (this repo's SFT task).** Because the class ids are anonymous, there is no
semantic concept for a vision-language model to ground: asking it to output `1` vs `3` would be asking it to
reproduce an arbitrary, meaningless label. So — exactly as we do for **DAGM** (also anonymous classes) — the
task is **binary**: `query` asks only good vs anomalous, and `annot` is the plain-text label `good` or
`anomalous` (label = `anomalous` iff the image has a defect annotation). **We do not put the anonymous class
id in `annot`.**
**Anonymous class ids + mask (deferred GT, in metadata / mask column).** The class information is not
discarded — it is preserved as ground truth: `metadata.defect_classes` holds the per-image list of defect
class ids present (e.g. `[1, 3]`; 427 images carry more than one), and the competition's run-length-encoded
(RLE) masks are decoded (column-major) into a **class-indexed** segmentation `mask` (pixel value = defect
class id), kept as deferred localization GT with `defect_area_fraction` in `metadata`. A downstream user who
obtains a semantic naming for the 4 classes can recover the full multi-label / segmentation task from these.
**On the 4 class ids.** Severstal never released the meaning of classes 1–4; the numeric ids remain the
only official labels, so this repo's task is strictly **binary** (`good` / `anomalous`) and the ids are kept
only as raw deferred GT in `metadata.defect_classes` (no semantic naming is asserted).
**What is excluded (audit).** The Kaggle **test set** (5,506 images, GT withheld) is dropped; the mirror's
`visualized_images/` are mask **overlays** (would leak the answer) and are excluded; the mirror's
`labels/*.txt` are **derived YOLO boxes** (computed from the RLE) — not used, the RLE is the raw GT.
**Split.** Single `train` pool = **12,568** images: 6,666 defective (RLE-annotated) + 5,902 defect-free.
The mirror's degenerate train(all-defective)/val(all-good) partition is not used as a split.
## Provenance
Underlying dataset: **Severstal**. Upstream license: **other (Kaggle competition data; via HF mirror rohanath/severstal-steel-detection)** (this card is `license: other`; respect the upstream terms). Converted read-only from the raw source into the unified schema; conversion code under `193/` (with `publish/push_to_hf.py`) in [`AI4Manufacturing/forge_model`](https://github.com/AI4Manufacturing/forge_model).
## Overlap / de-duplication (§8)
The Kaggle test set (GT withheld) and the mirror's derived YOLO labels are excluded; the RLE is the raw GT. Each record carries `metadata.image_sha256` so overlapping images can be kept entirely on one side of a train/eval split.
<!-- 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` | `None` |
| `legibility_floor_px` | `None` |
| `min_side_floor_px` | `None` |
| `spec_sha` | `4619037bbfa82f39` |
### Provenance and verification
| | |
|---|---|
| records | 12,568 |
| carrying a geometry block | **12,568 / 12,568** |
| instances per record | `0`: 5,902, `1`: 2,531, `2`: 1,785, `3`: 991, `4`: 545, `5+`: 814 |
| total instances | 16,471 |
| image dimensions | 1600×256 (12,568) |
| `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 -->