## 1 Introduction  
Aviation plugs shown in Figure 0(a) are important electromechanical components in a variety of modern electronic equipment. While the welding failures of solder joints inside them will directly affect their conduction performance and then damage the reliability of the circuit [1, 2]. Therefore, quality inspection of solder joints on aviation plugs has become a necessary and essential process. Currently, this task still relies heavily on manual visual inspection after welding, which suffers from the problems of low efficiency and low accuracy. In addition, it is susceptible to producing inconstant and unreliable detection results due to subjective evaluation. Recently, to reduce manual intervention and increase inspection accuracy and efficiency, a number of machine vision-based methods have been used in several specific industrial scenarios and have delivered impressive results. Despite that, due to the special structure of the aviation plugs studied in this paper, an automated system for detecting solder joints on them has not yet been developed. Thus, it is becoming increasingly urgent to develop an accurate and automated inspection system specifically for inspecting solder joints on aviation plugs. Throughout modern non-destructive testing technology, the approaches for weld inspection can be divided into ultrasonic testing [3, 4, 5], magnetic particle testing [6, 7], X-rays testing [8, 9], and optical testing [10, 11, 12], etc. Since optical detection methods have low requirements for the material being tested and the ability to monitor each product sustainably, they are gradually becoming the preferred choice in the industry. The mainstream is to take a photo of the regions to be examined by cameras and make estimates using some image recognition algorithms. Earlier algorithms generally used some traditional image processing technologies, which required pre-processing of the captured images firstly, typically including image normalization [12], filtering [13], enhancement [14; 15], and so on. Afterward, the pre-processed images are subjected to localization and segmentation operations, such as template matching [14; 16], thresholding [5; 17], or edge-based segmentation [18; 19], and then some algorithmic rules are designed using human experience, such as shape, area, greyscale, texture, etc. to characterize the target features. Finally, some common classification algorithms are adopted for quality assessment. For example, [PERSON] et al. [20] proposed a new automated optical inspection algorithm based on a Gaussian mixture model to inspect the solder joints of integrated circuits. Some researchers [21; 22] have also tried the use of a support vector machine for the classification of solder joints. In recent years, robust principal component analysis has been introduced into various defect detection tasks [23; 24] and achieved impressive results. However, as illustrated in Figure 1b, typical defects of solder joints on aviation plugs have an extremely similar appearance to normal solder joints. Therefore, it is difficult to distinguish them using only handcrafted low-level features. Meanwhile, the above methods are usually not fast enough for real-time online inspection. In general, although the above traditional methods using handcrafted features perform well in some simple tasks, they suffer from low accuracy and low robustness due to the limited feature representation capability. In recent years, deep convolutional neural networks (CNNs) have attracted significant attention in various anomaly detection tasks [25; 26; 27; 28], particularly in image data [29; 30; 31], since they are capable of automatically learning the features with robust and generalized representation. Weld quality assessment is a typical anomalous object detection that needs to locate and classify the anomalous objects in an image. In addition, there are two main categories of detectors in the generic object detection methods: one-stage detectors and two-stage detectors.