# A Novel Dataset for Fabric Defect Detection: Bridging Gaps in Anomaly Detection
## 4 Experiments and Discussion
### Results and Discussion  
The Lusitano dataset offers a comprehensive look into the fabric inspection domain, capturing real-world textile samples with meticulous detail. This dataset, sourced from Paulo de Oliveira, S.A., showcases normal and defective fabric examples crucial for anomaly detection and defect classification tasks. The high-resolution images, acquired using an industrial-grade camera, ensure the faithful representation of fabric textures, enabling a precise analysis of defects. The dataset's composition, detailed in Table 2, delineates the distribution of normal and defective samples across training and testing sets.  
With 32k normal images for training and 1100 normal along with 1300 defect images for testing, the dataset provides a balanced representation of fabric variations and defects, facilitating robust model evaluation. Visual inspection of the dataset, as depicted in Figures 3 and 4, highlights the subtle differences between normal and defective fabric samples. These images serve as reference points for fabric quality assessment, emphasizing the need for accurate anomaly detection techniques to identify defects reliably.  
Figure 4 presents a comparative analysis of defect and normal fabric images, showcasting their pixel-wise and cumulative histograms. The first row exhibits a defect image on the left and a normal image on the right, both representing the same fabric type. Despite the visual differences between the defect and normal images, the pixel histograms in the second row appear remarkably similar, indicating comparable distributions of pixel values across both image types. Similarly, the cumulative histograms in the third row display a limited discriminative power between defect and normal fabrics based solely on pixel intensity distributions. This observation underscores the challenge of distinguishing between defective and normal fabrics with fabrics of the same type.  
In our experimental evaluation, we scrutinized two state-of-the-art anomaly detection methods for fabric defect detection: DBFAD and RD4 AD. Both methods leverage innovative approaches to detect anomalies within fabric textures, employing reverse distillation techniques to enhance anomaly detection capabilities. Results from RD4 AD are illustrated in Figure 5, and those of DBFAD are depicted in Figure 6.  
Our experimental setup, detailed in the experiment setup section, encompassed a systematic evaluation of DBFAD and RD4 AD across different dataset sizes. By dividing the training dataset into six partitions and conducting evaluations with varying data volumes, we aimed to evaluate the scalability and performance of the selected methods.  
The results, summarized in Table 3, explore evaluation metrics for fabric defect anomaly detection, comparing DBFAD and RD4 AD across dataset sizes using AUC and mAP. Both methods showed an increasing AUC with larger datasets, but improvements were modest. RD4 AD consistently outperformed DBFAD in AUC and mAP. AUC and mAP improved notably with dataset size, especially for RD4 AD, suggesting its scalability. However, precision levels for both methods remained suboptimal, emphasizing the need for further method improvement.  
Furthermore, precision-recall curves and ROC curves, depicted in Figures 5-8, offer visual insights into the performance of DBFAD and RD4 AD across various evaluation criteria. These curves provide a nuanced understanding of the trade-offs between precision, recall, and false positive rates, aiding in the interpretation of model performance.