Automatic positioning welding method based on deep learning

Through deep learning technology, YOLOv3 network and RANSAC algorithm are used to solve the problem of weld feature extraction in complex welding environments, achieve accurate identification and positioning of welds, and improve the level of automation and intelligence of welding.

CN114266974BActive Publication Date: 2024-09-27FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111588808.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2024-09-27
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

Existing welding technology is difficult to effectively extract weld features in complex environments, especially when there are multiple interference lines. Weld recognition and positioning methods based on laser-assisted light sources have low accuracy, and passive vision methods require different designs for different welds. The feature extraction method cannot effectively extract features in complex environments.

Method used

An automatic positioning welding method based on deep learning is used, and the YOLOv3 network is used to build a classification recognition model. Through image preprocessing and feature extraction, combined with the RANSAC algorithm and the least squares method, the identification and fitting of the center point and edge line of the weld are realized, transforming the welding Seam endpoint positioning is a target identification and classification problem, and deep learning is used to achieve precise positioning of the welding seam endpoint.

Benefits of technology

It achieves accurate identification and positioning of welds in complex welding environments, improves welding accuracy, reduces dependence on laser-assisted light sources, can handle different types of welds and complex surfaces, and improves the automation and intelligence level of welding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114266974B
    Figure CN114266974B
Patent Text Reader

Abstract

The present invention relates to an automatic positioning welding method based on deep learning, comprising the following steps: step S1: constructing a data set; step S2: constructing and training a classification recognition model; step S3: performing target detection and recognition on an image acquired by a camera based on the trained classification recognition model, and completing image shearing based on the obtained target frame information to obtain a groove image and a groove edge image; step S4: obtaining a fitting weld center line LV; step S5: obtaining a fitting edge straight line LH; step S6: using the intersection of the fitting edge straight line LH and the fitting weld center line as a weld endpoint, and filtering out noise points exceeding the weld endpoint part in the weld center point set PV point set in step S4 based on the weld endpoint information; step S7: unifying the coordinates of each point in the weld center point set PV to a workpiece coordinate system through displacement transformation and camera external parameters, and finally guiding an ABB manipulator to complete welding through socket communication. The present invention effectively realizes automated welding and intelligent welding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatic welding, and in particular to an automatic positioning welding method based on deep learning. Background Art

[0002] Automated welding and intelligent welding are important development directions for efficient welding manufacturing, and vision-assisted automated welding is one of the important means of automated welding. The function of the visual assistance system is mainly realized by processing the welding image to obtain the welding corner information and feed it back to the actuator to complete the automated welding work.

[0003] Before deep learning was applied in the field of automated welding, previous weld recognition methods were mainly divided into two categories: active vision and passive vision. Active vision is to design a special feature detection algorithm with the help of the special features presented by the laser-assisted light source on the groove to complete the extraction of the weld center point. This method can effectively extract the position of the weld center point with high accuracy by designing a specific feature extraction method when there is little interference around the groove and a small field of view. However, the weld extraction method based on the laser-assisted light source not only needs to design different feature extraction methods for different grooves, but also when there are a large number of irregular interferences around the groove, especially line shape interference, the weld recognition and positioning method based on the laser-assisted light source will be difficult to perform effective weld feature extraction. Passive vision refers to a method that uses natural light or annular light sources without the help of lasers, and relies on the characteristics of the weld itself to design corresponding feature extraction methods to complete the separation and positioning of the weld and the background. This method also has the problem of needing to design different feature extraction methods for different welds and being unable to effectively extract features in complex welding environments. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide an automatic positioning welding method based on deep learning to effectively realize automated welding and intelligent welding.

[0005] To achieve the above object, the present invention adopts the following technical solution:

[0006] An automatic positioning welding method based on deep learning comprises the following steps:

[0007] Step S1: obtaining a linear groove image set formed by the butt joint of the welded plates, and preprocessing it to obtain a data set;

[0008] Step S2: construct a classification recognition model based on the YOLOv3 network, and train it based on the data set to obtain a trained target classification recognition model based on YOLOv3;

[0009] Step S3: Based on the trained YOLOv3-based target classification and recognition model, target detection and recognition are performed on the image acquired by the camera, and image cutting is completed based on the obtained target frame information to obtain the target image, including the groove image and the groove edge image;

[0010] Step S4: convert the groove image into a grayscale image and extract the weld center point, use the RANSAC algorithm to filter the noise points that deviate from the weld center, obtain the weld center point set PV point set, and finally use the least squares method to perform linear fitting on the extracted weld center points to obtain the fitted weld center line LV;

[0011] Step S5: the groove edge image recognition result is judged, and the upper and lower frames are processed separately. When the small frame edge image is extracted, the large frame edge image is not extracted and processed, and the fitting edge straight line LH is obtained based on the groove edge image;

[0012] Step S6: taking the intersection of the fitted edge straight line LH and the fitted weld center line LV as the weld endpoint, and further filtering out the noise points in the weld center point set PV in step S4 that exceed the weld endpoint;

[0013] Step S7: Based on the displacement transformation of the image acquisition position and the camera calibration position, after the weld center point is detected in the images obtained at each acquisition point, the coordinates of each point in the entire weld center point set PV are unified to the workpiece coordinate system through displacement transformation and camera external parameters, and the ABB manipulator is guided to complete the welding through socket communication.

[0014] Furthermore, the step S1 is specifically as follows:

[0015] Step S11: acquiring a linear groove image set formed by three types of welded plates, including a laser-cut smooth surface welded plate, an additive substrate with positioning openings commonly used in the laboratory, and a complex surface welded plate with different additive shapes on the surface after various additive tests are completed on the additive substrate;

[0016] Step S12: Use LabelImg open source software to complete target labeling;

[0017] Step S13: Use left-right mirror flipping and random adjustment of hue, saturation and brightness in HSV format to expand the image data set to obtain a training data set.

[0018] Furthermore, in terms of category design, step S12 converts the groove endpoint recognition into a classification recognition and positioning problem. The designed target categories include weld, up_edge_mini, up_edge, down_edge_mini, and down_edge, a total of 5 categories. Among them, there are two groups of upper and lower edge boxes of the groove, including two larger groups of up_edge and down_edge boxes, and two smaller groups of up_edge_mini and down_edge_mini boxes.

[0019] Furthermore, the step S2 is specifically as follows:

[0020] Step S21: Before training the YOLOv3 model, the kmeans algorithm is used to cluster the five types of marked target boxes to obtain new prior box data;

[0021] Step S22: The image is scaled to a preset ratio without distortion and used as input for the YOLOv3 model. The YOLOv3 model uses the darknet53 network and the FPN network to extract and enhance features to obtain enhanced feature information.

[0022] Step S23: Based on the mixed loss function composed of coordinate loss, confidence loss and classification loss, the network parameters of the YOLOv3 model are continuously optimized using the gradient descent method;

[0023] Step S24: During model training, the data set is randomly divided into a training set and a test set, and training is performed based on the training set. The test set is used to obtain the model evaluation after training. The model evaluation result uses the mean average precision (mAP) as the evaluation indicator for classification and recognition to obtain an effective target detection and classification model.

[0024] Furthermore, the step S4 is specifically as follows:

[0025] Step S41: Estimate the actual width of the groove, and use the inverse matrix of the camera extrinsic parameters to inversely calculate the groove width w in the pixel coordinate system;

[0026] Step S42: Set the extracted groove grayscale image to gray, and set the image size of gray to (raw, col), and the grayscale value at the point (i, j) to P (i,j) , for the groove grayscale image, find the coordinates P of the center point of the weld at the i-th row position i , we only need to solve T(i0,j0)=T min (i,j), then P i The coordinates are (i0, j0), where the formula used is:

[0027]

[0028] Step S43: Use the RANSAC algorithm to filter out the noise points that deviate from the weld center in step S42, and the remaining points constitute the weld center point set PV, and use the least squares method to fit the weld center line LV.

[0029] Furthermore, the step S5 is specifically as follows:

[0030] Step S51: Identify the extracted groove edge image category, process the upper and lower frames separately, and when the large and small frames of the same side groove edge are detected at the same time, only process the small frame data, ignore the large frame data, and convert the image into a grayscale image.

[0031] Step S52: Set the extracted grayscale image of the groove edge to gray, and set the image size of gray to (raw, col), and the grayscale value at the point (i, j) to P (i,j) For the groove grayscale image, we want to find the coordinates P of the center point of the weld at the i-th row position. i We only need to solve T(i0,j0)=T min (i,j), then P i The coordinates are (i0, j0), where the formula used is:

[0032]

[0033] where i∈[3,raw-4],j∈[0,col-1]

[0034] Step S53: Use the RANSAC algorithm to filter out the noise points that deviate from the groove edge line in step S52, and the remaining points constitute the edge point set PH, and use the least squares method to fit the edge straight line LH.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] 1. The present invention adds a groove edge recognition and positioning mechanism based on the original weld recognition and positioning, which transforms the key problem of weld end point positioning, which previously required the assistance of laser auxiliary light source, depth camera and other auxiliary mechanisms to achieve, into a general target recognition and positioning problem based on deep learning;

[0037] 2. The dataset structure proposed in the present invention adds a mark for the position of the groove edge. The mark divides the groove into two categories: upper and lower grooves. Each category is further divided into two categories: large and small edge grooves. The groove endpoint recognition is converted into a classification recognition problem to solve the problem that the previous weld recognition dataset can only complete rough positioning in positioning. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flow chart of the method of the present invention;

[0039] Figure 2 It is a classification method and a labeling diagram in one embodiment of the present invention;

[0040] Figure 3 A diagram of a weld center point identification process in one embodiment of the present invention;

[0041] Figure 4 A diagram of the edge point recognition process in one embodiment of the present invention;

[0042] Figure 5 A diagram of weld seam recognition results in one embodiment of the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0044] Please refer to Figure 1 The present invention provides an automatic positioning welding method based on deep learning, comprising the following steps:

[0045] Step S1: Create a dedicated "Weld dataset" in the PASCAL VOC dataset format. The present invention independently proposes a groove edge category design, converting the groove endpoint recognition into a classification recognition problem to solve the problem that the previous weld recognition dataset can only complete rough positioning in positioning.

[0046] Preferably, in this embodiment, the images used in the dedicated data set "Weld data set" are derived from a set of straight groove images formed by the butt joint of three types of welded plates collected in the laboratory, including a small number of laser-cut welded plates with smooth surfaces and additive substrates with positioning openings commonly used in the laboratory, as well as a large number of complex surface welded plates with a large number of different additive shapes on the surface after completing various additive tests on the additive substrates. The total number of images acquired is 1,251.

[0047] Step 1: Use LabelImg open source software to complete target labeling. Figure 2 As shown, in terms of category design, the present invention independently proposes a groove edge category design, and transforms the groove endpoint recognition into a classification recognition and positioning problem. The designed target categories include weld, up_edge_mini, up_edge, down_edge_mini, and down_edge, a total of 5 categories. Among them, there are two groups of upper and lower edge boxes of the groove, including two larger groups of up_edge and down_edge boxes, and two smaller groups of up_edge_mini and down_edge_mini boxes.

[0048] Preferably, during model training, before the image is imported into the YOLOv3 network, left-right mirror flipping (not upside down flipping or random angle rotation to ensure that the category will not change due to this operation) and random adjustment of hue, saturation and brightness in HSV format are used to expand the original data set to avoid the decrease in model accuracy due to insufficient data set size.

[0049] Step S2: The acquired images are fed into the YOLOv3 network in batches, and an effective classification and recognition model is obtained after training.

[0050] In this embodiment, preferably, step S2 is specifically:

[0051] Step S21: Before model training, the kmeans algorithm is used to cluster the five types of labeled target boxes to obtain new prior box data.

[0052] Step S22: The image is scaled to a 416*416 image without distortion as the input of the YOLOv3 model (an existing model in the art). The YOLOv3 model uses the darknet53 network and the FPN network to extract and enhance features to obtain enhanced feature information.

[0053] Step S23: Based on the mixed loss function composed of coordinate loss, confidence loss and classification loss (function already exists in this field), the gradient descent method is used to continuously optimize the network parameters of the YOLOv3 model.

[0054] Step S24: During model training, the ratio of the number of images in the training set to that in the test set is 7:3, and the model evaluation result uses the mean average precision (mAP) as the evaluation indicator for classification recognition.

[0055] Step S3: Based on the trained YOLOv3-based target classification and recognition model, target detection and recognition are performed on the image acquired by the camera, and image cutting is completed based on the obtained target frame information, and the complex background and the key position of the weld are effectively separated to obtain the target image, including the groove image and the groove edge image.

[0056] Step S4: Figure 3 As shown in the figure, the groove image extracted by the YOLOv3 model is converted into a grayscale image and the designed algorithm is used to extract the weld center point. Then, the RANSAC algorithm is used to filter the noise points deviating from the weld center to obtain the weld center point set PV point set. Finally, the extracted weld center points are linearly fitted using the least squares method to obtain the weld fitting center line LV.

[0057] In this embodiment, preferably, step S4 is specifically:

[0058] Step S41: Estimate the actual width of the groove, and use the inverse matrix of the external camera parameters to inversely calculate the groove width w in the pixel coordinate system.

[0059] Step S42: Set the extracted groove grayscale image as "gray", and assume the image size of gray is (raw, col), and the grayscale value at the position (i, j) is P. (i,j) For the groove grayscale image, to find the coordinates of the weld center point P at the i-th row position. i Only need to solve T(i0, j0) = T. min (i, j), then P. i The coordinates of are (i0, j0), and the formula used is:

[0060]

[0061] Step S43: Since the weld center points extracted in Step S42 contain a large number of noise points deviating from the weld center line, it is necessary to filter the noise points and fit the weld center line. Here, the RANSAC algorithm is used for noise filtering, and the least squares method is used for weld center line fitting. Assume the extracted weld center point set is the P point set, and the specific operation is as follows.

[0062] (1) First, randomly extract two points from the P point set and construct a straight line equation L for these two points.

[0063] (2) Set the error range D and calculate the distance d from all points in the P point set to the straight line L.

[0064] (3) For all points in P, count the number N of point sets that meet the error requirement (d < D).

[0065] (4) Repeat steps (1)-(3) a total of 50 times. Whenever the number of point sets that meet the error requirement is greater than the original number of point sets, update the straight line equation L and the point set N.

[0066] (5) Retain all point sets that meet the error requirement and have the largest number N of point sets, and regard the remaining points as noise points to be剔除. The retained P point set is denoted as the weld center point PV point set.

[0067] (6) Use the least squares method to perform a straight line fit on the PV point set, as shown in Figure 3 to obtain the fitted weld center line LV.

[0068] Step S5: For the groove edge image extracted by the YOLOv3 model, the upper and lower borders are processed separately. When the small frame edge image is extracted, the large frame edge image is not extracted and processed. The groove edge image processing (distinguishing the upper and lower edges and processing them separately) first uses the designed algorithm to obtain the edge corner points, then uses the RANSAC algorithm to filter the noise points that deviate from the groove edge, obtains the edge point set PH (distinguishing the upper and lower edge point sets), and finally uses the least squares method for linear fitting to obtain the fitted edge straight line LH (distinguishing the upper and lower edge fitting straight line). The processing effect is as follows: Figure 4 shown.

[0069] In this embodiment, preferably, step S5 is specifically:

[0070] Step S51: The upper and lower edge boxes detected by the YOLOv3 model are processed separately. When the small and large edge boxes on the same side are detected at the same time, only the small box data is processed. The large box data is used only when the small box target is not detected and the large box target is detected. The purpose of this is to ensure detection efficiency and detection accuracy.

[0071] Step S52: Set the extracted groove edge grayscale image to "gray", and assume that the image size of gray is (raw, col), and the grayscale value at the point (i, j) is P (i,j) For the groove grayscale image, we want to find the coordinates P of the center point of the weld at the i-th row position. i We only need to solve T(i0,j0)=T min (i,j), then P i The coordinates are (i0, j0), where the formula used is:

[0072]

[0073] where i∈[3,raw-4],j∈[0,col-1]

[0074] Step S53: Since the edge corner points extracted in step S52 contain a large number of noise points that deviate from the edge, it is necessary to filter the noise points and fit the edge centerline. Here, the RANSAC algorithm is used to filter the noise points, and the least squares method is used to fit the weld centerline. Assuming that the extracted weld center point set is the P point set, the specific operation is the same as step S43. The processing process is as follows: Figure 4 As shown, the edge point set PH and edge line LH are finally obtained.

[0075] The specific operations are:

[0076] (1) First, randomly select two points from the point set P and construct the straight line equation L for these two points.

[0077] (2) Set the error range D and calculate the distance d from each point in all P point sets to the straight line L.

[0078] (3) For all points in P, count the number N of point sets that meet the error requirement (d < D).

[0079] (4) Repeat steps (1)-(3) a total of 50 times. Whenever the number of point sets that meet the error requirement is greater than the original number of point sets, update the straight line equation L and the point set N.

[0080] (5) Retain all point sets that meet the error requirement and have the largest number N of point sets, and regard the remaining points as noise points to be removed. The retained P point set is denoted as the weld center point PH point set.

[0081] (6) Perform linear fitting on the PH point set using the least squares method, as Figure 3 shown, to obtain the fitted weld center line LH.

[0082] Step S6: The groove information obtained in step S3 only includes a general position of the groove. Therefore, the weld center point set obtained in step S4 based on the groove image obtained in step S3 may include corner points other than the weld endpoints, or there may be no weld endpoint information. Based on this problem, the present invention independently designs a classification recognition and positioning method for groove edge categories, that is, step S5. Use the intersection point of the fitted edge straight line LH obtained in step S5 and the fitted weld center line obtained in step S4 as the weld endpoints, and filter out the noise points in the PV point set of the weld center point set in step S4 that exceed the weld endpoints based on the weld endpoint information.

[0083] Step S7: As Figure 5 shown, due to the limitation of the camera imaging field of view, a single image cannot cover all information. In this embodiment, based on the displacement transformation between the image acquisition position and the camera calibration position, after detecting the weld center points in the images obtained by collecting points one by one, the coordinates of each point in the entire weld center point set PV are unified into the workpiece coordinate system through displacement transformation and the external parameters of the camera. Finally, the ABB manipulator is guided to complete welding through socket communication.

[0084] The above are only the preferred embodiments of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope covered by the present invention.

Claims

1. An automatic positioning welding method based on deep learning, characterized in that: The following steps are involved: Step S1: obtaining a linear groove image set formed by the butt joint of the welded plates, and preprocessing it to obtain a data set; Step S2: construct a classification recognition model based on the YOLOv3 network, and train it based on the data set to obtain a trained target classification recognition model based on YOLOv3; Step S3: Based on the trained YOLOv3-based target classification and recognition model, target recognition is performed on the image acquired by the camera, and image cutting is completed based on the obtained target frame information to obtain a target image, including a groove image and a groove edge image; Step S4: convert the groove image into a grayscale image and extract the weld center point, use the RANSAC algorithm to filter the noise points that deviate from the weld center, obtain the weld center point set PV point set, and finally use the least squares method to perform linear fitting on the extracted weld center points to obtain the weld fitting center line LV; Step S5: the groove edge image recognition result is judged, and the upper and lower frames are processed separately. When the small frame edge image is extracted, the large frame edge image is not extracted and processed, and the fitting edge straight line LH is obtained based on the groove edge image; Step S6: taking the intersection of the fitted edge straight line LH and the fitted weld center line LV as the weld endpoint, and filtering out the noise points in the weld center point set PV in step S4 that exceed the weld endpoint based on the weld endpoint information; Step S7: Based on the displacement transformation of the image acquisition position and the camera calibration position, after the weld center point detection is performed on the images acquired at each acquisition point, the coordinates of each point in the weld center point set PV are unified to the workpiece coordinate system through the displacement transformation and the camera external parameters, and finally the ABB manipulator is guided to complete the welding through socket communication; The step S1 is specifically as follows: Step S11: acquiring a linear groove image set formed by three types of welded plates, including a laser-cut smooth surface welded plate, an additive substrate with positioning openings commonly used in the laboratory, and a complex surface welded plate with different additive shapes on the surface after various additive tests are completed on the additive substrate; Step S12: Use LabelImg open source software to complete target labeling; Step S13: using left-right mirror flipping and random adjustment of hue, saturation and brightness in HSV format to expand the image data set to obtain a training data set; In the category design of step S12, the groove endpoint recognition is converted into a classification recognition and positioning problem. The designed target categories include weld, up_edge_mini, up_edge, down_edge_mini, and down_edge, a total of 5 categories, wherein the groove upper and lower edge frames are two groups each, including two larger frames of up_edge and down_edge, and two smaller frames of up_edge_mini and down_edge_mini. The step S4 is specifically as follows: Step S41: Estimate the actual width of the groove, and use the inverse matrix of the camera extrinsic parameters to inversely calculate the groove width w in the pixel coordinate system; Step S42: Set the extracted groove grayscale image to gray, and set the image size of gray to (raw, col), and the grayscale value at the point (i, j) to P (i,j) , for the groove grayscale image, find the coordinates P of the center point of the weld at the i-th row position i , we only need to solve T(i0,j0)=T min (i,j), then P i The coordinates are (i0, j0), where the formula used is: Step S43: Use the RANSAC algorithm to filter out the noise points that deviate from the weld center in step S42, and the remaining points constitute the weld center point set PV, and use the least squares method to fit the weld center line LV; The step S5 is specifically as follows: Step S51: the extracted groove edge image category is discriminated, and the upper and lower frames are processed separately. When the large and small frames of the groove edge on the same side are detected at the same time, only the small frame data is processed, and the large frame data is ignored; Step S52: Set the extracted grayscale image of the groove edge to gray, and set the image size of gray to (raw, col), and the grayscale value at the point (i, j) to P (i,j) For the groove grayscale image, we want to find the edge corner coordinates P at the jth column position. j We only need to solve T'(i0',j0')=T min '(i,j), then P j The coordinates are (i0', j0'), where the formula used is: where i∈[3,raw-4],j∈[0,col-1] Step S53: Use the RANSAC algorithm to filter out the noise points that deviate from the groove edge line in step S52, and the remaining points constitute the edge point set PH, and use the least squares method to fit the edge straight line LH.

2. The automatic positioning welding method based on deep learning according to claim 1 is characterized in that: The step S2 is specifically as follows: Step S21: Before training the YOLOv3 model, the kmeans algorithm is used to cluster the five types of marked target boxes to obtain new prior box data; Step S22: The image is scaled to a preset ratio without distortion and used as input for the YOLOv3 model. The YOLOv3 model uses the darknet53 network and the FPN network to extract and enhance features to obtain enhanced feature information. Step S23: Based on the mixed loss function composed of coordinate loss, confidence loss and classification loss, the network parameters of the YOLOv3 model are continuously optimized using the gradient descent method; Step S24: During model training, the data set is randomly divided into a training set and a test set, and training is performed based on the training set. The test set is used to obtain the model evaluation after training. The model evaluation result uses the mean average precision (mAP) as the evaluation indicator for classification and recognition to obtain an effective target detection and classification model.