Fabric Anomaly Recognition Dataset
Description
This dataset has been specifically developed to address critical challenges in fabric defect detection within the textile industry of Bangladesh. Recognizing the importance of maintaining high-quality standards in textile exports, minimizing material waste, and ensuring customer satisfaction, this dataset offers a comprehensive, real-world collection of fabric defects captured directly on production floors in Bangladeshi textile manufacturing units. The dataset focuses on three principal defect types that are most prevalent and industrially significant in textile quality control: • Hole (Class ID-0): Physical punctures or missing material resulting from mechanical damage during weaving, finishing, or handling stages. These defects undermine both the fabric’s structural integrity and its visual appeal, often leading to rejection of the product. • Broken End (Class ID-1): Breakage of warp yarns during weaving or finishing, causing visible gaps or thin lines on the fabric surface. These occur due to mechanical failures, excessive yarn tension, or handling errors, affecting fabric durability. • Oil Stains (Class ID-2): Surface discolorations and blemishes caused by oil or lubricant leaks from machinery during production. Such stains can alter fabric appearance and interfere with subsequent dyeing or finishing operations. The dataset consists of a total of 2,157 images, carefully curated to maintain near-class balance and reduce bias during machine learning model development. The class distribution is: • Hole: 649 images • Broken End: 666 images • Oil Stains: 842 images This balanced representation ensures that models trained on this dataset can detect defects equitably across all classes, enhancing overall performance. All images were collected in situ on factory floors across various textile units in Bangladesh, capturing defects in authentic production environments. Images exhibit a wide range of illumination conditions and background variations, reflecting real operational challenges encountered in industrial settings. Annotation was performed using LabelImg, a widely adopted open-source graphical tool for object detection labeling. Expert annotators manually drew bounding boxes tightly enclosing each defect instance, providing precise spatial localization critical for training and validation of deep learning models. Each annotated object is labeled with a numerical class ID consistent with widely used detection model conventions, such as YOLO: • Hole → 0 • Broken End → 1 • Oil Stains → 2 The labeling process involved rigorous quality control, including multiple review cycles and cross-validation by different annotators, to minimize subjective errors and ensure annotation accuracy. This meticulous annotation effort is essential to prevent error propagation during model training, which could otherwise degrade detection performance.
Files
Steps to reproduce
1. Data Collection • Select textile manufacturing sites within Bangladesh representing typical production environments. • Use a high-resolution mobile camera with manual controls (focus, exposure) to capture fabric images. • Ensure consistent and sufficient lighting by using natural light or additional LED sources to reduce shadows and highlights. • Mount the mobile phone on a stable tripod or fixed support to prevent motion blur and maintain image clarity. • Capture images of fabric rolls or sheets directly from the factory production line, ensuring representation of all three key defect types: holes, broken ends, and oil stains. • Capture images under various lighting conditions and fabric types for better dataset diversity. • Aim for balanced sampling, collecting roughly equal numbers of images for each defect category. 2. Data Preprocessing • Review and filter out unclear, blurred, or irrelevant images. • Standardize all images to a uniform format (JPEG or PNG) and resolution compatible with deep learning models (e.g., 416×416 pixels). • Document image metadata such as capture conditions, camera settings, and defect type labels. 3. Annotation • Transfer images to annotation software on a computer; LabelImg is recommended for its simplicity and precision. • Define three defect classes with numeric labels: Hole (0), Broken End (1), Oil Stains (2). • Manually draw bounding boxes around each defect instance in the images. • Save annotations in formats compatible with YOLO or other object detection models. • Perform multiple rounds of annotation review, involving different experts to ensure accuracy and reduce labeling errors. 4. Dataset Splitting and Augmentation • Split the dataset into training (~70%), validation (~15%), and test (~15%) subsets using stratified sampling to maintain class balance across splits. • Optionally apply data augmentation techniques (rotation, flipping, brightness adjustment) during training to improve model robustness against variations in image capture conditions. 5. Model Training • Set up a deep learning environment with necessary frameworks (e.g., PyTorch, TensorFlow). • Load the annotated dataset using appropriate data loaders. • Select an object detection model architecture optimized for defect detection, such as YOLO. • Configure hyperparameters including learning rate, batch size, and epochs. • Train the model on the training set while validating performance on the validation set to avoid overfitting. 6. Evaluation and Testing • Evaluate the trained model on the independent test set. • Measure performance metrics such as precision, recall, and mean Average Precision (mAP) to quantify detection accuracy for each defect class. • Analyze errors and refine the dataset or model as necessary.
Institutions
- National Institute of Textile Engineering and Research