Pool weld detection method and system based on line anchor classification and cyclic feature aggregation
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG UNIV OF SCI & TECH
- Filing Date
- 2026-07-03
- Publication Date
- 2026-08-07
AI Technical Summary
[0006]本发明的目的在于提供一种基于行锚分类与循环特征聚合的熔池焊缝检测方法、系统,以解决现有在复杂熔池背景下,对稀疏细长焊缝结构难以兼顾检测精度与推理效率的问题
Smart Images

Figure CN122530197A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image detection technology, specifically relating to a method and system for detecting weld pool seams based on row anchor classification and cyclic feature aggregation. Background Technology
[0002] With the deep integration of intelligent manufacturing and welding automation technologies, welding production is rapidly developing towards intelligence, unmanned operation, and high precision. As a key feature determining weld formation quality and structural strength, the weld seam plays a crucial role in closed-loop control, defect early warning, and path planning during the welding process. Molten pool images, as the most direct and real-time visual information carrier during welding, can simultaneously reflect the weld seam formation state and dynamic changes, serving as a key data source for online weld seam inspection and process control. Furthermore, relying on low-cost visual acquisition equipment such as industrial cameras, it offers significant economic and engineering deployment advantages.
[0003] However, in actual industrial welding scenarios, molten pool images are subject to complex interferences such as strong reflections, arc noise, smoke and dust interference, and blurred bevels. Furthermore, the weld seam exhibits a sparse, slender, and continuous linear structure, which is easily obscured by the background, making it difficult to balance weld seam detection accuracy and real-time performance.
[0004] Current weld detection methods rely on manually designed features such as edge extraction, threshold segmentation, and curve fitting, resulting in weak generalization ability and poor anti-interference capabilities. They are only suitable for simple working conditions and cannot work stably in complex molten pool environments. Deep learning-based weld detection methods also have shortcomings, including fast target detection methods but insufficient fine representation capabilities for slender welds; high accuracy semantic segmentation methods but high per-pixel computational overhead, making it difficult to meet the needs of real-time industrial inspection; and key point detection methods have good adaptability, but their robustness and weld continuity modeling capabilities need improvement.
[0005] Therefore, existing methods, in the context of complex molten pools and for sparse and slender weld structures, cannot balance detection accuracy and inference efficiency, and are difficult to adapt to the industrial needs of online monitoring of welding conditions in molten pool images. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for detecting weld seams in molten pools based on row anchor classification and cyclic feature aggregation, so as to solve the problem that existing methods are difficult to balance detection accuracy and inference efficiency for sparse and slender weld seam structures in complex molten pool backgrounds.
[0007] To achieve the above objectives, the technical solution of the present invention is as follows.
[0008] A method and system for detecting molten pool welds based on row anchor classification and cyclic feature aggregation includes the following steps: S1. Obtain the weld pool image and perform preliminary feature extraction on the image to obtain a small-scale feature map; perform channel attention enhancement and spatial attention enhancement on the small-scale feature map in sequence to obtain a small-scale enhanced feature map; downsample the small-scale feature map step by step, and perform channel attention enhancement and spatial attention enhancement in sequence after each downsampling to gradually obtain a medium-scale feature map and a large-scale feature map; S2. Slice the large-scale enhanced feature map along the horizontal and vertical directions, and perform a cyclic shift operation on the sliced large-scale enhanced feature map to obtain the global feature map; S3. Predict anchor welds row by row on the global feature map using the detector, and calculate the row anchor classification loss based on the confidence probability of the weld at each grid position within the row anchor. After upsampling the small, medium and large scale attention-enhanced feature maps respectively, channel stitching is performed to obtain multi-scale fusion features. The multi-scale fusion features are then adaptively upsampled step by step to obtain a feature map with the same size as the weld pool image in S1. Segmentation prediction is performed based on this feature map and the segmentation loss is calculated. The total loss is calculated based on segmentation loss, row anchor classification loss, and structural constraint loss. When the total loss meets the threshold requirement, the weld position is determined based on the row anchor weld prediction results.
[0009] Preferably, the cyclic shift operation includes: Set an initial iteration step size, and the features of each row receive the shifted features; as the number of iterations increases, the shift step size is gradually increased until the iteration ends, and the global information of the feature map can be aggregated at each position.
[0010] Preferably, the adaptive upsampling operation includes: For multi-scale fusion features, feature extraction is performed through a dual-branch approach: one branch uses bilinear interpolation to upsample and obtain detailed features; the other branch uses transposed convolution to upsample and obtain semantic features; the two features are then fused into an upsampled result based on adaptive weights.
[0011] Preferably, channel attention enhancement includes the following operations: The feature map is input into the parallel max pooling branch and average pooling branch, and then the branch weights are assigned through a shared multilayer perceptron. The max pooling features and average pooling features output from the parallel branches are weighted and fused, and then the channel attention enhancement features are obtained through an activation function.
[0012] Preferably, spatial attention enhancement includes the following operations: The channel attention-enhanced feature maps are processed by global average pooling and global max pooling respectively. The processed results are concatenated and fed into a 7×7 convolutional layer, and then normalized by the activation function to generate spatial attention weights. The channel-enhanced features are weighted and fused using spatial attention weights to obtain spatial attention-enhanced feature maps.
[0013] Preferably, row-by-row anchor point weld prediction includes: Using the global feature map as input, a detector classifies the grid cells corresponding to each row of anchor points, and outputs the predicted probability that the grid cell corresponding to each row of anchors contains a weld.
[0014] Preferably, row anchor classification loss , is represented as: , in, Indicates that there is One weld seam P represents the number of anchors. ij T represents the probability of the weld location. ij Labels indicating the actual location of the weld. This represents the cross-entropy loss.
[0015] A weld pool inspection system based on row anchor classification and cyclic feature aggregation includes: The feature enhancement module acquires the weld pool image, performs preliminary feature extraction on the image to obtain a small-scale feature map; performs channel attention enhancement and spatial attention enhancement on the small-scale feature map in sequence to obtain a small-scale enhanced feature map; and downsamples the small-scale feature map step by step, and performs channel attention enhancement and spatial attention enhancement in sequence after each downsampling step to gradually obtain a medium-scale feature map and a large-scale feature map. The global feature enhancement module slices the large-scale enhanced feature map along the horizontal and vertical directions, and then performs a cyclic shift operation on the sliced large-scale enhanced feature map to obtain the global feature map. The weld prediction module uses a detector to predict anchor welds row by row on the global feature map. It calculates the row anchor classification loss based on the confidence probability of the weld at each grid position within the row anchor. After upsampling the small, medium and large scale attention-enhanced feature maps respectively, channel stitching is performed to obtain multi-scale fusion features. The multi-scale fusion features are then adaptively upsampled step by step to obtain a feature map with the same size as the weld pool image in the feature enhancement module. Segmentation prediction is performed based on this feature map and the segmentation loss is calculated. The total loss is calculated based on the segmentation loss, row anchor classification loss, and structural constraint loss. When the total loss meets the threshold requirement, the weld position is determined based on the row anchor weld prediction results. Preferably, the global feature enhancement module includes: The cyclic shift module sets an initial iteration step size, and the features of each row receive the shifted features. As the number of iterations increases, the shift step size is gradually increased until the iteration ends. Global information of the feature map can be aggregated at each position.
[0016] Preferably, the output module includes: The adaptive upsampling module extracts features from multi-scale fused features through a dual-branch approach: one branch uses bilinear interpolation to upsample and obtain detailed features, while the other branch uses transposed convolution to upsample and obtain semantic features. The two features are then fused into an upsampled result based on adaptive weights.
[0017] Compared with the prior art, the technical solution provided by this invention has the following advantages: By performing channel attention enhancement and spatial attention enhancement on feature maps of different scales, the feature extraction capability for slender and sparse weld seam structures is improved, and background interference is effectively suppressed.
[0018] By using a cyclic shift feature aggregation method, the spatial distribution features of the melt pool image are extracted efficiently, effectively reducing the number of parameters and significantly lowering the computational complexity caused by traditional semantic segmentation pixel-by-pixel segmentation.
[0019] Transforming the pixel-by-pixel image detection task into detecting weld seams based on row anchor classification effectively reduces computational complexity and improves inference efficiency.
[0020] In the auxiliary branch, progressive recovery of multi-scale features is achieved through adaptive upsampling, which effectively enhances the ability to represent edge details in the weld area and improves detection accuracy. Attached Figure Description
[0021] Figure 1 The above are simulation images of weld seam inspection under different brightness levels according to the present invention. Detailed Implementation
[0022] To further understand the content of this invention, a detailed description of the invention is provided in conjunction with embodiments. A method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation includes the following steps: S1. Obtain the weld pool image and perform preliminary feature extraction on the image to obtain a small-scale feature map; perform channel attention enhancement and spatial attention enhancement on the small-scale feature map in sequence to obtain a small-scale enhanced feature map; downsample the small-scale feature map step by step, and perform channel attention enhancement and spatial attention enhancement in sequence after each downsampling to gradually obtain a medium-scale feature map and a large-scale feature map.
[0023] Acquire images of the weld pool, which contain complex industrial interference backgrounds such as weld pool highlights, arc interference, and messy textures, while also covering the slender and sparse structural features of the weld.
[0024] Considering that weld inspection has high requirements for feature representation capabilities in complex industrial scenarios, this invention adopts a lightweight residual convolutional network. In order to address the problem that weld targets in molten pool images are sparsely distributed, have a slender structure, and are easily affected by complex backgrounds, a channel-space hybrid attention mechanism is introduced in the residual module to enhance the feature representation capability of the weld region.
[0025] First, the image is subjected to multi-level convolution operations to extract preliminary features. After downsampling in the first residual module, a small-sized feature map with C channels, H height, and W width is obtained. .
[0026] Preferably, channel attention enhancement includes the following operations: The feature map is input into the parallel max pooling branch and average pooling branch, and then the branch weights are assigned through a shared multilayer perceptron. The max pooling features and average pooling features output from the parallel branches are weighted and fused, and then the channel attention enhancement features are obtained through an activation function.
[0027] For small-sized feature maps Global pooling is performed to aggregate global feature information from each channel, and the weights of each channel are adaptively learned using shared multilayer perceptrons. It dynamically enhances the effective features of the weld and suppresses ineffective interference features, achieving adaptive feature enhancement in the channel dimension.
[0028] Weights of each channel The calculation formula is expressed as follows: , in, This indicates a global average pooling operation; This represents the global max pooling operation; This indicates that the multi-layer perceptron operation is shared, and the output features of average pooling and max pooling are compressed in dimension and mapped in feature mapping respectively. The same set of parameters is used throughout the process, and the importance of each channel is obtained without increasing the amount of computation. This represents the activation function, which maps the fused features to the 0~1 range.
[0029] Specifically, by using a shared set of parameters throughout the entire process, the weights of each channel can be determined. Represented as: , in, For the first layer shared weights, The second layer uses shared weights, where r is the channel reduction ratio. express Features after global pooling express Features after global max pooling.
[0030] Finally, the weights of each channel are... Element-wise multiplication with the feature map yields the channel-enhanced feature map. , is represented as: .
[0031] By dynamically weighting the channel dimensions, the network's responsiveness to key weld feature channels is enhanced. Furthermore, spatial attention is used to focus on the weld region, suppressing background interference.
[0032] Preferably, spatial attention enhancement includes the following operations: The channel attention-enhanced feature maps are processed by global average pooling and global max pooling respectively. The processed results are concatenated and fed into a 7×7 convolutional layer, and then normalized by the activation function to generate spatial attention weights. The channel-enhanced features are weighted and fused using spatial attention weights to obtain spatial attention-enhanced feature maps.
[0033] First, calculate the spatial attention weights. : , in, express Convolution operation, and The terms "channel dimension compression" and "aggregate" represent the compression of channel dimensions, transforming c channel information into a single-channel two-dimensional spatial feature map. Average pooling captures the overall grayscale and texture distribution of the spatial region, while max pooling highlights local response areas such as weld edges and molten pool contours.
[0034] Spatial attention weights and channel enhancement features Weighted fusion is performed to obtain small-scale enhanced feature maps. , is represented as: .
[0035] The small-scale enhanced feature map is input into the second residual module, and after downsampling, a medium-scale feature map is output. The channel attention enhancement and spatial attention enhancement are performed sequentially to obtain the medium-scale enhanced feature map. The medium-scale enhanced feature map is input into the third residual module, and after downsampling, a large-scale feature map is output. The channel attention enhancement and spatial attention enhancement are performed sequentially to obtain the large-scale enhanced feature map.
[0036] Specifically, the small-scale feature map is downsampled and output by the first residual module, with a resolution of 36×100 and 128 channels, focusing on weld details and edge texture information; the medium-scale feature map is downsampled and output by the second residual module, with a resolution of 18×50 and 256 channels, integrating detailed and global semantic information, focusing on the overall structure of the weld; the large-scale feature map is downsampled and output by the third residual module, with a resolution of 9×25 and 512 channels, focusing on global semantic information.
[0037] S2. Slice the large-scale enhanced feature map along the horizontal and vertical directions. Perform a cyclic shift operation on the sliced large-scale enhanced feature map to obtain the global feature map.
[0038] Because the weld bevel in molten pool images has a sparse distribution and a long, continuous structure, it is difficult to extract its spatial features through local convolution. Therefore, this invention aggregates spatial information by cyclically shifting features. In the vertical direction, information aggregation is performed using a two-way information transfer method, from bottom to top and from top to bottom. In the horizontal direction, information aggregation is performed using a two-way information transfer method, from left to right and from right to left.
[0039] Furthermore, during the bidirectional cyclic shifting process in both vertical and horizontal directions, the same set of convolutional weights is reused for convolutional layers with the same shift step size in the same operation direction to reduce computational overhead.
[0040] The feature map is divided into M slices in the horizontal direction and N slices in the vertical direction. Taking the information transmission from bottom to top as an example, the slice index starts from 0 and ends at M-1.
[0041] Preferably, the cyclic shift operation includes: Set an initial iteration step size, and the features of each row receive the shifted features; as the number of iterations increases, the shift step size is gradually increased until the iteration ends, and the global information of the feature map can be aggregated at each position.
[0042] In the initial iteration (iteration number k=0), a cyclic shift operation with a step size of 1 is used, and the feature slice x of each row is... i+1 Can receive slice x i The shifted features, due to the use of a bidirectional cyclic shift strategy, allow slice x0 to receive slice x. h-1 Features after shift.
[0043] As the number of iterations increases, the shift step size The calculation formula is expressed as: , Where k is the number of iterations. In this case, N is the number of slices in the vertical direction of the feature map.
[0044] As can be seen from the shifting step formula, as the number of iterations increases, the shifting step gradually increases, enabling features to spread across a greater spatial distance.
[0045] Taking slice x2 as an example, in the second iteration, slice x2 can receive the features of slice x0. Combining the features of slice x1 that slice x2 has received in the initial iteration, and the features of slice x that slice x0 has received, h-1 it only takes two iterations for x2 to aggregate all the information of x2, x1, x0, and x h-1 .
[0046] Through the feature aggregation method of cyclic shifting, after K iterations, each position can aggregate the global information of the feature map, thereby enhancing the network's ability to model the spatial dependence relationship of the molten pool image, improving the feature expression ability of the continuous structure of the weld seam, and providing more sufficient global semantic information for subsequent weld seam positioning.
[0047] S3. Perform row-by-row anchor weld prediction on the global feature map through a detector, and calculate the row anchor classification loss based on the confidence probability of the weld seam at each grid position within the row anchor; After separately upsampling the small, medium, and large-scale attention-enhanced feature maps, perform channel splicing to obtain multi-scale fusion features. Perform progressive adaptive upsampling on the multi-scale fusion features to obtain a feature map with the same size as the molten pool weld image in S1, and perform segmentation prediction and calculate the segmentation loss based on this feature map; Calculate the total loss based on the segmentation loss, row anchor classification loss, and structural constraint loss. When the total loss meets the threshold requirement, determine the weld seam position according to the row-by-row anchor weld prediction result.
[0048] This invention is different from traditional object detection. A weld groove usually spans the entire image, which requires the network to have a sufficiently large receptive field to receive global features. However, performing discriminative output on the global feature map through a fully connected layer will greatly increase the computational cost.
[0049] Therefore, this invention uses a row anchor-based classification method to replace the fully connected layer to complete the position recognition of the weld seam. By setting several row anchor points in each row of the feature map, the pixel-level weld seam detection task is transformed into screening and matching the row anchor points of the weld seam target, and the weld seam positioning is achieved through the classification judgment of the row anchor points, effectively reducing the computational overhead.
[0050] Assume that the pixel height of the molten pool image is H, the pixel width is W, and there are C weld seams. The predefined number of row anchor points h and the number of grid cells w are much smaller than the size of the molten pool image, that is, h << H and w << W. According to the per-pixel weld seam detection method, it is necessary to classify each pixel into C + 1 dimensions (weld seam and non-weld seam areas), so the computational cost is H × W × (C + 1).
[0051] The row anchor-based classification method only requires (w+1)-dimensional classification for C weld seams and h row anchors. That is, for the h row anchors, at most (w+1)-dimensional classification is performed to determine which grid cell the weld seam falls into; classification prediction is performed on the grid cell corresponding to each row anchor, outputting the confidence probability of the weld seam's position in each grid cell within that row anchor, thereby determining the weld seam coordinates. Therefore, the computational cost of this invention is only C×h×(w+1), far less than the pixel-by-pixel weld seam detection method, significantly reducing computational complexity.
[0052] Preferably, row-by-row anchor point weld prediction includes: Using the global feature map as input, a detector classifies the grid cells corresponding to each row of anchor points, and outputs the predicted probability that the grid cell corresponding to each row of anchors contains a weld.
[0053] In weld location prediction, let X be the global feature map after cyclic feature shifting and aggregation. If the detector is selected at weld position i on the j-th row anchor, then the probability of the weld position is... , is represented as: , in, Indicates the number of anchors. It is a w+1 dimensional vector, representing the probability that each grid is a weld location.
[0054] Based on the probability of the weld location and the actual weld location label, calculate the row anchor classification loss. .
[0055] Preferably, row anchor classification loss , is represented as: , in, Indicates that there is One weld seam P represents the number of anchors. ij T represents the probability of the weld location. ij Labels indicating the actual location of the weld. This represents the cross-entropy loss.
[0056] This invention uses a global feature map to predict the probability distribution of all positions on each row anchor point, and continuously optimizes the accuracy of the prediction during the training phase, so that the accurate position of the weld can be determined based on the prediction results.
[0057] In the welding scenario of this invention, the weld seam in the molten pool image is a continuous, thin, straight line, and the weld seams on adjacent anchors are close to each other, which can make P ijThe offset at the corresponding position serves as the basis for representing the weld structure. By applying constraints to the offset, the network learns the structural information of the weld, thus resulting in a structural constraint loss for the weld. , is represented as: , By calculating the L1 distance between the prediction results of adjacent row anchor points, the prediction of the weld at adjacent positions is constrained to remain continuous and smooth, fully extracting the continuous structure of the weld and improving the stability of the detection results.
[0058] To improve the robustness of weld inspection tasks, this invention introduces an auxiliary segmentation branch, using pixel-level supervision signals as auxiliary training constraints.
[0059] Specifically, the auxiliary branch is only used during the training phase and does not participate in the computation during the inference phase.
[0060] Specifically, during the training phase, features at different scales, including three resolutions of 36×100, 18×50, and 9×25, are compressed to 128 dimensions through 1×1 convolution. Then, features at each scale are upsampled and processed to unify the resolution to 36×100 before being stitched together along the channel dimension to generate 384-dimensional multi-scale fusion features. The multi-scale fusion features are then adaptively upsampled at each level to obtain a feature map of the size of the weld pool image at the input, thus achieving full extraction of the local structural features of the weld.
[0061] Preferably, the adaptive upsampling operation includes: For multi-scale fusion features, feature extraction is performed through a dual-branch approach: one branch uses bilinear interpolation to upsample and obtain detailed features; the other branch uses transposed convolution to upsample and obtain semantic features; the two features are then fused into an upsampled result based on adaptive weights.
[0062] Multi-scale fusion features Two parallel upsampled feature maps are generated through bilinear interpolation and transposed convolution to obtain detailed features. and semantic features : , , in, This represents the bilinear interpolation operation. This indicates the transpose convolution operation.
[0063] The detailed features and semantic features are concatenated, and the weight parameters of the two features are learned through 3×3 convolution. The total weight is then output using the Softmax function. : , Decompose the weights into , The weights representing detailed features, The weights represent the semantic features. Through adaptive weighted fusion of the two feature streams, effective features are highlighted and redundant information is suppressed, resulting in an upsampling result. : .
[0064] By cascading the multi-scale fusion features through three adaptive upsampling processes, the feature map is gradually restored to the resolution of the original input image, providing high-detail feature support for the accurate positioning of the weld.
[0065] For the auxiliary branch, define pixel-level segmentation loss. The total loss Represented as row anchor classification loss Structural constraint loss and segmentation loss The sum is expressed as: , in, and These are the balance coefficients for the structural constraint loss and the auxiliary branch loss, respectively.
[0066] To further verify the effectiveness of the present invention, it was compared with two comparison algorithms (Method 1 and Method 2) and simulation verification was performed.
[0067] Method 1 uses a row anchor classification head strategy and adaptive upsampling-assisted segmentation branch to extract weld features, but it does not introduce channel-space hybrid attention enhancement technology, making it difficult to filter out molten pool specular interference and steel plate background noise. The segmented weld edge contour is redundantly expanded and locally attached discrete noise spots.
[0068] Method 2 introduces channel-space hybrid attention to complete feature selection optimization, but it lacks cyclic feature shifting and aggregation operations to build global feature associations. It also lacks global context modeling capabilities, and the detection results still have problems with low edge localization accuracy. Some areas deviate from the actual weld boundary, making it difficult to achieve fine characterization of the weld contour.
[0069] This invention relies on cyclic feature shifting and aggregation operations, and integrates multi-scale upsampling auxiliary branches and channel-space hybrid attention enhancement mechanisms to achieve precise weld seam segmentation. It can suppress noise in complex working conditions and finely fit the visible weld seam edge.
[0070] The configuration parameters used in this invention are shown in Table 1, and the experimental results are as follows: Figure 1 As shown.
[0071] Figure 1This image compares the weld inspection results under different light intensities. In the original image, solid lines represent the visible area of the weld, and dashed lines represent the obscured area. Figure 1 As can be seen, the present invention can detect the clear boundary of the weld and predict the hidden weld edge line in the area blocked by the welding torch, thus completing the complete contour detection of the entire weld.
[0072] Table 1 Network parameters of the present invention A weld pool inspection system based on row anchor classification and cyclic feature aggregation includes: The feature enhancement module acquires the weld pool image, performs preliminary feature extraction on the image to obtain a small-scale feature map; performs channel attention enhancement and spatial attention enhancement on the small-scale feature map in sequence to obtain a small-scale enhanced feature map; and downsamples the small-scale feature map step by step, and performs channel attention enhancement and spatial attention enhancement in sequence after each downsampling step to gradually obtain a medium-scale feature map and a large-scale feature map. The global feature enhancement module slices the large-scale enhanced feature map along the horizontal and vertical directions, and then performs a cyclic shift operation on the sliced large-scale enhanced feature map to obtain the global feature map. The weld prediction module uses a detector to predict anchor welds row by row on the global feature map. It calculates the row anchor classification loss based on the confidence probability of the weld at each grid position within the row anchor. After upsampling the small, medium and large scale attention-enhanced feature maps respectively, channel stitching is performed to obtain multi-scale fusion features. The multi-scale fusion features are then adaptively upsampled step by step to obtain a feature map with the same size as the weld pool image in the feature enhancement module. Segmentation prediction is performed based on this feature map and the segmentation loss is calculated. The total loss is calculated based on segmentation loss, row anchor classification loss, and structural constraint loss. When the total loss meets the threshold requirement, the weld position is determined based on the row anchor weld prediction results.
[0073] Preferably, the global feature enhancement module includes: The cyclic shift module sets an initial iteration step size, and the features of each row receive the shifted features. As the number of iterations increases, the shift step size is gradually increased until the iteration ends. Global information of the feature map can be aggregated at each position.
[0074] Preferably, the output module includes: The adaptive upsampling module extracts features from multi-scale fused features through a dual-branch approach: one branch uses bilinear interpolation to upsample and obtain detailed features, while the other branch uses transposed convolution to upsample and obtain semantic features. The two features are then fused into an upsampled result based on adaptive weights.
Claims
1. A method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation, characterized in that, Includes the following steps: S1. Obtain the weld pool image and perform preliminary feature extraction on the image to obtain a small-scale feature map; perform channel attention enhancement and spatial attention enhancement on the small-scale feature map in sequence to obtain a small-scale enhanced feature map; downsample the small-scale feature map step by step, and perform channel attention enhancement and spatial attention enhancement in sequence after each downsampling to gradually obtain a medium-scale feature map and a large-scale feature map; S2. Slice the large-scale enhanced feature map along the horizontal and vertical directions, and perform a cyclic shift operation on the sliced large-scale enhanced feature map to obtain the global feature map; S3. Predict anchor welds row by row on the global feature map using the detector, and calculate the row anchor classification loss based on the confidence probability of the weld at each grid position within the row anchor. After upsampling the small, medium and large scale attention-enhanced feature maps respectively, channel stitching is performed to obtain multi-scale fusion features. The multi-scale fusion features are then adaptively upsampled step by step to obtain a feature map with the same size as the weld pool image in S1. Segmentation prediction is performed based on this feature map and the segmentation loss is calculated. The total loss is calculated based on segmentation loss, row anchor classification loss, and structural constraint loss. When the total loss meets the threshold requirement, the weld position is determined based on the row anchor weld prediction results.
2. The method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation according to claim 1, characterized in that... The cyclic shift operation in S2 includes: Set an initial iteration step size, and the features of each row receive the shifted features; as the number of iterations increases, the shift step size is gradually increased until the iteration ends, and the global information of the feature map can be aggregated at each position.
3. The method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation according to claim 1, characterized in that... The adaptive upsampling operation in S3 includes: For multi-scale fusion features, feature extraction is performed through a dual-branch approach: one branch uses bilinear interpolation to upsample and obtain detailed features; the other branch uses transposed convolution to upsample and obtain semantic features; the two features are then fused into an upsampled result based on adaptive weights.
4. The method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation according to claim 1, characterized in that... Channel attention enhancement in S1 includes the following operations: The feature map is input into the parallel max pooling branch and average pooling branch, and then the branch weights are assigned through a shared multilayer perceptron. The max pooling features and average pooling features output from the parallel branches are weighted and fused, and then the channel attention enhancement features are obtained through an activation function.
5. The method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation according to claim 1, characterized in that... Spatial attention enhancement in S1 includes the following operations: The feature maps enhanced by channel attention are processed by global average pooling and global max pooling respectively. The processed results are concatenated and fed into a 7×7 convolutional layer, and then normalized by the activation function to generate spatial attention weights. The spatial attention-enhanced feature map is obtained by weighting and fusing the channel enhancement features using spatial attention weights.
6. The method for detecting molten pool welds based on row anchor classification and cyclic feature aggregation according to claim 1, characterized in that... The row-by-row anchor point weld prediction in S3 includes: Using the global feature map as input, a detector is used to classify the grid cells corresponding to each row of anchor points, and the predicted probability that the grid cells corresponding to each row of anchors contain welds is output.
7. The molten pool weld detection method based on row anchor classification and cyclic feature aggregation according to claim 1, wherein the row anchor classification loss in S3... , is represented as: , in, Indicates that there is One weld seam P represents the number of anchors. ij T represents the probability of the weld location. ij Labels indicating the actual location of the weld. This represents the cross-entropy loss.
8. A weld pool inspection system based on row anchor classification and cyclic feature aggregation, characterized in that, include: The feature enhancement module acquires images of the molten pool weld and performs preliminary feature extraction to obtain small-scale feature maps. Channel attention enhancement and spatial attention enhancement are sequentially performed on the small-scale feature map to obtain the small-scale enhanced feature map; the small-scale feature map is downsampled step by step, and channel attention enhancement and spatial attention enhancement are sequentially performed after each downsampling step to gradually obtain the medium-scale feature map and the large-scale feature map; The global feature enhancement module slices the large-scale enhanced feature map along the horizontal and vertical directions, and then performs a cyclic shift operation on the sliced large-scale enhanced feature map to obtain the global feature map. The weld prediction module uses a detector to predict anchor welds row by row on the global feature map. It calculates the row anchor classification loss based on the confidence probability of the weld at each grid position within the row anchor. After upsampling the small, medium and large scale attention-enhanced feature maps respectively, channel stitching is performed to obtain multi-scale fusion features. The multi-scale fusion features are then adaptively upsampled step by step to obtain a feature map with the same size as the weld pool image in the feature enhancement module. Segmentation prediction is performed based on this feature map and the segmentation loss is calculated. The total loss is calculated based on segmentation loss, row anchor classification loss, and structural constraint loss. When the total loss meets the threshold requirement, the weld position is determined based on the row anchor weld prediction results.
9. The molten pool weld inspection system based on row anchor classification and cyclic feature aggregation according to claim 8, characterized in that... The global feature enhancement module includes: The cyclic shift module sets an initial iteration step size, and the features of each row receive the shifted features. As the number of iterations increases, the shift step size is gradually increased until the iteration ends. Global information of the feature map can be aggregated at each position.
10. The molten pool weld inspection system based on row anchor classification and cyclic feature aggregation according to claim 8, characterized in that, The output module includes: The adaptive upsampling module extracts features from multi-scale fused features through a dual-branch approach: one branch uses bilinear interpolation to upsample and obtain detailed features, while the other branch uses transposed convolution to upsample and obtain semantic features. The two features are then fused into an upsampled result based on adaptive weights.