PolyMFO / README.md
CaoMinhh
Initial PolyMFO dataset release
752bf0f
|
Raw History Blame Contribute Delete
6.92 kB
---
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
[![License: CC BY-NC 4.0](https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc/4.0/)
[![Dataset](https://img.shields.io/badge/Hugging%20Face-Dataset-yellow.svg)](https://huggingface.co/datasets/VNSO-AI/PolyMFO)
[![Code](https://img.shields.io/badge/Code-GitHub-black.svg)](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.
![PolyMFO dataset visualization](PolyMFO_V1/visual_dataset/visual_dataset.jpg)
## 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/