File size: 13,336 Bytes
739365c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
742625c
739365c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
---
license: cc-by-sa-4.0
task_categories:
- image-classification
language:
- en
- zh
tags:
- ball-screw
- surface-defect
- defect-classification
- industrial-inspection
- quality-control
- manufacturing
- image-classification
- keenforge
size_categories:
- 10K<n<100K
---

# KIT_BallScrew_Defects-corrected

[![DOI](https://img.shields.io/badge/DOI-10.57967%2Fhf%2F11010-blue)](https://doi.org/10.57967/hf/11010)

**Ball-screw surface defect **classification** — cleaned, re-indexed, split and standardized version of the KIT-BS-recls dataset.**
**滚珠丝杠表面缺陷**分类** —— KIT-BS-recls 数据集的清理、重编号、划分与规整版。**

[English](#english) · [中文](#中文)

---

## English

### What is this?

A **cleaned, re-indexed, split and standardized image-classification version** of the
**Tri-classified Dataset for Ball Screw Surface Defects (KIT-BS-recls)** — three surface
conditions: **pitting**, **contaminated** and **normal**. This is a **classification**
dataset (one label per image, **no bounding boxes**).

Reference: Xue, F., Zhang, W., Xie, S., Puchta, A. & Fleischer, J. *"Domain-unique
group- and its subgroups-aware fault diagnostics for machine components: An open-set
domain adaptation approach."* **Neurocomputing**, 2025 — https://doi.org/10.1016/j.neucom.2025.131291.
Upstream: [fenghsueh/Triclass-BSDefects](https://github.com/fenghsueh/Triclass-BSDefects) (also on Kaggle).

The original release ships as three class folders plus a single `labels.txt` that maps
each path to a label, where the labels are the **non-contiguous ids 3 / 6 / 8**, with
**no train/val/test split** and filenames containing parentheses (`P(123).png`).

This release converts the archive into a folder-based classification layout, **remaps the
labels to 0 / 1 / 2**, adds a reproducible stratified split and normalises the filenames.

> ✅ **Upstream license: CC BY-SA 4.0** (Attribution-ShareAlike). This is a real open
> licence, but it is **ShareAlike** — any derivative must be released under the same
> licence. See [License & attribution](#license--attribution).

### Corrections vs. the official release

| # | Correction | Detail |
|---|---|---|
| 1 | **Classification layout** | Converted the archive into `images/<split>/<class>/` (Ultralytics-style folder classification). The redundant `labels.txt` is replaced by `labels.csv` and the folder structure. |
| 2 | **Re-indexed labels** ⭐ | The upstream ids are the **non-contiguous 3 / 6 / 8** (pitting / contaminated / normal). They are remapped to the contiguous **0 / 1 / 2**, so a model's output layer has no wasted units. |
| 3 | **Reproducible split** | Upstream ships **no split**. This release provides a seeded, class-stratified **70 / 15 / 15** split (seed 42): **15,288 / 3,276 / 3,271**. |
| 4 | **Near-duplicates kept together** | Near-identical images (identical 8×8-dHash and 32×32 pixel-MSE ≤ 1) are grouped and assigned entirely to one split (50 such groups). |
| 5 | **Filename hygiene** | Filenames contained parentheses, e.g. `P(123).png` → `P_123.png`; `P(1000)_.png` → `P_1000_.png`. |
| 6 | **Packaging** | Added `classes.txt`, `data.yaml` (Ultralytics classification) and `labels.csv` (filename, split, class, index, original name/dir). |

**Image pixels are never modified.** All 21,835 images are byte-for-byte identical to upstream (150×150 RGB `.png`; 9 images differ slightly in size — see note).

**Scope — structural clean-up only.** This is **not** a re-annotation; each image keeps its original single class label.

**Structural checks performed** on the released set:

| Check | Method | Result |
|---|---|---|
| `labels.txt` ↔ class folder consistency | per line | **0** mismatches |
| Files in `samples/` missing from `labels.txt` | set diff | **0** |
| Exact duplicate images | md5 | **0** |
| Cross-split near-identical leakage | cluster assignment | 0 groups straddle a split |
| Image format / channels | scan | RGB PNG, 150×150 (9 images slightly off-size) |

### Dataset at a glance

| Property | Value |
|---|---|
| Images | **21,835** (150 × 150 RGB `.png`) |
| Task | **Image classification** (single label per image) |
| Classes | **3** — `pitting` (0), `contaminated` (1), `normal` (2) |
| Split | train **15,288** / val **3,276** / test **3,271** (seeded, class-stratified) |

**Images per class:** `pitting` 10,760 · `contaminated` 7,523 · `normal` 3,552

**Per split:** train (`pitting` 7,532 / `contaminated` 5,267 / `normal` 2,489) ·
val (1,614 / 1,130 / 532) · test (1,614 / 1,126 / 531)

> **Note:** 9 of the 21,835 images are not exactly 150×150 (e.g. 146×150, 127×150). Their
> pixels are left unmodified; resize on load if a fixed input size is required.

### Structure

```
KIT_BallScrew_Defects-corrected/
├── images/
│   ├── train/{pitting,contaminated,normal}/   # 150x150 RGB .png
│   ├── val/{pitting,contaminated,normal}/
│   └── test/{pitting,contaminated,normal}/
├── classes.txt     # pitting / contaminated / normal (one per line, index order)
├── data.yaml       # Ultralytics classification configuration
├── labels.csv      # filename,split,class,class_index,original_name,original_dir
├── LICENSE         # CC BY-SA 4.0 (full text + notice of changes)
└── README.md
```

### Quick start (Ultralytics)

```python
from ultralytics import YOLO

model = YOLO("yolo11n-cls.pt")
model.train(data=".", epochs=50, imgsz=150)
```

### Citation

**1. The original dataset / paper — please always cite this.**

```bibtex
@article{xue2025domaingroup,
  title   = {Domain-unique group- and its subgroups-aware fault diagnostics for machine
             components: An open-set domain adaptation approach},
  author  = {Xue, Feng and Zhang, Weimin and Xie, Shulian and Puchta, Alexander and
             Fleischer, J{\"u}rgen},
  journal = {Neurocomputing},
  year    = {2025},
  doi     = {10.1016/j.neucom.2025.131291}
}
```

**2. This corrected release — please cite it as well.**

```bibtex
@misc{kit_ballscrew_corrected,
  author    = {KeenForgeAI},
  title     = {KIT_BallScrew_Defects-corrected: a cleaned classification release of the Tri-classified Ball Screw Surface Defects dataset (KIT-BS-recls)},
  year      = {2026},
  version   = {1.0},
  publisher = {KeenForgeAI},
  url       = {https://huggingface.co/datasets/KeenForgeAI/KIT_BallScrew_Defects-corrected},
  note      = {Curated by Lu Gan and Sam Li. Derived from KIT-BS-recls
               (Xue et al., Neurocomputing 2025), licensed CC BY-SA 4.0.}
}
```

**3. The annotation tool (optional).**

```bibtex
@software{keenforge,
  author    = {KeenForgeAI},
  title     = {KeenForge: a local-first, offline image annotation and model-training desktop tool},
  year      = {2026},
  publisher = {KeenForgeAI},
  url       = {https://github.com/KeenForgeAI/KeenForge},
  note      = {MIT licensed. Developed by Lu Gan and Sam Li.}
}
```

### License & attribution

**CC BY-SA 4.0 (Attribution-ShareAlike 4.0 International).** The upstream KIT-BS-recls is
licensed under CC BY-SA 4.0. Because ShareAlike is a copyleft condition, **this corrected
release is distributed under the same CC BY-SA 4.0 licence** — you must credit the original
authors, indicate if changes were made, and license any derivative under CC BY-SA 4.0. The
full licence text and a notice of the changes are in `LICENSE`.

Original work: Xue, Zhang, Xie, Puchta & Fleischer — https://github.com/fenghsueh/Triclass-BSDefects.

### Provenance

- Source: Tri-classified Dataset for Ball Screw Surface Defects (KIT-BS-recls), GitHub `fenghsueh/Triclass-BSDefects`.
- Upstream: 21,835 images / 3 classes (ids 3/6/8); no split; filenames with parentheses; 0 duplicate images.
- Verified: 21,835 images (byte-identical); labels remapped 3/6/8→0/1/2; split 15288/3276/3271; 0 label/folder mismatches, 0 cross-split near-identical leakage.

---

## 中文

### 这是什么?

**滚珠丝杠表面缺陷三分类数据集(KIT-BS-recls)**的**清理、重编号、划分与标准化图像分类版**——
三种表面状态:**点蚀(pitting)**、**污染(contaminated)**、**正常(normal)**。这是
**分类**数据集(每图一个标签,**无边界框**)。

论文:Xue, F., Zhang, W., Xie, S., Puchta, A. & Fleischer, J.《Domain-unique group- and its
subgroups-aware fault diagnostics for machine components: An open-set domain adaptation
approach》,**Neurocomputing**,2025 —— https://doi.org/10.1016/j.neucom.2025.131291。
上游:[fenghsueh/Triclass-BSDefects](https://github.com/fenghsueh/Triclass-BSDefects)(Kaggle 亦有)。

原始版本以三个类别文件夹 + 单个 `labels.txt`(每行"路径 + 标签")发布,标签为**不连续的
3 / 6 / 8**,**无 train/val/test 划分**,且文件名含括号(`P(123).png`)。

本版本将其转换为基于文件夹的分类布局、把标签**重映射为 0 / 1 / 2**、补充可复现的分层划分,
并净化文件名。

> ✅ **上游许可证:CC BY-SA 4.0**(署名—相同方式共享)。这是真正的开源许可,但为 **ShareAlike
> (传染性)**——任何衍生作品必须以同一许可发布。详见 [许可证与署名](#许可证与署名)。

### 相对官方版的修正

| # | 修正 | 说明 |
|---|---|---|
| 1 | **分类布局** | 转换为 `images/<split>/<class>/`(Ultralytics 风格的文件夹分类)。冗余的 `labels.txt` 由 `labels.csv` 与目录结构取代。 |
| 2 | **标签重编号** ⭐ | 上游标签为**不连续的 3 / 6 / 8**(pitting / contaminated / normal),已重映射为连续的 **0 / 1 / 2**,避免模型输出层出现空洞。 |
| 3 | **可复现划分** | 上游**完全没有划分**。本版提供固定种子、按类别分层的 **70 / 15 / 15** 划分(随机种子 42):**15,288 / 3,276 / 3,271**。 |
| 4 | **近重复固定同侧** | 近重复图(8×8 dHash 相同且 32×32 像素 MSE ≤ 1)归组并整体分配到一个划分(共 50 组)。 |
| 5 | **文件名净化** | 文件名含括号,如 `P(123).png` → `P_123.png`;`P(1000)_.png` → `P_1000_.png`。 |
| 6 | **规范化打包** | 新增 `classes.txt`、`data.yaml`(Ultralytics 分类配置)与 `labels.csv`(文件名、划分、类别、索引、原始名/目录)。 |

**图像像素从不修改**——全部 21,835 张图与上游文件逐字节一致(150×150 RGB `.png`;9 张尺寸略有不同,见说明)。

**本版范围——仅结构化清理**,**不是重新标注**;每张图保留其原始单标签。

**已执行的结构化检查**:`labels.txt`↔类别目录一致(0 错配)/ `samples/` 无遗漏文件 /
0 完全重复 / 0 近重复簇跨越划分 / 全部 RGB PNG。

### 数据集概览

| 属性 | 值 |
|---|---|
| 图片 | **21,835**(150 × 150 RGB `.png`) |
| 任务 | **图像分类**(每图单一标签) |
| 类别 | **3** —— `pitting` (0)、`contaminated` (1)、`normal` (2) |
| 划分 | train **15,288** / val **3,276** / test **3,271**(固定种子、类别分层) |

**各类图像数:** `pitting` 10,760 · `contaminated` 7,523 · `normal` 3,552

**各划分:** train(`pitting` 7,532 / `contaminated` 5,267 / `normal` 2,489)·
val(1,614 / 1,130 / 532)· test(1,614 / 1,126 / 531)

> **说明:** 21,835 张中有 9 张并非精确 150×150(如 146×150、127×150)。其像素保持原样;
> 若需固定输入尺寸,请在加载时缩放。

### 目录结构

```
KIT_BallScrew_Defects-corrected/
├── images/
│   ├── train/{pitting,contaminated,normal}/   # 150x150 RGB .png
│   ├── val/{pitting,contaminated,normal}/
│   └── test/{pitting,contaminated,normal}/
├── classes.txt     # pitting / contaminated / normal(每行一个,按索引顺序)
├── data.yaml       # Ultralytics 分类配置
├── labels.csv      # filename,split,class,class_index,original_name,original_dir
├── LICENSE         # CC BY-SA 4.0(全文 + 修改说明)
└── README.md
```

### 快速开始 (Ultralytics)

```python
from ultralytics import YOLO

model = YOLO("yolo11n-cls.pt")
model.train(data=".", epochs=50, imgsz=150)
```

### 引用

请**同时引用**原始论文与本修正版:**1.** 原始论文见上方英文 `xue2025domaingroup`;
**2.** 本修正版见上方英文 `kit_ballscrew_corrected`;**3.** 标注工具(可选)见 `keenforge`。

### 许可证与署名

**CC BY-SA 4.0(署名—相同方式共享 4.0 国际)。** 上游 KIT-BS-recls 采用 CC BY-SA 4.0。
由于 ShareAlike 是传染性条款,**本修正版以同一 CC BY-SA 4.0 许可发布**——你必须署名原作者、
注明是否修改,并以 CC BY-SA 4.0 发布任何衍生作品。完整许可文本与修改说明见 `LICENSE`。

原始作品:Xue, Zhang, Xie, Puchta & Fleischer —— https://github.com/fenghsueh/Triclass-BSDefects。

### 来源

- 来源:滚珠丝杠表面缺陷三分类数据集(KIT-BS-recls),GitHub `fenghsueh/Triclass-BSDefects`
- 上游:21,835 图 / 3 类(标签 id 3/6/8);无划分;文件名含括号;0 完全重复
- 已校验:21,835 图(逐字节一致);标签 3/6/8→0/1/2;划分 15288/3276/3271;0 标签/目录错配、0 跨划分近重复泄漏