Abstract
An automated and accurate fabric defect inspection system is in high demand as a replacement for slow, inconsistent, error-prone, and expensive human operators in the textile industry. Previous efforts focused on certain types of fabrics or defects, which is not an ideal solution. In this paper, we propose a novel one-class model that is capable of detecting various defects on different fabric types. Our model takes advantage of a well-designed Gabor filter bank to analyze fabric texture. We then leverage an advanced deep learning algorithm, autoencoder, to learn general feature representations from the outputs of the Gabor filter bank. Lastly, we develop a nearest neighbor density estimator to locate potential defects and draw them on the fabric images. We demonstrate the effectiveness and robustness of the proposed model by testing it on various types of fabrics such as plain, patterned, and rotated fabrics. Our model also achieves a true positive rate (a.k.a recall) value of 0.895 with no false alarms on our dataset based upon the Standard Fabric Defect Glossary.
Introduction
The textile industry relies heavily on manual quality control, where human inspectors identify defects in fabric. This process is inherently flawed due to human fatigue, inconsistency, and high operational costs. Automating this task presents significant challenges. First, defects are "rare events," making it difficult to collect the vast amounts of labeled data required for traditional supervised learning models like Convolutional Neural Networks (CNNs). Second, the diversity of fabric textures—ranging from simple plain weaves to complex patterns and varying orientations—requires a highly adaptable system.
To overcome these hurdles, we propose a shift from supervised classification to one-class modeling. Instead of training a model to recognize specific defects, we train it to understand the characteristics of "normal" fabric. Any significant deviation from this learned norm is then flagged as a defect.
Methodology
The proposed detection pipeline is divided into three primary stages: feature extraction, feature selection via deep learning, and anomaly detection.
Gabor Filter Bank
To capture the intricate textures of various textiles, we employ a bank of 90 Gabor filters. These filters, spanning 5 wavelengths and 18 orientations, mimic the multi-resolution processing of the human visual system. This stage extracts a high-dimensional set of magnitude responses that characterize the fabric's motif and weave.
Autoencoder for Feature Selection
The raw output from the Gabor filter bank is both high-dimensional and redundant. To distill these responses into a robust feature set, we utilize an autoencoder. Unlike linear methods such as Principal Component Analysis (PCA), the autoencoder can capture complex, non-linear relationships within the data.
The network is trained exclusively on patches of defect-free fabric. It learns to compress the Gabor responses into a low-dimensional "code" and then reconstruct the original input. This process ensures that the resulting feature vectors are highly representative of normal fabric textures.
Nearest Neighbor Density Estimator (NNDE)
In the testing phase, the fabric image is partitioned into patches. The feature vector for each patch is compared against the distribution of "normal" features saved during training. We use a Nearest Neighbor Density Estimator to calculate a likelihood ratio; patches that fall outside a defined threshold are identified as defects and highlighted in the final output.
Experimental Results
We evaluated the model using the Standard Fabric Defect Glossary (SFDG), selecting 31 representative images covering various backgrounds and defect types. To simulate real-world manufacturing conditions, we also tested the model's performance on fabrics with small rotations (0.02° to 5°).
Performance Metrics
The model achieved a conditioned True Positive Rate (cTPR) of 0.895. Crucially, this "conditioned" metric reflects the recall rate when the False Positive Rate (FPR) is zero, ensuring that the system does not trigger costly false alarms in a production environment.
Comparative Analysis
Our hybrid Gabor-Autoencoder approach significantly outperformed standard deep learning architectures and traditional feature selection methods:
- Vs. ResNet: While ResNet is a standard for many vision tasks, it achieved a cTPR of only 0.217, likely due to the lack of massive labeled defect datasets.
- Vs. PCA: The use of an autoencoder instead of PCA improved the cTPR by 12.9% and the Area Under the Curve (AUC) by 2.9%, demonstrating the superiority of non-linear feature extraction for complex textile patterns.
Conclusion
This research demonstrates that a one-class modeling approach, combining Gabor filters with deep autoencoders, provides a robust solution for automated fabric inspection. By focusing on learning "normal" textures, the system effectively identifies a wide range of defects without requiring extensive labeled negative samples. Future work will focus on improving the pixel-level precision of defect localization and optimizing the Gabor filter bank to reduce computational overhead.
Summary updated