# Detection of Welding Defects Tracked by YOLOv4 Algorithm
## 1 Introduction  
Aluminum alloy materials are not only corrosion resistant and easy to use and maintain, but they also significantly reduce the weight of objects. The development of the aluminum processing industry has primarily relied on mature technology, low-cost replication, and expansion, leading to increased production capacity and widespread application in aerospace, construction, and rail transportation. Due to the influence of various process parameters on the welding process of aluminum alloy weldments, both manual welding and robot-assisted automatic welding can result in defects such as pores, slag inclusion, and incomplete penetration. These welding defects pose potential safety hazards, including leakage and explosion, making weld defect detection a critical issue in the industry. In industrial production, X-ray non-destructive testing is commonly used to detect internal defects in aluminum alloy weldments. However, prolonged exposure to X-ray images can lead to ophthalmic diseases and errors due to human subjectivity and fatigue, which are unacceptable in engineering practice. Moreover, current real-time weld defect detection systems face limitations in terms of accuracy, efficiency, and false positive rates. Therefore, it is essential to develop an automated weld defect detection system that can detect weld defects more effectively, quickly, and accurately [1]. Object detection is a fundamental task in computer vision, aimed at identifying object categories within images and precisely determining their locations. Object detection algorithms can be classified into convolution-based and transformer-based methods [2]. Convolution-based approaches can be further subdivided into two-stage and one-stage detectors. The two-stage detection model consists of a first stage that proposes candidate bounding boxes and a second stage that refines and classifies these proposals. Notableexamples in the RCNN series include SPPNet [3], Fast R-CNN [4], and Region Proposal Network (RPN) [5]. While these methods achieve high detection accuracy, they do so at the expense of their processing speed [6]. In contrast, single-stage detection models such as YOLO [7], RetinaNet [8], and SSD [9] directly predict both the bounding boxes and class probabilities of objects within an image, thereby significantly enhancing detection speed and better meeting practical application requirements. [PERSON] et al. [10] introduced a novel infrared aerial target detection method called YOLO-Mamba to address challenges such as distance dependence and computational complexity in the existing approaches. [PERSON] et al. [11] proposed an enhanced RetinaNet algorithm to improve the model's detection performance, specifically targeting issues arising from multi-scale variations in targets. To tackle the problem of detecting occluded objects, [PERSON] et al. [12] developed a deep learning method based on Adaptive Training Sample Selection (ATSS), which labels only the center points of objects, thereby enhancing practicality. Weld defect detection, as a specialized application of computer vision, is a promising research area with significant prospects, particularly given the critical importance of oil and natural gas as primary energy sources that provide a strong practical foundation. Currently, experts in weld seam detection primarily focus on challenges such as dataset scarcity, multi-scale defect detection, and tiny target detection. [PERSON] et al. [13] proposed a detection method that integrates Generative Adversarial Networks (GANs) with transfer learning to balance data distribution and augment image samples, thereby addressing data imbalance issues. [PERSON] et al. [14] explored an image-centric approach and employed real-time image data augmentation techniques to overcome the limitations of X-ray datasets. [PERSON] et al. [15] tackled inconsistent scales and wide boundary transitions in weld seam defects by using geometric transformation-based data augmentation and a Feature Pyramid Network (FPN) to improve detection accuracy. [PERSON] et al.