Datasets:
File size: 6,919 Bytes
7dd9ffe 752bf0f 7dd9ffe 752bf0f 7dd9ffe 752bf0f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | ---
pretty_name: PolyMFO
license: cc-by-nc-4.0
task_categories:
- image-classification
- image-segmentation
size_categories:
- n<1K
tags:
- image
- anomaly-detection
- foreign-object-detection
- industrial-inspection
---
# PolyMFO
[](https://creativecommons.org/licenses/by-nc/4.0/)
[](https://huggingface.co/datasets/VNSO-AI/PolyMFO)
[](https://github.com/CaoMinhh/PolyMFO)
PolyMFO is a high-resolution image dataset for foreign-object anomaly classification and binary segmentation. It contains normal samples and samples from nine foreign-object classes. Every image has a corresponding binary mask.
> **This Hugging Face repository contains the dataset only.**
> Source code for data processing, benchmark preparation, evaluation, and related research utilities is maintained at [https://github.com/CaoMinhh/PolyMFO](https://github.com/CaoMinhh/PolyMFO).
## Dataset summary
| Property | Value |
|---|---:|
| Total images | 575 |
| Image resolution | 2160 × 2160 pixels |
| Training images | 460 |
| Testing images | 115 |
| Normal images | 288 |
| Anomaly images | 287 |
| Anomaly classes | 9 |
| Split | 80% training / 20% testing |
| Segmentation mask | Binary, 0 = background and 1 = anomaly |
The dataset uses a deterministic stratified holdout split based on `status` and `class_id`, with random seed `20260904`.
## Dataset visualization
Representative samples from PolyMFO are shown below. Each sample includes the input image, its binary segmentation mask, and the corresponding anomaly overlay. The visualization covers the normal category and all nine foreign-object classes.

## Class distribution
| Label index | Class ID | Foreign-object type | Training | Testing | Total |
|---:|---|---|---:|---:|---:|
| 0 | — | Normal | 230 | 58 | 288 |
| 1 | F001 | White textile thread | 23 | 5 | 28 |
| 2 | F002 | Black textile thread | 29 | 7 | 36 |
| 3 | F003 | Human hair | 26 | 6 | 32 |
| 4 | F004 | Transparent plastic film fragment | 15 | 4 | 19 |
| 5 | F005 | Cling film fragment | 20 | 5 | 25 |
| 6 | F006 | Colored plastic film fragment | 26 | 7 | 33 |
| 7 | F007 | Cardboard fragment | 39 | 10 | 49 |
| 8 | F008 | Plastic flash fragment | 23 | 6 | 29 |
| 9 | F009 | Cable tie fragment | 29 | 7 | 36 |
## Directory structure
```text
PolyMFO/
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
└── PolyMFO_V1/
├── classes.csv
├── final_polymfo_annotations.csv
├── split_info.json
├── visual_dataset/
│ └── visual_dataset.jpg
├── training/
│ ├── normal/
│ ├── normal_mask/
│ ├── anomaly/
│ └── anomaly_mask/
├── testing/
│ ├── normal/
│ ├── normal_mask/
│ ├── anomaly/
│ └── anomaly_mask/
└── npy/
├── x_train.npy
├── x_test.npy
├── segmentation/
│ ├── y_train.npy
│ └── y_test.npy
└── classification/
├── y_train.npy
└── y_test.npy
```
## Annotation files
### `final_polymfo_annotations.csv`
| Column | Description |
|---|---|
| `image_path` | Image path relative to the dataset root |
| `mask_path` | Corresponding binary-mask path |
| `split` | `training` or `testing` |
| `status` | `normal` or `anomaly` |
| `class_id` | `F001`–`F009`; empty for normal images |
| `foreign_object_type` | `none` for normal images |
| `mask_area_percent` | Mask foreground area as a percentage of the image, rounded to four decimal places |
| `updated_at` | Annotation update timestamp, when available |
### Other metadata
- `classes.csv` maps each anomaly class ID to its foreign-object type.
- `split_info.json` records the split method, random seed, counts, and dataset version.
## NumPy arrays
All provided arrays use `float32`.
| File | Shape | Description |
|---|---|---|
| `npy/x_train.npy` | `(460, 2160, 2160, 3)` | RGB training images |
| `npy/x_test.npy` | `(115, 2160, 2160, 3)` | RGB testing images |
| `npy/segmentation/y_train.npy` | `(460, 2160, 2160, 1)` | Binary training masks |
| `npy/segmentation/y_test.npy` | `(115, 2160, 2160, 1)` | Binary testing masks |
| `npy/classification/y_train.npy` | `(460, 10)` | One-hot training labels |
| `npy/classification/y_test.npy` | `(115, 10)` | One-hot testing labels |
The classification index order is:
```text
0: normal
1: F001
2: F002
3: F003
4: F004
5: F005
6: F006
7: F007
8: F008
9: F009
```
Because the image and segmentation arrays are large, memory mapping is recommended:
```python
import numpy as np
x_train = np.load("npy/x_train.npy", mmap_mode="r")
y_seg_train = np.load("npy/segmentation/y_train.npy", mmap_mode="r")
y_cls_train = np.load("npy/classification/y_train.npy", mmap_mode="r")
print(x_train.shape, x_train.dtype)
print(y_seg_train.shape, y_seg_train.dtype)
print(y_cls_train.shape, y_cls_train.dtype)
```
## Code repository
This Hugging Face repository is dedicated to the **PolyMFO dataset**.
The source code for data processing, benchmark preparation, evaluation, and related research utilities is available at:
**https://github.com/CaoMinhh/PolyMFO**
For implementation details and reproducibility instructions, please refer to the GitHub repository.
## Intended uses
PolyMFO is intended for non-commercial academic and scientific research, including:
- Image classification
- Binary semantic segmentation
- Anomaly detection and localization
- Industrial visual-inspection benchmarking
- Evaluation of models under high-resolution inputs
- Reproduction and comparison of research results
Commercial use is not permitted under the CC BY-NC 4.0 license.
## Limitations
- The dataset contains 575 images and may not represent all real-world foreign objects, imaging conditions, or operating environments.
- Class frequencies are not identical, especially in the testing split.
- Results obtained on PolyMFO should not be interpreted as proof of generalization to other acquisition systems or industrial environments.
- Users should report the provided fixed split for directly comparable benchmark results.
## Citation
Citation information and the BibTeX entry will be updated after the associated paper is published.
```bibtex
% To be updated after publication.
```
## License
PolyMFO is licensed under the **CC BY-NC 4.0** license.
Non-commercial use is permitted with proper attribution. Commercial use is prohibited.
See the full license terms: https://creativecommons.org/licenses/by-nc/4.0/ |