Abstract:To address the issues of high missed detection rates for small targets, low detection accuracy, and insufficient algorithm robustness in fiber rope surface defect detection under scenarios with fine textures and complex backgrounds, this paper proposes an improved fiber rope surface defect detection algorithm based on the unsupervised model a discriminatively trained reconstruction embedding for surface anomaly detection (DRAEM). In the preprocessing stage, the GrabCut segmentation algorithm is incorporated to extract masks for each image, reducing background interference through mask-constrained anomaly generation and mitigating false positives and missed detections caused by complex backgrounds. In the reconstruction network, skip connections are introduced to capture high-dimensional image space normal data distributions, and a dual channel-spatial attention module is added to enhance the reconstruction capability for anomalous regions, to improve the reconstruction quality of fine-scale textures, thereby avoiding texture loss and preventing the missed detection of small-scale defects. In the segmentation network, Transformer modules are integrated after the last two layers of the encoder to optimize the capture of cascaded global features between normal and abnormal regions. Additionally, atrous spatial pyramid pooling (ASPP) is employed to capture multi-scale contextual information for global feature aggregation, providing sufficient semantic differentiation for segmentation and enhancing the model’s segmentation accuracy and the detection accuracy of small surface defects. Experimental results demonstrate that, compared to the original DRAEM, the proposed method achieves a 4.4% improvement in image-level AUROC, a 4.43% increase in pixel-level AUROC, and a 21.86% boost in pixel-level average precision. These enhancements significantly improve the model’s recognition accuracy and robustness, making it more effective for fiber rope defect detection applications.