Friction stir welding seam defect intelligent detection method based on multi-scale alignment polymerization module
By combining a multi-scale alignment and aggregation module with friction stir welding, high-precision identification and real-time detection of friction stir welding defects are achieved, solving the problems of insufficient accuracy and real-time performance of traditional detection methods in complex industrial scenarios, and improving the accuracy and stability of detection.
Patent Information
- Application Number
- CN202511004611.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-10-28
AI Technical Summary
Existing technologies struggle to simultaneously identify millimeter-level flash and micron-level pore defects with high precision in friction stir welding. Furthermore, traditional detection methods lack real-time performance in complex industrial scenarios, resulting in poor detection accuracy and stability.
By combining a multi-scale alignment and aggregation module with friction stir welding, and through a multi-scale feature alignment mechanism, combined with data acquired by an industrial linear array camera and a laser 3D scanner, an adaptive feature aggregation strategy is designed. By combining depth information from an ultrasonic phased array with visual inspection, the spatial coordinates of defects can be accurately reconstructed. Furthermore, the computation path is optimized through a parallel feature filtering module to meet real-time detection requirements.
It achieves high-precision identification of defects in friction stir welding, reduces the rate of missed detection and false alarm, meets the real-time detection needs of industrial production lines, and improves the accuracy and stability of detection.
Smart Images

Figure CN120852879A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of weld defect detection technology, and in particular to an intelligent detection method for friction stir weld defects based on a multi-scale aligned aggregation module. Background Art
[0002] In friction stir welding (FSW), various defects such as burrs, porosity, and lack of fusion are easily generated during the process. Traditional manual inspection is inefficient and highly subjective. Existing non-destructive testing techniques such as X-ray and penetrant testing have limitations such as radiation pollution, high cost, and inability to accurately quantify the defects. Although automated inspection methods based on machine vision are widely used, they are affected by the complex plastic deformation of the weld surface, the overlap of multi-scale defects such as micron-level pores and millimeter-level burrs, and optical interference, resulting in difficulties in feature extraction and a high rate of missed detection.
[0003] Currently, the technical bottlenecks are as follows: single-scale feature aggregation models cannot simultaneously meet the high-precision identification requirements of extremely small holes and large-sized flash; geometric distortion caused by welding deformation leads to inaccuracy in the feature space, making traditional detection models sensitive to interference information and lacking stability; industrial sites simultaneously impose stringent requirements on real-time online detection systems for high detection accuracy and low processing latency, and existing methods struggle to balance these three performance indicators, severely restricting the level of automated and intelligent detection of friction stir welding quality. Therefore, it is necessary to design an intelligent detection method for friction stir welding defects based on a multi-scale alignment aggregation module. Summary of the Invention
[0004] The purpose of this invention is to provide an intelligent detection method for weld defects in friction stir welding based on a multi-scale aligned aggregation module, which solves the technical problems of insufficient accuracy and limited real-time performance of traditional detection methods in complex industrial scenarios.
[0005] This invention innovatively combines a multi-scale alignment aggregation (MAFM) module with the core technology of friction stir welding. Through a multi-scale feature alignment mechanism, it overcomes the limitations of traditional single-scale inspection for complex weld morphologies, simultaneously capturing millimeter-level flash and micron-level pore defects. Addressing the unique material flow characteristics of friction stir welding (such as surface irregularities caused by shoulder extrusion), its adaptive feature aggregation strategy effectively compensates for welding path deviations and, combined with depth information from an ultrasonic phased array and planar features from visual inspection, achieves precise reconstruction of defect spatial coordinates, solving the misjudgment problem of traditional planar inspection.
[0006] Meanwhile, by optimizing the computation path through a parallel feature filtering module, the time for a single inspection is reduced to less than 200ms while maintaining high accuracy at the 0.1mm level, meeting the real-time requirements of industrial production lines. This technical solution effectively avoids existing problems such as insufficient sensitivity of X-ray inspection to surface defects, inability of penetrant testing to quantitatively analyze defects, and high false alarm rates of single-sensor detection. Utilizing a multimodal data aggregation architecture, it ultimately achieves industrial-grade inspection standards for defect type identification accuracy and false negative rate.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A smart detection method for defects in friction stir welding seams based on a multi-scale aligned aggregation module, the method comprising the following steps:
[0009] Step 1: Construct a self-built dataset by simultaneously acquiring weld surface images and deformation data during the welding process using an industrial linear array camera and a laser 3D scanner;
[0010] Step 2: Design a multi-scale alignment aggregation module and a parallel feature filtering module. Through deformable convolution, the receptive field is dynamically adjusted to achieve accurate modeling of cross-scale geometric mapping relationships.
[0011] Step 3: A parallel dual-channel attention mechanism is adopted, which generates channel weights by combining global average pooling and max pooling, and combines the spatial weight allocation of Softmax normalization to achieve dynamic focusing on the key defect area of friction stir welding and rapid filtering of redundant background.
[0012] Step 4: Use depthwise separable convolution to replace traditional convolution, reducing the number of model parameters. By decoupling the head structure to separate classification and regression tasks, conflicting information interference is reduced, detection speed is improved, and the needs of industrial online detection are met.
[0013] Further, in step 1, defects such as flash, holes, lack of fusion, incomplete penetration, cracks, and shape defects (including porosity and shrinkage cavities, and undercut and weld beads) are identified. Image quality is improved through histogram equalization and noise filtering preprocessing. The self-built dataset is divided into training, validation, and test sets in a 6:2:2 ratio. Hardware deployment and data acquisition include: sensor layout on the friction stir welding machine, sampling rate settings, data synchronization, an industrial linear array camera (resolution ≥ 12 megapixels, frame rate ≥ 9 FPS) and a laser 3D scanner, and the establishment of a platform for synchronous acquisition of weld surface morphology and defects; configuration of an NVIDIA GPU accelerator card to improve model inference efficiency. Data acquisition methods include: sensor distribution and data acquisition on the friction stir welding machine, setting of stirring pin operating parameters, setting of sampling rate, selection of strong correlation parameters using grayscale correlation, and setting the ratio for dividing the generated dataset.
[0014] Furthermore, in step 2, the multi-scale alignment and aggregation module uses an improved YOLO-v5 backbone network to extract multi-scale features from layers C2 to C5. A baseline layer is selected, with layer C3 as the base. Cross-scale geometric mapping relationships are established through deformable convolutions, and bidirectional pyramid aggregation is used to pass high-level semantic features from top to bottom (C5 layer → C4 layer → C3 layer → C2 layer). Low-level detailed features are aggregated from bottom to top (C2 layer → C3 layer → C4 layer → C5 layer). Finally, all upsampled feature streams are concatenated to eliminate feature misalignment and semantic bias.
[0015] Furthermore, a parallel dual-channel attention mechanism is introduced after the output of the multi-scale alignment aggregation module. The parallel dual-channel attention mechanism includes channel attention and spatial attention. That is, channel weights are generated by global average pooling and max pooling to suppress redundant features, and spatial weights are normalized by Softmax to focus on defect areas and filter background noise.
[0016] Furthermore, the parallel feature filtering module in the multi-scale alignment aggregation module optimizes feature selection through a parallel dual-channel attention mechanism, including the synergistic optimization of channel attention and spatial attention. In the channel dimension, global average pooling and global max pooling are used in parallel to extract global statistical information from the feature map. GAP generates the mean channel importance by compressing local features, while GMP captures significant feature peaks. After aggregation, the channel weights are generated by dimensionality reduction through a fully connected layer and Sigmoid activation, which strengthens key defect channels and suppresses redundant background channels. In the spatial dimension, Softmax normalization is used to assign weights to the spatial location of the feature map, and the channel weights are combined to form a multi-dimensional attention map, enabling the model to dynamically focus on defect-sensitive areas. At the same time, parallel computation reduces the time overhead of the attention mechanism, ultimately achieving synergistic optimization of defect area feature enhancement and background noise suppression.
[0017] Furthermore, in step 2, the backbone network architecture of the multi-scale alignment aggregation module is consistent with YOLOv5, including the CBS module, C3 module, and SPPF module. The CBS module is a composite module composed of convolutional layers, batch normalization layers, and SiLU activation functions. The C3 module is designed based on the CSP bottleneck structure and contains three convolutional layers. By deploying four C3 modules, features at different scales can be extracted. The spatial pyramid fast pooling module, as an efficient feature aggregation unit, has the core function of fully extracting and integrating high-level semantic information from high-resolution features during the feature aggregation process through several max pooling operations.
[0018] Furthermore, a dynamic feature optimization module is set up in the feature selection optimization. On the one hand, the feature selection algorithm is used to filter redundant information, and on the other hand, spatial attention-guided convolution operation is used to strengthen the key features of the target area. The feature channel weighting mechanism is used to enhance important features, while spatial masking is used to suppress background interference, so that the detection focuses on the defect-sensitive area.
[0019] The present invention, by adopting the above-described technical solution, has the following beneficial effects:
[0020] (1) This invention combines an industrial linear array camera and a laser 3D scanner to simultaneously acquire weld surface images and deformation data, and designs a multi-scale alignment aggregation module (MAFM) to achieve accurate modeling of cross-scale geometric mapping relationships. Through innovative multi-scale feature aggregation and lightweight design, it significantly improves the accuracy and real-time performance of friction stir welding defect detection, providing an efficient and reliable solution for industrial quality inspection.
[0021] (2) By combining the Multi-Scale Alignment Aggregation (MAFM) module with the core technology of friction stir welding, the limitations of traditional single-scale inspection on complex weld morphologies are overcome through the multi-scale feature alignment mechanism, enabling the simultaneous capture of millimeter-level flash and micron-level pore defects. For the unique material flow characteristics of friction stir welding (such as surface irregularities caused by shoulder extrusion), the adaptive feature aggregation strategy effectively compensates for welding path deviations and, combined with the depth information of the ultrasonic phased array and the planar features of visual inspection, achieves accurate reconstruction of the defect spatial coordinates, solving the misjudgment problem of traditional planar inspection.
[0022] (3) By optimizing the calculation path through a parallel feature filtering module, the time for a single detection is reduced to less than 200ms while maintaining high accuracy at the 0.1mm level, thus meeting the real-time requirements of industrial production lines. This technical solution effectively avoids existing problems such as insufficient sensitivity of X-ray detection to surface defects, inability of penetrant testing to quantitatively analyze defects, and high false alarm rate of single sensor detection. By utilizing a multimodal data aggregation architecture, it ultimately achieves industrial-grade detection standards for defect type identification accuracy and false negative rate. Attached Figure Description
[0023] Figure 1 This is a flowchart of the method of the present invention;
[0024] Figure 2 This is a schematic diagram of the feature fusion strategy of the present invention;
[0025] Figure 3 This is the operation diagram of the multi-scale alignment aggregation module and parallel dual-channel mechanism of the present invention;
[0026] Figure 4 This is an example diagram of sensor data sampling according to the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are merely to provide the reader with a thorough understanding of one or more aspects of the present invention, and these aspects of the invention can be implemented even without these specific details.
[0028] like Figure 1 As shown, the intelligent detection method for weld defects in friction stir welding based on a multi-scale aligned aggregation module includes the following steps:
[0029] S101: Construct a dataset of weld defects in friction stir welding;
[0030] This example utilizes an industrial linear array camera, a laser 3D scanner, and a stirring pin mounted on a friction stir welding machine to acquire images of the weld surface and deformation data. See the detailed sensor data sampling layout diagram below. Figure 2 Image quality was improved through histogram equalization and noise filtering preprocessing before being used as input to the model. A total of 7000 images were collected, and the time-series data was divided into training, validation, and test sets in a 6:2:2 ratio.
[0031] S102: Design a multi-scale alignment aggregation module (MAFM) to achieve accurate modeling of cross-scale geometric mapping relationships by dynamically adjusting the receptive field through deformable convolution;
[0032] Its backbone network architecture is consistent with YOLOv5, mainly consisting of the CBS module, C3 module, and SPPF module. The CBS module is a composite module (Conv2D_BN_SiLU) composed of convolutional layers (Conv2D), batch normalization layers (BN), and the SiLU activation function. The C3 module is designed based on the CSP (Cross-Stage Local Connectivity) bottleneck structure and contains three convolutional layers. By deploying four C3 modules in the model, features at different scales can be comprehensively extracted. Furthermore, the Spatial Pyramid Fast Pooling (SPPF) module, as an efficient feature aggregation unit, has the core function of fully extracting and integrating high-level semantic information from high-resolution features during feature aggregation through multiple max pooling operations.
[0033] In weld surface defect detection scenarios, complex defect morphologies (such as inclusions and densely distributed similar defects) can easily lead to a decrease in detection accuracy. To address this, the MAFP strategy is proposed, which improves detection performance through feature extraction and filtering mechanisms. This strategy comprises two core modules: MAFM (Multi-Scale Attention Convergence Module) and PFF (Parallel Feature Filtering Module), which are specifically designed to process the feature flow of the input image. Figure 2 In the text, A stands for FPN in YOLOv5. Figure 2In this context, B stands for MAFM in Yolo-MAFP.
[0034] The MAFM module borrows from the feature pyramid network architecture of YOLOv5 and adopts a dual-path feature aggregation mechanism (such as...). Figure 2 As shown): First, it concatenates the semantic features of historical sampling layers, effectively preserving the correlation between features across multiple levels and avoiding information decay (corresponding to...). Figure 2 (B) and formula (1)); secondly, cross-scale integration of feature processes, enhancing the robustness of feature representation through full-scale cascading (corresponding to Figure 2 (B) and Equation (2)). This design breaks through the limitations of traditional single-layer feature flow and enhances the distinction between target features and background noise through feature interaction mechanism.
[0035]
[0036] In the image processing workflow, resolution enhancement (up) and resolution reduction (down) operations correspond to enlarging and shrinking the feature map size, respectively. Feature stitching and integration (Cat()) achieves feature interaction through multi-dimensional data overlay, while the feature interaction mechanism (FF()) and aggregated features (FF) complete the semantic association of cross-scale features. Here, Fi and Fi′ (i = {1, 2, 3, 4, 5}) represent... Figure 2 The output feature vectors of the module shown are displayed at different processing stages.
[0037] Based on this architecture, the proposed Dynamic Feature Optimization (PFF) module improves model performance through a dual mechanism: on the one hand, it uses a feature selection algorithm to filter redundant information, and on the other hand, it employs spatial attention-guided convolution operations to enhance key features of the target region. This module enhances important features through a feature channel weighting mechanism, while simultaneously using a spatial mask to suppress background interference, enabling detection to focus on defect-sensitive regions.
[0038] For the Channel Refinement Module (CRM), adaptive average pooling (f) is also used. AP (FF)) and adaptive maximum pooling (f MP (FF) is used to obtain more refined global features of the compressed image. Then, for the m-th (m = {1, 2, 3}) PFF module, the channel adaptive weights corresponding to the four aggregated feature streams can be calculated as follows:
[0039] [a m b m c m d m ] = Sigmoid[f AP (FF)+f MP (FF)] (3)
[0040] Where a, b, c, and d are channel adaptive weights. Simultaneously, softmax is used in the spatial normalization module (SNM) to normalize the feature maps along the channel directions to obtain the relative weights of different channels at the same location. As shown in (4), the spatial attention weights e, f, g, and h are obtained in the following way:
[0041] [e m f m g m h m =Softmax(FF). (4)
[0042] Once these attention weights are calculated, they are multiplied by the initial four aggregated features to filter out interfering features. The detailed operations in the channel (Cm) and space (Sm) can be represented by (5) and (6), respectively.
[0043]
[0044] in Defined as the value of the nth feature map at position (x, y) on the kth channel of the mth PFF module. For example, according to (1), when m is 1, (5) and (6) can be rewritten as (7) and (8) respectively.
[0045]
[0046] Finally, the necessary detailed features (p) will be obtained. m This is the cascaded output of the module, and it can be represented as:
[0047] P m =Cat(C m S m (9)
[0048] This embodiment relies on the following conditions, as shown in Table 1, for training experiments.
[0049] Table 1 shows the training experiment data.
[0050]
[0051] S103 evaluates the intermediate models trained in S102 and selects the model with the best evaluation performance as the final model. To accelerate network convergence, this example uses cross-validation during training to evaluate the intermediate models. Specifically, after every 200 training iterations, the overall model is frozen, validated for 50 training iterations, and then unfrozen, repeating this process until 5000 training iterations have been completed.
[0052] S104. The final model selected in S103 is applied to a complex real-world scenario. Specifically, the final model is considered as the intelligent monitoring method for weld defects in friction stir welding based on a multi-scale aligned aggregation module proposed in this invention. This model is deployed to an online monitoring system to perform real-time detection of data collected by existing sensors. This assists technical experts in dynamically adjusting welding process parameters to improve welding quality.
[0053] Matters not covered in this invention are common knowledge.
[0054] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for intelligent detection of defects in friction stir welding seams based on a multi-scale aligned aggregation module, characterized in that, The method includes the following steps: Step 1: Construct a self-built dataset by simultaneously acquiring weld surface images and deformation data during the welding process using an industrial linear array camera and a laser 3D scanner; Step 2: Design a multi-scale alignment aggregation module and a parallel feature filtering module. Through deformable convolution, the receptive field is dynamically adjusted to achieve accurate modeling of cross-scale geometric mapping relationships. Step 3: A parallel dual-channel attention mechanism is adopted, which generates channel weights by combining global average pooling and max pooling, and combines the spatial weight allocation of Softmax normalization to achieve dynamic focusing on the key defect area of friction stir welding and rapid filtering of redundant background. Step 4: Use depthwise separable convolution to replace traditional convolution, reducing the number of model parameters. By decoupling the head structure to separate classification and regression tasks, conflicting information interference is reduced, detection speed is improved, and the needs of industrial online detection are met.
2. The intelligent detection method for weld defects in friction stir welding based on a multi-scale aligned aggregation module according to claim 1, characterized in that: In step 1, flash, holes, lack of fusion, incomplete penetration, cracks, and shape defects are identified. Holes include porosity and shrinkage cavities, and shape defects include undercut and weld beads. Image quality is improved through histogram equalization and noise filtering preprocessing. The self-built dataset is divided into training set, validation set, and test set in a 6:2:2 ratio.
3. The intelligent detection method for friction stir welding defects based on a multi-scale aligned aggregation module according to claim 1, characterized in that: In step 2, the multi-scale alignment and aggregation module uses an improved YOLO-v5 backbone network to extract multi-scale features from layers C2 to C5. A baseline layer is selected, with layer C3 as the base. Cross-scale geometric mapping relationships are established through deformable convolutions, and bidirectional pyramid aggregation is used to pass high-level semantic features from top to bottom (C5 layer → C4 layer → C3 layer → C2 layer). Low-level detailed features are aggregated from bottom to top (C2 layer → C3 layer → C4 layer → C5 layer). Finally, all upsampled feature streams are concatenated to eliminate feature misalignment and semantic bias.
4. The intelligent detection method for weld defects in friction stir welding based on a multi-scale aligned aggregation module according to claim 1, characterized in that: A parallel dual-channel attention mechanism is introduced after the output of the multi-scale alignment aggregation module. The parallel dual-channel attention mechanism includes channel attention and spatial attention. That is, channel weights are generated by global average pooling and max pooling to suppress redundant features, and spatial weights are normalized by Softmax to focus on defect areas and filter background noise.
5. The intelligent detection method for weld defects in friction stir welding based on a multi-scale aligned polymerization module according to claim 4, characterized in that: The parallel feature filtering module in the multi-scale alignment aggregation module optimizes feature selection through a parallel dual-channel attention mechanism, including the synergistic optimization of channel attention and spatial attention. In the channel dimension, global average pooling and global max pooling are used in parallel to extract global statistical information from the feature map. GAP generates the mean channel importance by compressing local features, while GMP captures significant feature peaks. After aggregation, the channel weights are generated by dimensionality reduction through a fully connected layer and sigmoid activation, which strengthens key defect channels and suppresses redundant background channels. In the spatial dimension, Softmax normalization is used to assign weights to the spatial location of the feature map. Combined with the channel weights, a multi-dimensional attention map is formed, which enables the model to dynamically focus on defect-sensitive areas. At the same time, parallel computation reduces the time overhead of the attention mechanism, ultimately achieving synergistic optimization of defect area feature enhancement and background noise suppression.
6. The intelligent detection method for weld defects in friction stir welding based on a multi-scale aligned aggregation module according to claim 1, characterized in that: In step 2, the backbone network architecture of the multi-scale alignment aggregation module is consistent with YOLOv5, including the CBS module, C3 module, and SPPF module. The CBS module is a composite module composed of convolutional layers, batch normalization layers, and SiLU activation functions. The C3 module is designed based on the CSP bottleneck structure and contains three convolutional layers. By deploying four C3 modules, features at different scales can be extracted. The spatial pyramid fast pooling module, as an efficient feature aggregation unit, has the core function of fully extracting and integrating high-level semantic information from high-resolution features during the feature aggregation process through several max pooling operations.
7. The intelligent detection method for friction stir welding defects based on a multi-scale aligned aggregation module according to claim 5, characterized in that: In the optimization of feature selection, a dynamic feature optimization module is set up. On the one hand, the feature selection algorithm is used to filter redundant information, and on the other hand, spatial attention-guided convolution operation is used to strengthen the key features of the target region. The feature channel weighting mechanism is used to enhance important features, while spatial masking is used to suppress background interference, so that the detection focuses on the defect-sensitive area.