1. Introduction
Robotic welding technology is an important indicator on which to measure the technical development of the welding industry in today’s highly developed environment. Currently, the two most common operating modes for welding robots, namely, the teaching mode and the off-line programming mode, do not depend on sensor measurements during welding; the welding trajectories are set in advance by workers, and the robot moves in accordance with the desired trajectory. These two modes are suitable for use in a standardized, modular, strictly coordinated welding system [
1,
2,
3,
4]. However, in actual welding operations, the welding environment might not be static. Therefore, these two modes do not offer sufficient flexibility and robustness to handle such a complex and dynamic welding environment. The teaching mode and off-line programming mode require a lot of time to teach and preprogram each time the workpiece is replaced; therefore, with the rapid improvement in sensor technology and integration technology, intelligent welding robots that can overcome the difficulties that are encountered when operating welding robots in the teaching and off-line programming modes are emerging. An intelligent welding robot uses external sensors to perceive its environment and detect the weld position. In the past, arc and contact sensors were two of the most widely applied types of sensors in robot sensing models [
5,
6]. Visual sensing is widely used presently in the field of robotic welding because of its high accuracy and non-contact nature [
7,
8,
9]. Furthermore, it could obtain abundant information regarding the welding environment. Currently, most visual sensors are composed of a camera, an auxiliary laser, a filter, and a partition. In general, the auxiliary laser is a line laser. Research that is related to visual sensors typically focuses on image preprocessing [
10,
11,
12], weld joint contour extraction [
13,
14,
15], and weld feature point extraction [
16,
17,
18].
The recognition of the weld joint is the most important part of weld visual sensors. In real industrial environments, many types of weld joints are encountered, including fillet weld joints, butt weld joints, and v-type weld joints, due to the diversity of the workpieces. Many scholars have proposed corresponding single weld joint recognition methods for locating the position of the weld joint [
10,
11,
12,
13,
14,
15,
16,
17,
18]. For example, Fan et al. considered feature extraction for butt weld joints [
17], Zou et al. considered feature extraction for the recognition of lap weld joints [
18], and Fang considered feature extraction for fillet weld joints [
19]. These methods need to recognize only one kind of weld joint due to the single weld joint environment. However, in some welding environments, such as bridge structure welding environments, there might be many kinds of weld joint types. Different weld joints have different welding currents, welding voltages, welding torch swing methods, and welding speeds. Therefore, the ability to recognize multiple types of weld joints is necessary in a real welding environment. In recent years, some researchers have investigated multi-type weld joint recognition. Li et al. used the spatial composition relationship of the line segment elements and the junctions of weld joints for weld joint classification [
20]. First, the relationship between the line segment elements and the junctions is defined; then, weld joint recognition is performed in accordance with this characteristic composition relationship. This method is feasible, but it has difficulty in recognizing different weld joints with similar compositional characteristics. Qian et al. proposed a two-step method for multi-type weld joint recognition [
21]. First, the position of the laser curve is found and then the weld type is recognized. This method identifies the weld joint type by considering the correlations among feature points However, while using this method, a series of experiments must be performed to choose threshold values to distinguish different weld joints, which is complex and impractical. Li et al. proposed a method that was based on the Hausdorff distance and template matching to recognize different weld joint types [
22]; its computational cost is 1.17s and it lacks adaptability. Fan et al. proposed a method for establishing a support vector machine (SVM) model by using the distances from the weld joint ends to the bottom of the weld to form the feature vector [
23]; it has a better recognition accuracy and less computational cost than other methods, possibly because it uses SVM to build the recognition model.
SVM is a machine learning algorithm that is widely used for classification. This algorithm is very suitable for problems that involve small sample sizes and it has a relatively low computational cost. Additionally, the SVM approach is also suitable for solving nonlinear, high-dimensional problems because its use of a kernel function. SVM was applied in [
23]. However, for two similar weld joints, the recognition results are poor because the feature vector only has one kind of feature and, thus, does not have enough recognition information. Therefore, the development of a weld joint recognition system that has high recognition accuracy and low computational cost and is suitable for multiple types of weld joints is necessary.
In this paper, a weld joint type identification method for visual sensor based on image features and SVM is proposed. Two different types of features are extracted from the weld joint image to improve the recognitions accuracy. SVM is used to build a model for weld joint type recognition to reduce the computational cost and improve the accuracy of recognition, and five-fold cross-validation is employed to find the optimal parameters of the SVM model.
The main contribution of this paper is three-fold, as follows:
- (1)
A weld joint type identification method that is based on the deformation information of a laser curve in the image is proposed to improve the welding system adaptability and automation degree.
- (2)
A weld joint type identification model that is based on an optimal SVM is constructed to identify various kinds of weld joints.
- (3)
A comprehensive study on the feature extraction, recognition, experimental comparison, and discussion of weld joint images is performed to handle the weld joint recognition task of the arc welding systems.
The remaining sections of this paper are organized, as follows.
Section 2 introduces the visual tracking sensor used in this paper and the feature analysis of various welding joint images. In
Section 3, the weld joint image feature extraction method used in this paper is proposed. In
Section 4, an SVM-based weld joint recognition model is built, and the weld joint type recognition method proposed in this paper is introduced.
Section 5 discusses the experimental. Finally, the conclusions of this paper are provided.
4. Weld Joint Type Recognition Using SVM
The feature vector has been extracted in Section III. Now, a weld joint recognition model should be constructed. Therefore, in this paper, an SVM is adopted as the basis of the recognition model. An SVM is a maximum interval classifier for binary classification that determines the decision plane f(x) = wTx + b based on the maximum distance between the plane and some edge data, which are also support vectors.
Suppose that there are two types of data,
A and
B, which are labelled with
y values of {1, −1}, respectively. Afterwards, the decision plane is defined, as follows:
One of the common methods of solving for
is:
Soft intervals can be introduced to prevent over-fitting, which allows the SVM to make mistakes with some samples and allows some samples to fail to satisfy
yi(
wTx +
b) ≥ 1. However, the number of samples that fail to satisfy the constraint should be as small as possible. Therefore, the relaxation variable
ξ is introduced, and Equation (12) can be written as:
In the case of linearly inseparable data, it is difficult to find a suitable hyperplane for classifying the two types of data. The common solution to this problem that is adopted in the SVM algorithm is to find a mapping function for mapping the data into higher dimensions; thus, data that are inseparable in lower dimensions can become separable in a higher dimensional space, such that an appropriate hyperplane can be found to classify them. A kernel function
ĸ(
xi,
xj) is introduced to map two vectors from the original space into the higher-dimensional space to solve the problem of high-dimensional data and to calculate the inner product during optimization. The input to this kernel function consists of two vectors, and its output is the inner product of the two vectors mapped into the higher-dimensional space. Common kernel functions include linear kernels, polynomial kernels, Gaussian kernels, Laplace kernels, and sigmoid kernels. In this paper, a Gaussian kernel (radial basis function, RBF) is adopted:
where
g is the bandwidth of the Gaussian kernel function. As
g goes toward infinity, almost all of the samples become support vectors, which can lead to overfitting, as all training samples will be accurately classified. As
g goes toward zero, the discriminant function of the SVM becomes a constant function, and its classification ability for new samples becomes 0; in other words, it will classify all the samples into the same class, which leads to under-fitting. Therefore, choosing an appropriate bandwidth has great influence on the performance of the model, and it is necessary to find a balance between correctly dividing the current data and ensuring suitability for a wider range of data to ensure that the model has good practical value.
SVMs are mainly used for binary classification; however, there are two main schemes that can be used to adapt them for multi-class classification. The first is the one-to-many scheme, in which multiple classifications are performed, each for identifying whether the samples belong to one particular category. Therefore, for K classes of samples, it is necessary to construct K SVMs. Classification is achieved by comparing the distances between each of the input samples and the hyperplane in each SVM. The second scheme is the one-to-one scheme, which is based on SVMs for distinguishing between two particular classes of samples. Therefore, ĸ(ĸ − 1)/2 SVMs are needed for the K sample classes. The category to which each sample belongs is determined by voting to make the classification decision. The samples are input into all SVMs, and the results of the individual decisions are then counted. The category with the most votes for a given sample is determined to be the category of that sample. In this paper, a total of 10 SVMs are designed for classifying five types of weld joints while using the second scheme.
The selection of the parameter set plays an important role in determining the quality of an SVM model. Additionally, multi-type weld joint recognition involves the selection of parameters for multiple SVM models. In general, there are two methods that can be applied for choosing parameters:
- (1)
The parameter set for each SVM model (i.e., the model for distinguishing between each pair of weld types) is independently selected, and each model will have its own parameter settings. For example, with this approach, there will eventually be 10 sets of parameters since there are 10 SVM models for the problem considered in this paper.
- (2)
All of the models share one set of parameters, and the parameters that yield the highest overall performance are selected.
Each method has its advantages. A single parameter set might not be appropriate for all ĸ(ĸ − 1)/2 models. However, the overall accuracy is the ultimate consideration, and individual sets of model parameters may lead to over-fitting of the overall model. Therefore, the second strategy is adopted in this paper, the same set of parameters is used for all of the models, and the parameters are set based on the overall performance.
To optimize the parameters, the feature vectors were first normalized to facilitate fast convergence. Subsequently, the parameter set was selected by using the grid search method that is based on five-fold cross-validation. The training samples were divided into five groups. Four groups were treated as the training data each time, and the remaining group was used as the test data. Afterwards, the average five-fold cross-validation accuracy was obtained by averaging the results that were obtained in this way for each set of parameters.
Figure 16 shows the results that were obtained for 110 sets of parameters via the cross-validation approach. These results show that when log2C is equal to −5 and log2g is equal to −15, i.e., C = 0.03125 and g = 0.00003, the accuracy that is determined via cross-validation is the lowest, with a value of 62.3834%. When log2C is equal to 13 and log2g is equal to 1, i.e., C = 8192 and g = 2, the accuracy determined via cross-validation is the highest, 98.7565%. Therefore, C = 8192 and g = 2 were used as the parameter settings for model training to establish the weld joint classification model.
5. Experimental Results and Analysis
As shown in
Figure 17, the welding system that was considered in this paper consisted of five parts: a welding robot, a visual sensor, a robot controller, a computer, and the auxiliary welding equipment.
A visual sensor is installed on the end effector of the robot. For communication, there are cable connections between the auxiliary welding equipment and the robot controller, between the computer and the robot controller, and between the robot controller and the welding robot, and the visual sensor transmits image data to the computer through a USB connection.
The five weld joint types that were considered for recognition in this paper were lap weld joints, butt weld joints, splice weld joints, fillet weld joints, and v-type weld joints.
Table 2 shows the parameters of each weld type.
5.1. Experimrntal Results
For this analysis, 600 weld joint images, including 120 images for each type of joint, were selected as the training images. A total of 250 weld joint images were selected for testing: images 1–50 were images of lap weld joints, labelled with a value of 1; images 51–100 were the images of butt weld joints, labelled as 2; images 101–150 were images of splice weld joints, labelled as 3; images 151–200 were images of fillet weld joints, labelled as 4; and, images 201–250 were images of v-type weld joints, labelled as 5. All of the experiments that were reported in this paper were performed on a computer with an Intel i5-6500 CPU, with a main frequency of 3.2 GHz and 8 GB of RAM.
According to the final experimental results, the recognition accuracy achieved 98.4%, and the computational cost of single-image recognition is 148.23 ms.
Figure 18 shows the recognition results for various weld joint images.
5.2. Comparison of Weld Joint Image Feature Extraction Methods
We compared the proposed feature extraction algorithm for weld images with the weld image feature extraction method presented in reference [
23] to verify the effectiveness and superiority of the feature extraction method proposed in this paper. The cited paper presents a comparison with previously proposed weld joint feature extraction algorithms and it shows that the selected method achieves better recognition accuracy with a lower computational cost; thus, it can be used as an object of comparison in this paper. We used both feature extraction algorithms to extract feature vectors with which to build SVM models.
Table 3 shows the final recognition accuracies and computational costs of the two methods.
Figure 19 shows the results of weld image recognition.
A comparison reveals that the recognition accuracy and computational cost of the weld image feature extraction algorithm that was proposed in this paper are better than those of the feature extraction method presented in reference [
23]. The vertical distance from the groove to the surface of the weld joint is used to construct the feature vector. This feature vector is relatively simple. Consequently, this method is more suitable for weld joint types or weld grooves that exhibit large differences. Weld joints that do not show significant groove differences will be difficult to distinguish. The method of reference [
23] misidentifies some lap weld joints, splice weld joints, and fillet weld joints, because the weld grooves of these three types of joints are relatively small, which makes it difficult to differentiate among them, as shown in
Figure 19. By contrast, the method that was proposed in this paper not only utilized the characteristics of the weld joint, but also accounted for laser deformation, which made it suitable for a wider scope of applications and enabled it to achieve a higher accuracy rate.
5.3. Comparision of Classification Methods
Currently, the most commonly applied classification algorithms include logistic regression, the K-nearest- neighbour algorithm, the decision tree algorithm, Bayesian classification, the SVM algorithm, and neural networks. The SVM results were compared with the results of other classification methods to verify the effectiveness and applicability of the SVM method selected in this paper. Logistic regression is mainly used for binary classification, since the number of weld types considered here is greater than two, logistic regression is not a suitable classification algorithm for the problem of interest. Bayesian classification is based on the premise that the posterior probability can be obtained with the prior probability. Bayesian classification is not suitable for the problem of interest because it is difficult to find a suitable prior probability for the problem considered in this paper. Neural networks have high requirements in terms of the number of samples needed and they are not suitable for classification with small sample sizes, and they require a high performance GPU for training and testing; they are not suitable for welding industrial sites. Therefore, the SVM model that was established in this paper was compared with the K-nearest-neighbour algorithm and the decision tree algorithm. The classification accuracy of each algorithm and the computational cost of single image recognition were analysed based on the feature vectors that were extracted in this paper.
The K-nearest-neighbour algorithm recognizes the weld joint type by calculating the Euclidean distances between the feature vector of the weld joint to be recognized and the feature vectors of all known joint images. In the decision tree algorithm, a decision tree is recursively generated by selecting features as criteria for node splitting. The traditional ID3 algorithm was used in this experiment.
Table 4 shows the final experimental results.
The experimental results show that the joint recognition system that is based on the proposed SVM model is superior to the K-nearest neighbour algorithm in terms of both recognition accuracy and computational cost. By contrast, the time cost of the decision tree algorithm is lower than that of the SVM algorithm by 9.88 ms; however, its accuracy rate is only 90.3%. Therefore, based on comprehensive consideration of the computational cost and accuracy, we conclude that the SVM model that is presented in this paper is also superior to the decision tree algorithm.
5.4. Robustness Testing of the Proposed Weld Joint Recognition Method
We added a new weld joint type to the model to verify the robustness of the proposed weld recognition algorithm. The new weld joint type is “filler layer weld joint”.
Figure 20 shows a laser curve image of such a filler layer weld joint. During the actual welding process, the welding voltage and current are lower than those in the bottom layer, because one layer has already been welded, and the swing range of the welding torch should be smaller. Thus, the weld characteristics meet the needs of weld joint recognition, as presented in this paper. With this addition of this weld joint type, the final recognition accuracy of the new weld joint recognition system is 98.1%. When compared with the previous performance, the accuracy of the proposed system is reduced by only 0.3%, thus showing that the proposed joint recognition system exhibits good robustness.
It is necessary to test the recognition results for different weld sizes to verify the generalizability of the proposed recognition algorithm. Therefore, along with the additional weld joint mentioned above, our system was applied to weld joint image of different sizes, as shown in
Table 5. Ultimately, the recognition accuracy of the new model is 98.4% and the computational cost is 148.23 ms. In fact, the changes in weld size have no effect on the recognition accuracy.
In this study, we recognize the welding joint type before welding begins. However, there might be multiple welding robots working together in an actual welding workshop. In this case, the other welding robots affects the welding joint image, and the arc light and splash generated by other welding robots appear in the image. We input the image with splash and arc light into our welding system to test the effectiveness of the proposed algorithm in the case of external noise interference. The results show that the proposed algorithm can effectively process an image with splash and arc light, as shown in
Figure 21.