Abstract:
The textile industry continues to rely heavily on manual inspection for fabric defect detection, a process that is often inefficient, inconsistent, and highly susceptible to human error, particularly in fast-moving production environments. These challenges are further amplified when inspecting coloured and complex patterned fabrics, where conventional automated systems struggle to achieve reliable defect detection. Moreover, quality assessment methods such as the 4-point system require accurate defect size measurements, yet most existing automated solutions lack defect sizing capabilities and interpretable outputs, limiting their practical adoption and trustworthiness in industrial settings.
To address these limitations, this research proposes an explainable deep learning-based fabric defect detection and sizing framework. The Xception pre-trained convolutional neural network was employed for both fabric pattern classification and defect detection, trained using a publicly available patterned fabric dataset. To enhance model transparency, the Grad-CAM explainable AI (XAI) technique was integrated to generate visual heatmaps highlighting defect regions responsible for model predictions. These heatmaps were further processed to localise defect areas and compute defect sizes in pixel space. Using optical principles including working distance, focal length, and field-of-view calculations, pixel measurements were converted into real-world dimensions.
Experimental results demonstrate strong performance, with the defect detection model achieving 0.91 training accuracy and 0.88 validation and test accuracy, alongside precision, recall, and F1-score values of 0.88. Fabric pattern classification achieved a test accuracy of 0.98. The integration of Grad-CAM provided meaningful visual explanations and enabled accurate defect localisation and size estimation.
Overall, this approach improves interpretability, supports informed decision-making in textile quality control, and contributes toward the development of reliable and transparent AI-driven inspection systems for modern textile manufacturing.