Weld joint deviation identification method, medium and equipment
By acquiring pixel blocks in the weld area and performing linear fitting and feature fusion, the problem of insufficient adaptability of weld offset detection methods is solved, achieving efficient and accurate weld offset recognition and meeting the needs of modern production.
Patent Information
- Application Number
- CN202511843336.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-02-24
AI Technical Summary
Existing weld offset detection methods are not adaptable enough and cannot reliably and accurately identify weld offset, resulting in a decline in welding quality.
By acquiring pixel blocks in the weld area, performing linear fitting and boundary equation translation, calculating pixel coordinate extreme values, and combining the ratio to determine weld offset, a weld recognition model is used for feature extraction and fusion to eliminate environmental noise and improve detection accuracy.
It improves the adaptability and accuracy of weld offset detection, reduces computational complexity, and quickly determines whether a weld has shifted, meeting the needs of modern production.
Smart Images

Figure CN121564433A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated welding technology, and in particular to a method, medium, and equipment for identifying weld seam offset. Background Technology
[0002] In the field of welding manufacturing, welds are the core components that achieve permanent connection of the base materials and impart structural strength, stiffness, sealing performance, and corrosion / conductivity. With the increasing demands for welding quality and service reliability in rail transportation, shipbuilding, pressure vessels, aerospace, and new energy equipment, weld geometric accuracy has become one of the key indicators for evaluating welding quality. However, due to clamping errors, thermal deformation, robot teaching deviations, or workpiece dimensional variations, the actual path of the welding torch (or heat source) often deviates from the designed weld trajectory, resulting in a "weld offset" defect. This defect significantly reduces the effective weld width and depth, leading to problems such as incomplete fusion, undercut, porosity, and poor forming, thereby weakening the static load / fatigue strength of the joint and causing sealing failure. It has become a key focus and challenge in on-site quality control.
[0003] Currently, the industry still primarily relies on post-weld visual inspection to detect weld misalignment: inspectors use their experience to compare the relative positions of the weld to the edge of the base material or the center line of the bevel to determine if misalignment exists. This method is limited by human spatial resolution, fatigue levels, and subjective differences, resulting in inherent drawbacks such as low efficiency, high cost, high rates of missed detections / false judgments, and lack of data traceability. It is no longer sufficient to meet the demands of modern production processes that require high volume, high cycle time, and high reliability.
[0004] To overcome the limitations of manual inspection, template matching schemes based on 2D vision have emerged in recent years. These schemes first acquire the grayscale or contour of a "qualified" weld area as a reference template, then search for the sub-region with the highest similarity to the template in the image to be inspected, calculating the offset using coordinate differences. However, in actual welding processes, the weld surface morphology is affected by multiple factors, including beveling errors, assembly gaps, heat input fluctuations, and wire alignment deviations, resulting in significant random variations in forming height, width, excess height, and texture. When the weld morphology differs greatly from the template, the matching algorithm is prone to getting trapped in local optima, leading to mismatches or even matching failures, thus distorting the offset calculation. Furthermore, ambient arc light, spatter, oxidation colors, and secondary reflections also reduce image contrast, further weakening the robustness of template matching. Therefore, existing 2D vision methods have stringent requirements for weld shape consistency, poor adaptability to field conditions, and struggle to provide stable and accurate offset detection results under complex working conditions.
[0005] Therefore, how to improve the existing weld offset detection methods, which have insufficient adaptability and cannot stably and accurately identify weld offset, is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0006] Based on this, the purpose of this application is to provide a weld offset identification method, medium, and device to solve at least one of the technical problems mentioned in the background art.
[0007] In a first aspect, this application provides a weld offset identification method, including: Obtain pixel blocks of the weld seam area; The pixels of the current workpiece edge region are obtained and a straight line is fitted to obtain the boundary equation. The boundary equation is then translated a set distance in a set direction to obtain the weld boundary line. Obtain the extreme coordinate values of each pixel in the current weld area pixel block in the vertical direction of the weld boundary line, and calculate the distance between each extreme coordinate value and the weld boundary line to obtain the left offset value and the right offset value. Based on the left and right offset values, determine whether the weld has shifted.
[0008] Furthermore, based on the left and right offset values, it is determined whether the weld has shifted, including: Determine whether the left and right offset values are less than the set distance threshold; if so, the weld seam is offset. If not, obtain the ratio between each offset value and determine whether it is within the set ratio range. If yes, the weld has not shifted; otherwise, the weld has shifted.
[0009] Furthermore, the method for obtaining pixel blocks in the weld seam region includes: Collect several workpiece surface images and label the pixel blocks of the weld area to construct a training dataset; Based on the training dataset, a weld recognition model is constructed and trained, taking the workpiece surface image as input and the weld region pixel block as output, including: The input layer is used to preprocess and standardize the workpiece surface image to obtain an optimized surface image to eliminate environmental noise; The feature extraction layer is used to perform multi-dimensional feature extraction and scale-based enhancement operations on the optimized surface image to obtain a multi-scale enhanced feature map. The feature fusion layer is used to perform cross-scale fusion and boundary optimization operations on multi-scale enhanced feature maps to obtain fused feature maps with clear boundaries and uniform scale. The output layer is used to locate, filter, and integrate pixels in the fused feature map to obtain pixel blocks of the weld seam region. Input the current workpiece surface image into the trained weld recognition model to obtain the current weld area pixel block.
[0010] Furthermore, the specific structure of the input layer includes a filtering module, a multi-scale preprocessing and fusion module, and a data distribution calibration module connected in sequence: The filtering module is used to perform median filtering, bilateral filtering and Gaussian filtering on the workpiece surface image in parallel to obtain the median filtered image, bilateral filtered image and Gaussian filtered image; The multi-scale preprocessing fusion module is used to perform size alignment, channel stitching, and feature fusion on median filtered images, bilateral filtered images, and Gaussian filtered images to obtain fused preprocessed images. The data distribution calibration module is used to perform batch normalization (BN) and mean / variance calibration on the fused preprocessed image to obtain an optimized surface image.
[0011] Furthermore, the specific structure of the filtering module includes a median filter unit, a bilateral filter unit, and a Gaussian filter unit designed in parallel: The median filtering unit is used to perform neighborhood median replacement on the workpiece surface image to suppress discrete noise points and obtain a median filtered image. The bilateral filtering unit is used to perform weighted filtering on the workpiece surface image by combining spatial distance and gray-level similarity to obtain a bilaterally filtered image; The Gaussian filtering unit is used to perform Gaussian kernel weighted average smoothing on the workpiece surface image to obtain a Gaussian filtered image.
[0012] Furthermore, the specific structure of the feature extraction layer includes parallel convolutional modules and feature decoupling modules designed in parallel: The parallel convolution module is used to perform local feature extraction and horizontal and vertical morphology capture convolution operations on the optimized surface image in parallel to obtain morphology enhancement feature maps. The feature decoupling module is used to extract grayscale differences, edge gradients, and surface texture features from the optimized surface image in parallel to obtain a dimension-enhanced feature map. The dual-path feature fusion module is connected to the outputs of the parallel convolution module and the feature decoupling module. It is used to fuse the morphological enhancement feature map and the dimension enhancement feature map to obtain the dual-path fused feature map. The feature attention enhancement module, connected to the output of the dual-path feature fusion module, is used to perform scale-wise downsampling and global feature aggregation on the dual-path fusion feature map to obtain a multi-scale enhanced feature map.
[0013] Furthermore, the specific structure of the parallel convolution module includes convolutional units for local feature extraction, horizontal morphology capture, and vertical morphology capture, designed in parallel: The local feature extraction convolution unit is used to perform square kernel convolution on the optimized surface image to extract local features of the image and obtain a local detail feature map; The horizontal morphology capture convolutional unit is used to perform longitudinal convolution on the optimized surface image to extract the horizontal orientation features of the image and obtain the horizontal morphology feature map. The vertical morphology capture convolution unit is used to perform transverse convolution on the optimized surface image to extract the vertical orientation features of the image and obtain the vertical morphology feature map. The spatial attention fusion unit is connected to the outputs of the local feature extraction convolutional unit, the horizontal morphology capture convolutional unit, and the vertical morphology capture convolutional unit. It is used to assign weights to and fuse the local detail feature map, the horizontal morphology feature map, and the vertical morphology feature map to obtain the spatial focus feature map. The semantic feature enhancement unit, connected to the output of the spatial attention fusion unit, is used to enhance the semantic features of the spatial focus feature map to distinguish between weld seams and workpiece edges, thereby obtaining a morphological enhancement feature map.
[0014] Furthermore, the specific structure of the feature attention enhancement module includes fine-scale feature downsampling units, medium-scale feature downsampling units, and coarse-scale feature downsampling units arranged in parallel, as well as several global feature aggregation SPPF units: The fine-scale feature downsampling unit is used to downsample the dual-path fused feature map to a fine scale to obtain a fine-scale downsampled feature map; The fine-scale global feature aggregation SPPF unit is connected to the output of the fine-scale feature downsampling unit. It is used to perform fine-scale pooling operation on the dual-path fusion feature map, extract fine-scale global features, and aggregate fine-scale local features and fine-scale global features to obtain a fine-scale global aggregated feature map. The mesoscale feature downsampling unit is used to downsample the dual-path fused feature map to the mesoscale to obtain the mesoscale downsampled feature map; The mesoscale global feature aggregation SPPF unit is connected to the output of the mesoscale feature downsampling unit. It is used to perform mesoscale pooling operation on the dual-path fusion feature map, extract mesoscale global features, and aggregate mesoscale local features and mesoscale global features to obtain a mesoscale global aggregated feature map. The coarse-scale feature downsampling unit is used to downsample the dual-path fused feature map to a coarse scale to obtain a coarse-scale downsampled feature map; The coarse-scale global feature aggregation SPPF unit is connected to the output of the coarse-scale feature downsampling unit. It is used to perform coarse-scale pooling operation on the dual-path fusion feature map, extract coarse-scale global features, and aggregate coarse-scale local features and coarse-scale global features to obtain a coarse-scale global aggregated feature map.
[0015] Furthermore, the specific structure of the feature fusion layer includes a parallel design of fine-scale adaptive weighted PAFPN modules, a mesoscale adaptive weighted PAFPN module, and a coarse-scale adaptive weighted PAFPN module: The fine-scale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the fine-scale global aggregated feature map to obtain a fine-scale adaptive fused feature map. The mesoscale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the mesoscale global aggregated feature map to obtain the mesoscale adaptive fused feature map. The coarse-scale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the coarse-scale global aggregated feature map to obtain a coarse-scale adaptive fused feature map. The local feature fusion module is connected to the outputs of the fine-scale adaptive weighted PAFPN module and the meso-scale adaptive weighted PAFPN module. It is used to fuse the fine-scale adaptive fusion feature map and the meso-scale adaptive fusion feature map to obtain the local fusion feature map. The global feature fusion module is connected to the outputs of the local feature fusion module and the coarse-scale adaptive weighted PAFPN module. It is used to fuse the local fusion feature map and the coarse-scale adaptive fusion feature map to obtain the global fusion feature map. The Sobel boundary enhancement module is connected to the output of the global feature fusion module. It is used to extract the gradient boundary of the global fusion feature map using the Sobel operator to obtain the gradient boundary feature map. The Canny boundary enhancement module is connected to the output of the global feature fusion module and is used to extract strong edges from the global fusion feature map using the Canny operator to obtain a strong edge feature map. The boundary feature fusion module, connected to the outputs of the Sobel boundary enhancement module and the Canny boundary enhancement module, is used to fuse gradient boundary feature maps and strong edge feature maps to obtain a fused feature map.
[0016] Furthermore, the specific structure of the output layer includes a multi-scale mask fusion module and a coordinate mapping module connected in sequence: The multi-scale mask fusion module is used to extract shared features at multiple scales, then predict pixel masks to obtain multi-scale masks, and then fuse them to obtain fused pixel masks. The coordinate mapping module is used to obtain the pixel blocks of the weld area based on the mapping between the coordinates of the fused pixel mask and the pixels of the workpiece surface image; Output module, used to output pixel blocks of the weld seam area.
[0017] Secondly, this application also provides a computer storage medium storing executable program code; the executable program code is used to execute the weld offset identification method described in any one of the first aspects.
[0018] Thirdly, this application also provides a terminal device, including a memory and a processor; the memory stores program code executable by the processor; the program code is used to execute the weld offset identification method according to any one of the first aspects.
[0019] This invention provides a weld seam offset identification method, medium, and device. By acquiring pixel blocks of the weld seam region, it can adapt to weld seams of different shapes and sizes, providing a reliable data foundation for subsequent analysis. It acquires pixels of the current workpiece edge region and performs straight-line fitting to obtain a boundary equation. This boundary equation is then translated a predetermined distance in a set direction to obtain the weld seam boundary line. By simplifying complex boundaries into straight-line equations, the complexity of subsequent calculations is reduced. The extreme coordinate values of each pixel in the current weld seam region pixel block in the direction perpendicular to the weld seam boundary line are obtained, and the distance between each extreme coordinate value and the weld seam boundary line is calculated to obtain left and right offset values. These extreme points directly reflect the degree of deviation between the weld seam and the boundary line, facilitating understanding and analysis. Based on the left and right offset values, it is determined whether the weld seam has shifted, improving the efficiency of the judgment. This solves the problems of insufficient adaptability and inability to stably and accurately identify weld seam offsets in existing weld seam offset detection methods. Attached Figure Description
[0020] Figure 1 This is a flowchart of the weld offset identification method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the weld seam recognition model according to an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0022] It should be noted that if the embodiments of the present invention involve directional indications, such as up, down, left, right, front, back, etc., these directional indications are only used to explain the relative positional relationships and movement of the components in a specific posture. If the specific posture changes, the directional indications will also change accordingly. Furthermore, if the embodiments of the present invention involve descriptions such as "first," "second," "S1," "S2," "step one," "step two," etc., these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance, or implicitly indicating the number of technical features indicated or the order of method execution. Those skilled in the art will understand that anything that does not violate the inventive concept and is within the scope of the present invention should be included in the protection scope of the present invention.
[0023] like Figure 1 As shown, the present invention provides a method for identifying weld offset: S1: Obtain pixel blocks of the weld seam area; Specifically, it is optional, but not limited to, collecting several workpiece surface images to construct a training dataset to train any existing neural network model, obtaining a trained neural network model, and inputting the workpiece surface image of the current workpiece to be identified into the trained neural network model to obtain the weld seam region pixel blocks in the workpiece surface image of the current workpiece to be identified. It can adapt to weld seams of different shapes and sizes, providing a reliable data foundation for subsequent analysis.
[0024] For example, multiple sets of 2D weld images can be obtained by scanning the surface of the workpiece to construct a training dataset. The YOLOv8-seg segmentation model can be trained using the training dataset to segment and locate the position of the weld region pixel blocks in the image. Then, the current 2D image of the weld to be identified is input into the trained YOLOv8-seg segmentation model for inference to obtain the weld region pixel blocks.
[0025] S2: Obtain the pixels of the current workpiece edge region and perform straight line fitting to obtain the boundary equation. Then, translate the boundary equation in the set direction by a set distance to obtain the weld boundary line. Specifically, the pixels of the current workpiece edge region can be obtained and fitted with a straight line to obtain the boundary equation. This simplifies the complex boundary into a straight line equation, reduces the complexity of subsequent calculations, effectively suppresses the influence of noise, and extracts a smoother and more realistic edge trend. Since the weld position (including the weld direction and the set distance between the weld and the workpiece edge) is set in advance, the distance between the weld and the workpiece boundary is known. The boundary equation can be shifted by a set distance in the set direction to obtain the weld boundary line.
[0026] S3: Obtain the extreme coordinate values of each pixel in the current weld area pixel block in the vertical direction of the weld boundary line, and calculate the distance between each extreme coordinate value and the weld boundary line to obtain the left offset value and the right offset value. S4: Determine whether the weld has shifted based on the left and right offset values.
[0027] Specifically, you can determine whether the difference between the left offset value and the right offset value is less than a set threshold. If not, it means that the weld has shifted significantly to one side. If so, it means that the weld has not shifted.
[0028] Preferably, the step of determining whether the weld has shifted based on the left and right offset values may include: S41: Determine whether the left offset value and the right offset value are less than the set distance threshold. If so, the weld seam will shift. Specifically, a distance threshold can be optionally set to obtain the extreme coordinate values of each pixel in the current weld area pixel block in the vertical direction of the weld boundary line, and calculate the distance between each extreme coordinate value and the weld boundary line to obtain the left offset value and the right offset value. By calculating the vertical distance from the extreme point (leftmost / rightmost pixel) to the boundary line, the asymmetry on both sides of the weld can be directly quantified. Since there may be errors when obtaining the pixel block, resulting in inaccurate pixel segmentation, pixels that originally belong to the background area are classified as weld area pixels, it is optional to determine whether the left offset value and the right offset value are less than the set distance threshold. If so, it means that there is no weld on the left or right side of the boundary line, so the weld must be offset to one side, improving the judgment efficiency.
[0029] For example, a straight line can be fitted using the RANSAC algorithm based on the edge of the workpiece in the image. Simultaneously, based on a fixed distance d1 between the base material joint line and the workpiece edge in the image, the fitted straight line is moved to the joint line position in the image, serving as the weld boundary line. The process is then iterated row by row, counting whether there are weld area pixels on both sides of the boundary line in each row. A distance threshold d2 is set; if a pixel on the left side of the weld is more than d2 away from the boundary line, it is considered that there is a weld on the left side of that row; otherwise, there is no weld on the left side of that row. The same applies to the right side. Since the boundary line is located at the joint line, when there is no weld on either side of the boundary line, it can be directly determined that the weld has shifted, improving judgment efficiency.
[0030] S42: If not, obtain the ratio between each offset value and determine whether it is within the set ratio range. If yes, the weld has not shifted; if no, the weld has shifted.
[0031] Specifically, when the left offset value and the right offset value are not less than the set distance threshold, it means that the weld is located in the set area. However, there may still be slight offsets. Therefore, it is necessary to obtain the ratio between each offset value and determine whether the ratio is within the set ratio range to further determine the weld displacement and improve the judgment accuracy. At this time, the closer the ratio between the left offset value and the right offset value is to 1, the more correct the weld position is. If it is, the weld has not shifted; if not, the weld has shifted.
[0032] For example, you can optionally count the number of pixel rows of the left weld and the number of pixel rows of the right weld, i.e., the left offset value and the right offset value. Divide the minimum value of the two by the maximum value to get a ratio r1. Set a threshold r2. If r1 is less than r2, the weld is determined to be offset.
[0033] This embodiment presents a weld seam offset recognition method of the present invention. By acquiring pixel blocks of the weld seam region, it can adapt to weld seams of different shapes and sizes, providing a reliable data foundation for subsequent analysis. The method acquires pixels of the current workpiece edge region and performs straight line fitting to obtain a boundary equation. This boundary equation is then translated a predetermined distance in a set direction to obtain the weld seam boundary line. By simplifying complex boundaries into straight line equations, the complexity of subsequent calculations is reduced. The extreme values of the coordinates of each pixel in the current weld seam region pixel block in the direction perpendicular to the weld seam boundary line are obtained, and the distance between each extreme value and the weld seam boundary line is calculated to obtain left and right offset values. These extreme values directly reflect the degree of deviation between the weld seam and the boundary line, facilitating understanding and analysis. Based on the left and right offset values, it is determined whether the weld seam has shifted. This rapid determination based on the offset values improves judgment efficiency. This method solves the problems of insufficient adaptability and inability to stably and accurately identify weld seam offsets in existing weld seam offset detection methods.
[0034] Preferably, the step of obtaining the pixel block of the weld seam region may include: S11: Collect several workpiece surface images and label the pixel blocks of the weld area to construct a training dataset; Specifically, it is optional, but not limited to, acquiring several workpiece surface images and labeling the weld seam area pixel blocks in them pixel by pixel to construct a training dataset based on several labeled workpiece surface images.
[0035] S12: Based on the training dataset, construct and train a weld recognition model that takes the workpiece surface image as input and the weld region pixel blocks as output, including: The input layer is used to preprocess and standardize the workpiece surface image to obtain an optimized surface image to eliminate environmental noise; The feature extraction layer is used to perform multi-dimensional feature extraction and scale-based enhancement operations on the optimized surface image to obtain a multi-scale enhanced feature map. The feature fusion layer is used to perform cross-scale fusion and boundary optimization operations on multi-scale enhanced feature maps to obtain fused feature maps with clear boundaries and uniform scale. The output layer is used to locate, filter, and integrate pixels in the fused feature map to obtain pixel blocks of the weld seam area.
[0036] Specifically, optional but not limited to denoising (such as Gaussian filtering, median filtering), illumination normalization (such as histogram equalization, Retinex algorithm), and contrast enhancement on the input workpiece surface image through the input layer, can effectively suppress environmental noise such as uneven workshop lighting, metal reflection, and dust noise, and improve the stability of subsequent feature extraction. Then, through the feature extraction layer, traditional geometric features (such as edge gradient, texture LBP / HOG) and deep semantic features (such as CNN convolution activation values) are combined to comprehensively capture the shape, texture, and contextual semantic information of the weld seam, so as to cope with the morphological differences caused by different welding processes (such as laser welding and arc welding). It can enhance the microscopic jaggedness and ablation marks of the weld seam edge, and capture the overall direction and width gradient trend of the weld seam. Finally, through the feature fusion layer, the deep and shallow features are fused to solve the contradiction between large-scale localization and small-scale precise localization of the weld seam. For example, by locating the approximate weld area through deep semantic features and correcting edge pixel-level deviations through shallow high-resolution features, a boundary optimization technique for fused feature maps with clear boundaries and uniform scale is obtained. Finally, the output layer outputs a pixel-level mask through instance segmentation (such as Mask R-CNN) or semantic segmentation (such as U-Net++), supporting irregular weld shapes (such as curved welds and intermittent welds). Then, the weld area pixel blocks in the workpiece surface image are located based on the pixel-level mask, completing weld recognition. It is worth noting that... Figure 2 As shown, the specific structure of this weld recognition model is for illustrative purposes only and is not intended to be limiting.
[0037] Preferably, the specific structure of the input layer includes a filtering module, a multi-scale preprocessing fusion module, and a data distribution calibration module connected in sequence: The filtering module is used to perform median filtering, bilateral filtering and Gaussian filtering on the workpiece surface image in parallel to obtain the median filtered image, bilateral filtered image and Gaussian filtered image; The multi-scale preprocessing fusion module is used to perform size alignment, channel stitching, and feature fusion on median filtered images, bilateral filtered images, and Gaussian filtered images to obtain fused preprocessed images. The data distribution calibration module is used to perform batch normalization (BN) and mean / variance calibration on the fused preprocessed image to obtain an optimized surface image.
[0038] Specifically, the filtering module can be used to perform median filtering, bilateral filtering, and Gaussian filtering on the workpiece surface image in parallel to suppress different types of noise, avoid the limitations of single filtering, and preserve weld details. Then, the multi-scale preprocessing fusion module performs size alignment, channel stitching, and feature fusion on the median-filtered, bilateral-filtered, and Gaussian-filtered images to integrate the advantages of multi-path filtering, eliminate feature bias, and output a unified feature base. Finally, the data distribution calibration module performs batch normalization (BN) and mean / variance calibration on the fused preprocessed image to accelerate model convergence and enhance the generalization ability to images under different lighting / equipment conditions.
[0039] Preferably, the specific structure of the filtering module includes a median filtering unit, a bilateral filtering unit, and a Gaussian filtering unit designed in parallel: The median filtering unit is used to perform neighborhood median replacement on the workpiece surface image to suppress discrete noise points and obtain a median filtered image. The bilateral filtering unit is used to perform weighted filtering on the workpiece surface image by combining spatial distance and gray-level similarity to obtain a bilaterally filtered image; The Gaussian filtering unit is used to perform Gaussian kernel weighted average smoothing on the workpiece surface image to obtain a Gaussian filtered image.
[0040] Specifically, the system can simultaneously use a median filter unit to efficiently remove environmental noise (such as welding spatter, dust, etc.) while preserving the sharpness of the weld edges. A bilateral filter unit can preserve the weld structure while removing noise, making it suitable for materials with high reflectivity on metal surfaces. A Gaussian filter unit can eliminate Gaussian noise from the sensor, improve image grayscale consistency, and provide a data foundation for subsequent steps.
[0041] Preferably, the specific structure of the feature extraction layer includes a parallel convolutional module and a feature decoupling module designed in parallel: The parallel convolution module is used to perform local feature extraction and horizontal and vertical morphology capture convolution operations on the optimized surface image in parallel to obtain morphology enhancement feature maps. The feature decoupling module is used to extract grayscale differences, edge gradients, and surface texture features from the optimized surface image in parallel to obtain a dimension-enhanced feature map. The dual-path feature fusion module is connected to the outputs of the parallel convolution module and the feature decoupling module. It is used to fuse the morphological enhancement feature map and the dimension enhancement feature map to obtain the dual-path fused feature map. The feature attention enhancement module, connected to the output of the dual-path feature fusion module, is used to perform scale-wise downsampling and global feature aggregation on the dual-path fusion feature map to obtain a multi-scale enhanced feature map.
[0042] Specifically, a parallel convolution module can be used to cover different morphological features (direction, local details) of the weld to enhance morphological expression. At the same time, a feature decoupling module can be used to refine the extraction of multi-dimensional features to highlight the distinction between the weld and the base material. Then, a dual-path feature fusion module can be used to fuse morphological and dimensional features to improve feature integrity and expressive power. Finally, a feature attention enhancement module can be used to perform scale-wise downsampling and global feature aggregation on the dual-path fused feature map to adapt to welds of different scales, focus on key features, suppress background interference, and obtain multi-scale enhanced feature maps (including fine-scale, medium-scale, and coarse-scale).
[0043] Preferably, the specific structure of the parallel convolution module includes a parallel design of local feature extraction convolution units, horizontal morphology capture convolution units, and vertical morphology capture convolution units: The local feature extraction convolution unit is used to perform square kernel convolution on the optimized surface image to extract local features of the image and obtain a local detail feature map; The horizontal morphology capture convolutional unit is used to perform longitudinal convolution on the optimized surface image to extract the horizontal orientation features of the image and obtain the horizontal morphology feature map. The vertical morphology capture convolution unit is used to perform transverse convolution on the optimized surface image to extract the vertical orientation features of the image and obtain the vertical morphology feature map. The spatial attention fusion unit is connected to the outputs of the local feature extraction convolutional unit, the horizontal morphology capture convolutional unit, and the vertical morphology capture convolutional unit. It is used to assign weights to and fuse the local detail feature map, the horizontal morphology feature map, and the vertical morphology feature map to obtain the spatial focus feature map. The semantic feature enhancement unit, connected to the output of the spatial attention fusion unit, is used to enhance the semantic features of the spatial focus feature map to distinguish the weld seam from the background and obtain the morphological enhancement feature map.
[0044] Specifically, a local feature extraction convolutional unit can be used to capture the fine structure of the weld seam to adapt to intermittent / curved weld seams. Horizontal and vertical morphology capture convolutional units can be used to extract horizontal and vertical orientation features respectively to specifically enhance the different orientations of the weld seam and cover diverse weld seam structures. Then, a spatial attention fusion unit is used to weight and fuse the local detail feature map, horizontal morphology feature map, and vertical morphology feature map to focus on the weld seam area, suppress background interference, and improve the purity of the feature space. Finally, a semantic feature deepening unit is used to transform shallow morphological features into deep semantic features, reducing category confusion and obtaining a morphologically enhanced feature map.
[0045] Preferably, the specific structure of the feature decoupling module includes a parallel-designed grayscale difference enhancement unit, an edge gradient enhancement unit, and a surface texture perception unit: The grayscale difference enhancement unit is used to enhance and optimize the grayscale difference features of the surface image to obtain a grayscale feature map; Edge gradient enhancement unit is used to enhance the edge gradient features of the optimized surface image to obtain a gradient feature map; The surface texture sensing unit is used to enhance and optimize the surface texture features of the surface image to obtain a texture feature map. The channel weight adaptive fusion unit is connected to the outputs of the grayscale difference enhancement unit, the edge gradient enhancement unit, and the surface texture perception unit. It is used to adaptively allocate channel weights and fuse each feature map according to the grayscale feature map, gradient feature map, and texture feature map to enhance key dimension features and obtain a dimension-enhanced feature map.
[0046] Specifically, grayscale difference enhancement unit, edge gradient enhancement unit and surface texture perception unit can be selected to enhance and optimize the grayscale difference, edge gradient and surface texture features of the surface image respectively. By refining the single-dimensional features, the recognition of each dimension is improved. Then, the channel weight adaptive fusion unit is used to adaptively allocate channel weights to enhance key dimension features and obtain a dimension-enhanced feature map.
[0047] Preferably, the specific structure of the feature attention enhancement module includes fine-scale feature downsampling units, medium-scale feature downsampling units, and coarse-scale feature downsampling units arranged in parallel, as well as several global feature aggregation SPPF units: The fine-scale feature downsampling unit is used to downsample the dual-path fused feature map to a fine scale to obtain a fine-scale downsampled feature map; The fine-scale global feature aggregation SPPF unit is connected to the output of the fine-scale feature downsampling unit. It is used to perform fine-scale pooling operation on the dual-path fusion feature map, extract fine-scale global features, and aggregate fine-scale local features and fine-scale global features to obtain a fine-scale global aggregated feature map. The mesoscale feature downsampling unit is used to downsample the dual-path fused feature map to the mesoscale to obtain the mesoscale downsampled feature map; The mesoscale global feature aggregation SPPF unit is connected to the output of the mesoscale feature downsampling unit. It is used to perform mesoscale pooling operation on the dual-path fusion feature map, extract mesoscale global features, and aggregate mesoscale local features and mesoscale global features to obtain a mesoscale global aggregated feature map. The coarse-scale feature downsampling unit is used to downsample the dual-path fused feature map to a coarse scale to obtain a coarse-scale downsampled feature map; The coarse-scale global feature aggregation SPPF unit is connected to the output of the coarse-scale feature downsampling unit. It is used to perform coarse-scale pooling operation on the dual-path fusion feature map, extract coarse-scale global features, and aggregate coarse-scale local features and coarse-scale global features to obtain a coarse-scale global aggregated feature map.
[0048] Specifically, the dual-path fusion feature map can be downsampled first using a fine / medium / coarse scale feature downsampling unit to obtain a fine / medium / coarse scale downsampled feature map, providing a data foundation for subsequent steps. Then, the fine / medium / coarse scale global feature aggregation SPPF unit uses pooling kernels of different sizes (such as 5×5, 9×9, 13×13) to perform pooling operations on the fine / medium / coarse scale downsampled feature map to obtain a fine / medium / coarse scale global aggregation feature map, so as to take into account both details and the overall picture and improve feature integrity.
[0049] Preferably, the specific structure of the feature fusion layer includes a parallel design of a fine-scale adaptive weighted PAFPN module, a medium-scale adaptive weighted PAFPN module, and a coarse-scale adaptive weighted PAFPN module: The fine-scale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the fine-scale global aggregated feature map to obtain a fine-scale adaptive fused feature map. The mesoscale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the mesoscale global aggregated feature map to obtain the mesoscale adaptive fused feature map. The coarse-scale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the coarse-scale global aggregated feature map to obtain a coarse-scale adaptive fused feature map. The local feature fusion module is connected to the outputs of the fine-scale adaptive weighted PAFPN module and the meso-scale adaptive weighted PAFPN module. It is used to fuse the fine-scale adaptive fusion feature map and the meso-scale adaptive fusion feature map to obtain the local fusion feature map. The global feature fusion module is connected to the outputs of the local feature fusion module and the coarse-scale adaptive weighted PAFPN module. It is used to fuse the local fusion feature map and the coarse-scale adaptive fusion feature map to obtain the global fusion feature map. The Sobel boundary enhancement module is connected to the output of the global feature fusion module. It is used to extract the gradient boundary of the global fusion feature map using the Sobel operator to obtain the gradient boundary feature map. The Canny boundary enhancement module is connected to the output of the global feature fusion module and is used to extract strong edges from the global fusion feature map using the Canny operator to obtain a strong edge feature map. The boundary feature fusion module, connected to the outputs of the Sobel boundary enhancement module and the Canny boundary enhancement module, is used to fuse gradient boundary feature maps and strong edge feature maps to obtain a fused feature map.
[0050] Specifically, the system can optionally use a fine / medium / coarse scale adaptive weighted PAFPN module to perform PAFPN fusion of shallow and deep features and scale feature weight calibration on the global aggregated feature maps of the corresponding sizes to adapt to the weld feature requirements of the corresponding scale and enhance the balance between detail and semantics. Then, a local feature fusion module performs feature interaction fusion to supplement medium-scale details, thereby eliminating fine / medium-scale discontinuities and improving the accuracy of medium-scale details. Next, a global feature fusion module performs feature interaction fusion to supplement large-scale semantics, thereby eliminating medium / coarse-scale discontinuities and improving the accuracy of large-scale localization. Then, a Sobel / Canny boundary enhancement module is used to extract gradient boundaries using the Sobel operator and strong edges using the Canny operator, respectively, thereby complementaryly capturing boundary features (gradient / strong edges) and improving boundary integrity. Finally, a boundary feature fusion module fuses the gradient boundary feature map and the strong edge feature map to integrate the advantages of gradient and strong edges and optimize the sharpness and integrity of the boundary.
[0051] Preferably, the specific structure of each adaptive weighted PAFPN module includes a scale feature fusion PAFPN unit and a scale feature weight calibration unit connected in sequence: The scale feature fusion PAFPN unit is used to fuse deep and shallow features through the PAFPN structure to obtain a global aggregated feature map at the corresponding scale. The scale feature weight calibration unit is used to adaptively adjust the feature weights of the global aggregated feature map at each scale to enhance key features.
[0052] Specifically, the scale feature fusion PAFPN unit can be used to resolve single-scale detail / semantic contradictions and improve feature integrity. Then, the scale feature weight calibration unit can be used to improve the targeting of intra-scale feature fusion and reduce interference from invalid features.
[0053] Preferably, the specific structure of the output layer includes a multi-scale mask fusion module and a coordinate mapping module connected in sequence: The multi-scale mask fusion module is used to extract shared features at multiple scales, then predict pixel masks to obtain multi-scale masks, and then fuse them to obtain fused pixel masks. The coordinate mapping module is used to obtain the pixel blocks of the weld area based on the mapping between the coordinates of the fused pixel mask and the pixels of the workpiece surface image; Output module, used to output pixel blocks of the weld seam area.
[0054] Specifically, a multi-scale mask fusion module can be used to eliminate multi-scale mask deviations and improve the pixel-level accuracy of the mask. Then, a coordinate mapping module can be used to accurately locate the actual pixel blocks. Finally, the output module can be used to output the pixel blocks of the weld area.
[0055] Preferably, the specific structure of the multi-scale mask fusion module includes a fine-scale shared feature extraction unit, a medium-scale shared feature extraction unit, and a coarse-scale shared feature extraction unit designed in parallel, as well as a pixel mask prediction unit connected to the output of each shared feature extraction unit: The fine-scale shared feature extraction unit is used to extract fine-scale mask prediction features through shared convolution; The mesoscale shared feature extraction unit is used to extract mesoscale mask prediction features through shared convolution; The coarse-scale shared feature extraction unit is used to extract coarse-scale mask prediction features through shared convolution; The pixel mask prediction unit is used to perform semantic segmentation on the fine / medium / coarse scale mask prediction features to predict the fused pixel mask of the weld area and the workpiece edge.
[0056] Specifically, the corresponding scale mask prediction features can be extracted by the fine / medium / coarse scale shared feature extraction unit through shared convolution to adapt to the corresponding scale mask prediction requirements and improve prediction accuracy. Then, the pixels are accurately segmented by the pixel mask prediction unit.
[0057] S13: Input the current workpiece surface image into the trained weld recognition model to obtain the current weld area pixel block and the current workpiece edge pixel block.
[0058] Specifically, one option, but not limited to, inputting the currently acquired workpiece surface image into the trained weld recognition model to obtain the current weld region pixel block.
[0059] In another embodiment of the present invention, a method for obtaining weld seam region pixel blocks is also provided. This involves acquiring several workpiece surface images and labeling the weld seam region pixel blocks therein to construct a training dataset. Acquiring real workpiece images ensures that the model training closely resembles actual application scenarios. Labeling the weld seam region and workpiece edges facilitates subsequent accurate positioning and offset judgment. Then, based on the training dataset, a weld seam recognition model is constructed and trained, taking the workpiece surface image as input and the weld seam region pixel blocks as output. This model includes: an input layer for preprocessing and standardizing the workpiece surface image to obtain an optimized surface image, thereby eliminating environmental noise and enhancing model robustness; and a feature extraction layer for performing multi-dimensional feature extraction and scale-based enhancement on the optimized surface image. The process involves several steps: First, a multi-scale enhanced feature map is obtained. This map extracts local and global information through different receptive fields (e.g., using dilated convolution and multi-branch structures), better capturing the thickness variations and complex shapes of the weld. Second, a feature fusion layer performs cross-scale fusion and boundary optimization on the multi-scale enhanced feature map, resulting in a fused feature map with clear boundaries and uniform scale. This combines low-level details (edges, textures) with high-level semantics (region categories) to improve segmentation accuracy. Third, an output layer performs localization, filtering, and pixel integration on the fused feature map to obtain weld region pixel blocks. Based on the judgment results of other structures, it outputs the weld region pixel blocks in the workpiece surface image, completing weld recognition. Finally, the current workpiece surface image is input into the trained weld recognition model to obtain the current weld region pixel blocks. This effectively improves the recognition accuracy of weld pixel blocks.
[0060] On the other hand, the present invention also provides a computer storage medium storing executable program code; the executable program code is used to execute any of the above-mentioned weld seam offset identification methods.
[0061] On the other hand, the present invention also provides a terminal device, including a memory and a processor; the memory stores program code that can be executed by the processor; the program code is used to execute any of the above-described weld seam offset identification methods.
[0062] For example, the program code can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the program code in the terminal device.
[0063] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the terminal device may also include input / output devices, network access devices, buses, etc.
[0064] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0065] The memory can be an internal storage unit of the terminal device, such as a hard drive or RAM. The memory can also be an external storage device of the terminal device, such as a plug-in hard drive, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal and external storage units of the terminal device. The memory is used to store the program code and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or will be output.
[0066] The computer storage medium and terminal equipment described above are created based on the weld offset identification method described above. Their technical functions and beneficial effects will not be elaborated here. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above 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.
[0067] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for identifying weld offset, characterized in that, include: Obtain pixel blocks of the weld seam area; The pixels of the current workpiece edge region are obtained and a straight line is fitted to obtain the boundary equation. The boundary equation is then translated a set distance in a set direction to obtain the weld boundary line. Obtain the extreme coordinate values of each pixel in the current weld area pixel block in the vertical direction of the weld boundary line, and calculate the distance between each extreme coordinate value and the weld boundary line to obtain the left offset value and the right offset value. Based on the left and right offset values, determine whether the weld has shifted.
2. The method according to claim 1, characterized in that, Based on the left and right offset values, determine whether the weld has shifted, including: Determine whether the left and right offset values are less than the set distance threshold; if so, the weld seam is offset. If not, obtain the ratio between each offset value and determine whether it is within the set ratio range. If yes, the weld has not shifted; otherwise, the weld has shifted.
3. The method according to claim 1, characterized in that, Methods for obtaining pixel blocks in the weld seam region include: Collect several workpiece surface images and label the pixel blocks of the weld area to construct a training dataset; Based on the training dataset, a weld recognition model is constructed and trained, taking the workpiece surface image as input and the weld region pixel block as output, including: The input layer is used to preprocess and standardize the workpiece surface image to obtain an optimized surface image to eliminate environmental noise; The feature extraction layer is used to perform multi-dimensional feature extraction and scale-based enhancement operations on the optimized surface image to obtain a multi-scale enhanced feature map. The feature fusion layer is used to perform cross-scale fusion and boundary optimization operations on multi-scale enhanced feature maps to obtain fused feature maps with clear boundaries and uniform scale. The output layer is used to locate, filter, and integrate pixels in the fused feature map to obtain pixel blocks of the weld seam region. Input the current workpiece surface image into the trained weld recognition model to obtain the current weld area pixel block.
4. The method according to claim 3, characterized in that, The specific structure of the input layer includes a filtering module, a multi-scale preprocessing and fusion module, and a data distribution calibration module connected in sequence: The filtering module is used to perform median filtering, bilateral filtering and Gaussian filtering on the workpiece surface image in parallel to obtain the median filtered image, bilateral filtered image and Gaussian filtered image; The multi-scale preprocessing fusion module is used to perform size alignment, channel stitching, and feature fusion on median filtered images, bilateral filtered images, and Gaussian filtered images to obtain fused preprocessed images. The data distribution calibration module is used to perform batch normalization (BN) and mean / variance calibration on the fused preprocessed image to obtain an optimized surface image.
5. The method according to claim 4, characterized in that, The specific structure of the filtering module includes a median filter unit, a bilateral filter unit, and a Gaussian filter unit designed in parallel: The median filtering unit is used to perform neighborhood median replacement on the workpiece surface image to suppress discrete noise points and obtain a median filtered image. The bilateral filtering unit is used to perform weighted filtering on the workpiece surface image by combining spatial distance and gray-level similarity to obtain a bilaterally filtered image; The Gaussian filtering unit is used to perform Gaussian kernel weighted average smoothing on the workpiece surface image to obtain a Gaussian filtered image.
6. The method according to claim 3, characterized in that, The specific structure of the feature extraction layer includes parallel convolutional modules and feature decoupling modules designed in parallel: The parallel convolution module is used to perform local feature extraction and horizontal and vertical morphology capture convolution operations on the optimized surface image in parallel to obtain morphology enhancement feature maps. The feature decoupling module is used to extract grayscale differences, edge gradients, and surface texture features from the optimized surface image in parallel to obtain a dimension-enhanced feature map. The dual-path feature fusion module is connected to the outputs of the parallel convolution module and the feature decoupling module. It is used to fuse the morphological enhancement feature map and the dimension enhancement feature map to obtain the dual-path fused feature map. The feature attention enhancement module, connected to the output of the dual-path feature fusion module, is used to perform scale-wise downsampling and global feature aggregation on the dual-path fusion feature map to obtain a multi-scale enhanced feature map.
7. The method according to claim 6, characterized in that, The specific structure of the parallel convolution module includes parallel-designed local feature extraction convolution units, horizontal morphology capture convolution units, and vertical morphology capture convolution units: The local feature extraction convolution unit is used to perform square kernel convolution on the optimized surface image to extract local features of the image and obtain a local detail feature map; The horizontal morphology capture convolutional unit is used to perform longitudinal convolution on the optimized surface image to extract the horizontal orientation features of the image and obtain the horizontal morphology feature map. The vertical morphology capture convolution unit is used to perform transverse convolution on the optimized surface image to extract the vertical orientation features of the image and obtain the vertical morphology feature map. The spatial attention fusion unit is connected to the outputs of the local feature extraction convolutional unit, the horizontal morphology capture convolutional unit, and the vertical morphology capture convolutional unit. It is used to assign weights to and fuse the local detail feature map, the horizontal morphology feature map, and the vertical morphology feature map to obtain the spatial focus feature map. The semantic feature enhancement unit, connected to the output of the spatial attention fusion unit, is used to enhance the semantic features of the spatial focus feature map to distinguish between weld seams and workpiece edges, thereby obtaining a morphological enhancement feature map.
8. The method according to claim 6, characterized in that, The specific structure of the feature attention enhancement module includes fine-scale feature downsampling units, medium-scale feature downsampling units, and coarse-scale feature downsampling units arranged in parallel, as well as several global feature aggregation SPPF units: The fine-scale feature downsampling unit is used to downsample the dual-path fused feature map to a fine scale to obtain a fine-scale downsampled feature map; The fine-scale global feature aggregation SPPF unit is connected to the output of the fine-scale feature downsampling unit. It is used to perform fine-scale pooling operation on the dual-path fusion feature map, extract fine-scale global features, and aggregate fine-scale local features and fine-scale global features to obtain a fine-scale global aggregated feature map. The mesoscale feature downsampling unit is used to downsample the dual-path fused feature map to the mesoscale to obtain the mesoscale downsampled feature map; The mesoscale global feature aggregation SPPF unit is connected to the output of the mesoscale feature downsampling unit. It is used to perform mesoscale pooling operation on the dual-path fusion feature map, extract mesoscale global features, and aggregate mesoscale local features and mesoscale global features to obtain a mesoscale global aggregated feature map. The coarse-scale feature downsampling unit is used to downsample the dual-path fused feature map to a coarse scale to obtain a coarse-scale downsampled feature map; The coarse-scale global feature aggregation SPPF unit is connected to the output of the coarse-scale feature downsampling unit. It is used to perform coarse-scale pooling operation on the dual-path fusion feature map, extract coarse-scale global features, and aggregate coarse-scale local features and coarse-scale global features to obtain a coarse-scale global aggregated feature map.
9. The method according to claim 3, characterized in that, The specific structure of the feature fusion layer includes a parallel design of fine-scale adaptive weighted PAFPN modules, a mid-scale adaptive weighted PAFPN module, and a coarse-scale adaptive weighted PAFPN module: The fine-scale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the fine-scale global aggregated feature map to obtain a fine-scale adaptive fused feature map. The mesoscale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the mesoscale global aggregated feature map to obtain the mesoscale adaptive fused feature map. The coarse-scale adaptive weighted PAFPN module is used to perform PAFPN fusion of deep and shallow features and scale feature weight calibration on the coarse-scale global aggregated feature map to obtain a coarse-scale adaptive fused feature map. The local feature fusion module is connected to the outputs of the fine-scale adaptive weighted PAFPN module and the meso-scale adaptive weighted PAFPN module. It is used to fuse the fine-scale adaptive fusion feature map and the meso-scale adaptive fusion feature map to obtain the local fusion feature map. The global feature fusion module is connected to the outputs of the local feature fusion module and the coarse-scale adaptive weighted PAFPN module. It is used to fuse the local fusion feature map and the coarse-scale adaptive fusion feature map to obtain the global fusion feature map. The Sobel boundary enhancement module is connected to the output of the global feature fusion module. It is used to extract the gradient boundary of the global fusion feature map using the Sobel operator to obtain the gradient boundary feature map. The Canny boundary enhancement module is connected to the output of the global feature fusion module and is used to extract strong edges from the global fusion feature map using the Canny operator to obtain a strong edge feature map. The boundary feature fusion module, connected to the outputs of the Sobel boundary enhancement module and the Canny boundary enhancement module, is used to fuse gradient boundary feature maps and strong edge feature maps to obtain a fused feature map.
10. The method according to claim 6, characterized in that, The specific structure of the output layer includes a multi-scale mask fusion module and a coordinate mapping module connected in sequence: The multi-scale mask fusion module is used to extract shared features at multiple scales, then predict pixel masks to obtain multi-scale masks, and then fuse them to obtain fused pixel masks. The coordinate mapping module is used to obtain the pixel blocks of the weld area by mapping the coordinates of the fused pixel mask to the pixels of the workpiece surface image; Output module, used to output pixel blocks of the weld seam area.