# A Defect Detection Method Based on YOLOv7 for Automated Remanufacturing
## 1 Introduction
[17] developed a novel self-supervised efficient defect detector (SEDD) that focuses on eliminating the annotation step of the data by using a homographic enhancement method. They also designed a custom detector based on depth-wise convolution layers and an attention module to enhance performance and accuracy. Another approach is to utilize state-of-the-art object detection detectors for defect detection applications. This approach is known as transfer learning, where the model is trained on a new dataset to perform a related task using initial weights [28]. [PERSON] et al. [7; 19] adopted mask region-based CNN (Mask RCNN) architecture for detecting and segmenting the damaged area on metal parts for further repair applications. In addition, [PERSON] et al. [20] investigated the performance of Faster R-CNN, YOLOv3, and RetinaNet architectures on rail crack detection employing knowledge transfer of the COCO dataset [29]. Furthermore, [PERSON] et al. [21] and [PERSON] et al. [22] based their detection model on the U-Net architecture for defect detection. In [8; 9], [PERSON] et al. leveraged one of the most known two-stage models--Faster R-CNN using the transfer learning concept (using the COCO dataset) to detect and localize steel parts' wear for a remanufacturing task. A recent work by [PERSON] et al. [23] proposed a new method that leverages and enhances CSPDarknet53 architecture by integrating a multi-head self-attention block and using it as the backbone of their detector. They also adopted some simple yet effective techniques to enhance the model's performance, such as augmentation and grayscale filtering. Moreover, [PERSON] et al. [24] integrated a dual attention module with DeepLabv3+ architecture to detect and segment metal defects. Furthermore, [PERSON] et al. [25] developed a new module that follows a similar pipeline to ResNet based on Transformers and CNNs to retain both local and global information. Moreover, [PERSON] et al. [26] adopted the Swin Transformer with a variant shift window called Cas-VSWin Transformer as the backbone network for better performance on the defect detection task. In addition, they used the feature pyramid network (FPN) as the neck, whereas the Cascade Mask network is the head of the architecture. One feature of YOLO detectors is real-time inference. They gained a lot of attention on the object detection task. With the speed requirement for the defect inspection process in production lines, many scientists have investigated and adopted YOLO for the defect detection problem. In addition, the YOLO series provides the lowest processing time compared to all other state-of-the-art detectors. However, higher detection accuracy is achieved with enhanced versions of the YOLO series by integrating it with other networks, such as self-attention mechanisms. [PERSON] et al. [30] developed an improved version of the YOLO network using only CNN layers. This method performed well; however, no comparison with the standard YOLO network was conducted. Furthermore, [PERSON] et al. [31] proposed a new detector based on YOLOv3 architecture with an anchor-free feature selection method and custom dense convolution blocks. This improves the training process and inference accuracy by about 26.7% on the NEU-DET dataset. In addition, [PERSON] et al. [32] modified the YOLOv3 network to improve accuracy by focusing on extracting more features of small defects using a new scale feature layer. With this, an improvement of 4.6% in precision is gained on the Tianchi dataset. On the other hand, [PERSON] et al. [33] introduced an improved architecture of YOLOv5 with a Transformer encoder as the backbone of the network to integrate more global information into the model. This model was tested with the NEU-DET dataset and achieved 75.2% mean average precision (mAP) on inference. [PERSON] et al. [34] also proposed combining YOLOv5 and DeepLabV3+ models, which provides stable and reliable defect detection in components, overcoming the limitations of traditional methods.