Weld joint detection method and system

By constructing a three-dimensional virtual model and YOLOv3 network, welding seam marking frames are automatically generated, which solves the welding problems caused by the instability of manual marking and improves welding efficiency and stability.

CN118735840AActive Publication Date: 2024-10-01WUXI WEIZHUO INTELLIGENT ROBOT CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310337244.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01
Estimated Expiration
2043-03-31

AI Technical Summary

Technical Problem

When existing laser welding robots weld in harsh environments, the welding effect is poor due to the instability of manually marked welds.

Method used

By constructing a three-dimensional virtual model, simulating laser irradiation to generate a virtual welding seam laser map, automatically generating a welding seam marking frame, and using the YOLOv3 target detection network to train the welding seam detection model, identify the welding seam position of the workpiece to be welded, generate a welding trajectory, and avoid manual mark.

Benefits of technology

It improves the stability and efficiency of welding seam, saves manpower and material resources, and improves the overall efficiency of welding operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735840A_ABST
    Figure CN118735840A_ABST
Patent Text Reader

Abstract

The invention provides a welding seam detection method and system, and the method comprises the steps: building a plurality of three-dimensional virtual models of workpieces containing welding seams, carrying out the simulation illumination of the models, generating a virtual welding seam laser diagram, and automatically generating a welding seam marking frame through the intersection of a plane equation of a virtual laser emission surface and a linear equation of a virtual welding seam. Therefore, manual welding seam marking is avoided, and the efficiency of welding seam detection in earlier stage processing is improved to a great extent. According to the method, the virtual welding seam laser diagram with the generated welding seam marking frame is used as the training set and the test set, so that manual on-site sampling is avoided, a large amount of manpower and material resources are saved, the efficiency of obtaining the welding seam detection training model is improved to a great extent, and the efficiency of the whole welding seam welding operation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of welding technology, and in particular to a weld detection method; in addition, the present invention also relates to a weld detection system. Background Art

[0002] Today, intelligent manufacturing has been vigorously developed in my country, and the technology of laser welding robots has been continuously accumulated. In particular, there is a great demand for laser welding robots in harsh environments. In the development process of laser welding robots, laser welding robot arms have developed the most mature. However, the existing laser welding robot arms need to manually mark the welds of the workpieces when welding them, and then the laser welding robot arms perform the welds according to the pre-marked weld trajectories. Due to the instability of manually marking the welds of the workpieces, for example, when working in a sick or fatigued state, it may cause marking deviations, resulting in poor welding effects. Summary of the invention

[0003] In order to solve the problems existing in the prior art, at least one embodiment of the present invention provides a weld detection method, which avoids manual labeling and greatly improves the welding effect of the weld. To this end, at least one embodiment of the present invention also provides a weld detection system.

[0004] In a first aspect, an embodiment of the present invention provides a weld detection method, the method comprising the following steps:

[0005] Constructing a plurality of three-dimensional virtual models of workpieces including welds, and generating virtual weld laser images by simulating laser irradiation of the three-dimensional virtual models;

[0006] Generate a weld mark frame in the virtual weld laser image by the intersection of the virtual laser emission surface and the virtual weld position;

[0007] The virtual weld laser image with the generated weld mark frame is used as the training set and the test set, and is input into the target detection network for training to obtain the weld detection model;

[0008] The weld seam detection model is used to identify the weld seam of the workpiece to be welded and output the position information of the weld seam.

[0009] In some embodiments, the present invention provides a weld detection method, generating the virtual weld laser image comprises the following steps:

[0010] The position where the normal vector of the virtual weld line is extended outward for a certain distance is used as the light source of the virtual laser;

[0011] Simulating emitting a virtual laser line to the three-dimensional virtual model at the light source;

[0012] The virtual weld seam laser image is generated by the intersection of the virtual laser line and the three-dimensional virtual model.

[0013] In some embodiments, the present invention provides a weld detection method, wherein the light source simulates emitting a laser line at a certain tilt angle to the three-dimensional virtual model.

[0014] In some embodiments, the present invention provides a weld detection method, in which the target detection network adopts the YOLOv3 network.

[0015] In some embodiments, the loss function of the YOLOv3 network is:

[0016]

[0017]

[0018]

[0019] loss = lbox + lobj + lcls

[0020] Among them, lbox represents the prediction box coordinate error, λ coord is the prediction box coordinate error weight, S 2 is the S*S unit grid, B is the number of prediction boxes, w i is the width of the prediction box, h i is the height of the prediction box, x i is the horizontal coordinate of the center point of the prediction box, y i is the ordinate of the center point of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the width of the real frame, is the height of the real box; lcls represents the classification error, λ class is the classification weight; lobj is the confidence error, c i is the confidence level, is the true value, λ noobj is the weight when the prediction box does not contain an object, λ obj is the weight when the prediction box contains an object.

[0021] In some embodiments, a weld detection method provided by the present invention uses a virtual weld laser image with a generated weld marking frame as a training set and a test set, and when it is input into a target detection network for training, the weld marking frame is expanded outward by multiple pixels as a regression frame for weld detection.

[0022] In some embodiments, the present invention provides a weld detection method, which generates a weld welding trajectory through the position information of the identified weld of the workpiece to be welded after identifying the weld of the workpiece to be welded through the weld detection model and outputting the position information of the weld.

[0023] In some embodiments, the present invention provides a weld detection method, wherein the coordinates of the weld marking frame are obtained by the intersection of the plane equation of the virtual laser emitting surface and the straight line equation of the virtual weld.

[0024] In a second aspect, an embodiment of the present invention further provides a weld detection system, comprising:

[0025] A virtual model building module, used for building a three-dimensional virtual model of a plurality of workpieces including welds;

[0026] A virtual weld laser image generation module, used to generate a virtual weld laser image by simulating laser irradiation on the three-dimensional virtual model;

[0027] A weld mark frame generation module, used to generate a weld mark frame in the virtual weld laser image through the intersection of a virtual laser emission surface and a virtual weld position;

[0028] A training module is used to input the virtual weld laser image with the generated weld mark frame as a training set and a test set into the target detection network for training to obtain a weld detection model;

[0029] The weld detection module is used to identify the weld of the workpiece to be welded through the weld detection model.

[0030] In some embodiments, the present invention provides a weld detection system, wherein the virtual weld laser image generation module includes:

[0031] A virtual laser light source setting module, used to use the position where the normal vector of the virtual weld line extends outward for a certain distance as the light source of the virtual laser;

[0032] A virtual laser line emission module, used for simulating the emission of a virtual laser line at a certain inclination angle to the three-dimensional virtual model at the light source;

[0033] The intersection module is used to generate the virtual weld laser image through the intersection of the virtual laser line and the three-dimensional virtual model.

[0034] In some embodiments, the present invention provides a weld detection system, wherein the training module includes:

[0035] The regression frame generation module is used to expand the weld mark frame outward by multiple pixels as a regression frame for weld detection.

[0036] In some embodiments, the present invention provides a weld detection system, wherein the weld detection module comprises:

[0037] The weld seam welding trajectory generating module is used to generate the weld seam welding trajectory according to the position information of the weld seam that has been identified in the workpiece to be welded.

[0038] In a third aspect, an embodiment of the present invention further provides a weld detection device, comprising at least one processor; a memory coupled to the at least one processor, the memory storing executable instructions, which when executed by the at least one processor implement the steps of any one of the methods of the first aspect above.

[0039] In a fourth aspect, an embodiment of the present invention further provides a chip for executing the steps of the method in the first aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip is used to execute the steps of the method in the first aspect.

[0040] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods in the first aspect above are implemented.

[0041] In a sixth aspect, an embodiment of the present invention further provides a computer program product, comprising computer program instructions, which enable a computer to execute the steps of the method in the first aspect.

[0042] It can be seen that a weld detection method and system according to an embodiment of the present invention constructs a plurality of three-dimensional virtual models of workpieces containing welds, simulates lighting to generate virtual weld laser images, and then automatically generates weld marking frames through the intersection of the plane equation of the virtual laser emission surface and the straight line equation of the virtual weld, thereby avoiding manual weld marking and greatly improving the efficiency of weld detection in the early stage of processing. The virtual weld laser images with generated weld marking frames are used as training sets and test sets, thereby avoiding manual on-site sampling, saving a lot of manpower and material resources, and greatly improving the efficiency of obtaining weld detection training models, thereby improving the efficiency of the entire weld welding operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0044] Figure 1Shown is a flow chart of a weld detection method according to an embodiment of the present invention;

[0045] Figure 2 Shown is a schematic diagram of simulating the emission of virtual laser lines on a three-dimensional virtual model in an embodiment of the present invention;

[0046] Figure 3 Shown is a schematic diagram of the framework of a weld detection system in an embodiment of the present invention. Specific implementation plan

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] The inventor of this solution found that in the prior art, due to the instability of manually marking the weld of the workpiece, the welding effect of the weld is not good. The embodiment of the present invention provides the following solution:

[0049] like Figure 1 As shown, in a first aspect, an embodiment of the present invention provides a weld detection method, the method comprising the following steps:

[0050] Construct multiple three-dimensional virtual model drawings of workpieces containing welds. Three-dimensional modeling can be performed using the CAD drawings provided by the customer. The three-dimensional modeling can be performed using modeling software such as Solidwords, 3D Studio, and AutoCAD.

[0051] A virtual weld laser image is generated by simulating laser irradiation on a three-dimensional virtual model. The generation of the virtual weld laser image includes the following steps:

[0052] The position where the normal vector of the virtual weld line is extended outward for a certain distance is used as the light source of the virtual laser. The distance extended outward can be set to, for example, 30 cm, 35 cm or 40 cm, etc., and can be adjusted according to actual needs.

[0053] like Figure 2As shown, at the light source, a virtual laser line is emitted at a certain tilt angle to simulate the three-dimensional virtual model. The tilt angle can be set to, for example, 30 degrees, 35 degrees or 40 degrees, etc., and can be adjusted according to actual needs. A virtual weld laser image is generated by the intersection of the virtual laser line and the three-dimensional virtual model. Since the coordinates of each point on the three-dimensional virtual model are known in the virtual space in the modeling software, the virtual weld laser image can be obtained by only the intersection of the virtual laser line and the coordinates of each point on the three-dimensional virtual model.

[0054] The weld mark frame is generated in the virtual weld laser image by the intersection of the virtual laser emission surface and the virtual weld position. The weld mark frame is the actual position of the weld in the virtual space. The coordinates of the weld mark frame are obtained by the intersection of the plane equation of the virtual laser emission surface and the straight line equation of the virtual weld.

[0055] Description of the simulated laser emitting surface: The plane normal vector of the simulated laser emitting surface is VP (vp1, vp2, vp3), and the point on the plane is n (n1, n2, n3).

[0056] Description of virtual weld position information: The straight line direction vector of the weld line is VL (v1, v2, v3), and the point on the straight line is m (m1, m2, m3).

[0057] The equation of the line can be written as a parametric equation:

[0058]

[0059] The plane equation of the simulated laser emission surface is written in the form of a point normal equation, that is,

[0060] vp1 * (x – n1) + vp2 * (y – n2) + vp3 * (z – n3) = 0 (2),

[0061] Then the intersection of the line and the plane must satisfy equations (1) and (2). Combining the two equations, we can obtain:

[0062] t=[(n1–m1)*vp1+(n2–m2)*vp2+(n3–m3)*vp3] / (vp1*v1+vp2*v2+vp3*v3)(3),

[0063] If the denominator (vp1*v1+vp2*v2+vp3*v3) in formula (3) is 0, it means that the line is parallel to the plane, that is, the line and the plane have no intersection. After solving t, substitute t into formula (1) to obtain the coordinates (x, y, z) of the intersection point. The set of all intersection points is the weld mark frame.

[0064] The virtual weld laser image with the generated weld marking frame is used as the training set and the test set, and is input into the target detection network for training to obtain the weld detection model.

[0065] Object detection refers to the process of detecting specific objects in an image. It not only needs to identify object information, but also needs to give the specific location of the target object on this basis. At present, there are two types of commonly used object detection. One is based on traditional machine learning methods, which generates some candidate boxes and extracts features, and then uses classifiers to detect and classify the targets. This type of method focuses more on feature extraction and has strong feature explanatory power. At the same time, the selection of candidate boxes is more troublesome and requires setting different scales and aspect ratios. The other type is a target detection method based on deep learning. This type of method does not require artificially designed features, and the features can only be understood by computers. The disadvantage is that it contains a large number of parameters and complex structures, and it takes a lot of time to train. Therefore, it needs to be assisted by a high-performance computing platform and a large amount of raw data. At present, this type of method is mainly divided into two categories, one is two-stage and the other is one-stage. The main idea of ​​the first type of method is to first extract some candidate boxes where the target objects may exist, and then extract features and classify them. There are mainly R-CNN, SPP-Net, Fast RCNN, Faster RCNN, and R-FCN. The second method is to directly perform regression processing on the source image. After being processed by the network, the predicted box of the target object in the image is output, and the category information of the secondary object is output. The main ones are the YOLO series algorithms and the SSD algorithm.

[0066] The target detection network uses the YOLOv3 network. You can also use the YOLOv1 network, YOLOv2 network, etc. Here we take the YOLOv3 network as an example.

[0067] YOLO is short for You Only Look Once, and is a target detection method proposed by Joseph Redmon and others. In order to simulate the behavior that humans only need to glance at the image to know the objects in the image and the positions of these objects, specifically, the CNN network will cut the image into several grids, and each grid only needs to detect the objects whose center points fall within the grid. At the same time, each cell will predict the position information of B bounding boxes and the confidence of the bounding box. The position information of the bounding box can be expressed by four values: (x, y, w, h), where (x, y) is the center coordinate of the bounding box, and w and h represent the width and height of the bounding box. The confidence consists of two parts, one is whether the bounding box contains the target, and the other is the accuracy of the bounding box.

[0068] YOLOv3 is a product that introduces many cutting-edge ideas in the field of target detection based on YOLOv1 and YOLOv2. Compared with YOLOv2, it has made some improvements, and Darknet-53 replaces the previous Darknet-19. All pooling layers are discarded and full convolution layers are used. In YOLOv2, the size of the feature map is carried out by maximum pooling, and a total of 5 reductions are performed, but in YOLOv3, the change in image size is achieved by changing the step size of the convolution kernel. For example, when the step size is 2, it means that the image is reduced by half. Finally, after 5 downsamplings, the output feature map will be reduced to 1 / 32 of the input image. At the same time, YOLOv3 replaces the softmax classifier used for single-label classification with a logistic classifier for multi-label classification, which can classify different objects for a single object. In addition, since the model has a deep network of up to 53 layers, a Res module is added to the network model after the convolution layer, mainly to prevent the gradient from disappearing when the network structure is very deep, so that the network structure has better robustness.

[0069] YOLOv3 draws on the idea of ​​FPN image pyramid, extracts features from different scales and performs detection, that is, extracts features from feature maps of 1 / 8, 1 / 16 and 1 / 32 of the source image size and performs detection. For example, for a 416×416 source image, the size of the base scale feature map is 13×13, and then upsampling can obtain a 26×26 feature map, which is fused with the output of the previous convolutional layer to obtain a second scale feature map of 26×26. Finally, a third scale feature map of 52×52 is obtained based on the second scale feature map. The shallow features concatenate the deep features, so the 52×52 feature map simultaneously integrates the semantic information of the 26×26 and 13×13 feature maps. Similarly, the 26×26 feature map also integrates the semantic information of the 13×13 feature map. After extracting the three scale feature maps, predictions are made at the three scales. This method can effectively take into account target welds of different scales.

[0070] Each cell in YOLOv3 will predict 3 background areas, which is less than the 5 background areas predicted by each cell in YOLOv2. However, since YOLOv3 predicts objects at 3 scales, the total number of prediction boxes actually increases. When the input image is 416×416, the total number of prediction boxes is (13×13+26×26+52×52)×3=10467. During training, YOLOv3 uses logistic regression to calculate the IOU of each prediction box, and uses the non-maximum suppression algorithm to finally determine the optimal prediction box.

[0071] When training, the weld mark box is expanded outward by multiple pixels as the regression box for weld detection. For example, expanding outward by 5 pixels can effectively improve the accuracy of detection and prevent the weld from being out of the regression box due to errors. The loss function is used to estimate the degree of inconsistency between the predicted value and the actual value. During the training process, the value of the loss function is used to update the various parameters in the optimization model. The loss function of the YOLOv3 network is:

[0072]

[0073]

[0074]

[0075] loss = lbox + lobj + lcls

[0076] Among them, lbox represents the prediction box coordinate error, λ coord is the prediction box coordinate error weight, S 2 is a unit grid of S*S, such as 13*13, 26*26, 52*52, etc.; B is the number of prediction boxes, w i is the width of the prediction box, h i is the height of the prediction box, x i is the horizontal coordinate of the center point of the prediction box, y i is the ordinate of the center point of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the width of the real frame, is the height of the real box; lcls represents the classification error, λ class is the classification weight; lobj is the confidence error, c i is the confidence level, is the true value, λ noobj is the weight when the prediction box does not contain an object, λ obj is the weight when the prediction box contains an object.

[0077] It is represented as 1 if the j-th prediction box in the i-th unit grid has the responsible target object, otherwise it is 0.

[0078] It is represented as 1 if the j-th prediction box of the i-th unit grid does not have the responsible target object, otherwise it is 0.

[0079] In order to increase the detection accuracy of small targets, the larger the real box is, the smaller the weight is, and the smaller the weight is, the larger the weight is. Therefore, based on the original YOLOv3 network, lbox is increased by (2-w i*h i )parameter.

[0080] Both training and testing were performed on a high-performance workstation running Windows 11 operating system, which was configured with Intel 2.10GHz eight-core CPU, 32GB memory, and Nvidia GeForce RTX 3080 graphics card. The experiment selected the optimal parameter values ​​through feedback of model verification results, and the training model was iterated 20,000 times each time to finally obtain the weld detection model.

[0081] The laser welding robot arm uses laser to scan the weld of the workpiece to be welded, identifies the specific position information of the weld of the workpiece to be welded through the weld detection model, and then generates a weld welding trajectory based on the specific position information of the weld, and performs welding operations according to the weld welding trajectory.

[0082] like Figure 3 As shown, in a second aspect, an embodiment of the present invention further provides a weld detection system, including a virtual model building module, a virtual weld laser image generating module, a weld marking frame generating module, a training module and a weld detection module.

[0083] The virtual model construction module is used to construct a plurality of three-dimensional virtual models of workpieces containing welds; the virtual weld laser image generation module is used to generate a virtual weld laser image by simulating laser irradiation of the three-dimensional virtual model; the weld marking frame generation module is used to generate a weld marking frame in the virtual weld laser image through the intersection of the virtual laser emission surface and the virtual weld position; the training module is used to use the virtual weld laser image with the generated weld marking frame as a training set and a test set, and input it into the target detection network for training to obtain a weld detection model; the weld detection module is used to identify the weld of the workpiece to be welded through the weld detection model.

[0084] The virtual weld laser image generation module includes a virtual laser light source setting module, a virtual laser line emission module and an intersection module. The virtual laser light source setting module is used to extend the normal vector of the virtual weld line outward for a certain distance as the light source of the virtual laser; the virtual laser line emission module is used to simulate the three-dimensional virtual model at the light source and emit a virtual laser line at a certain tilt angle; the intersection module is used to generate a virtual weld laser image through the intersection of the virtual laser line and the three-dimensional virtual model.

[0085] Construct multiple three-dimensional virtual model drawings of workpieces containing welds. Three-dimensional modeling can be performed using the CAD drawings provided by the customer. The three-dimensional modeling can be performed using modeling software such as Solidwords, 3D Studio, and AutoCAD.

[0086] A virtual weld laser image is generated by simulating laser irradiation on a three-dimensional virtual model. The generation of the virtual weld laser image includes the following steps:

[0087] The position where the normal vector of the virtual weld line is extended outward for a certain distance is used as the light source of the virtual laser. The distance extended outward can be set to, for example, 30 cm, 35 cm or 40 cm, etc., and can be adjusted according to actual needs.

[0088] like Figure 2 As shown, at the light source, a virtual laser line is emitted at a certain tilt angle to simulate the three-dimensional virtual model. The tilt angle can be set to, for example, 30 degrees, 35 degrees or 40 degrees, etc., and can be adjusted according to actual needs. A virtual weld laser image is generated by the intersection of the virtual laser line and the three-dimensional virtual model. Since the coordinates of each point on the three-dimensional virtual model are known in the virtual space in the modeling software, the virtual weld laser image can be obtained by only the intersection of the virtual laser line and the coordinates of each point on the three-dimensional virtual model.

[0089] The weld mark frame is generated in the virtual weld laser image by the intersection of the virtual laser emission surface and the virtual weld position. The weld mark frame is the actual position of the weld in the virtual space. The coordinates of the weld mark frame are obtained by the intersection of the plane equation of the virtual laser emission surface and the straight line equation of the virtual weld.

[0090] Description of the simulated laser emitting surface: The plane normal vector of the simulated laser emitting surface is VP (vp1, vp2, vp3), and the point on the plane is n (n1, n2, n3).

[0091] Description of virtual weld position information: The straight line direction vector of the weld line is VL (v1, v2, v3), and the point on the straight line is m (m1, m2, m3).

[0092] The equation of the line can be written as a parametric equation:

[0093]

[0094] The plane equation of the simulated laser emission surface is written in the form of a point normal equation, that is,

[0095] vp1 * (x – n1) + vp2 * (y – n2) + vp3 * (z – n3) = 0 (2),

[0096] Then the intersection of the line and the plane must satisfy equations (1) and (2). Combining the two equations, we can obtain:

[0097] t=[(n1–m1)*vp1+(n2–m2)*vp2+(n3–m3)*vp3] / (vp1*v1+vp2*v2+vp3*v3)(3),

[0098] If the denominator (vp1*v1+vp2*v2+vp3*v3) in formula (3) is 0, it means that the line is parallel to the plane, that is, the line and the plane have no intersection. After solving t, substitute t into formula (1) to obtain the coordinates (x, y, z) of the intersection point. The set of all intersection points is the weld mark frame.

[0099] The training module includes a regression frame generation module, which is used to expand the label outward by multiple pixels as a regression frame for weld detection. The weld detection module includes a weld welding trajectory generation module, which is used to generate a weld welding trajectory based on the position information of the weld that has been identified on the workpiece to be welded.

[0100] The virtual weld laser image with the generated weld marking frame is used as the training set and the test set, and is input into the target detection network for training to obtain the weld detection model.

[0101] Object detection refers to the process of detecting specific objects in an image. It not only needs to identify object information, but also needs to give the specific location of the target object on this basis. At present, there are two types of commonly used object detection. One is based on traditional machine learning methods, which generates some candidate boxes and extracts features, and then uses classifiers to detect and classify the targets. This type of method focuses more on feature extraction and has strong feature explanatory power. At the same time, the selection of candidate boxes is more troublesome and requires setting different scales and aspect ratios. The other type is a target detection method based on deep learning. This type of method does not require artificially designed features, and the features can only be understood by computers. The disadvantage is that it contains a large number of parameters and complex structures, and it takes a lot of time to train. Therefore, it needs to be assisted by a high-performance computing platform and a large amount of raw data. At present, this type of method is mainly divided into two categories, one is two-stage and the other is one-stage. The main idea of ​​the first type of method is to first extract some candidate boxes where the target objects may exist, and then extract features and classify them. There are mainly R-CNN, SPP-Net, Fast RCNN, Faster RCNN, and R-FCN. The second method is to directly perform regression processing on the source image. After being processed by the network, the predicted box of the target object in the image is output, and the category information of the secondary object is output. The main ones are the YOLO series algorithms and the SSD algorithm.

[0102] The target detection network uses the YOLOv3 network. You can also use the YOLOv1 network, YOLOv2 network, etc. Here we take the YOLOv3 network as an example.

[0103] YOLO is short for You Only Look Once, and is a target detection method proposed by Joseph Redmon and others. In order to simulate the behavior that humans only need to glance at the image to know the objects in the image and the positions of these objects, specifically, the CNN network will cut the image into several grids, and each grid only needs to detect the objects whose center points fall within the grid. At the same time, each cell will predict the position information of B bounding boxes and the confidence of the bounding box. The position information of the bounding box can be expressed by four values: (x, y, w, h), where (x, y) is the center coordinate of the bounding box, and w and h represent the width and height of the bounding box. The confidence consists of two parts, one is whether the bounding box contains the target, and the other is the accuracy of the bounding box.

[0104] YOLOv3 is a product that introduces many cutting-edge ideas in the field of target detection based on YOLOv1 and YOLOv2. Compared with YOLOv2, it has made some improvements, and Darknet-53 replaces the previous Darknet-19. All pooling layers are discarded and full convolution layers are used. In YOLOv2, the size of the feature map is carried out by maximum pooling, and a total of 5 reductions are performed, but in YOLOv3, the change in image size is achieved by changing the step size of the convolution kernel. For example, when the step size is 2, it means that the image is reduced by half. Finally, after 5 downsamplings, the output feature map will be reduced to 1 / 32 of the input image. At the same time, YOLOv3 replaces the softmax classifier used for single-label classification with a logistic classifier for multi-label classification, which can classify different objects for a single object. In addition, since the model has a deep network of up to 53 layers, a Res module is added to the network model after the convolution layer, mainly to prevent the gradient from disappearing when the network structure is very deep, so that the network structure has better robustness.

[0105] YOLOv3 draws on the idea of ​​FPN image pyramid, extracts features from different scales and performs detection, that is, extracts features from feature maps of 1 / 8, 1 / 16 and 1 / 32 of the source image size and performs detection. For example, for a 416×416 source image, the size of the base scale feature map is 13×13, and then upsampling can obtain a 26×26 feature map, which is fused with the output of the previous convolutional layer to obtain a second scale feature map of 26×26. Finally, a third scale feature map of 52×52 is obtained based on the second scale feature map. The shallow features concatenate the deep features, so the 52×52 feature map simultaneously integrates the semantic information of the 26×26 and 13×13 feature maps. Similarly, the 26×26 feature map also integrates the semantic information of the 13×13 feature map. After extracting the three scale feature maps, predictions are made at the three scales. This method can effectively take into account target welds of different scales.

[0106] Each cell in YOLOv3 will predict 3 background areas, which is less than the 5 background areas predicted by each cell in YOLOv2. However, since YOLOv3 predicts objects at 3 scales, the total number of prediction boxes actually increases. When the input image is 416×416, the total number of prediction boxes is (13×13+26×26+52×52)×3=10467. During training, YOLOv3 uses logistic regression to calculate the IOU of each prediction box, and uses the non-maximum suppression algorithm to finally determine the optimal prediction box.

[0107] When training, the weld mark box is expanded outward by multiple pixels as the regression box for weld detection. For example, expanding outward by 5 pixels can effectively improve the accuracy of detection and prevent the weld from being out of the regression box due to errors. The loss function is used to estimate the degree of inconsistency between the predicted value and the actual value. During the training process, the value of the loss function is used to update the various parameters in the optimization model. The loss function of the YOLOv3 network is:

[0108]

[0109]

[0110]

[0111] loss = lbox + lobj + lcls

[0112] Among them, lbox represents the prediction box coordinate error, λ coord is the prediction box coordinate error weight, S 2is a unit grid of S*S, such as 13*13, 26*26, 52*52, etc.; B is the number of prediction boxes, w i is the width of the prediction box, h i is the height of the prediction box, x i is the horizontal coordinate of the center point of the prediction box, y i is the ordinate of the center point of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the width of the real frame, is the height of the real box; lcls represents the classification error, λ class is the classification weight; lobj is the confidence error, c i is the confidence level, is the true value, λ noobj is the weight when the prediction box does not contain an object, λ obj is the weight when the prediction box contains an object.

[0113] It is represented as 1 if the j-th prediction box in the i-th unit grid has the responsible target object, otherwise it is 0.

[0114] It is represented as 1 if the j-th prediction box of the i-th unit grid does not have the responsible target object, otherwise it is 0.

[0115] In order to increase the detection accuracy of small targets, the larger the real box is, the smaller the weight is, and the smaller the weight is, the larger the weight is. Therefore, based on the original YOLOv3 network, lbox is increased by (2-w i *h i )parameter.

[0116] Both training and testing were performed on a high-performance workstation running Windows 11 operating system, which was configured with Intel 2.10GHz eight-core CPU, 32GB memory, and Nvidia GeForce RTX 3080 graphics card. The experiment selected the optimal parameter values ​​through feedback of model verification results, and the training model was iterated 20,000 times each time to finally obtain the weld detection model.

[0117] The laser welding robot arm uses laser to scan the weld of the workpiece to be welded, identifies the specific position information of the weld of the workpiece to be welded through the weld detection model, and then generates a weld welding trajectory based on the specific position information of the weld, and performs welding operations according to the weld welding trajectory.

[0118] In a third aspect, an embodiment of the present invention further provides a weld detection device, comprising:

[0119] At least one processor; a memory coupled to the at least one processor, the memory storing executable instructions, wherein the executable instructions, when executed by the at least one processor, implement the method steps of the first aspect of the present invention.

[0120] In a weld detection device provided by an embodiment of the present invention, a processor and a memory may be provided separately or integrated together.

[0121] For example, the memory may include a random access memory, a flash memory, a read-only memory, a programmable read-only memory, a non-volatile memory or a register, etc. The processor may be a central processing unit (CPU), etc. or a graphic processing unit (GPU). The memory may store executable instructions. The processor may execute the executable instructions stored in the memory to implement the various processes described herein.

[0122] It can be understood that the memory in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a ROM (Read-Only Memory), a PROM (Programmable ROM), an EPROM (Erasable PROM), an EEPROM (Electrically EPROM), or a flash memory. The volatile memory can be a RAM (Random Access Memory), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as SRAM (Static RAM), DRAM (Dynamic RAM), SDRAM (Synchronous DRAM), DDR SDRAM (Double Data Rate SDRAM), ESDRAM (Enhanced SDRAM), SLDRAM (Synchlink DRAM), and DRRAM (Direct Rambus RAM). The memories described herein are intended to include, but are not limited to, these and any other suitable types of memories.

[0123] In some embodiments, the memory stores the following elements, upgrade packages, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and an application program.

[0124] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program includes various application programs, which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application program.

[0125] In an embodiment of the present invention, the processor calls a program or instruction stored in a memory, specifically, a program or instruction stored in an application program, and the processor is used to execute the method steps provided in the first aspect.

[0126] In a fourth aspect, an embodiment of the present invention further provides a chip for executing the method in the first aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip is used to execute the method in the first aspect.

[0127] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method of the first aspect of the present invention are implemented.

[0128] For example, machine-readable storage media may include, but are not limited to, various known and unknown types of non-volatile memory.

[0129] In a sixth aspect, an embodiment of the present invention further provides a computer program product, comprising computer program instructions, which enable a computer to execute the method in the first aspect.

[0130] In summary, a weld detection method and system according to an embodiment of the present invention constructs a plurality of three-dimensional virtual models of workpieces containing welds, simulates lighting to generate a virtual weld laser image, and then automatically generates a weld marking frame through the intersection of the plane equation of the virtual laser emission surface and the straight line equation of the virtual weld, thereby avoiding manual weld marking and greatly improving the efficiency of weld detection in the early stage of processing. The virtual weld laser image with the generated weld marking frame is used as a training set and a test set, thereby avoiding manual sampling on site, saving a lot of manpower and material resources, and greatly improving the efficiency of obtaining a weld detection training model, thereby improving the efficiency of the entire weld welding operation.

[0131] It will be appreciated by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0132] In the embodiments of the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, the division of units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system. In addition, the coupling between the various units can be direct coupling or indirect coupling. In addition, the various functional units in the embodiments of the present application can be integrated into a processing unit, or can be separate physical existences, etc.

[0133] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0134] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a machine-readable storage medium. Therefore, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a machine-readable storage medium, which can include several instructions to enable an electronic device to perform all or part of the technical solution described in the embodiments of the present application. The above-mentioned storage medium may include various media that can store program codes, such as ROM, RAM, removable disk, hard disk, magnetic disk or optical disk.

[0135] The above contents are only specific implementation methods of the present application, and the protection scope of the present application is not limited thereto. Those skilled in the art may make changes or substitutions within the technical scope disclosed in the present application, and these changes or substitutions shall be within the protection scope of the present application.

Claims

1. A weld detection method, characterized in that: The method comprises the following steps: Constructing a plurality of three-dimensional virtual models of workpieces including welds, and generating virtual weld laser images by simulating laser irradiation of the three-dimensional virtual models; Generate a weld mark frame in the virtual weld laser image by the intersection of the virtual laser emission surface and the virtual weld position; The virtual weld laser image with the generated weld mark frame is used as the training set and the test set, and is input into the target detection network for training to obtain the weld detection model; The weld seam detection model is used to identify the weld seam of the workpiece to be welded and output the position information of the weld seam.

2. A weld detection method according to claim 1, characterized in that: Generating the virtual weld laser image comprises the following steps: The position where the normal vector of the virtual weld line is extended outward for a certain distance is used as the light source of the virtual laser; Simulating emitting a virtual laser line to the three-dimensional virtual model at the light source; The virtual weld seam laser image is generated by the intersection of the virtual laser line and the three-dimensional virtual model.

3. A weld detection method according to claim 2, characterized in that: The three-dimensional virtual model is simulated by emitting laser lines at a certain tilt angle at the light source.

4. A weld detection method according to claim 1, characterized in that: The target detection network adopts the YOLOv3 network.

5. A weld detection method according to claim 4, characterized in that: The loss function of the YOLOv3 network is set to: loss = lbox + lobj + lcls Among them, lbox represents the prediction box coordinate error, λ coord is the prediction box coordinate error weight, S 2 is the S*S unit grid, B is the number of prediction boxes, w i is the width of the prediction box, h i is the height of the prediction box, x i is the horizontal coordinate of the center point of the prediction box, y i is the ordinate of the center point of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the width of the real frame, is the height of the real box; lcls represents the classification error, λ class is the classification weight; lobj is the confidence error, c i is the confidence level, is the true value, λ noobj is the weight when the prediction box does not contain an object, λ obj is the weight when the prediction box contains an object.

6. A weld detection method according to claim 1 or 4, characterized in that: The virtual weld laser image with the generated weld mark frame is used as a training set and a test set. When it is input into the target detection network for training, the weld mark frame is expanded outward by multiple pixels as a regression frame for weld detection.

7. A weld detection method according to claim 1, characterized in that: After the weld of the workpiece to be welded is identified by the weld detection model and the position information of the weld is output, a weld welding trajectory is generated by the position information of the identified weld of the workpiece to be welded.

8. A weld detection method according to claim 1, characterized in that: The coordinates of the weld mark frame are obtained by the intersection of the plane equation of the virtual laser emitting surface and the straight line equation of the virtual weld.

9. A weld detection system, characterized in that: include: A virtual model building module, used for building a three-dimensional virtual model of a plurality of workpieces including welds; A virtual weld laser image generation module, used to generate a virtual weld laser image by simulating laser irradiation on the three-dimensional virtual model; A weld mark frame generation module, used to generate a weld mark frame in the virtual weld laser image through the intersection of a virtual laser emission surface and a virtual weld position; A training module is used to input the virtual weld laser image with the generated weld mark frame as a training set and a test set into the target detection network for training to obtain a weld detection model; The weld detection module is used to identify the weld of the workpiece to be welded through the weld detection model.

10. A weld detection system according to claim 9, characterized in that: The virtual weld laser image generation module includes: A virtual laser light source setting module, used to use the position where the normal vector of the virtual weld line extends outward for a certain distance as the light source of the virtual laser; A virtual laser line emission module, used for simulating the emission of a virtual laser line at a certain inclination angle to the three-dimensional virtual model at the light source; The intersection module is used to generate the virtual weld laser image through the intersection of the virtual laser line and the three-dimensional virtual model.

11. A weld detection system according to claim 9, characterized in that: The training module includes: The regression frame generation module is used to expand the weld mark frame outward by multiple pixels as a regression frame for weld detection.

12. A weld inspection system according to claim 9, characterized in that: The weld detection module comprises: The weld seam welding trajectory generating module is used to generate the weld seam welding trajectory according to the position information of the weld seam that has been identified in the workpiece to be welded.

13. A weld detection device, comprising at least one processor; a memory coupled to the at least one processor, the memory storing executable instructions, characterized in that: The executable instructions, when executed by the at least one processor, enable the steps of the method according to any one of claims 1 to 8 to be implemented.

14. A chip, characterized in that: It comprises a processor, which is used to call and run a computer program from a memory, so that a device equipped with the chip executes the steps of the method as claimed in any one of claims 1 to 8.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Container weld joint detection method, electronic equipment and storage medium

    CN112365491A

  • Weld seam feature point extraction method and device, electronic equipment and storage medium

    CN113674218A

  • Laser vision stripe classification and welding seam feature extraction method under uncertain interference source

    CN113723494A

  • Iron tower foot parameterized welding method and device based on 3D vision

    CN114161048A

  • Welding training system

    JP2020187166A