Welding tungsten electrode defect detection method and system based on semantic segmentation and tip repair

By semantic segmentation and tip repair of tungsten electrode images, the problem of time-consuming and labor-intensive manual inspection is solved, enabling accurate judgment of tungsten electrode defects and efficient welding, thereby improving welding quality and saving costs.

CN118799269BActive Publication Date: 2026-04-10SHANDONG JIANZHU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, tungsten electrode defect detection mainly relies on manual inspection, which is time-consuming, labor-intensive, and easily affected by subjective factors, thus impacting welding quality and efficiency.

Method used

A semantic segmentation and tip repair method is used to segment, correct angles, and repair tungsten electrode images. By comparing the masks before and after repair, defects are identified, which guides the welding equipment to rationally plan the tungsten electrode replacement cycle.

Benefits of technology

It enables more accurate and objective assessment of tungsten electrode damage, improving welding quality and efficiency while saving time and material costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799269B_ABST
    Figure CN118799269B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of defect detection, in particular to a welding tungsten tip defect detection method and system based on semantic segmentation and tip repair, the original tungsten tip image obtained is subjected to semantic segmentation to obtain a mask corresponding to the tungsten tip column body and the tungsten tip tip, the mask of the tungsten tip tip is corrected to an upright posture by calculating the deviation angle, and the mask of the tungsten tip tip in the upright state is obtained; the mask of the tungsten tip tip in the upright state is repaired to an undamaged state, and the repaired mask of the tungsten tip tip in the upright state is obtained; according to the tungsten tip vertex coordinates, the tungsten tip repair vertex coordinates, the tungsten tip tip edge coordinates and the tungsten tip repair edge coordinates in the mask of the tungsten tip tip and the repaired mask of the tungsten tip tip in the upright state, it is judged whether the tungsten tip exists wear, splashing slag and melting deformation defects. More accurate and objective tungsten damage state data can be provided for welding equipment, and the problem that current manual inspection of the tungsten state is time-consuming and laborious and is easily affected by subjective factors can be overcome.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of defect detection, in particular to a welding tungsten electrode defect detection method and system based on semantic segmentation and tip repair. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.

[0003] Tungsten inert-gas arc welding (TIG) utilizes the high-temperature arc between the tungsten electrode and the workpiece to stably ignite and form a liquid molten pool, and completes the welding process by melting the base, finally forming a weld. TIG welding has the technical advantages of high welding arc stability, almost no spatter during welding process, etc.

[0004] In TIG welding, the tungsten electrode directly participates in the welding process, and its functions include guiding current, transmitting electric energy and stabilizing arc, etc. Through the participation of the tungsten electrode, the strength and toughness of the weld can be enhanced, the welding tightness can be ensured, and the welding quality can be effectively improved and the welding efficiency can be improved. However, in the actual welding process, due to burning loss, slag splashing and other reasons, the tungsten electrode is prone to damage and defects (such as wear defects, slag splashing defects, etc.), thereby affecting the stability of the arc and the formation of the weld.

[0005] In order to prevent the decline of welding quality caused by the damage of the tungsten electrode, it is necessary to detect the defects of the welding tungsten electrode. However, the current tungsten electrode defect inspection mainly relies on manual operation, which is time-consuming and labor-intensive, and is easily affected by subjective factors. SUMMARY

[0006] In order to solve the technical problems existing in the background art, the present application provides a welding tungsten electrode defect detection method and system based on semantic segmentation and tip repair, which performs semantic segmentation, angle correction and tip repair on the tungsten electrode images obtained in actual welding work, and judges whether there is a defect and confirms the defect category by comparing the masks before and after the tungsten electrode tip repair, thereby guiding the welding equipment to reasonably plan the tungsten electrode replacement rhythm, ensuring the welding quality while improving the work efficiency, saving time and material cost.

[0007] In order to achieve the above purpose, the present application adopts the following technical solutions:

[0008] The first aspect of the present application provides a welding tungsten electrode defect detection method based on semantic segmentation and tip repair, comprising the following steps:

[0009] An original tungsten electrode image is obtained, and masks corresponding to the tungsten electrode column and the tungsten electrode tip are obtained through semantic segmentation;

[0010] According to the deviation angle calculated by the tungsten pole column mask, the mask of the tungsten pole tip is corrected to an upright posture, an upright state tungsten pole tip mask is obtained, and the mask is repaired to an undamaged state, and a tungsten pole tip repair mask in an upright state is obtained;

[0011] According to the distance between the tungsten pole vertex coordinates and the tungsten pole repair vertex coordinates in the tungsten pole tip mask and the tungsten pole tip repair mask in the upright state, it is judged whether the tungsten pole has wear defects;

[0012] According to the tungsten pole tip edge coordinates and the tungsten pole tip repair edge coordinates in the tungsten pole tip mask and the tungsten pole tip repair mask in the upright state, the proportion of the outer point in the tungsten pole tip edge point set is determined, and it is judged whether the tungsten pole has melting deformation;

[0013] In the case that the tungsten pole is not melted and deformed, according to the distance from the tungsten pole tip edge point set to the tungsten pole tip repair edge point set, it is judged whether the tungsten pole has splashing slag.

[0014] Further, the original tungsten pole image is subjected to semantic segmentation to obtain the masks corresponding to the tungsten pole column and the tungsten pole tip, specifically: taking DeepLabV3+ as the backbone network, through feature encoding, multi-scale feature fusion and feature decoding, the masks corresponding to the tungsten pole column and the tungsten pole tip are obtained.

[0015] Further, according to the deviation angle calculated by the tungsten pole column mask, the mask of the tungsten pole tip is corrected to an upright posture, an upright state tungsten pole tip mask is obtained, and the mask is repaired to an undamaged state, and a tungsten pole tip repair mask in an upright state is obtained; comprising the following steps:

[0016] Traverse each row in the tungsten pole column mask, obtain the average value of the horizontal coordinates and the average value of the vertical coordinates in the region with a pixel value of 1 in each row, and the average value of the horizontal coordinates and the average value of the vertical coordinates together form the tungsten pole midpoint coordinates of the row;

[0017] Fit a straight line according to the tungsten pole midpoint coordinates of each row, the straight line is the tungsten pole center line, and the deviation angle θ of the straight line from the vertical direction is determined;

[0018] Rotate the tungsten pole tip mask by -θ to obtain the tungsten pole tip mask in an upright state.

[0019] Further, the tungsten pole tip mask in an upright state is repaired to an undamaged state to obtain a tungsten pole tip repair mask in an upright state; specifically:

[0020] According to the tungsten pole tip mask in an upright state, the tip edge of the tungsten pole is obtained, and the tip edge is divided into left edge and right edge, and the left and right edges are respectively fitted with a straight line based on the RANSAC method to obtain the repaired left edge and the repaired right edge, which together form the repaired tip to obtain the tungsten pole tip repair mask in an upright state.

[0021] Further, according to the distance between the tungsten electrode tip point coordinates in the tungsten electrode tip mask and the tungsten electrode repair tip point coordinates in the tungsten electrode tip repair mask in the upright state, it is judged whether the tungsten electrode has wear defects; specifically:

[0022] The tungsten electrode tip point coordinates in the tungsten electrode tip mask and the tungsten electrode repair tip point coordinates in the tungsten electrode tip repair mask in the upright state are obtained, and when the distance between the tungsten electrode tip point coordinates and the tungsten electrode repair tip point coordinates exceeds a set threshold value, the tungsten electrode has wear.

[0023] Further, according to the distance between the tungsten electrode tip edge coordinates in the tungsten electrode tip mask and the tungsten electrode repair tip edge coordinates in the tungsten electrode tip repair mask in the upright state, the proportion of outliers in the tungsten electrode tip edge point set is determined, and it is judged whether the tungsten electrode has melting deformation; specifically:

[0024] The tungsten electrode tip edge point set is constructed according to the tungsten electrode tip edge coordinates in the tungsten electrode tip mask in the upright state;

[0025] The tungsten electrode tip repair edge point set is constructed according to the tungsten electrode repair tip edge coordinates in the tungsten electrode tip repair mask in the upright state;

[0026] The Euclidean distance between a point in the tungsten electrode tip edge point set and each point in the tungsten electrode repair tip edge point set is calculated, and the minimum value of the Euclidean distance is taken as the distance from the selected point in the tungsten electrode tip edge point set to the tungsten electrode repair tip edge point set;

[0027] The above steps are repeated until each point in the tungsten electrode tip edge point set is traversed, and the distance from each point to the tungsten electrode repair tip edge point set is obtained;

[0028] When the distance from a point in the tungsten electrode tip edge point set to the tungsten electrode repair tip edge point set exceeds a set threshold value, the point in the tungsten electrode tip edge point set is marked as an outlier, and the proportion of outliers in the tungsten electrode tip edge point set is counted. When the proportion exceeds a set threshold value, the tungsten electrode has melting deformation.

[0029] Further, in the case where the tungsten electrode has not melted and deformed, according to the distance between the tungsten electrode tip edge point set and the tungsten electrode repair tip edge point set, it is judged whether the tungsten electrode has splashing slag; specifically:

[0030] The Euclidean distance between a point in the tungsten electrode tip edge point set and each point in the tungsten electrode repair tip edge point set is calculated, and the minimum value of the Euclidean distance is taken as the distance from the selected point in the tungsten electrode tip edge point set to the tungsten electrode repair tip edge point set;

[0031] The above steps are repeated until each point in the tungsten electrode tip edge point set is traversed, and the distance from each point to the tungsten electrode repair tip edge point set is obtained;

[0032] Taking the maximum value in the distance between each point in the tungsten electrode tip edge point set and the tungsten electrode tip repair edge point set as the distance between the tungsten electrode tip edge point set and the tungsten electrode tip repair edge point set;

[0033] In the case that the tungsten electrode is not fused and deformed, when the distance between the two edge point sets exceeds the set threshold value, the tungsten electrode has spatter.

[0034] The second aspect of the present application provides a welding tungsten electrode defect detection system based on semantic segmentation and tip repair, comprising:

[0035] The semantic segmentation module is configured to: obtain an original tungsten electrode image, and obtain a mask corresponding to a tungsten electrode column and a tungsten electrode tip through semantic segmentation;

[0036] The angle correction module is configured to: calculate a deviation angle according to the tungsten electrode column mask, correct the mask of the tungsten electrode tip to a vertical posture, and obtain a vertical tungsten electrode tip mask;

[0037] The tip repair module is configured to: repair the vertical tungsten electrode tip mask to an undamaged state to obtain a vertical tungsten electrode tip repair mask;

[0038] The defect judgment module is configured to: according to the distance between the tungsten electrode vertex coordinates and the tungsten electrode repair vertex coordinates in the vertical tungsten electrode tip mask and the vertical tungsten electrode tip repair mask, judge whether the tungsten electrode has wear defects;

[0039] The defect judgment module is further configured to: according to the tungsten electrode tip edge coordinates and the tungsten electrode tip repair edge coordinates in the vertical tungsten electrode tip mask and the vertical tungsten electrode tip repair mask, determine the proportion of outliers in the tungsten electrode tip edge point set, and judge whether the tungsten electrode has fusion deformation;

[0040] The defect judgment module is further configured to: in the case that the tungsten electrode is not fused and deformed, according to the distance between the tungsten electrode tip edge point set and the tungsten electrode tip repair edge point set, judge whether the tungsten electrode has spatter.

[0041] The third aspect of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the above welding tungsten electrode defect detection method based on semantic segmentation and tip repair.

[0042] The fourth aspect of the present application provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the program to realize the steps of the above welding tungsten electrode defect detection method based on semantic segmentation and tip repair.

[0043] Compared with the prior art, the above one or more technical solutions have the following beneficial effects:

[0044] The tungsten electrode image obtained in the actual welding work is subjected to semantic segmentation, the image of the tungsten electrode body part is used to correct the tip part to an upright state, and image repair is performed, the tungsten electrode tip mask image after repair is used as a reference image in a standard state, by comparing the mask before and after the repair of the tungsten electrode tip, whether there is a defect is judged, and the corresponding defect category is confirmed, the problem that the current manual inspection of the tungsten electrode state is time-consuming and laborious and is easily affected by subjective factors is overcome, more accurate and more objective tungsten electrode damage state data can be provided for the welding equipment, so as to guide the welding equipment to reasonably plan the tungsten electrode replacement rhythm, ensure the welding quality, improve the work efficiency, save time and material cost. BRIEF DESCRIPTION OF DRAWINGS

[0045] The drawings accompanying the specification of this application form a part of this application and serve to further provide a further understanding of the application, the illustrative embodiments of the application and its description serve to explain the application and do not limit the application in any manner.

[0046] Figure 1 The flowchart of the welding tungsten electrode defect detection method based on semantic segmentation and tip repair provided for one or more embodiments of the application;

[0047] Figure 2 The flowchart of the semantic segmentation module provided for one or more embodiments of the application;

[0048] Figure 3 The flowchart of the angle correction module provided for one or more embodiments of the application;

[0049] Figure 4 The flowchart of the tip repair module provided for one or more embodiments of the application;

[0050] Figure 5 The flowchart of the defect discrimination module provided for one or more embodiments of the application;

[0051] Figure 6 The example diagram of calculating the distance between the tungsten electrode vertex coordinates and the tungsten electrode repair vertex coordinates provided for one or more embodiments of the application;

[0052] Figure 7 The example diagram of calculating the distance between the tungsten electrode edge point set and the tungsten electrode repair edge point set provided for one or more embodiments of the application;

[0053] Figure 8 The processing effect diagram for the tungsten electrode wear defect provided for one or more embodiments of the application;

[0054] Figure 9 The processing effect diagram for the tungsten electrode melting deformation defect provided for one or more embodiments of the application;

[0055] Figure 10 a processing effect diagram for tungsten electrode sputtering slag defects provided for one or more embodiments of the present application;

[0056] Figure 11 a structural block diagram of a welding tungsten electrode defect detection system based on semantic segmentation and tip repair provided for one or more embodiments of the present application. DETAILED DESCRIPTION

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

[0058] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.

[0059] As introduced in the background, the tungsten electrode in TIG welding will be damaged with use, thereby affecting the welding quality, and the prior art relies on manual method for defect detection of the tungsten electrode, which is time-consuming and laborious.

[0060] Therefore, the following embodiments give a welding tungsten electrode defect detection method and system based on semantic segmentation and tip repair, which performs semantic segmentation, angle correction and tip repair on the tungsten electrode image obtained in actual welding work, and judges whether there is a defect and confirms the defect category by comparing the masks before and after the tungsten electrode tip repair, so as to guide the welding equipment to reasonably plan the tungsten electrode replacement rhythm, thereby ensuring the welding quality while improving the work efficiency, saving time and material cost.

[0061] Embodiment one:

[0062] As shown in Figures 1-10 The welding tungsten electrode defect detection method based on semantic segmentation and tip repair comprises the following steps:

[0063] obtaining an original tungsten electrode image in welding production through a camera;

[0064] segmenting the tungsten electrode column and the tungsten electrode tip in the original tungsten electrode image respectively through the trained tungsten electrode semantic segmentation module to obtain a tungsten electrode column mask and a tungsten electrode tip mask;

[0065] correcting the tungsten electrode to an upright posture through an angle correction module according to the tungsten electrode column mask to obtain an upright state tungsten electrode tip mask;

[0066] repairing the upright state tungsten electrode tip mask to an undamaged state through a tip repair module according to the upright state tungsten electrode tip mask to obtain an upright state tungsten electrode tip repair mask;

[0067] The defect discrimination module compares the tungsten electrode tip mask in the upright state with the tungsten electrode tip repair mask in the upright state to determine whether the tungsten electrode has defects and the defect category.

[0068] The specific process is as follows:

[0069] Step S1: Obtain the original tungsten electrode image in the welding production through the camera.

[0070] In this embodiment, the original tungsten electrode image is the tungsten electrode image captured by the camera in the actual welding work.

[0071] Step S2: Separate the tungsten electrode column and the tungsten electrode tip in the original tungsten electrode image through the trained tungsten electrode semantic segmentation module to obtain the tungsten electrode column mask and the tungsten electrode tip mask.

[0072] As shown in Figure 2 In this embodiment, the tungsten electrode semantic segmentation module uses the DeeplabV3+ network. The core structure of DeepLabV3+ is composed of three parts, which are the encoding network, the multi-scale feature fusion network, and the decoding network.

[0073] The encoding network uses a residual network (ResNet) as the backbone network. The residual structure in the network effectively alleviates the gradient vanishing problem in the training process, so that the encoding network has better ability to extract image features.

[0074] The multi-scale feature fusion network includes multiple parallel network branches. Each network branch uses a dilated convolution with different expansion rates to extract image features at different scales.

[0075] The decoding network gradually increases the size of the image feature map through bilinear interpolation and introduces the low-level image features extracted by the encoding network through cross-layer connection, so as to output more accurate segmentation boundaries.

[0076] Step S3: According to the tungsten electrode column mask, correct the tungsten electrode to the upright posture through the angle correction module to obtain the tungsten electrode tip mask in the upright state.

[0077] The mask is a black and white binary image with the same size as the original tungsten electrode image. The pixel value of each pixel point in the target area is 1, and the pixel value of each pixel point in the non-target area is 0. For example, in the tungsten electrode column mask, the pixel value of each pixel point in the tungsten electrode column area is 1, and the pixel value of each pixel point in other areas is 0.

[0078] In judging whether the tungsten electrode is worn, the tungsten electrode vertex coordinates need to be obtained. When the tungsten electrode tip is in an upright state, the tungsten electrode center line is a column in the image, and the minimum point in the column pixels with pixel value of 1 in the tungsten electrode tip mask in the upright state is the tungsten electrode vertex. When the tungsten electrode tip is in a tilted or even inverted state, the tungsten electrode vertex coordinates need to be obtained while considering the tilt angle of the tungsten electrode, which is more complex in calculation and programming implementation. Therefore, the tungsten electrode tip mask is corrected to the upright state in the embodiment, and the tungsten electrode vertex coordinates can be obtained more easily.

[0079] The tungsten electrode tip repair needs to distinguish the left edge and the right edge. When the tungsten electrode tip is in an upright state, the tungsten electrode center line is a column in the image, and the left edge point and the right edge point can be distinguished according to the horizontal coordinates of the column, wherein the left edge point is the point with horizontal coordinate less than the horizontal coordinate of the tungsten electrode center line among the tungsten electrode edge points, and the right edge point is the point with horizontal coordinate greater than the horizontal coordinate of the tungsten electrode center line among the tungsten electrode edge points. When the tungsten electrode tip is in a tilted state, the coordinates of the edge points need to be brought into the tungsten electrode center line equation to distinguish the left edge and the right edge, and the calculation is more complex. Therefore, the tungsten electrode tip mask is corrected to the upright state in the embodiment, which facilitates the subsequent tungsten electrode tip repair process.

[0080] The process of correcting the tungsten electrode tip to the upright posture is shown in Figure 3 , which first traverses each row in the tungsten electrode column mask, obtains the average value of the horizontal coordinates and the average value of the vertical coordinates in the region with pixel value of 1 in each row, and the average value of the horizontal coordinates and the average value of the vertical coordinates together constitute the midpoint coordinates of the row. After traversing each row in the tungsten electrode column mask, the obtained tungsten electrode column midpoint point set position is shown by the dotted line in Figure 3 (b);

[0081] Then, a straight line is fitted as the tungsten electrode center line according to the tungsten electrode column midpoint point set, and the fitted tungsten electrode center line is shown by the solid line in Figure 3 (c). The least square method is adopted to fit the tungsten electrode center line, and the specific formula is as follows:

[0082]

[0083] wherein (x i ,y i ) is the coordinates of the i-th point in the tungsten electrode column midpoint point set, the tungsten electrode column midpoint point set contains n points, k is the slope of the fitted tungsten electrode center line, and c is the intercept of the fitted tungsten electrode center line. k * and c * are the slope and intercept of the optimal tungsten electrode center line obtained by solving formula (1) by an optimization method, that is, the formula for fitting the tungsten electrode column center line by the above least square method is as follows:

[0084] y=k * x+c* (2)

[0085] Next, the slope k of the line fitting the tungsten pole column is calculated * , and the deviation angle θ of the tungsten pole from the vertical direction is calculated, and the specific formula is as follows:

[0086]

[0087] Finally, the tungsten pole tip mask is rotated by-θ to obtain the upright tungsten pole tip mask, and the upright tungsten pole tip mask is shown in (f) of Figure 3 .

[0088] In this embodiment, the upright tungsten pole tip mask, wherein the tungsten pole tip belongs to the tungsten pole perpendicular to the row of the image.

[0089] Step S4: According to the upright tungsten pole tip mask, the upright tungsten pole tip mask is repaired to the undamaged state by the tip repair module, and the upright tungsten pole tip repair mask is obtained.

[0090] As shown in Figure 4 , first, the tip edge is obtained according to the upright tungsten pole tip mask, and the tip edge is divided into left and right edges, as shown in Figure 4 (b);

[0091] Then, the left and right edges are respectively fitted with a straight line using the RANSAC method, and the repair left edge and the repair right edge are respectively generated.

[0092] Taking the left edge as an example, the method of generating the repair left edge using the RANSAC method is introduced:

[0093] Input: left edge point set before repair Wherein, is the coordinates of the kth point in the left edge point set before repair, K l is the number of left edge points before repair.

[0094] The following steps are executed:

[0095] ① Set the maximum number of iterations I max , the threshold T for judging whether the sample point is an inner point or an outer point, and the minimum number of sample points K min for fitting a straight line. Set the current iteration number i=0.

[0096] ② If i>I max , jump to step ⑥, otherwise i=i+1, enter step ③.

[0097] ③ Randomly select K sample points from P l , K≥K min, the least square method is used to fit a straight line based on the k randomly selected sample points wherein, and are the slope and intercept of the fitted left edge line at the i-th iteration, respectively.

[0098] 4. For P l , calculate the distance from each sample point to the fitted straight line , mark the sample points with distance less than threshold T as inliers, and mark the other sample points as outliers. Count the number of inliers

[0099] 5. Go to step 2.

[0100] 6. Find the iteration with the maximum number of inliers. l Using all inliers at this iteration, the least square method is used to fit a straight line, obtaining the straight line equation y = a l x + b l , which is taken as the repaired left edge, wherein a l and b l represent the slope and intercept of the repaired left edge line, respectively.

[0101] Output: the repaired left edge line equation y = a l x + b l .

[0102] The process of generating the repaired right edge using the RANSAC method is consistent with the above process, and the repaired right edge line equation is y = a r x + b r , wherein a r and b r represent the slope and intercept of the repaired right edge line, respectively. Experiments show that the method of using the RANSAC method for linear fitting to obtain the repaired left and right edges can effectively suppress the influence of splash and other tungsten electrode defects on the repair of the tungsten electrode tip. The repaired left and right edges of the tungsten electrode are shown in (c) of Figure 4 .

[0103] Finally, the repaired left edge and the repaired right edge together form the repaired tip, and the vertical tungsten electrode tip repair mask is obtained. The specific method is as follows:

[0104] Input: the repaired left edge line equation y = a l x + b l , and the repaired right edge line equation y = a r x + b r .

[0105] Perform the following steps:

[0106] ① Find the intersection point of the left and right edge straight lines after repair, as shown below:

[0107]

[0108] wherein, is the intersection point coordinate of the left edge straight line after repair and the right edge straight line after repair.

[0109] ② Fill the area surrounded by the left edge straight line after repair and the right edge straight line after repair below the intersection point, which is the tungsten tip repair mask in the upright state, as shown in (d) of Figure 4 .

[0110] Step S5: Compare the tungsten tip mask in the upright state and the tungsten tip repair mask in the upright state through the defect judgment module to judge whether the tungsten tip has defects and the category of the defects.

[0111] In welding, different workpieces have different purposes, and the allowable degree of welding defects is different, and thus the allowable degree of tungsten tip defects is also different. By comparing the tungsten tip mask in the upright state and the tungsten tip repair mask, the accurate value of the explainable judgment parameter can be given, for example, by calculating the tungsten tip vertex coordinates in the upright state and the tungsten tip repair vertex coordinates, the tungsten tip wear length can be obtained, which can quantify the defects of the tungsten tip during welding, help the staff better debug the welding process and welding equipment, and set different defect judgment thresholds for different welding equipment according to different welding process requirements. If the defect category is directly output in the form of deep learning, different judgment models need to be trained for different judgment standards, which not only consumes time and effort, but also makes it difficult to ensure that the judgment effect strictly meets the corresponding judgment standard.

[0112] As shown in Figures 5-7 , the tungsten tip vertex coordinates in the tungsten tip mask in the upright state are (x1, y1), and the tungsten tip repair vertex coordinates in the tungsten tip repair mask in the upright state are (x2, y2). By calculating the distance between the tungsten tip vertex coordinates and the tungsten tip repair vertex coordinates, it is judged whether the tungsten tip is worn. The distance calculation formula is as follows:

[0113]

[0114] wherein, d represents the distance between the tungsten tip vertex coordinates and the tungsten tip repair vertex coordinates. The formula for judging whether the tungsten tip is worn is as follows:

[0115]

[0116] wherein, d T represents the set tungsten tip wear threshold. An example of calculating the distance d between the tungsten tip vertex coordinates and the tungsten tip repair vertex coordinates is shown in Figure 6 .

[0117] Based on the edge coordinates of the tungsten electrode tip in the upright tungsten electrode tip mask, construct the tungsten electrode tip edge point set;

[0118] Based on the coordinates of the tungsten electrode tip repair edge in the upright tungsten electrode tip repair mask, construct the tungsten electrode tip repair edge point set;

[0119] Calculate the Euclidean distance from a point in the set of tungsten electrode tip edge points to each point in the set of tungsten electrode tip repair edge points, and take the minimum Euclidean distance as the distance from the selected point in the set of tungsten electrode tip edge points to the set of tungsten electrode tip repair edge points.

[0120] Repeat the above steps until every point in the tungsten electrode tip edge point set has been traversed, and obtain the distance from each point to the tungsten electrode tip repair edge point set;

[0121] When the distance from a point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set exceeds a set threshold, this point in the tungsten electrode tip edge point set is marked as an outer point. The proportion of the outer point in the tungsten electrode tip edge point set is counted. When the proportion exceeds a set threshold, the tungsten electrode melts and deforms.

[0122] Let the edge point set of the tungsten electrode tip be in, Let m represent the coordinates of the m-th point in the point set at the edge of the tungsten electrode tip. This point set includes a total of M points, and the points in this set are located as follows: Figure 7 The image shows the edge position of the tungsten electrode tip before repair.

[0123] Tungsten electrode tip repair edge point set in, This represents the coordinates of the nth point in the set of points for tungsten electrode tip repair edge repair. This set includes N points in total, and the points in this set are located as follows: Figure 7 The edge position of the tungsten electrode tip after repair is shown.

[0124] Calculate P 0 The m-th point and P 1 Calculate the Euclidean distance between each point in the matrix and take the minimum value as P. 0 From the m-th point to P 1 Distance D of the point set m The specific formula is as follows:

[0125]

[0126] Based on the above formula (7), the distance {D} from each point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set has been obtained. m |m=1,2,……,M}. D mThe points greater than the set threshold value are marked as outliers, and the proportion R of outliers in the tungsten electrode tip edge point set is counted, and the formula is as follows:

[0127]

[0128] Wherein, T represents the threshold value for judging whether the point in the tungsten electrode tip edge point set is an outlier, |{D m |D m T, m = 1, 2, …, M} represents the number of outliers in the tungsten electrode tip edge point set. R T represents the threshold value for judging whether the tungsten electrode is melted and deformed, and the formula for judging whether the tungsten electrode is melted and deformed is as follows:

[0129]

[0130] Take the maximum value of the distance from each point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set as the distance from the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set;

[0131] In the case where the tungsten electrode is not melted and deformed, when the distance between the two edge point sets exceeds the set threshold value, the tungsten electrode exists splash slag.

[0132] Calculate the maximum value of all D m , m = 1, 2, …, M as the distance D between the two point sets, that is:

[0133] D = max{D m |m = 1, 2, …, M} (10)

[0134] The formula for judging whether the tungsten electrode exists splash slag according to the distance is as follows:

[0135]

[0136] Wherein, D T represents the set threshold value for judging whether the tungsten electrode exists splash slag. An example of the distance D between the two edge point sets is shown in Figure 7 .

[0137] The processing effect of the tungsten electrode wear is shown in Figure 8 , the processing effect of the tungsten electrode melting and deformation is shown in Figure 9 , and the processing effect of the tungsten electrode splash slag is shown in Figure 10 .

[0138] By performing semantic segmentation on the tungsten electrode image taken in actual welding work, the tungsten electrode column mask and the tungsten electrode tip mask are obtained; according to the tungsten electrode column mask, the tungsten electrode inclination angle is calculated, and the tungsten electrode is corrected to an upright posture by image rotation, and the mask of the tungsten electrode tip in the upright state is obtained, which reflects the current actual state of the tungsten electrode.

[0139] According to the tungsten electrode tip mask in the upright state, the tungsten electrode tip mask in the upright state is repaired to the undamaged state through the tip repair model to obtain a tungsten electrode tip repair mask in the upright state, which reflects the ideal state or the standard state of the tungsten electrode.

[0140] By comparing the tungsten electrode tip mask in the upright state and the tungsten electrode tip repair mask in the upright state through the defect discrimination model, whether the tungsten electrode has defects and the defect category can be determined, which can overcome the problem that the current manual inspection of the tungsten electrode state is time-consuming and labor-intensive and is easily affected by subjective factors, and can provide accurate tungsten electrode damage state data for the welding equipment, thereby guiding the welding equipment to reasonably plan the tungsten electrode replacement rhythm, ensuring the welding quality while improving the work efficiency, saving time and material cost.

[0141] Embodiment two:

[0142] As shown in Figure 11 The welding tungsten electrode defect detection system based on semantic segmentation and tip repair includes:

[0143] The semantic segmentation module is configured to obtain an original tungsten electrode image, and obtain a mask corresponding to a tungsten electrode column and a tungsten electrode tip through semantic segmentation.

[0144] The angle correction module is configured to calculate a deviation angle according to the tungsten electrode column mask, correct the mask of the tungsten electrode tip to an upright posture, and obtain a tungsten electrode tip mask in the upright state.

[0145] The tip repair module is configured to repair the tungsten electrode tip mask in the upright state to the undamaged state to obtain a tungsten electrode tip repair mask in the upright state.

[0146] The defect discrimination module is configured to determine whether the tungsten electrode has wear defects according to the distance between the tungsten electrode vertex coordinates and the tungsten electrode repair vertex coordinates in the tungsten electrode tip mask and the tungsten electrode tip repair mask in the upright state.

[0147] The defect discrimination module is further configured to determine the proportion of outliers in the tungsten electrode tip edge point set according to the tungsten electrode tip edge coordinates and the tungsten electrode tip repair edge coordinates in the tungsten electrode tip mask and the tungsten electrode tip repair mask in the upright state, and determine whether the tungsten electrode has melting deformation.

[0148] The defect discrimination module is further configured to determine whether the tungsten electrode has splashing slag according to the distance between the tungsten electrode tip edge point set and the tungsten electrode tip repair edge point set in the case where the tungsten electrode is not melted and deformed.

[0149] By the tip repair module, the tungsten electrode tip image after semantic segmentation is restored to the standard state tungsten electrode tip image, and the current state mask is compared with the repaired standard state, so that the defect category of the tungsten electrode can be accurately judged, so that the loss of the tungsten electrode in the welding operation can be more accurately and objectively mastered, and the subjective experience influence in the traditional manual detection is reduced.

[0150] Embodiment three:

[0151] The embodiment provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize steps in the welding tungsten electrode defect detection method based on semantic segmentation and tip repair in the embodiment one.

[0152] Embodiment four:

[0153] The embodiment provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor realizes steps in the welding tungsten electrode defect detection method based on semantic segmentation and tip repair in the embodiment one when executing the program.

[0154] The steps in the above embodiments two to four correspond to the embodiment one, and the specific embodiments can be referred to the related description part of the embodiment one. The term "computer readable storage medium" should be understood as including a single medium or multiple media of one or more instruction sets; and should also be understood as including any medium capable of storing, encoding or carrying instruction sets for execution by a processor and causing the processor to execute any method in the present application.

[0155] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for detecting defects in a welding tungsten electrode based on semantic segmentation and tip repair, characterized by, The method comprises the following steps: Obtain the original tungsten electrode image, and obtain the mask corresponding to the tungsten electrode column and the tungsten electrode tip through semantic segmentation; Calculate the deviation angle according to the tungsten electrode column mask, correct the mask of the tungsten electrode tip to an upright posture, and obtain the mask of the tungsten electrode tip in the upright state; Repair the mask of the tungsten electrode tip in the upright state to the undamaged state to obtain the repaired mask of the tungsten electrode tip in the upright state, specifically: According to the mask of the tungsten electrode tip in the upright state, obtain the tip edge of the tungsten electrode, and divide the tip edge into a left edge and a right edge, perform linear fitting on the left and right edges respectively based on the RANSAC method to obtain the repaired left edge and the repaired right edge, and the two edges together form the repaired tip to obtain the repaired mask of the tungsten electrode tip in the upright state; Determine the proportion of outliers in the tungsten electrode tip edge point set according to the distance between the tungsten electrode tip edge coordinates and the tungsten electrode tip repair edge coordinates in the mask of the tungsten electrode tip and the mask of the tungsten electrode tip in the upright state, and judge whether the tungsten electrode is fused and deformed; In the case that the tungsten electrode is not fused and deformed, judge whether the tungsten electrode exists splashing slag according to the distance from the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set. The original tungsten electrode image is segmented by semantics to obtain the mask corresponding to the tungsten electrode column and the tungsten electrode tip, specifically: taking DeepLabV3+ as the backbone network, through feature encoding, multi-scale feature fusion and feature decoding, the mask corresponding to the tungsten electrode column and the tungsten electrode tip is obtained.

2. The welding tungsten tip defect detection method based on semantic segmentation and tip repair according to claim 1, wherein, According to the tungsten electrode column mask, the deviation angle is calculated, the mask of the tungsten electrode tip is corrected to an upright posture, and the mask of the tungsten electrode tip in the upright state is obtained; comprising the following steps:

3. The welding tungsten tip defect detection method based on semantic segmentation and tip repair according to claim 1, wherein, Traverse each row in the tungsten electrode column mask, obtain the average value of the horizontal coordinate and the average value of the vertical coordinate in the region with a pixel value of 1 in each row, and the average value of the horizontal coordinate and the average value of the vertical coordinate together form the tungsten electrode midpoint coordinates of the row; θ A straight line is fitted according to the tungsten electrode midpoint coordinates of each row, the straight line is a tungsten electrode centerline, and a deviation angle of the straight line from the vertical direction is determined -θ ; Rotating the tungsten tip mask Determine whether the tungsten electrode exists wear defect according to the distance between the tungsten electrode tip vertex coordinates and the tungsten electrode repair tip vertex coordinates in the mask of the tungsten electrode tip and the mask of the tungsten electrode tip in the upright state; to obtain the tungsten tip mask in an upright position.

4. The method for detecting defects in a welding tungsten electrode based on semantic segmentation and tip repair as claimed in claim 1, wherein, Specifically: Obtain the tungsten electrode tip vertex coordinates in the mask of the tungsten electrode tip in the upright state, and the tungsten electrode repair tip vertex coordinates in the mask of the tungsten electrode tip in the upright state, when the distance between the tungsten electrode tip vertex coordinates and the tungsten electrode repair tip vertex coordinates exceeds the set threshold value, the tungsten electrode appears wear. Determine the proportion of outliers in the tungsten electrode tip edge point set according to the distance between the tungsten electrode tip edge coordinates and the tungsten electrode tip repair edge coordinates in the mask of the tungsten electrode tip and the mask of the tungsten electrode tip in the upright state, and judge whether the tungsten electrode is fused and deformed; Specifically:

5. The semantic segmentation and tip repair based welding tungsten tip defect detection method of claim 1, wherein, According to the tungsten electrode tip edge coordinates in the mask of the tungsten electrode tip in the upright state, the tungsten electrode tip edge point set is constructed; According to the tungsten electrode tip repair edge coordinates in the mask of the tungsten electrode tip in the upright state, the tungsten electrode tip repair edge point set is constructed; ​ The Euclidean distance from one point in the tungsten electrode tip edge point set to each point in the tungsten electrode tip repair edge point set is calculated, and the minimum value of the Euclidean distance is taken as the distance from the selected point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set; The above steps are repeated until each point in the tungsten electrode tip edge point set is traversed, and the distance from each point to the tungsten electrode tip repair edge point set is obtained; When the distance from the point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set exceeds the set threshold, the selected point in the tungsten electrode tip edge point set is marked as an outlier, and the proportion of outliers in the tungsten electrode tip edge point set is counted. When the proportion exceeds the set threshold, the tungsten electrode tip is fused and deformed.

6. The semantic segmentation and tip repair based welding tungsten tip defect detection method of claim 1, wherein, In the case where the tungsten electrode tip is not fused and deformed, the distance from the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set is calculated to determine whether the tungsten electrode tip is splashed; specifically: The Euclidean distance from one point in the tungsten electrode tip edge point set to each point in the tungsten electrode tip repair edge point set is calculated, and the minimum value of the Euclidean distance is taken as the distance from the selected point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set; The above steps are repeated until each point in the tungsten electrode tip edge point set is traversed, and the distance from each point to the tungsten electrode tip repair edge point set is obtained; The maximum value of the distance from each point in the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set is taken as the distance from the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set; In the case where the tungsten electrode tip is not fused and deformed, the distance between the two edge point sets exceeds the set threshold, indicating that the tungsten electrode tip is splashed.

7. A welding tungsten tip defect detection system based on semantic segmentation with tip repair, characterized in that, It includes: A semantic segmentation module configured to obtain an original tungsten electrode image and obtain a mask corresponding to a tungsten electrode column and a tungsten electrode tip through semantic segmentation; An angle correction module configured to calculate a deviation angle based on the tungsten electrode column mask, correct the mask of the tungsten electrode tip to a vertical posture, and obtain a vertical tungsten electrode tip mask; A tip repair module configured to repair the vertical tungsten electrode tip mask to an undamaged state to obtain a vertical tungsten electrode tip repair mask, specifically: According to the vertical tungsten electrode tip mask, the tip edge of the tungsten electrode is obtained, and the tip edge is divided into left and right edges. The RANSAC method is used to fit straight lines to the left and right edges respectively to obtain the repaired left edge and the repaired right edge, which together form the repaired tip to obtain the vertical tungsten electrode tip repair mask; A defect discrimination module configured to determine whether the tungsten electrode tip is worn based on the distance between the tungsten electrode tip coordinates and the tungsten electrode repair tip coordinates in the vertical tungsten electrode tip mask and the vertical tungsten electrode tip repair mask; The defect discrimination module is also configured to determine the proportion of outliers in the tungsten electrode tip edge point set based on the tungsten electrode tip edge coordinates and the tungsten electrode tip repair edge coordinates in the vertical tungsten electrode tip mask and the vertical tungsten electrode tip repair mask, and determine whether the tungsten electrode tip is fused and deformed; The defect discrimination module is also configured to determine whether the tungsten electrode tip is splashed based on the distance from the tungsten electrode tip edge point set to the tungsten electrode tip repair edge point set in the case where the tungsten electrode tip is not fused and deformed.

8. A computer-readable storage medium, characterized in that, A computer program product comprising a computer readable medium having stored thereon the computer program, the computer program comprising instructions which, when executed by a processor, cause the processor to carry out the steps of the method according to any one of claims 1 to 6.

9. A computer device, comprising: A computer program product comprising a computer readable medium having stored thereon the computer program, the computer program comprising instructions which, when executed by a processor, cause the processor to carry out the steps of the method according to any one of claims 1 to 6.