Datasets:
text stringlengths 37 1.68k |
|---|
2 0.498757 0.558306 0.994751 0.117716 |
2 0.500000 0.482965 1.000000 0.073858 |
6 0.503906 0.587822 0.085938 0.217832 |
7 0.723771 0.499715 0.070366 0.997201 |
1 0.502606 0.486975 0.047578 0.029351 |
0 0.412679 0.473604 0.095694 0.324402 |
6 0.429297 0.463984 0.095573 0.337344 |
1 0.555046 0.484385 0.041952 0.037217 |
6 0.494792 0.414062 0.059896 0.185547 |
2 0.500000 0.559123 1.000000 0.044880 |
0 0.577751 0.394059 0.106858 0.432448 |
2 0.500000 0.513545 1.000000 0.083444 |
2 0.499309 0.493094 0.990331 0.050645 |
1 0.544816 0.467500 0.046041 0.049489 |
0 0.511563 0.224976 0.086124 0.445159 |
6 0.744531 0.661465 0.046354 0.158076 |
7 0.531023 0.503413 0.220265 0.993173 |
2 0.500000 0.228134 1.000000 0.100614 |
2 0.500000 0.525147 1.000000 0.080866 |
2 0.501934 0.490341 0.992818 0.088591 |
2 0.500000 0.439825 1.000000 0.096443 |
0 0.496810 0.780861 0.080542 0.249123 |
7 0.507016 0.503004 0.171734 0.983881 |
6 0.375000 0.383789 0.041667 0.187500 |
2 0.502072 0.489052 0.995856 0.111796 |
6 0.496484 0.544463 0.063281 0.279551 |
7 0.374309 0.500000 0.056630 1.000000 |
1 0.589834 0.499351 0.050129 0.034924 |
0 0.608852 0.459458 0.089314 0.483517 |
2 0.500997 0.559131 0.998006 0.131021 |
2 0.500000 0.620166 1.000000 0.109586 |
2 0.498688 0.505801 0.997376 0.037753 |
6 0.681966 0.473633 0.039714 0.171875 |
0 0.344896 0.462656 0.103668 0.521794 |
0 0.523126 0.726045 0.069378 0.406627 |
6 0.338411 0.653848 0.054427 0.170186 |
2 0.500997 0.333413 0.998006 0.103836 |
7 0.490677 0.505985 0.025552 0.988029 |
7 0.288329 0.499079 0.021409 0.998158 |
2 0.501381 0.522385 0.997238 0.115866 |
2 0.500000 0.518333 1.000000 0.100387 |
0 0.485646 0.502967 0.122010 0.993174 |
6 0.427604 0.499912 0.230208 0.112324 |
1 0.480866 0.613336 0.059337 0.037286 |
2 0.500000 0.492551 1.000000 0.107753 |
0 0.741228 0.296164 0.098884 0.551659 |
2 0.498405 0.483748 0.996810 0.148971 |
7 0.504489 0.500000 0.071133 1.000000 |
1 0.572947 0.483619 0.059337 0.044890 |
6 0.589518 0.512207 0.061849 0.362305 |
2 0.500000 0.491814 1.000000 0.091538 |
2 0.500000 0.524227 1.000000 0.097440 |
6 0.513021 0.359854 0.192708 0.195498 |
1 0.502590 0.499660 0.031501 0.071222 |
0 0.458931 0.502193 0.108453 0.995614 |
2 0.500000 0.504521 1.000000 0.083812 |
6 0.281641 0.689600 0.149219 0.261230 |
7 0.642610 0.500000 0.090470 1.000000 |
7 0.378916 0.500000 0.062155 1.000000 |
0 0.523525 0.288381 0.078150 0.468309 |
2 0.500000 0.478545 1.000000 0.079751 |
2 0.500000 0.592376 1.000000 0.123250 |
1 0.500598 0.479107 0.037081 0.072625 |
0 0.499203 0.519904 0.117225 0.911427 |
2 0.498619 0.522394 0.997238 0.263214 |
2 0.499862 0.514282 0.996961 0.114383 |
0 0.501595 0.465431 0.090112 0.312041 |
1 0.500197 0.536865 0.041071 0.073369 |
7 0.496547 0.515654 0.041436 0.968692 |
2 0.500997 0.348764 0.998006 0.082703 |
6 0.471366 0.491682 0.666667 0.110860 |
2 0.500691 0.308545 0.998619 0.119116 |
2 0.508373 0.643668 0.925040 0.086380 |
1 0.511962 0.554230 0.043062 0.086844 |
0 0.491627 0.500359 0.082137 0.740742 |
6 0.499085 0.483691 0.406707 0.138496 |
7 0.757597 0.497698 0.060773 0.995396 |
7 0.243211 0.500000 0.049033 1.000000 |
2 0.499171 0.497891 0.998343 0.100018 |
0 0.520933 0.249099 0.121611 0.425630 |
7 0.508978 0.500000 0.058011 1.000000 |
7 0.126727 0.496777 0.033840 0.993554 |
7 0.244358 0.497081 0.033840 0.989871 |
7 0.745856 0.500000 0.045580 1.000000 |
7 0.898943 0.495285 0.054095 0.970626 |
6 0.446199 0.516623 0.863158 0.139418 |
2 0.500000 0.122456 1.000000 0.088620 |
2 0.499801 0.677967 0.999601 0.075223 |
2 0.500000 0.474862 1.000000 0.057643 |
0 0.507376 0.460486 0.161483 0.896252 |
1 0.494019 0.547141 0.035885 0.081169 |
2 0.499003 0.495718 0.998006 0.101491 |
2 0.501381 0.458840 0.997238 0.095580 |
7 0.754834 0.500000 0.042818 1.000000 |
7 0.669890 0.502569 0.051796 0.994401 |
2 0.501994 0.346571 0.996013 0.090279 |
6 0.496961 0.492928 0.297790 0.218996 |
1 0.484049 0.513475 0.035090 0.069097 |
6 0.523066 0.501943 0.700829 0.130221 |
2 0.496212 0.634896 0.904705 0.068828 |
BDFD9 — Bangladeshi Fabric Defect Dataset, version 3
An annotated image dataset of nine fabric defect types photographed on the production and inspection floors of four Bangladeshi textile and garment groups.
1,088 images · 1,388 annotated instances · 9 defect classes · CC BY 4.0
Quick start
Detection works out of the box with an unmodified Ultralytics loader:
yolo detect train data=data.yaml model=yolov8n.pt epochs=100 imgsz=640
For instance segmentation, swap the label sets first:
python use_segmentation.py seg # labels/ now holds polygons
yolo segment train data=data.yaml model=yolov8n-seg.pt epochs=100 imgsz=640
python use_segmentation.py det # switch back to boxes
Verified: YOLOv8n trains in both modes directly from data.yaml with no format
conversion or re-annotation.
Layout
BDFD9/
train/ images/ 726 labels/ 726 labels_seg/ 726
valid/ images/ 220 labels/ 220 labels_seg/ 220
test/ images/ 142 labels/ 142 labels_seg/ 142
data.yaml class list and split paths
classes.txt class ID to name mapping
dataset_metadata.csv per-image provenance (see below)
split_provenance.json split parameters and random seed
use_segmentation.py switches labels/ between boxes and polygons
scripts/ preparation and verification scripts
labels/ holds one axis-aligned box per instance in five-value YOLO format.
labels_seg/ holds one polygon per instance. Every file within a set uses a single
geometry type, so detection and segmentation loaders each receive uniform input.
Coordinates are normalised to [0, 1].
data.yaml deliberately has no path: key — a relative path resolves against the
Ultralytics datasets directory rather than this folder.
Classes
| ID | Class | Description | Occurs on |
|---|---|---|---|
| 0 | DropStitch | Dropped stitch: a loop lost from the knit structure, visible as a run or ladder along the wale | knit |
| 1 | Hole | Complete perforation through the fabric substrate | both |
| 2 | Horizontal LineMark | Course-direction (weft) line artefact from a machine fault | knit |
| 3 | Knot | Yarn knot protruding from the surface, usually a piecing join | knit |
| 4 | Oil Spot | Lubricant stain absorbed into the fabric, irregular boundary | knit |
| 5 | Setup | Localised opening or distortion produced during machine setup | woven |
| 6 | Slub | Localised thickening from irregular yarn diameter | knit |
| 7 | Vertical LineMark | Wale-direction (warp) line artefact from a machine fault | knit |
| 8 | Yarn Dust | Fly or lint contamination embedded in the surface | both |
Line-mark classes are defined relative to the fabric, not the image frame: annotators read the knit or weave direction from each photograph. Any augmentation applying a 90-degree rotation or transpose will exchange classes 2 and 7.
Splits
| Split | Images | Instances | Boxes | Polygons | Share |
|---|---|---|---|---|---|
| train | 726 | 955 | 847 | 108 | 66.7 % |
| valid | 220 | 271 | 247 | 24 | 20.2 % |
| test | 142 | 162 | 147 | 15 | 13.1 % |
| Total | 1,088 | 1,388 | 1,241 | 147 |
| ID | Class | Train | Valid | Test | Total |
|---|---|---|---|---|---|
| 0 | DropStitch | 88 | 25 | 14 | 127 |
| 1 | Hole | 84 | 23 | 15 | 122 |
| 2 | Horizontal LineMark | 57 | 23 | 15 | 95 |
| 3 | Knot | 77 | 22 | 15 | 114 |
| 4 | Oil Spot | 110 | 30 | 14 | 154 |
| 5 | Setup | 89 | 26 | 15 | 130 |
| 6 | Slub | 81 | 22 | 15 | 118 |
| 7 | Vertical LineMark | 207 | 59 | 33 | 299 |
| 8 | Yarn Dust | 162 | 41 | 26 | 229 |
| All | 955 | 271 | 162 | 1,388 |
The split was constructed using group-aware assignment so that recorded burst/near-duplicate groups do not cross split boundaries. A later bounded perceptual-hash screen of a 220-image sample surfaced candidate pairs, including cross-split candidates. These are not confirmed duplicates and require manual review; possible near-duplicate overlap therefore remains an unresolved limitation. Rare classes were given a floor on their test allocation, which is why the image-level ratio departs from a nominal 70/20/10.
Sources
| ID | Factory | Construction | Device | Capture date | Images |
|---|---|---|---|---|---|
| F1 | Tropical Knitex | knit | Pixel 6 | 2025-11-14 | 129 |
| F2 | Comfit Composite Knit Ltd. | single jersey, lycra | Pixel 6 | 2026-02-22 | 262 |
| F3 | Amtranet Group | woven | Pixel 6 | 2026-03-05 | 110 |
| F4 | N.R. Group | knit | iPhone 14 Pro Max | — | 587 |
dataset_metadata.csv
One row per image:
filename, original_filename, split, device, factory_id, fabric_type,
fabric_detail, width, height, megapixels, aspect_ratio, file_format,
classes, n_classes, n_instances, n_boxes, n_polygons, is_background,
group_id, capture_datetime, capture_date
group_id identifies near-duplicate and burst groups — all members share a split.
original_filename maps back to the version 2 release.
Please read before benchmarking
Images are not raw camera output. They were transferred from the handsets before annotation, and that transfer re-encoded and mostly downscaled them: iPhone files are WebP, Pixel files JPEG, median resolution 1.57 MP against roughly 12 MP native, and some captures were cropped. No preprocessing or augmentation was applied during annotation or export. Per-image dimensions and format are in the metadata.
Capture session is confounded with class. Seven of the nine classes come from a
single factory, three of those from a capture window under one hour. Each factory was
visited once and photographed with a single handset, so device, site, date and fabric
construction vary together. For most classes, training and test images share fabric,
lighting and camera — test scores will be optimistic relative to an unseen factory,
and no effect can be attributed to the camera alone. factory_id is provided so users
can build factory-aware evaluations, but leave-one-factory-out is not feasible here
because it would leave seven classes with no training data.
Annotation reliability varies by class. A second annotator independently labelled 100 images: Cohen's kappa 0.91 on image-level class presence, and 98.7 % class agreement where both marked the same region. Two caveats. Localisation agreement falls with defect size — 86 % of instances covering at least 2 % of the image matched at IoU ≥ 0.5, against 31 % below that — so expect noise in box extent for Yarn Dust and Hole rather than in class identity. And Hole is not reliably separated from DropStitch: of 15 reference Hole instances the second annotator assigned 5 to Hole, 6 to another class (5 to DropStitch), and did not mark 4.
Class imbalance is larger than it looks. The nominal ratio is 3.15× between the largest and smallest class, but 69 % of Vertical LineMark images belong to a near-duplicate or burst group, against 9 % or less elsewhere — so its effective number of independent samples is lower than its instance count suggests.
Two images carry no annotation and are released as explicit background samples,
flagged by is_background. 41 images carry two defect classes; none carries three.
Licence and citation
Released under CC BY 4.0. All photographs show fabric only; no people, faces, or personal data were captured, and no location information is embedded in the release. Images were taken with the written permission of the participating companies.
Please cite both the dataset and the accompanying Data in Brief article.
Research execution and reproducibility
The leakage-controlled modelling cohort is 709 train / 212 validation / 142 locked test (official splits remain 726/220/142). See dataset_audit/training_protocol.md for the validation-only model matrix and one-time locked-test procedure. The current Colab handoff is COLAB_QUICKSTART.md in the public staging copy. No formal model-performance results should be inferred from the earlier SmallCNN smoke test.
- Downloads last month
- 220