# A Novel Dataset for Fabric Defect Detection: Bridging Gaps in Anomaly Detection
## 1 Introduction
\begin{table}
\begin{tabular}{p{113.8 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt} p{42.7 pt}} \hline \hline
**Dataset** & **Samples** & \begin{tabular}{c} **Multi-Class** \\ **Defects** \\ \end{tabular} & \begin{tabular}{c} **Defect** \\ **Types** \\ \end{tabular} & \
\begin{tabular}{c} **Synthetic** \\ **Images** \\ \end{tabular} &
\begin{tabular}{c} **Public Availability** \\ \end{tabular} \\ \hline ine TILDA [4] & 3200 & Yes & 8 & No & Yes (https://universe. roboflow.com/irvin-andersen/tilda-fabric/dataset/2), accessed on 4 April 2024 \\ \hline HKU Fabric [5] & 162 & Yes & 6 & Yes & Yes (https://ytngan. wordpress.com/codes/ accessed on 4 April 2024) \\ \hline Fabric Stain Dataset [6] & 466 & No & - & No & Yes (https://www. kaggle.com/datasets/ priemshpathirana/fabric-stain-dataset accessed on 4 April 2024) \\ \hline DHU FD [7] & 1500 & Yes & 10 & No & No \\ \hline Aliyun Tianchi Fabric [8] & 15,436 & Yes & 15 & No & No \\ \hline YDFID-1 [9] & 3501 & No & - & No & No ([[https://github.com/ZHW-AI/YDFID-1/blob/main/README_ENG.md](https://github.com/ZHW-AI/YDFID-1/blob/main/README_ENG.md)]([https://github.com/ZHW-AI/YDFID-1/blob/main/README_ENG.md](https://github.com/ZHW-AI/YDFID-1/blob/main/README_ENG.md)) accessed on 13 November 2022) \\ \hline ZJU-Leaper [3] & 98,777 & No & - & No & Yes (http://www. qaas.zju.edu.cn/zju-leaper/accessed on 4 April 2024 ) \\ \hline Lusitano (our dataset) & 36,000 & No & 35 & No & Yes ([[https://kailashhambarde.github.io/Lusitano/accessed](https://kailashhambarde.github.io/Lusitano/accessed)]([https://kailashhambarde.github.io/Lusitano/accessed](https://kailashhambarde.github.io/Lusitano/accessed)) on 4 April 2024 ) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of datasets for fabric defect detection. In our study, we conducted a comparative analysis between our proposed dataset and existing datasets, as illustrated in Figure 1. To perform this comparison, we randomly selected images representing both defective and non-defective fabric samples. Subsequently, we analysed the pixel intensity and cumulative density function (CDF) of these chosen images. Our observations revealed that our proposed dataset exhibited significantly higher levels of complexity in terms of pixel intensity and CDF disparities between defect and non-defect images. To further improve efforts in this area, we propose our new dataset. Its main innovation consists in applying the one-class classification paradigm, which means our dataset contains only fabric images without defects, so that neural networks can be trained to detect any anomaly encountered as a defect. We collected 32,000 fabric images without defects, which can be used for training purposes, and created a test set with 1100 normal and 1300 defect images. All of these images were obtained directly from the factory, in industry conditions, and no data augmentation or post-processing was performed. While the total number of pictures does not match that of the ZJU-Leaper dataset, it surpasses that of other datasets. Furthermore, the absence of augmented or synthetic data entails  
Figure 1: The red frame shows images from the HKU fabric dataset. In the first row, the first image exhibits a defect, while the second image does not. Both images are from the same fabric type. In the second row, the first image shows the pixel intensity of the defect and normal images, while the second image displays the cumulative distribution function (CDF) of both images. The blue frame represents images from the zipper dataset, while the green frame depicts images from the Lusitano dataset. that this dataset can be used for real use cases, or that any future users may apply data augmentation/synthesis pipelines as necessary for their particular use cases. We also tested several baseline anomaly detection methods on this dataset and present the results. We believe our new dataset thus poses a valuable contribution to the area of fabric defect detection.