## 1 Introduction  
With the rapid development of battery electric vehicles (BEVs), laser welding technology has been widely used in the assembling process of lithium-ion batteries. The performance of BEVs depends highly on the power and energy capacities of their batteries. To meet the desired power and capacity demand for BEVs, a lithium-ion battery pack is assembled from lots of battery cells, sometimes several hundred or even thousands, which depends on the cell configuration and pack size [1]. Several cells are typically joined together to form a module with common bus-bars, and tens of modules are then assembled into a battery pack [2]. As laser welding defects on the safety vent of a battery may cause overheating or explosion over time when it is in use, the quality control of laser welding is very critical, which helps to prolong the life of the batteries and ensure the safety of the batteries. At present, the main methods to detect the quality of welding include laser [3], ultrasonic [4], X-ray [5, 6], machine vision [7, 8], and so on, which have been widely used by many companies to inspect welding quality during manufacturing. Benefiting from the development of image processing algorithms and camera technology, machine vision is playing a significant role in modern industries for real-time quality assurance [7]. Automated optical inspection (AOI), also called machine vision inspection, is used broadly in solder joint quality inspection [8]. One of the earliest studies on solder joint quality inspection was conducted by [PERSON] and [PERSON], and they proved that features inferred from facets and Gaussian curvature were better in the classification of a solder joint using a minimum-distance classification algorithm [9]. However, the results were poor for the algorithm's sensitivity to the illumination environment. Other AOI inspection algorithms are available, such as the defect model through statistical modeling [10], feature map analysis [11], and Gaussian mixture model [12]. However, these algorithms are complex when analyzing the details of the defect images [13]. Some AOI applies Bayes and support vector machine (SVM) to classify defects, and extracts feature information from a feature extraction region. For example, [PERSON] et al. created a method using SVM [14], [PERSON] et al. used the Bayes classifier and an SVM [7], and [PERSON] et al. used adaptive boosting (AdaBoosting) and a decision tree [15]. However, note that the feature extraction of the aforementioned methods [7; 8; 9; 10; 11; 12; 13; 14; 15] is usually set manually by an operator [16]. If the features of numerous components are manually set from the feature extraction region, the efficiency of the AOI process will decrease greatly. Additionally, these methods are easily influenced by the illumination environment. In our case, namely, the welding defect inspection of battery's safety vent, the main difficulty encountered by visual inspection algorithms is that the quality of the photographs is seriously affected by the illumination environment [8]. Additionally, the diversity and complexity of welding defects make it difficult to identify a suitable algorithm. Even in one sample, there may be several different defects. These problems can also lead to a high fault positive rate, which is defined as the ratio of the number of defect products categorized as positive to the total number of defect products (regardless of classification). Hence, surface welding defects of safety vent are mainly detected manually in the factory. Recently, deep learning has advanced dramatically in visual object recognition, object detection, and other domains; consequently, it has the potential ability to help to execute defect inspection of safety vent's surface welding.