Contrastive Texture Metric Learning: An Attention-Guided Siamese Model for Fabric Inspection
International Journal of Engineering Research and Development, vol.22, no.7, pp.1-11, 2026 (Peer-Reviewed Journal)
- Publication Type: Article / Article
- Volume: 22 Issue: 7
- Publication Date: 2026
- Journal Name: International Journal of Engineering Research and Development
- Journal Indexes: Academic Search Ultimate (EBSCO), Materials Science & Engineering Collection (ProQuest)
- Page Numbers: pp.1-11
- Open Archive Collection: AVESIS Open Access Collection
- Erzincan Binali Yildirim University Affiliated: Yes
Abstract
In smart manufacturing systems, it is crucial to diagnose defects as products pass along conveyor belts using automated computer vision systems. Compared to traditional manual defect diagnosis methods, this approach reduces time loss, high costs, and operator errors. This study proposes a fast Siamese network supported by contrastive learning and attention mechanisms for the detection and classification of fabric defects. A Channel Attention module is integrated during the feature extraction phase to ensure the network focuses on key regions. Thanks to the Siamese structure, samples belonging to the same class are brought closer together in the feature space, while different classes are distanced from each other. This aims to enable the model to more accurately distinguish small defects, especially between similar fabrics. During the training process, contrastive loss and cross-entropy loss were optimized together. In addition, computational costs were reduced using data augmentation methods and mixed precision training strategies. Experimental studies showed that the proposed model achieved 97% test accuracy. Grad-CAM visualization results showed that the model successfully localized defective regions. In conclusion, the proposed method offers a high-performance and practical solution for real-time textile quality control applications