A high-precision weld seam recognition and robot tracking path generation method
The weld image is predicted and extracted by the neural network model, and fitted with the B-spline curve to the weld trajectory, solving the problems of low weld recognition accuracy and low automation detection efficiency in the existing technology, and achieving high-precision automated quality detection of welds.
Patent Information
- Application Number
- CN202410319576.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-03-20
AI Technical Summary
The prior art has problems such as low accuracy, low efficiency and harmful to the operator's body in weld recognition and automated detection, especially in the case of complex workshop environment and stains or interfering with structures on the weld surface.
Weld images are predicted using neural network models, straight welds and curved weld parts are extracted, binary images are generated and outer contours are extracted, local centroids are extracted through sliding windows, and weld trajectories are fitted using B-spline curves to generate robot tracking paths.
The accuracy of weld recognition is improved, a smooth weld trajectory is generated, and the automated quality inspection of welds is realized, meeting the requirements of high accuracy and high efficiency.
Smart Images

Figure CN118521528B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of weld seam identification and positioning, and in particular to a high-precision weld seam identification and robot tracking path generation method. Background Art
[0002] The current method for detecting the internal quality of welds is mainly manual inspection. The method of manually operating ultrasonic or X-ray equipment for internal flaw detection is inefficient, and repeated operations are prone to missed detection and there are subjective judgments, which affect the detection effect. At the same time, long-term contact with X-ray equipment is harmful to the operator's body. Although machine vision technology has been introduced into the identification and positioning of welds, most methods are used for welding guidance, and there is relatively little research on the identification of welds after welding. The method of combining target detection and structured light lacks a global investigation of the weld; at the same time, the workshop environment is complex, and there may be some stains or other interfering structures on the surface of the weld after welding, which will increase the difficulty of image recognition, resulting in low detection accuracy and difficulty in meeting the high-precision and high-efficiency requirements of automated detection. The uneven and discontinuous weld recognition will also cause the robot to run unsteadily, affecting the quality detection of the weld. Summary of the invention
[0003] Based on this, it is necessary to provide a high-precision weld recognition and robot tracking path generation method to solve the above problems.
[0004] The present invention provides a high-precision weld seam recognition and robot tracking path generation method, the method comprising:
[0005] S1: receiving the captured weld image and preprocessing the weld image;
[0006] S2: input the preprocessed weld image into the trained neural network model, and output a predicted weld area image; the types of pixels in the predicted weld area image include background, straight weld, and curved weld;
[0007] S3: extracting the pixel points of the predicted weld area that are straight welds and curved welds, and generating corresponding binary images respectively;
[0008] S4: extracting the outer contours of the weld areas predicted on the two binary images respectively, and setting a threshold; retaining the weld areas whose outer contour areas meet the threshold;
[0009] S5: Make a circumscribed rectangle for each retained weld area, and extract the local centroid of each circumscribed rectangle through a sliding window;
[0010] S6: Based on the local centroid, a B-spline curve is used for fitting to obtain a weld trajectory; and the weld trajectory is used as a robot tracking path.
[0011] Preferably, in S1, the preprocessing of the weld image includes:
[0012] The weld image is adjusted to the size required by the trained neural network model, and Gaussian filtering is used to perform weighted averaging on the pixels in an area of a convolution kernel size in the adjusted weld image to obtain a denoised weld image.
[0013] Preferably, in S2, the neural network model includes a feature extraction module and an output module;
[0014] The feature extraction module adopts the MobileNet-v2 network model, and inserts a NAM attention mechanism before each bottleneck convolution layer in the MobileNet-v2 network model performs a shortcut operation;
[0015] The output module restores the feature map extracted by the feature extraction module to a feature map with the same size as the preprocessed weld image through a combination of convolution operation and bilinear interpolation, thereby obtaining the predicted weld area image.
[0016] Preferably, the training process of the neural network model includes:
[0017] Step 1: performing data enhancement on the preprocessed weld image to obtain an enhanced data set;
[0018] Step 2: Use the Labelme tool to annotate the images in the enhanced data set at the pixel level as the detection standard; use the images in the enhanced data set and the corresponding detection standard as the test set, and use the enhanced data set as the training set;
[0019] Step 3: Using cross entropy loss and Dice loss as loss functions, setting a weighting coefficient to weightedly fuse the cross entropy loss and the Dice loss to obtain a fusion loss;
[0020] Step 4: Select an optimizer, set the initial learning rate and weight decay formula in the optimizer, and define the batch size and number of training rounds;
[0021] Step 5: performing a round of training according to the test set, the training set, the fusion loss and the set optimizer and by adjusting the weighting coefficient;
[0022] Step 6: Iterate step 5 until the maximum number of training rounds is reached, select the weighted coefficient with the highest prediction accuracy in each round as the network model weight, and obtain the trained neural network model.
[0023] Preferably, the calculation formula of the cross entropy loss is:
[0024]
[0025] Among them, CE_Loss represents the cross entropy loss; N represents the number of pixels in an image; i represents the i-th pixel; M represents the type of pixel; c represents the c-th type; y ic is a sign function, whose value is 0 or 1; p ic Indicates the predicted probability that the i-th pixel belongs to the c-th type;
[0026] The calculation formula of the Dice loss is:
[0027]
[0028] Among them, Dice_Loss represents Dice loss, |X| represents the sum or square sum of the detection criteria, |Y| represents the sum or square sum of the prediction results, and |X∩Y| represents the intersection of the detection criteria and the prediction results;
[0029] The calculation formula of the fusion loss is:
[0030] L=w·CE_Loss+(1-w)·Dice_Loss;
[0031] Among them, L represents the fusion loss and w represents the weighting coefficient.
[0032] Preferably, in S4, a third-party library is called to find the outer contour of the predicted weld area on the two binary images. If the area of the outer contour is smaller than the threshold, the outer contour is ignored; otherwise, a set of all pixel positions in the outer contour is returned until all predicted weld areas on the two binary images are traversed.
[0033] Preferably, in S5, the process of extracting the local centroid of the circumscribed rectangle through the sliding window includes:
[0034] S5.1: Let the coordinates of the four vertices of the circumscribed rectangle be (x1, y1), (x2, y1), (x1, y2), (x2, y2) respectively.
[0035] When the aspect ratio of the circumscribed rectangle is greater than or equal to 1, the sliding window moves from left to right;
[0036] Define the x coordinate of the left side of the sliding window as x l , the x coordinate of the right side of the sliding window is x r , let x l =x1, then x r =x l +a, a is the set sliding window width;
[0037] When the aspect ratio of the circumscribed rectangle is less than 1, the sliding window moves from top to bottom;
[0038] Define the y coordinate of the upper side of the sliding window as y t , the y coordinate of the lower side of the sliding window is y b , let y t =y1, then y b =y t +a;
[0039] S5.2: Calculate the area of the sliding window based on each coordinate, and calculate the centroid (x z ,y z ) and record it, the expression is as follows:
[0040]
[0041] Among them, p m Represents the pixel value of the mth pixel in the window area, x m and m Respectively represent the horizontal and vertical coordinates of the m-th pixel, and M represents the number of pixels in the window area;
[0042] S5.3: Let x l =x r or t =y b , repeat S5.2 until x l >x2 or y t >y2, obtain the local centroid of the circumscribed rectangle.
[0043] Preferably, in S6, the process of obtaining the weld trajectory includes:
[0044] Using the local centroid from the straight weld portion as a control point, fitting the weld path using a low-order quasi-uniform B-spline curve to generate a straight weld trajectory;
[0045] Based on the local centroid from the bent weld portion, a curved weld trajectory is generated by fitting the weld path using a high-order quasi-uniform B-spline curve.
[0046] Preferably, the expression of the basis function of the B-spline is:
[0047]
[0048] Among them, B i,k (u) represents the i-th k-order B-spline; u represents a node; u i represents the i-th node, u i+1 represents the i+1th node;
[0049] Based on the control points and node vectors, the expression for generating the B-spline curve is:
[0050]
[0051] Where P(u) represents the B-spline curve of the u-th node, n represents the number of local centroids from the straight weld part; P i represents the local centroid of the ith straight weld section.
[0052] Preferably, the area calculation formula of the sliding window includes:
[0053] Q1={(x,y)|x∈[x l ,x r ]||y∈[y1,y2]};
[0054] Where Q1 represents the area of the sliding window moving from left to right, x represents the x coordinate, and y represents the y coordinate; l Indicates the x coordinate of the left side of the sliding window; x r represents the x-coordinate of the right side of the sliding window; y1 represents the y-coordinate of the upper side of the circumscribed rectangle; y2 represents the y-coordinate of the lower side of the circumscribed rectangle;
[0055] Q2={(x,y)|x∈[x1,x2]||y∈[y t ,y b ]};
[0056] Where Q2 represents the area of the sliding window moving from top to bottom, x1 represents the x coordinate on the left side of the bounding rectangle; x2 represents the x coordinate on the right side of the bounding rectangle; y t Indicates the y coordinate of the upper side of the sliding window; y b Indicates the y-coordinate of the bottom side of the sliding window.
[0057] Beneficial effects: The method provided by the present invention outputs a predicted weld area image by inputting the preprocessed weld image into the trained neural network model; the types of pixels in the predicted weld area image include background, straight weld, and curved weld; extract the parts of the predicted weld area with straight weld and curved weld as pixel types, and generate corresponding binary images respectively; extract the outer contours of the predicted weld areas on the two binary images respectively, and set a threshold; retain the weld areas whose outer contour areas meet the threshold; make circumscribed rectangles for each retained weld area, and extract the local centroid of each circumscribed rectangle through a sliding window; based on the local centroid, fit with a B-spline curve to obtain a smooth weld trajectory. The method can improve the accuracy of weld recognition, generate a smooth weld trajectory, and guide the robot to achieve automated quality inspection of welds. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 This is a flow chart of a high-precision weld seam recognition and robot tracking path generation method according to an embodiment of the present application.
[0060] Figure 2 This is a schematic diagram of a weld image captured according to an embodiment of the present application.
[0061] Figure 3 A schematic diagram of a binary image of a weld image captured according to an embodiment of the present application.
[0062] Figure 4 This is a schematic diagram of using a sliding window to extract a local centroid according to an embodiment of the present application.
[0063] Figure 5 This is a schematic diagram of the weld trajectory of an embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present application, so the present application is not limited by the specific embodiments disclosed below.
[0065] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0066] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "upper", "lower", "left", "right" and similar expressions used herein are for illustrative purposes only and are not intended to be the only implementation method.
[0067] like Figure 1 As shown, this embodiment provides a high-precision weld recognition and robot tracking path generation method, which is applied to an industrial robot. A CCD industrial camera is reasonably installed on the industrial robot for collecting weld images, and then the weld images are transmitted to a controller also installed on the industrial robot for subsequent image processing operations, and then the obtained weld trajectory is used as a reference path for the movement of the flaw detection robot.
[0068] The method includes:
[0069] S1: receiving the captured weld image and preprocessing the weld image.
[0070] Specifically, the preprocessing of the weld image includes:
[0071] The weld seam images are as follows: Figure 2 As shown; the weld image is adjusted to the required size of the trained neural network model, and Gaussian filtering is used to perform weighted averaging on the pixels in an area of a convolution kernel size in the adjusted weld image to obtain a denoised weld image.
[0072] The template for Gaussian filtering denoising is:
[0073]
[0074] S2: Input the preprocessed weld image into the trained neural network model and output a predicted weld area image; the types of pixels in the predicted weld area image include background, straight weld, and curved weld.
[0075] Specifically, the neural network model includes a feature extraction module and an output module;
[0076] The feature extraction module adopts the MobileNet-v2 network model, and inserts a NAM attention mechanism before each bottleneck convolution layer in the MobileNet-v2 network model performs shortcut operations; by inserting the NAM attention mechanism, global information is captured, unimportant channels or pixels are suppressed to highlight the significant features of the weld, so that the network can better understand the global structure and semantic information, and the neural network's attention to the weld area is improved, thereby better segmenting the weld area and improving the network recognition accuracy.
[0077] The output module restores the feature map extracted by the feature extraction module to a feature map of the same size as the preprocessed weld image by combining convolution operation with bilinear interpolation to obtain the predicted weld area image. In this embodiment, the size is adjusted to 224×224.
[0078] The predicted weld area image contains three channels, representing three different types of prediction results. The most likely category of each pixel position in the weld area image is obtained after processing with the argmax function. If the maximum value of the prediction result at the same position in the 0th channel is returned as 0, it is the background type. Similarly, if the return value is 1, it is a straight weld type, and if the return value is 2, it is a curved weld type. Figure 3 As shown, it is a binary image generated when the return value is 2. The black area has a value of 0, and the white area is the part of the predicted bent weld type with a value of 255.
[0079] The training process of the neural network model includes:
[0080] Step 1: performing data enhancement on the preprocessed weld image to obtain an enhanced data set; in this way, the diversity of training samples is increased and the generalization ability of the network model is improved;
[0081] In this embodiment, the methods of expanding the image include but are not limited to flipping, translating, scaling, and clipping;
[0082] Step 2: Use the Labelme tool to annotate the images in the enhanced data set at the pixel level as the detection standard; use the images in the enhanced data set and the corresponding detection standard as the test set, and use the enhanced data set as the training set;
[0083] Before the training started, for the 4200 predicted weld area images containing two types of pixels (straight weld type and curved weld type) in the training set, the training batch size was set to 8 and the number of training rounds was set to 100. The warmup strategy was used to increase the learning rate first and then decrease it during the training process, slowing down the early overfitting of the model to the mini-batch in the initial stage, and maintaining the stability of the distribution and the depth of the model.
[0084] Step 3: Using cross entropy loss and Dice loss as loss functions, setting a weighting coefficient to weightedly fuse the cross entropy loss and the Dice loss to obtain a fusion loss;
[0085] The calculation formula of the cross entropy loss is:
[0086]
[0087] Among them, CE_Loss represents the cross entropy loss; N represents the number of pixels in an image; i represents the i-th pixel; M represents the type of pixel; c represents the c-th type; y ic is a sign function, whose value is 0 or 1; p ic Indicates the predicted probability that the i-th pixel belongs to the c-th type;
[0088] The calculation formula of the Dice loss is:
[0089]
[0090] Among them, Dice_Loss represents Dice loss, |X| represents the sum or square sum of the detection criteria, |Y| represents the sum or square sum of the prediction results, and |X∩Y| represents the intersection of the detection criteria and the prediction results;
[0091] The calculation formula of the fusion loss is:
[0092] L=w·CE_Loss+(1-w)·Dice_Loss;
[0093] Where L represents the fusion loss, w represents the weighting coefficient, w∈[0,1]. While considering the global semantic information between categories through cross entropy loss, Dice loss is used to focus on processing fewer categories, reducing shocks during training and making the training process smoother.
[0094] Step 4: Select an optimizer, set the initial learning rate and weight decay formula in the optimizer, and define the batch size and number of training rounds;
[0095] Step 5: performing a round of training according to the test set, the training set, the fusion loss and the set optimizer and by adjusting the weighting coefficient;
[0096] Step 6: Iterate step 5 until the maximum number of training rounds is reached, select the weighted coefficient with the highest prediction accuracy in each round as the network model weight, and obtain the trained neural network model.
[0097] S3: extract the pixel points of the predicted weld area that are straight welds and curved welds, and generate corresponding binary images respectively.
[0098] The result of image segmentation cannot provide accurate motion information for the robot, so it is necessary to further generate a path that meets the robot's motion requirements.
[0099] S4: extracting the outer contours of the weld areas predicted on the two binary images respectively, and setting a threshold; retaining the weld areas whose outer contour areas meet the threshold.
[0100] Specifically, a third-party library is called to find the outer contour of the predicted weld area on the two binary images. If the area of the outer contour is smaller than the threshold, the outer contour is ignored. Otherwise, a set of all pixel positions in the outer contour is returned until all predicted weld areas on the two binary images are traversed.
[0101] S5: Make a circumscribed rectangle for each retained weld area, and extract the local centroid of each circumscribed rectangle through a sliding window.
[0102] Specifically, the process of extracting the local centroid of the circumscribed rectangle through the sliding window includes:
[0103] S5.1: Let the coordinates of the four vertices of the circumscribed rectangle be (x1, y1), (x2, y1), (x1, y2), (x2, y2) respectively.
[0104] When the aspect ratio of the circumscribed rectangle is greater than or equal to 1, the sliding window moves from left to right;
[0105] The aspect ratio is greater than or equal to 1, that is:
[0106]
[0107] γ is the aspect ratio.
[0108] Define the x coordinate of the left side of the sliding window as x l , the x coordinate of the right side of the sliding window is x r , let x l =x1, then x r =x l +a, a is the set sliding window width;
[0109] When the aspect ratio of the circumscribed rectangle is less than 1, the sliding window moves from top to bottom;
[0110] Define the y coordinate of the upper side of the sliding window as y t , the y coordinate of the lower side of the sliding window is y b , let y t =y1, then y b=y t +a;
[0111] S5.2: Calculate the area of the sliding window based on each coordinate, calculate the centroid of the pixel points in the area of the sliding window and record it;
[0112] The area calculation formula for the sliding window includes:
[0113] Q1={(x,y)|x∈[x l ,x r ]||y∈[y1,y2]};
[0114] Where Q1 represents the area of the sliding window moving from left to right, x represents the x coordinate, and y represents the y coordinate; l Indicates the x coordinate of the left side of the sliding window; x r represents the x-coordinate of the right side of the sliding window; y1 represents the y-coordinate of the upper side of the circumscribed rectangle; y2 represents the y-coordinate of the lower side of the circumscribed rectangle;
[0115] Q2={(x,y)|x∈[x1,x2]||y∈[y t ,y b ]};
[0116] Where Q2 represents the area of the sliding window moving from top to bottom, x1 represents the x coordinate on the left side of the bounding rectangle; x2 represents the x coordinate on the right side of the bounding rectangle; y t Indicates the y coordinate of the upper side of the sliding window; y b Indicates the y-coordinate of the bottom side of the sliding window.
[0117] Calculate the centroid of the pixels in the area of the sliding window (x z ,y z ), the expression is as follows:
[0118]
[0119] Among them, p m Represents the pixel value of the mth pixel in the window area, x m and m They represent the horizontal and vertical coordinates of the mth pixel respectively, and M represents the number of pixels in the window area.
[0120] S5.3: Let x l =x r or t =y b , repeat S5.2 until x l >x2 or y t >y2, such as Figure 4As shown, the local centroid of the circumscribed rectangle is calculated for each pixel in each window, and finally a set of points consisting of local centroid coordinates is output for each region. Compared with the method of directly fitting all points in the region, the method of extracting the local centroid by sliding the window can use the most representative and least points to represent the weld position, greatly reducing the amount of calculation for curve fitting.
[0121] S6: Based on the local centroid, a B-spline curve is used for fitting to obtain a weld trajectory; and the weld trajectory is used as a robot tracking path.
[0122] Specifically, in order to seamlessly connect the robot's path planning and ensure the smoothness of the robot's operation, the B-spline curve is used to fit the extracted local centroid to generate the weld trajectory. The process includes:
[0123] The local centroid from the straight weld portion is used as a control point, and a low-order quasi-uniform B-spline curve is used to fit the weld path to generate a straight weld trajectory; this can reduce the amount of calculation.
[0124] The node repetition degree at both ends of the curve is set to k, so that the spline curve coincides with the endpoints of the control polygon, and the shape of the curve at both ends is better controlled; based on the local centroid from the bent weld part, a high-order quasi-uniform B-spline curve is used to fit the weld path to generate a smoother curved weld trajectory with a higher fit to the weld centerline, so as to achieve accurate positioning of the weld and ensure the smooth operation of the flaw detection robot, such as Figure 5 shown.
[0125] The expression of the basis function of B-spline is:
[0126]
[0127] Among them, B i,k (u) represents the i-th k-order B-spline; u represents a node; u i represents the i-th node, u i+1 represents the i+1th node;
[0128] Based on the control points and node vectors, the expression for generating the B-spline curve is:
[0129]
[0130] Where P(u) represents the B-spline curve of the u-th node, n represents the number of local centroids from the straight weld part; P i represents the local centroid of the ith straight weld section.
[0131] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A high-precision weld seam recognition and robot tracking path generation method, characterized in that: include: S1: receiving the captured weld image and preprocessing the weld image; S2: input the preprocessed weld image into the trained neural network model, and output a predicted weld area image; the types of pixels in the predicted weld area image include background, straight weld, and curved weld; S3: extracting the pixel points of the predicted weld area that are straight welds and curved welds, and generating corresponding binary images respectively; S4: extracting the outer contours of the weld areas predicted on the two binary images respectively, and setting a threshold; retaining the weld areas whose outer contour areas meet the threshold; S5: Make a circumscribed rectangle for each retained weld area, and extract the local centroid of each circumscribed rectangle through a sliding window; S5.1: Let the coordinates of the four vertices of the circumscribed rectangle be (x1, y1), (x2, y1), (x1, y2), (x2, y2) respectively. When the aspect ratio of the circumscribed rectangle is greater than or equal to 1, the sliding window moves from left to right; Define the x coordinate of the left side of the sliding window as x l , the x coordinate of the right side of the sliding window is x r , let x l =x1, then x r =x l +a, a is the set sliding window width; When the aspect ratio of the circumscribed rectangle is less than 1, the sliding window moves from top to bottom; Define the y coordinate of the upper side of the sliding window as y t , the y coordinate of the lower side of the sliding window is y b , let y t =y1, then y b =y t +a; S5.2: Calculate the area of the sliding window based on each coordinate, and calculate the centroid (x z ,y z ) and record it, the expression is as follows: Among them, p m Represents the pixel value of the mth pixel in the window area, x m and m Respectively represent the horizontal and vertical coordinates of the m-th pixel, and M represents the number of pixels in the window area; S5.3: Let x l =x r or t =y b , repeat S5.2 until x l >x2 or y t >y2, obtain the local centroid of the circumscribed rectangle; S6: Based on the local centroid, a B-spline curve is used for fitting to obtain a weld trajectory; and the weld trajectory is used as a robot tracking path; The process of obtaining the weld trajectory includes: Using the local centroid from the straight weld portion as a control point, fitting the weld path using a low-order quasi-uniform B-spline curve to generate a straight weld trajectory; Based on the local centroid from the bent weld portion, a curved weld trajectory is generated by fitting the weld path using a high-order quasi-uniform B-spline curve.
2. The high-precision weld seam recognition and robot tracking path generation method according to claim 1 is characterized in that: In S1, the preprocessing of the weld image includes: The weld image is adjusted to the size required by the trained neural network model, and Gaussian filtering is used to perform weighted averaging on the pixels in an area of a convolution kernel size in the adjusted weld image to obtain a denoised weld image.
3. The high-precision weld seam recognition and robot tracking path generation method according to claim 1 is characterized in that: In S2, the neural network model includes a feature extraction module and an output module; The feature extraction module adopts the MobileNet-v2 network model, and inserts a NAM attention mechanism before each bottleneck convolution layer in the MobileNet-v2 network model performs a shortcut operation; The output module combines convolution operation with bilinear interpolation to restore the feature map extracted by the feature extraction module to a feature map with the same size as the preprocessed weld image, thereby obtaining the predicted weld area image.
4. The high-precision weld seam recognition and robot tracking path generation method according to claim 3 is characterized in that: The training process of the neural network model includes: Step 1: performing data enhancement on the preprocessed weld image to obtain an enhanced data set; Step 2: Use the Labelme tool to annotate the images in the enhanced data set at the pixel level as the detection standard; use the images in the enhanced data set and the corresponding detection standard as the test set, and use the enhanced data set as the training set; Step 3: Using cross entropy loss and Dice loss as loss functions, setting a weighting coefficient to weightedly fuse the cross entropy loss and the Dice loss to obtain a fusion loss; Step 4: Select an optimizer, set the initial learning rate and weight decay formula in the optimizer, and define the batch size and number of training rounds; Step 5: performing a round of training according to the test set, the training set, the fusion loss and the set optimizer and by adjusting the weighting coefficient; Step 6: Iterate step 5 until the maximum number of training rounds is reached, select the weighted coefficient with the highest prediction accuracy in each round as the network model weight, and obtain the trained neural network model.
5. The high-precision weld seam recognition and robot tracking path generation method according to claim 4 is characterized in that: The calculation formula of the cross entropy loss is: Among them, CE_Loss represents the cross entropy loss; N represents the number of pixels in an image; i represents the i-th pixel; M represents the type of pixel; c represents the c-th type; y ic is a sign function, whose value is 0 or 1; p ic Indicates the predicted probability that the i-th pixel belongs to the c-th type; The calculation formula of the Dice loss is: Among them, Dice_Loss represents Dice loss, |X| represents the sum or square sum of the detection criteria, |Y| represents the sum or square sum of the prediction results, and |X∩Y| represents the intersection of the detection criteria and the prediction results; The calculation formula of the fusion loss is: L=w·CE_Loss+(1-w)·Dice_Loss; Among them, L represents the fusion loss and w represents the weighting coefficient.
6. The high-precision weld seam recognition and robot tracking path generation method according to claim 1, characterized in that: In S4, a third-party library is called to find the outer contour of the predicted weld area on the two binary images. If the area of the outer contour is smaller than the threshold, the outer contour is ignored. Otherwise, a set of all pixel positions in the outer contour is returned until all predicted weld areas on the two binary images are traversed.
7. The high-precision weld seam recognition and robot tracking path generation method according to claim 1, characterized in that: The expression of the basis function of B-spline is: Among them, B i,k (u) represents the i-th k-order B-spline; u represents a node; u i represents the i-th node, u i+1 represents the i+1th node; Based on the control points and node vectors, the expression for generating the B-spline curve is: Where P(u) represents the B-spline curve of the u-th node, n represents the number of local centroids from the straight weld part; P i represents the local centroid of the ith straight weld section.
8. The high-precision weld seam recognition and robot tracking path generation method according to claim 1, characterized in that: The area calculation formula for the sliding window includes: Q1={(x,y)|x∈[x l ,x r ]||y∈[y1,y2]}; Where Q1 represents the area of the sliding window moving from left to right, x represents the x coordinate, and y represents the y coordinate; l Indicates the x coordinate of the left side of the sliding window; x r represents the x-coordinate of the right side of the sliding window; y1 represents the y-coordinate of the upper side of the circumscribed rectangle; y2 represents the y-coordinate of the lower side of the circumscribed rectangle; Q2={(x,y)x∈[x1,x2]y∈[y t ,and b ]}; Where Q2 represents the area of the sliding window moving from top to bottom, x1 represents the x coordinate on the left side of the bounding rectangle; x2 represents the x coordinate on the right side of the bounding rectangle; y t Indicates the y coordinate of the upper side of the sliding window; y b Indicates the y-coordinate of the bottom side of the sliding window.
Citation Information
Patent Citations
Weld joint identification and path extraction method for wall-climbing robot navigation
CN112101137A
Dental arch line image generation method and device and computer equipment
CN114512221A