Downloads · 30 days
33
26% of all-time downloads
steven0226/steel-defect-segmentation
steel-defect-segmentation is a image segmentation model from steven0226. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for ultralytics. The card lists the license as agpl-3.0.
Instance segmentation model for steel surface defects (4 defect classes), fine-tuned from Ultralytics YOLO26 (yolo26s-seg) on the Severstal: Steel Defect Detection Kaggle dataset.
Downloads · 30 days
33
26% of all-time downloads
All-time downloads
129
Public
Repo size
65.4 MB
Likes
0
Public
Click a slice to open those files.
.onnx42.1 MB · 64%
From the Hugging Face model README
Instance segmentation model for steel surface defects (4 defect classes),
fine-tuned from Ultralytics YOLO26
(yolo26s-seg) on the Severstal: Steel Defect Detection
Kaggle dataset.
Full training/evaluation pipeline, conversion scripts, and a Gradio demo are in the source repo: **source repository publication pending
Try it live: Space deployment pending
Manual visual inspection of steel strip surfaces is slow, inconsistent between inspectors, and hard to scale to full production-line speed. Instance segmentation — as opposed to plain classification or bounding-box detection — recovers the actual defect shape and area, which is what quality control needs to judge severity and to feed downstream metrics like defect area per coil. An end-to-end, NMS-free model like YOLO26-seg keeps per-image latency low enough (single-digit milliseconds on GPU, see below) for inline inspection.
12,568 grayscale 1600x256 images, RLE instance masks, 4 defect classes,
severely imbalanced (defect_3: 4,636 training images vs. defect_2: 222). Full
conversion pipeline (RLE decode, instance splitting, stratified split) is in
the source repo's scripts/convert_severstal_to_yolo.py. Kaggle competition
rules do not permit redistributing the raw data, so it is not included in
this model repo — download it yourself from Kaggle (free, requires accepting
the competition rules).
Held-out validation split (734 images, seed 42), imgsz=1024:
| mask mAP50 | mask mAP50-95 | GPU latency (RTX 4090, ONNX) | CPU latency (ONNX) |
|---|---|---|---|
| 0.587 | 0.232 | 8.04 ms mean (p95 8.46 ms) | 167.39 ms mean (p95 179.35 ms) |
| class | mask mAP50 | mask mAP50-95 |
|---|---|---|
| defect_1 | 0.537 | 0.173 |
| defect_2 | 0.543 | 0.181 |
| defect_3 | 0.625 | 0.260 |
| defect_4 | 0.642 | 0.316 |
Class imbalance, honestly: instance count alone doesn't predict per-class difficulty. defect_2 — the rarest class in training — outperforms defect_1 (~10x more training instances) on mask mAP50-95. defect_1's defects tend to be thin, elongated scratches with ambiguous boundaries, which likely hurts mask IoU regardless of how much data it has.
steel_defect_yolo26s_seg_best.pt — PyTorch checkpoint (Ultralytics format)steel_defect_yolo26s_seg_best.onnx — ONNX export (NMS-free, end-to-end), used for the CPU-friendly Gradio demopip install ultralytics huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights = hf_hub_download("steven0226/steel-defect-segmentation", "steel_defect_yolo26s_seg_best.pt")
model = YOLO(weights)
results = model.predict("steel_surface.jpg", imgsz=1024)
results[0].plot(pil=True).show()
For the ONNX file, pass task="segment" explicitly — a bare .onnx (no
Ultralytics .pt metadata) can't always auto-detect the task and otherwise
silently falls back to detection-only output with no masks:
model = YOLO(hf_hub_download("steven0226/steel-defect-segmentation", "steel_defect_yolo26s_seg_best.onnx"), task="segment")
The training/conversion/demo code in the source GitHub repo is MIT licensed. These weights are fine-tuned from Ultralytics YOLO26, which Ultralytics distributes under AGPL-3.0 (or a commercial Enterprise license) — see Ultralytics' licensing terms before using these weights in a closed-source product. The training data is subject to the Severstal competition rules.
Training, conversion and demo code: https://github.com/kuotunyu/steel-defect-segmentation (GitHub kuotunyu and Hugging Face steven0226 are the same author). That repository pins this model at an immutable revision and records the LFS object identities in its release/huggingface-evidence.json, but it deliberately does not claim that these weights are the artifact behind its reported metrics: this card records no source Git SHA, split membership or evaluation environment, so the artifact-to-report linkage is treated as unestablished. Do not cite the repository's numbers as this model's.