PRL-MSD / README.md
YenweiChen's picture
Serve paired image and mask columns in Dataset Viewer
875e997 verified
|
Raw History Blame Contribute Delete
3.49 kB
---
license: cc-by-nc-4.0
pretty_name: PRL-MSD
language:
- en
task_categories:
- image-segmentation
tags:
- computer-vision
- industrial-inspection
- manufacturing
- surface-defect-segmentation
- semantic-segmentation
size_categories:
- 1K<n<10K
configs:
- config_name: default
data_files:
- split: train
path: data/train-00000-of-00001.parquet
---
# PRL-MSD: Industrial Surface Defect Segmentation Dataset
The Product Realization Laboratory at National Tsing Hua University, Taiwan, developed PRL-MSD for research on automated visual inspection. This release contains 1,599 industrial surface images with manually annotated pixel-level masks. Each image and mask is a 256 × 256 RGB PNG. Images stored as grayscale before release were converted to RGB by copying their intensity values into all three channels.
## Sample distribution
| Sample category | Count |
| --- | ---: |
| Background | 300 |
| Indentation | 496 |
| Scar | 374 |
| Scratch | 429 |
| **Total** | **1,599** |
Each retained mask contains at most one defect class. This release excludes 14 samples from the previous revision whose masks contained two defect classes. Thirteen combined indentation and scratch, and one combined indentation and scar. The 300 background samples have all-black masks. Sample IDs remain stable across revisions, so the sequence has gaps.
## Mask encoding
| Pixel class | RGB | Suggested class ID |
| --- | --- | ---: |
| Background | `(0, 0, 0)` | 0 |
| Indentation | `(249, 192, 12)` | 1 |
| Scar | `(249, 50, 12)` | 2 |
| Scratch | `(0, 185, 241)` | 3 |
Use exact RGB matches to convert masks to integer class IDs. Use nearest-neighbor interpolation if you resize the masks for training.
## Load the dataset
```python
from datasets import load_dataset
dataset = load_dataset("YenweiChen/PRL-MSD", split="train")
sample = dataset[0]
image, mask = sample["image"], sample["mask"]
```
The `train` split contains the full collection. This release supplies a single split for loading. Benchmark users should create and document their evaluation partition.
| Field | Description |
| --- | --- |
| `sample_id` | Stable ID shared by the image and its mask. |
| `image` | Surface image. |
| `mask` | RGB mask with the pixel classes shown above. |
| `category` | Sample-level category derived from the original filename. |
| `defect_classes` | Defect classes present in the mask, excluding background. |
| `is_multiclass` | Whether the mask contains more than one defect class. This field is false for all samples in this release. |
The Parquet file used by the Dataset Viewer embeds both PNGs in each row. For direct access to the PNG files, download `data/train.zip`. It contains paired files in `image_256_gray/` and `mask_256/`, with sample mappings in `metadata.jsonl`.
## Collection and limitations
The images depict industrial workpieces photographed under varying perspectives and lighting conditions. A single expert manually annotated the defect regions. Inter-annotator agreement has yet to be measured. Performance may vary on other materials, surface finishes, or imaging setups.
## License
PRL-MSD is licensed under [Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/). Contact the dataset maintainer for commercial permissions.
## Citation
Reference the [PRL-MSD dataset repository](https://huggingface.co/datasets/YenweiChen/PRL-MSD) and the revision used.