A method for identifying mechanical welding gap defects
Through multi-spectral imaging and multi-scale convolutional neural network combined with support vector machine algorithm, the model parameters are dynamically adjusted, and the problems of instability in weld defect detection are solved, high-precision weld defect identification and quality evaluation are achieved, and the intelligence level of welding quality control is improved.
Patent Information
- Application Number
- CN202510819899.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-06-19
AI Technical Summary
When facing complex and diverse defect patterns, the existing weld defect detection methods have unstable detection accuracy, strong subjectivity and low efficiency, making it difficult to meet the requirements of modern precision manufacturing for detection accuracy and consistency. In addition, existing recognition algorithms are difficult to accurately capture subtle but critical feature differences, resulting in the identification system being unable to effectively distinguish similar defect types.
Multispectral imaging technology is used to collect weld surface images, extract defect features through multi-scale convolutional neural network, combine support vector machine algorithm to classify defects, and dynamically adjust model parameters to establish a weld quality evaluation database to achieve high-precision automatic identification of weld defects.
It realizes accurate identification, classification and positioning of weld defects, improves the intelligence level and reliability of welding quality control, improves identification accuracy and adaptability, and adapts to stable identification of different welding process conditions.
Smart Images

Figure CN120355701B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent welding quality detection and defect recognition, and in particular to a method for mechanical welding gap defect recognition. Background Art
[0002] As a core joining technology in modern manufacturing, mechanical welding's quality directly determines the safety and reliability of products in key sectors such as aerospace, marine engineering, and nuclear power equipment. Accurate identification and assessment of weld defects has become a crucial factor in ensuring the integrity of engineering structures and is of strategic importance to the quality control system of the entire manufacturing industry.
[0003] Traditional weld defect detection methods primarily rely on manual visual inspection and simple nondestructive testing techniques. These methods suffer from unstable detection accuracy, strong subjectivity, and low efficiency. While existing automated detection systems have improved detection speed to a certain extent, they often suffer from high false positive rates and poor adaptability when dealing with complex and diverse defect morphologies, making them unable to meet the stringent requirements of modern precision manufacturing for detection accuracy and consistency. A core challenge facing the current weld defect recognition field stems from the complexity of defect feature extraction. Defects such as porosity, slag inclusions, cracks, and lack of fusion generated under different welding processes exhibit significant differences in morphology, size, and distribution. Existing recognition algorithms struggle to accurately capture these subtle yet critical differences. This limited feature extraction capability directly leads to decreased defect classification accuracy, making it difficult for recognition systems to effectively distinguish similar defect types. Further complicating matters, the same defect type can exhibit distinct manifestations under different process parameters, material combinations, and environmental conditions. This lack of process adaptability results in significant performance degradation when faced with new welding processes or changing operating conditions, preventing robust recognition across process conditions. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for mechanical welding gap defect identification, to construct an intelligent recognition system that can not only accurately extract multi-dimensional defect characteristics but also adapt to different welding process conditions, so as to achieve high-precision automatic identification of various weld defects.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for identifying mechanical welding gap defects, the method comprising:
[0006] S1. Collect weld surface image data to obtain a standardized image dataset, perform feature extraction on the standardized image dataset, extract the edge contour, texture distribution, and grayscale change characteristics of the defect, and generate a high-dimensional feature vector containing the spatial position coordinates and morphological characteristics of the defect;
[0007] S2. Generate a weld quality assessment database including defect distribution uniformity and defect severity scores based on edge continuity parameters and grayscale uniformity parameters in the high-dimensional feature vector;
[0008] S3. Using an online learning algorithm, based on newly added defect sample data and defect trend analysis results, dynamically adjust the weight update frequency of the multi-scale convolutional neural network and the kernel function selection of the support vector machine, optimize the feature weight distribution and kernel parameters, and generate updated defect recognition model parameters;
[0009] S4. Calculate the loss function value of the updated defect recognition model through the model convergence evaluation algorithm. Combined with the incremental sample labeling results, determine whether the model classification accuracy meets the preset threshold and determine the optimized intelligent recognition system configuration parameters.
[0010] Preferably, collecting weld surface image data in S1 to obtain a standardized image data set includes collecting image data of the weld surface in visible light, infrared and ultraviolet bands through a multispectral imaging device, using an image clarity threshold and a noise level threshold to screen the collected images, eliminating blurred or excessively noisy images, and obtaining a standardized image data set.
[0011] Preferably, the S1 further includes using a multi-scale convolutional neural network to perform feature extraction on the standardized image data set, setting the convolution kernel sizes to 3x3, 5x5 and 7x7, and extracting the edge contour, texture distribution and grayscale change features of the defects.
[0012] Preferably, S2 includes using a support vector machine classification algorithm to identify defect types based on the edge continuity parameter and grayscale uniformity parameter in the high-dimensional feature vector. If the edge continuity parameter is greater than 0.8, it is judged to be a crack defect; if the grayscale uniformity parameter is less than 0.6, it is judged to be a pore defect, thereby obtaining a preliminary defect classification result.
[0013] Preferably, S2 also includes dynamically adjusting the weight coefficient and discrimination threshold of the support vector machine classification algorithm according to the current intensity, welding speed and shielding gas flow parameters of the welding process, integrating the process parameter information through the weighted fusion algorithm, and generating an optimized defect classification result adapted to the current process conditions.
[0014] Preferably, S2 also includes adopting multi-sensor data fusion technology, integrating and optimizing defect classification results and process parameter information through a weighted fusion algorithm, and calculating a comprehensive confidence score. If the comprehensive confidence score is greater than 0.85, the final identification result of the defect type and defect location coordinates is confirmed.
[0015] Preferably, S2 also includes calculating the defect density distribution and defect space clustering characteristics through a statistical analysis algorithm based on the defect type and defect location coordinates, combining the defect size statistics and defect type ratio to generate a weld quality assessment database including defect distribution uniformity and defect severity scores.
[0016] Preferably, the S2 generates a weld quality assessment database including defect distribution uniformity and defect severity score based on the edge continuity parameter and grayscale uniformity parameter in the high-dimensional feature vector. The specific formula is:
[0017] ;
[0018] ;
[0019] in, represents the intelligent evaluation score of defect images, represents the area term weight factor, represents the grayscale perturbation weight factor, represents the morphological complexity adjustment factor, represents the defect area, represents the area power exponent, represents the grayscale standard deviation, represents the grayscale mean, represents the grayscale perturbation power index, represents the defect edge disturbance adjustment parameter, represents the edge discontinuity score, represents the direction angle of the kth edge point, Indicates the number of edge pixels.
[0020] Preferably, the The specific calculation formula is:
[0021] ;
[0022] in, represents the area term weight factor, represents the defect area, Indicates the major axis length of the minimum circumscribed ellipse of the defect area.
[0023] Preferably, the The specific calculation formula is:
[0024] ;
[0025] in, represents the grayscale perturbation weight factor, Indicates the standard deviation of local grayscale changes within the defect area, Indicates the mean value of the gradient direction offset;
[0026] described =1- - ;
[0027] in, Represents the morphological complexity adjustment factor.
[0028] It can be seen from the above technical solution that the present invention has the following beneficial effects:
[0029] This mechanical welding seam defect recognition method uses multispectral imaging to capture weld surface images, a multiscale convolutional neural network to extract defect features, and a support vector machine algorithm for defect classification. Its innovation lies in integrating welding process parameters to dynamically adjust the classification algorithm and employing multi-sensor data fusion technology to improve recognition accuracy. The invention also establishes a weld quality assessment database and continuously optimizes the recognition model through an online learning algorithm. This method enables the precise identification, classification, and location of weld defects and provides a comprehensive assessment of weld quality, effectively enhancing the intelligent level and reliability of welding quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0031] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0032] like Figure 1 As shown, the present invention provides a technical solution: a method for identifying mechanical welding gap defects, the method comprising:
[0033] S1. Collect weld surface image data to obtain a standardized image dataset, perform feature extraction on the standardized image dataset, extract the edge contour, texture distribution, and grayscale change characteristics of the defect, and generate a high-dimensional feature vector containing the spatial position coordinates and morphological characteristics of the defect;
[0034] S2. Generate a weld quality assessment database including defect distribution uniformity and defect severity scores based on edge continuity parameters and grayscale uniformity parameters in the high-dimensional feature vector;
[0035] S3. Using an online learning algorithm, based on newly added defect sample data and defect trend analysis results, dynamically adjust the weight update frequency of the multi-scale convolutional neural network and the kernel function selection of the support vector machine, optimize the feature weight distribution and kernel parameters, and generate updated defect recognition model parameters;
[0036] S4. Calculate the loss function value of the updated defect recognition model through the model convergence evaluation algorithm. Combined with the incremental sample labeling results, determine whether the model classification accuracy meets the preset threshold and determine the optimized intelligent recognition system configuration parameters.
[0037] This method achieves efficient identification and quality assessment of mechanical weld seam defects through four stages. In the first stage, real-time images of the weld surface are captured using a high-resolution industrial camera. These images undergo a standardized processing process, including preprocessing operations such as image resizing, grayscale normalization, and noise suppression, to ensure consistent image quality. Subsequently, defect features are extracted using methods based on edge detection (such as the Canny algorithm), texture analysis (such as LBP or Gabor filtering), and grayscale gradient analysis. This generates a high-dimensional feature vector containing attributes such as spatial location, edge contour complexity, texture directionality, and grayscale variation. This vector provides a complete structured description of each defect type, laying the foundation for subsequent identification modeling. In the second stage, using two key parameters in this high-dimensional feature vector—edge continuity and grayscale uniformity—the distribution of weld defects and a severity scoring system are constructed by calculating statistical indicators such as the edge connection length ratio and grayscale standard deviation of the feature regions. The scoring results are then entered into a weld quality assessment database, which supports classification and archiving of multiple defect types (such as pores, cracks, and lack of fusion) and their severity levels, enabling quality traceability and trend analysis. In the third phase, a dynamic online learning mechanism is introduced. The system continuously incorporates newly acquired defect images and their annotations into the training process. A multi-scale convolutional neural network processes image features at different resolutions, identifying defect regions at a coarse scale and then refining defect boundaries at a fine scale, enhancing the model's regional awareness. The network's weight update frequency is dynamically adjusted based on the complexity and class distribution of newly added samples. Furthermore, a support vector machine (SVM) is employed as a supplementary classifier. It automatically selects the optimal kernel function (such as radial basis kernel, sigmoid kernel, or polynomial kernel) based on real-time data to improve the model's ability to discriminate nonlinear boundaries. Feature importance analysis is used to adjust the weights of various features, enabling the model to rapidly adapt to changes in weld defect morphology. In the final phase, the system monitors the training process using a model convergence assessment algorithm. This includes monitoring metrics such as the rate of decrease of the loss function (such as cross-entropy loss or mean squared error) and the trend of improvement in training accuracy to assess model stability and generalization. Validation is performed on newly annotated incremental samples, calculating comprehensive metrics such as classification accuracy, recall, and F1 score. These metrics are then compared against a set performance threshold to determine whether to accept the current model version. If the requirements are met, the model will be automatically deployed to the intelligent recognition system, and the configuration parameters will be updated synchronously, such as the recognition confidence threshold, warning level setting, and inference speed tuning parameters, to achieve optimal deployment of system performance.
[0038] 1. Image preprocessing and feature extraction
[0039] First, a high-resolution industrial camera captures an image of the weld surface. The image is normalized to uniform size and brightness, and noise is removed using methods such as median filtering to generate a standardized image. The system then uses edge detection methods (such as the Canny algorithm) to extract the edge contours of weld defects in the image. A Gabor filter is also used to extract the directional texture features of the defect area. The gray-level co-occurrence matrix is then used to analyze the distribution of grayscale variations in the defect area.
[0040] On this basis, two key feature parameters are extracted:
[0041] Edge continuity parameter: This parameter indicates whether the edge of the defect area is complete. It is calculated by counting the total length of all continuous edge segments and dividing it by the total length of the edge detection to obtain a ratio. The larger the ratio, the more complete the edge structure, which means that the recognition model can more easily locate the defect area.
[0042] Parameter meaning explanation: The total length of continuous edge segments represents the linear recognizability of the defect boundary; the total edge detection length represents the sum of all identifiable edge pixels in the image.
[0043] Parameter determination method: Use edge detection algorithm to count edge pixels and mark continuous areas, and then add pixel distance to get the length.
[0044] Grayscale uniformity parameter: This parameter measures the grayscale stability of the defective area. The calculation method is: first calculate the standard deviation of the grayscale of the defective area, then divide it by the average grayscale value of the area, and finally subtract this ratio from 1. The closer the value is to 1, the more uniform the grayscale of the area.
[0045] Parameter meaning explanation: Grayscale standard deviation indicates the degree of image brightness change; grayscale mean indicates the overall brightness level.
[0046] Parameter determination method: After extracting the grayscale values of all pixels in the defect area, the system automatically calculates their standard deviation and mean, and performs ratio conversion.
[0047] 2. Generation of weld quality assessment database
[0048] Based on these two characteristic parameters, two scores are constructed: one for defect severity and the other for defect uniformity. These two scores are then combined into a weighted average to create a comprehensive score. This score reflects the degree to which the defect impacts overall weld quality.
[0049] Parameter meaning explanation: The severity score reflects whether the defect morphology characteristics affect the structural strength, and the uniformity score indicates the stability of the defect within the image area.
[0050] 3. Online learning and recognition model optimization
[0051] An online learning mechanism is used to dynamically update the defect recognition model. This mechanism incorporates a multi-scale convolutional neural network to process weld images of varying resolutions and structural complexities. As new defect samples accumulate, the system dynamically adjusts the update frequency of the neural network parameters.
[0052] Update frequency calculation method: The system multiplies the number of new samples by the diversity of the samples, and then multiplies it by an adjustment coefficient to obtain the final update frequency.
[0053] Parameter description: The number of new samples indicates the number of new image samples collected since the last update; the diversity index is obtained by calculating the entropy of the sample category distribution; the adjustment coefficient is an empirical value, such as 0.1, which controls the sensitivity of frequency changes.
[0054] In addition, a support vector machine (SVM) is used as an auxiliary classification module, and its kernel function type is selected through cross-validation. The system selects the one with the smallest classification error among the radial basis kernel function, sigmoid kernel function, and polynomial kernel function as the kernel function for the current model.
[0055] 4. Model convergence evaluation
[0056] After each model training run, the system evaluates whether the training has converged, that is, whether the model error has stabilized within a small range. Using cross-entropy loss as a foundation, the system calculates the difference between the model output and the actual annotations, taking the average of all samples as the total loss. If this value decreases slowly or remains stable, the model has converged.
[0057] Parameter description: The true label and predicted probability of each sample are used to calculate the loss; the loss values of all samples are averaged to obtain the overall loss result.
[0058] On this basis, the system further combines precision and recall to calculate the F1 value as the final performance evaluation indicator of the model.
[0059] The F1 value is the harmonic mean of precision and recall. If it is greater than a set threshold (such as 0.92), the model is judged to meet the deployment criteria.
[0060] This method utilizes quantitative formulas and parametric models to scientifically identify and assess welding defects. By combining high-dimensional features with evaluation metrics, it enables structured evaluation and trend analysis of weld quality. An online learning mechanism ensures the model can continuously adapt to changes in defect distribution caused by variations in welding batches, materials, or process parameters. The model convergence algorithm employed enhances system stability, reduces training time, and improves overall recognition efficiency and reliability.
[0061] Taking a large-scale automatic steel structure welding line at a shipyard as an example, the system installed a dual-channel industrial camera downstream of the welding line to collect image data, processing approximately 3,200 weld images daily. After deploying the aforementioned recognition method, the system dynamically introduced new defect samples from the previous seven days during the S3 phase to train and update the recognition model, accurately classifying and identifying six types of defects, including lack of fusion, slag inclusions, and undercuts. The system's automatic recognition rate increased from 84.7% to 93.2%. The quality assessment database, combined with the scoring results, automatically generates weld batch assessment reports, facilitating on-site quality inspection process standardization, traceability management, and welding process adjustment recommendations, saving approximately 15% of manual inspection time for shipbuilding.
[0062] In S1, the weld surface image data is collected to obtain a standardized image data set, which includes collecting image data of the weld surface in the visible light, infrared and ultraviolet bands through a multispectral imaging device, and using the image clarity threshold and noise level threshold to filter the collected images, eliminate blurred or too noisy images, and obtain a standardized image data set.
[0063] This embodiment uses multispectral imaging and image quality screening mechanisms to obtain high-quality, information-rich weld images for constructing a standardized image dataset, thereby enhancing the accuracy and stability of subsequent defect identification.
[0064] 1. Image acquisition method
[0065] An imaging device with multi-spectral channels is used to simultaneously capture images of the weld surface in three bands:
[0066] Visible light band images are used to obtain the weld surface color, morphology and edge structure;
[0067] Infrared band images are used to reflect the thermal distribution characteristics of weld metal materials, such as potential thermal stress concentration;
[0068] Ultraviolet band images can enhance the visualization of metal cracks and tiny defects.
[0069] The multi-channel image acquisition process uses a synchronous control system to ensure the one-to-one correspondence of the three band images in spatial pixel positions, so as to facilitate subsequent multispectral image fusion and unified analysis.
[0070] 2. Image Quality Screening Mechanism
[0071] To ensure that the data entering the model training has high definition and low noise characteristics, the system uses the following two indicators to screen images:
[0072] 1. Image clarity evaluation
[0073] Image clarity is measured by calculating the gradient change intensity of the image edge area. The specific method is as follows:
[0074] First, the system applies a Laplace transform (i.e., a second-order derivative operation) to the image to enhance the response of the edge areas in the image; then, the variance of the transformed results for all pixels is calculated; the final variance value is the clarity score of the image.
[0075] Parameter explanation and determination method: The larger the clarity score value, the clearer the image edge information. The set clarity threshold is generally based on statistics of typical clear images in the training data set, and is usually set between 100 and 150. If the clarity score of an image is less than the threshold, the system determines that the image is a "blurred image" and is not included in the standardized image data set.
[0076] 2. Image noise level evaluation
[0077] The noise level is measured by the grayscale fluctuations in the weld background area of the image. The specific process is as follows: First, the non-defective area of the image is identified as the background area. Then, the system calculates the grayscale values of all pixels in the background area. The sum of the squared deviations between these grayscale values and the average grayscale value is calculated, and the arithmetic mean and square root are taken to obtain the standard deviation. The resulting standard deviation is the noise score.
[0078] Parameter interpretation and determination method: The larger the standard deviation, the more severe the grayscale fluctuation in the background area, that is, the higher the noise level; the noise threshold is set between 10 and 20 based on the equipment noise characteristics, acquisition environment, and other conditions; if the noise score of an image is greater than the threshold, it is judged as a "high noise image" and is eliminated.
[0079] 3. Screening decision logic
[0080] The following joint judgment is performed on each frame of image: only when the clarity score of the image is greater than or equal to the clarity threshold and the noise score is less than or equal to the noise threshold, the image is considered to be of qualified quality and included in the standardized dataset; otherwise, the image is marked as "unqualified" and excluded from the subsequent analysis process.
[0081] Through this double screening mechanism, it is ensured that the constructed standardized image dataset only contains high-quality images with sufficient spatial details and low background interference, providing a stable and reliable data foundation for the subsequent training of defect recognition models.
[0082] The use of multispectral imaging technology significantly improves the detectability of weld defects. The infrared band enhances the response to areas of thermal stress concentration or potential cracks, while the ultraviolet band has a stronger ability to identify tiny metal cracks, significantly outperforming single-light source imaging systems. A dual screening mechanism for image clarity and noise ensures high consistency in data source quality, effectively reducing false detection rates and error propagation, and improving the accuracy of subsequent feature extraction and model training. The construction of a standardized image set lays a solid foundation for the robustness and transferability of the entire system.
[0083] S1 also includes the use of a multi-scale convolutional neural network to extract features from standardized image datasets, setting convolution kernel sizes of 3x3, 5x5, and 7x7 to extract edge contours, texture distribution, and grayscale change features of defects.
[0084] This implementation incorporates a multi-scale convolutional neural network structure based on image preprocessing to accurately extract features from weld images of varying sizes and complexities. This approach is particularly suitable for identifying multiple weld defects, including microcracks, weld bumps, and abnormal grayscale distributions. The neural network comprises three convolutional channels, with kernel sizes set to 3×3, 5×5, and 7×7, respectively. This parallel architecture ensures the extraction of sufficient edge, texture, and grayscale variation features at multiple scales.
[0085] 1. Basic principles of convolution operation
[0086] The convolution operation involves sliding a weight matrix (i.e., a convolution kernel) over local regions of the input image. At each sliding position, the local region of the image is multiplied by the corresponding elements of the convolution kernel and the sum is calculated, resulting in a new eigenvalue. This process is repeated for each position in the image, generating a new feature map that represents specific structural features in the input image.
[0087] Take 3×3 convolution as an example: select a 3×3 pixel block centered on a certain pixel in the image and multiply it by the 9 parameter values in the convolution kernel respectively; add these 9 products to obtain the output feature value of that position; after this operation traverses the entire image, a 3×3 convolution feature map can be generated.
[0088] The convolution process of 5×5 and 7×7 is the same, except that the calculation area is expanded, which is more conducive to capturing larger structures or slowly changing grayscale information.
[0089] 2. Output feature map size calculation
[0090] To ensure that the image size after convolution is controllable, the system introduces the "padding" and "step" parameters. For any convolution kernel size K, the input image size is width, height, step, and padding size, and the output image size is determined by the following calculation:
[0091] The output width is calculated by adding twice the padding value to the input width, subtracting the kernel size, dividing by the stride and adding 1. The output height is calculated in the same way as the width.
[0092] For example, if the input image width is 256 pixels, a 7×7 convolution kernel is used, the padding is set to 3, and the stride is set to 1, then the output width is: 256+2×3 7 = 255, divided by the stride of 1 and then added to 1, the result is 256 pixels; that is, the convolution operation keeps the image size unchanged.
[0093] The padding value is usually set to "convolution kernel size minus 1 divided by 2". For example: for 3×3 convolution, the padding size is 1, for 5×5 convolution, the padding size is 2, and for 7×7 convolution, the padding size is 3, so as to keep the feature map output consistent with the input image size, facilitating subsequent multi-scale feature fusion.
[0094] 3. Multi-scale channel fusion mechanism
[0095] Three parallel channels are designed to extract features of different sizes, and finally the three outputs are fused to form a unified feature vector. The fusion method includes:
[0096] 1. Feature splicing and fusion: directly splice the output feature maps of different convolution paths according to the channel dimension to form a high-dimensional joint feature representation;
[0097] 2. Weighted fusion: Set fusion weights for each path based on experience or training data. For example, if weights are set to 0.3, 0.3, and 0.4 for the 3×3, 5×5, and 7×7 channels, respectively, the fused output feature is the sum of the weighted sums of the individual outputs.
[0098] There are two ways to determine the weighted value: one is manual setting, based on experimental verification of the contribution distribution of each convolution channel to the recognition accuracy; the other is training and learning, in which the network adaptively adjusts the weight value to minimize the overall loss function.
[0099] 4. Activation Function and Normalization Operation
[0100] The output of each convolutional layer is first processed through the ReLU activation function, which resets all negative values to zero. This gives the features a nonlinear distribution, helping to capture nonlinear image features. Batch normalization is then performed to standardize the feature distribution of each channel to a mean of 0 and a variance of 1, improving network stability and accelerating training convergence.
[0101] 5. Structural composition of output features
[0102] The fused multi-scale feature vector contains the following three important dimensional information: 1. Edge contour information: mainly extracted by 3×3 convolution, reflecting subtle structural changes such as cracks and boundary anomalies; 2. Texture distribution information: obtained by 5×5 convolution, depicting the directional and periodic characteristics of the weld surface texture; 3. Grayscale change information: identified by 7×7 convolution, used to detect large-scale intensity changes, such as defective areas such as lack of fusion, burn-through, or thickness mutation.
[0103] Finally, the fused high-dimensional feature vector is input into the subsequent defect classification module, position regression module or scoring module to realize functions such as defect identification, positioning and severity assessment.
[0104] By introducing a multi-scale convolution kernel structure, the system can consider both microscopic and macroscopic information when extracting image features, overcoming the limitations of a single convolution scale in identifying complex or overlapping defects. This strategy significantly improves the model's adaptability to weld defects with blurred edges, slow grayscale transitions, or irregular texture distribution. The feature fusion mechanism avoids information loss, improves the robustness and distinguishability of the overall feature representation, and contributes to improved final recognition accuracy and classification stability.
[0105] S2 includes defect type identification based on the edge continuity parameter and grayscale uniformity parameter in the high-dimensional feature vector using a support vector machine classification algorithm. If the edge continuity parameter is greater than 0.8, it is judged as a crack defect; if the grayscale uniformity parameter is less than 0.6, it is judged as a pore defect, and a preliminary defect classification result is obtained.
[0106] This implementation uses a two-stage approach, "threshold determination + support vector machine classification," to perform preliminary weld defect identification based on high-dimensional feature vectors extracted from weld images. This method specifically targets two common defect types: cracks and porosity. It constructs a classification logic based on edge continuity and grayscale uniformity, while integrating it with a support vector machine model to improve classification accuracy and application flexibility.
[0107] 1. Definition and calculation of edge continuity parameters
[0108] The edge continuity parameter describes the degree of continuity of weld defect boundaries in an image, specifically whether the edge presents a complete linear structure. The calculation process for this parameter is as follows: All edge pixels are identified using an image processing algorithm (such as Canny edge detection); these edge pixels are profiled to identify and mark continuous edge segments; the lengths of all continuous edge segments are calculated, referred to as the "continuous edge length"; the lengths of all detected edge pixels in the image are also calculated, referred to as the "total edge length"; and the "continuous edge length" is divided by the "total edge length" to determine the edge continuity parameter for the region.
[0109] This parameter ranges from 0 to 1, with values closer to 1 indicating a more coherent edge. Based on statistical data from a large number of weld images, values above 0.8 are often associated with crack-like defects. Therefore, the system sets 0.8 as the crack detection threshold.
[0110] 2. Definition and calculation of grayscale uniformity parameters
[0111] The grayscale uniformity parameter measures the degree of grayscale variation within a defective area, specifically whether there are significant brightness fluctuations in the image. The calculation process is as follows: extract the grayscale values of all pixels in the defective area to be analyzed; calculate the average of these grayscale values, recorded as the "grayscale mean"; calculate the squares of the differences between these grayscale values and the grayscale mean, average them, and take the square root to obtain the "grayscale standard deviation"; divide the "grayscale standard deviation" by the "grayscale mean" to obtain the grayscale variation ratio; and subtract this ratio from 1 to obtain the grayscale uniformity parameter.
[0112] This parameter also has a value between 0 and 1. Values closer to 1 indicate smoother grayscale within the region. Analysis of actual engineering images shows that pore defects appear as randomly distributed dark spots within the image, resulting in extremely uneven grayscale distribution within the region. This parameter is often below 0.6. Therefore, the system sets 0.6 as the threshold for identifying pore defects.
[0113] 3. Preliminary Determination Logic of Defect Type
[0114] After the system completes the extraction of edge continuity and grayscale uniformity parameters, it performs the following logical judgment: if the edge continuity parameter is greater than 0.8, the area is judged as a "crack defect"; if the grayscale uniformity parameter is less than 0.6, the area is judged as a "pore defect"; if neither of the above two conditions is met, the type of the defect area is marked as "uncertain" and needs to enter the second stage of identification.
[0115] This threshold classification strategy is suitable for quickly screening typical defect types and can significantly reduce the subsequent model calculation burden.
[0116] 4. Support Vector Machine Classification Principle and Parameter Description
[0117] For samples that don't meet the aforementioned threshold criteria, the system uses a support vector machine (SVM) for further classification and identification. Its basic principle is to construct an "optimal hyperplane" in the feature space that maximizes the distinction between different types of defect data points. The SVM uses training samples to learn this classification boundary.
[0118] In practice, the system constructs a multi-dimensional feature vector for each defect sample, including edge features, texture features, grayscale features, and other information. The SVM model inputs these features into a classifier, which outputs a corresponding defect type label (such as crack, pore, or lack of fusion).
[0119] The classification process includes the following parameter settings and determinations: Kernel function selection: In order to improve the processing capability of nonlinear data, the system adopts radial basis kernel function; Regularization parameter: used to control the error tolerance. The larger the value, the stronger the penalty for error. It is usually set between 1-10. The optimal value is selected according to the cross-validation accuracy; Kernel function width parameter γ: controls the "influence range" of the RBF kernel function. A smaller value indicates a larger influence range. It is usually initially set to 1 / n (n is the feature dimension) and then tuned through grid search.
[0120] The training process uses a sample set of labeled defect images to optimize the classification boundaries, giving the SVM model strong generalization capabilities. For an unknown defect area input, the SVM will output its most likely category label and confidence level.
[0121] By combining a preset threshold strategy with an SVM model, rapid and interpretable classification of defect types is achieved. The threshold method provides a clear identification path for typical defects such as common cracks and pores, streamlining the processing workflow. The SVM classification system enhances the system's generalization capabilities for defects with fuzzy boundaries and uncertain morphology, improving overall recognition accuracy and robustness. This method is particularly suitable for industrial scenarios requiring rapid preliminary classification.
[0122] S2 also includes dynamically adjusting the weight coefficient and discrimination threshold of the support vector machine classification algorithm according to the current intensity, welding speed and shielding gas flow parameters of the welding process, integrating the process parameter information through the weighted fusion algorithm, and generating optimized defect classification results that adapt to the current process conditions.
[0123] This implementation further integrates key welding process parameters, including welding current, welding speed, and shielding gas flow, based on image recognition to achieve dynamic adjustment and adaptive optimization of the support vector machine classification model. This method transforms process parameters into quantifiable operating condition factors and adjusts the model's classification weights and discrimination boundaries accordingly, thereby improving defect recognition stability and process adaptability.
[0124] 1. Normalization of process parameters
[0125] Since the three process parameters of welding current, speed and gas flow have different physical units and orders of magnitude, the system first standardizes them and converts them into dimensionless parameters with unified dimensions to facilitate subsequent weighted fusion.
[0126] The specific method is as follows:
[0127] 1. For welding current, assume the actual current (in amperes), the minimum current allowed by the welding system, and the maximum current. Normalized current is calculated by subtracting the minimum current from the current current, then dividing by the difference between the maximum and minimum currents.
[0128] That is: normalized current value = (actual current Current lower limit)÷(Current upper limit Current lower limit).
[0129] 2. For welding speed, set the current speed (unit is mm / s), speed lower limit, and upper limit. The normalization method is the same as above: normalized speed value = (actual speed Speed lower limit) ÷ (speed upper limit Speed lower limit).
[0130] 3. For the protective gas flow rate, set the current value (in liters per minute), the gas lower limit, and the upper limit. The normalization process is: Normalized gas flow value = (current gas flow Minimum) ÷ (maximum minimum value).
[0131] The values of these three normalized parameters are all between 0 and 1 to ensure the consistency of subsequent operations.
[0132] Description of parameter determination method: The above upper and lower limits can be obtained based on the company's welding standards, material type or statistics of previous process tests, or can be set as an empirical safety interval range.
[0133] 2. Weighted fusion calculation of working condition influencing factors
[0134] To reflect the relative importance of the three process parameters on defect identification, the system introduces a process weight coefficient and uses it to calculate a comprehensive operating factor. The calculation method is as follows: the normalized current, speed, and gas flow are multiplied by the corresponding weight value, and then the three are added together to obtain a operating factor value between 0 and 1.
[0135] For example, the weight assigned to the normalized value of current is 0.4, the speed is 0.35, and the gas flow rate is 0.25. If the current normalized values are 0.6, 0.7, and 0.8, respectively, the comprehensive operating condition factor is: 0.4×0.6+0.35×0.7+0.25×0.8=0.24+0.245+0.2=0.685.
[0136] This factor is used to characterize the degree of deviation of the current process state from the ideal state. The larger the value, the greater the fluctuation of the working condition and the more significant the impact on defect identification.
[0137] 3. Adaptive Adjustment of Classification Model Parameters
[0138] Two key parameters in the support vector machine classifier will be adjusted according to the above working condition factors: 1. Classification threshold adjustment: The system sets a standard defect classification probability threshold, such as 0.5 as the default value; if the current working condition factor is higher than the preset stability threshold (such as 0.7), the system dynamically lowers the judgment threshold according to the difference; for example, when the working condition factor is 0.85 and the difference is 0.15, if the setting is lowered by 0.02 for every 0.1 deviation, the new classification threshold is 0.5 (0.15×0.2)=0.47; this can reduce the risk of false rejection of the model under process instability conditions and improve fault tolerance.
[0139] 3. Dynamic weighting of feature weights
[0140] If the welding speed increases significantly, the system multiplies the input value of the crack characteristic dimension by an enhancement factor, such as 1.2, to increase the sensitivity of this type of defect in classification;
[0141] If the gas flow rate is too low, the system multiplies the stomatal feature dimension by a factor such as 1.3 to make it easier for the classifier to identify stomatal features;
[0142] The size of the weighting factor is determined by the changing trend of the recognition accuracy of historical samples under different working conditions.
[0143] 4. Final Defect Classification Fusion
[0144] The judgment is made based on the image recognition output probability and the corrected classification threshold: if the recognition probability is higher than the corrected threshold, the defect type is directly confirmed; if the recognition probability is close to the threshold and the working condition factor deviates greatly, the system will mark the classification result as "low confidence" and report it or manually review it; combining the dual dimensions of image and process, the optimized defect type label and confidence value are finally output.
[0145] By incorporating welding process parameters into the defect classification process, the system implements a dual-dimensional adaptive recognition mechanism based on image and process. This strategy significantly enhances the model's robustness to inconsistent defect manifestations under complex production conditions and reduces the false positive rate due to process drift. The dynamic adjustment mechanism of the support vector machine parameters ensures the flexibility of the classification boundaries, effectively improving the model's accuracy and environmental adaptability, making it suitable for industrial automated inspection systems with different product types and welding modes.
[0146] S2 also includes the use of multi-sensor data fusion technology to integrate and optimize defect classification results and process parameter information through a weighted fusion algorithm to calculate a comprehensive confidence score. If the comprehensive confidence score is greater than 0.85, the final identification result of the defect type and defect location coordinates is confirmed.
[0147] To improve the reliability of the final decision-making process for welding defect identification, this system, based on image recognition and process optimization, incorporates a multi-sensor fusion mechanism. This system integrates the output of the image recognition model with welding process parameters to calculate a "comprehensive confidence score." The final identification result, including the defect type and location coordinates, is then confirmed based on whether this score meets a threshold. This method utilizes soft fusion technology to comprehensively evaluate information from multiple data sources using a weighted strategy, ensuring real-time and adjustable performance.
[0148] The process consists of the following four stages:
[0149] 1. Input Data Acquisition and Standardization
[0150] Identification-related information is obtained from two types of data sources:
[0151] 1. Image recognition model output data
[0152] After processing a weld image, the image recognition model outputs a numerical value, called the image recognition confidence score, which indicates the likelihood that the image represents a particular defect type. This value is a decimal between 0 and 1. For example, a score of 0.92 indicates a 92% probability that the system predicts that the area is a "crack defect."
[0153] 2. Welding process status indicators
[0154] The process confidence parameter is a unified indicator derived from the integration of process data such as welding current, speed, and gas flow. This value is also normalized to a decimal between 0 and 1, representing the system's confidence in the stability of the identification under the current process conditions. For example, if the welding parameters are within the ideal range, the system will output a higher value, such as 0.85.
[0155] 2. Fusion Scoring Mechanism
[0156] The above two confidence scores are weighted and fused to calculate a new value, called the comprehensive confidence score, which is used to uniformly measure the credibility of the recognition results. The fusion process uses a linear weighted method and is calculated as follows:
[0157] First, a weighted ratio, called a "weight coefficient", is assigned to each of the image recognition score and the craftsmanship score;
[0158] The sum of the weight of the image recognition score and the weight of the process score is equal to 1, indicating that the fusion result comes entirely from the two types of score sources;
[0159] Each score is then multiplied by its corresponding weight and the results are added together to obtain the final comprehensive score.
[0160] That is: first, multiply the image recognition confidence by the image scoring weight to obtain the score for this part; then multiply the process confidence by the process scoring weight to obtain the score for this part, and then add the above two scores together to obtain the "comprehensive confidence score".
[0161] For example: the image confidence is 0.92, the process confidence is 0.85, the image score weight is set to 0.7, and the process score weight is 0.3. Then the image score part is 0.92×0.7=0.644, and the process score part is 0.85×0.3=0.255. Adding the two together, the comprehensive confidence score is 0.899.
[0162] 3. Judgment Rules and Threshold Setting
[0163] The rules for judging the integrated confidence score after fusion are as follows:
[0164] Set a "confidence threshold" with a default value of 0.85. When the comprehensive confidence score is greater than or equal to the threshold, it means that the recognition result is credible and can be directly confirmed as the final recognition result. If it is lower than the threshold, it means that the system judges that the result is not credible enough. The recognition result will be marked as "low confidence" and requires manual review or entering the model retraining queue.
[0165] Parameter description and setting basis: The image score weight is generally set to 0.7, indicating that the image recognition model is the main information source. The process score weight is generally set to 0.3 to reflect the impact of the external environment on recognition stability. The weight ratio can be dynamically adjusted based on historical classification accuracy, model stability, etc. The confidence threshold can be calculated using historical data to calculate the ROC curve and find the best compromise between recognition rate and error rate, such as the F1 optimal point.
[0166] 4. Final recognition output
[0167] When the comprehensive confidence level is greater than or equal to 0.85, the system records the following information as the final output: defect type label (such as cracks, pores, etc.), the spatial position coordinates of the defect in the image (which can be a rectangular bounding box or a polygonal area), and the comprehensive confidence score for subsequent quality traceability reference.
[0168] If the comprehensive score does not meet the requirements, the system will not output the final label, but will mark the recognition result as "needs review" and enter the manual review or algorithm re-learning module.
[0169] By performing a weighted fusion calculation on the image recognition results and process status information, the system introduces external environment cognition, effectively reducing the model's misjudgment rate under extreme working conditions or fuzzy image conditions; the confidence scoring mechanism establishes a quantifiable verification standard for each recognition result, improving the reliability of the system's decision-making; this method is suitable for production links with high requirements for recognition accuracy, such as aerospace, nuclear power equipment manufacturing and other fields.
[0170] S2 also includes calculating the defect density distribution and defect spatial clustering characteristics through statistical analysis algorithms based on defect type and defect location coordinates, and combining defect size statistics and defect type ratios to generate a weld quality assessment database that includes defect distribution uniformity and defect severity scores.
[0171] In this implementation, the system uses statistical analysis to calculate the density distribution characteristics, spatial clustering, size statistics, and defect type ratios of weld defects based on the identified weld defect types and locations. Based on these statistical indicators, two key evaluation dimensions are established: a defect distribution uniformity score and a defect severity score, ultimately forming a weld quality assessment database. This approach quantifies the overall structural characteristics of weld quality, rather than focusing solely on individual defects, improving the system's ability to perceive weld stability and identify trends.
[0172] 1. Defect density distribution calculation
[0173] Defect density represents the number of defects identified per unit weld length. It is calculated as follows: First, the entire weld is segmented into regular intervals, such as every 100 mm as an analysis interval. The number of defects in each interval is counted, and the density of that interval is calculated.
[0174] Defect density per segment = number of defects in the current segment ÷ segment length;
[0175] For example: If there are 8 defects in the first segment and the segment length is 100 mm, the density of the segment is 0.08 defects / mm.
[0176] Parameter description: The segment length is a fixed parameter that can be set according to the total length of the weld and the detection accuracy. The common value is 50-200mm. The number of defects comes from the identification module statistics and is automatically counted by the system.
[0177] 2. Calculation of Defect Density Coefficient of Variation
[0178] In order to measure whether the density distribution is uniform, the system calculates the coefficient of variation of the density of all segments. The coefficient of variation of density = standard deviation of the density of each segment ÷ mean of the density of each segment. The calculation steps are: count the mean of the density of all segments, calculate the square of the difference between the density of each segment and the mean, sum and take the square root to get the standard deviation, divide the standard deviation by the density mean to get the coefficient of variation.
[0179] Parameter description: If the coefficient of variation is larger, it means that the density of some areas is much higher than that of other areas, and the defects are unevenly distributed. If it is less than a certain threshold (such as 0.2), it can be considered that the distribution is relatively uniform.
[0180] 3. Defect Clustering Feature Analysis
[0181] Use a clustering algorithm (such as K-means or density clustering DBSCAN) to cluster the spatial locations of defects. The steps are as follows:
[0182] The spatial coordinates of all defects are used as input to perform a clustering operation, obtaining multiple cluster centers. The number of cluster centers and the average defect density within the clusters are then counted. Parameter description: The number of clusters reflects whether there is a concentrated distribution trend of defects. The number of defects in each cluster divided by the cluster area represents the clustering intensity. Clustering criteria can be set. If any cluster is larger than twice the overall mean, the cluster is considered to be severely clustered.
[0183] 4. Defect size statistics
[0184] Extract the size indicators of each defect area, such as area, length, and width, and calculate statistical indicators:
[0185] Mean, maximum, minimum, standard deviation; the proportion of defects with a statistical size greater than a preset threshold (such as a crack length exceeding 10mm).
[0186] The threshold setting refers to standard welding quality assessment indicators, such as ISO 5817, which are used to evaluate whether the defect size structure deviates from the normal distribution.
[0187] 5. Calculation of defect type ratio
[0188] Categorize and count all defects by type, such as cracks, pores, lack of fusion, and slag inclusions. Calculate the percentage of each type relative to the total number of defects. For example: Crack percentage = number of cracks ÷ total number of defects × 100%.
[0189] The weight of each type can be preset according to the safety level, such as crack > lack of fusion > pore, for subsequent severity scoring.
[0190] VI. Scoring Mechanism Construction
[0191] Two scoring indicators are established based on the above statistical indicators:
[0192] Defect distribution uniformity score ; =1 Density variation coefficient (normalized), the closer it is to 1, the more uniform it is. If there is severe clustering, you can reduce it by the penalty item .
[0193] Defect Severity Rating ;
[0194] According to the proportion of high-risk types , super-threshold size ratio , maximum cluster density Build;
[0195] ;
[0196] The default weights are w1=0.5, w2=0.3, w3=0.2.
[0197] Evaluation database construction
[0198] The aforementioned scores, defect statistics, image numbers, recognition times, process parameters, and location coordinates are stored in a database table, forming a queryable and searchable quality assessment data warehouse. This database supports batch comparison analysis, process traceability, and quality control.
[0199] This method constructs a statistical map of weld defects from a macroscopic perspective, enabling the system to not only identify single-point defects but also form a framework for assessing the overall weld quality structure. Defect density and clustering information effectively reflect welding process stability, while defect size and type structure provide quantitative risk assessment indicators. This mechanism provides critical data support for subsequent quality traceability, abnormal process warnings, and automatic process compensation control.
[0200] S2 generates a weld quality assessment database containing defect distribution uniformity and defect severity scores based on the edge continuity parameters and grayscale uniformity parameters in the high-dimensional feature vector. The specific formula is:
[0201] ;
[0202] ;
[0203] in, represents the intelligent evaluation score of defect images, represents the area term weight factor, represents the grayscale perturbation weight factor, represents the morphological complexity adjustment factor, represents the defect area, represents the area power exponent, represents the grayscale standard deviation, represents the grayscale mean, represents the grayscale perturbation power index, represents the defect edge disturbance adjustment parameter, represents the edge discontinuity score, represents the direction angle of the kth edge point, Indicates the number of edge pixels.
[0204] Based on the aforementioned defect recognition results, this implementation further introduces a comprehensive image evaluation model to construct a weld quality assessment database. This model fully considers multiple key factors in defect images, including defect area, image grayscale fluctuation, edge discontinuity, and edge disturbance intensity. Each factor is normalized using preset weighting factors and adjustment factors before being comprehensively evaluated.
[0205] First, the system uses the area of the defect region as a basic evaluation factor, assigning it an importance weight. A larger area has a more significant impact on the score. Second, the system calculates the degree of grayscale dispersion within the defect region to quantify the uniformity of the grayscale distribution in the image. The system then adjusts the evaluation contribution of this component using the grayscale anti-disturbance weight.
[0206] The system then further analyzes the edge structure, evaluating whether there are breaks, sharp angles, or sudden changes by calculating the degree of directional variation between edge points, thereby reflecting the structural integrity of the defect edge. An edge perturbation factor is also introduced to adjust the impact of edge perturbations on the overall score. Furthermore, to more accurately reflect the nonlinear effects of different morphological defects on the scoring curve, the system incorporates a morphological complexity adjustment mechanism. By applying a logarithmic function to specific influencing factors, the model's sensitivity to structurally complex images is enhanced.
[0207] By integrating and analyzing these multiple image dimensions, the system ultimately outputs a comprehensive intelligent score that indicates the severity and visual identification difficulty of weld defects in the image. This score serves as a core field in the quality assessment database, supporting quality grade classification, process anomaly alarms, and statistical analysis modeling.
[0208] This embodiment achieves a comprehensive judgment of the image quality and severity of weld defects by constructing an intelligent evaluation model that integrates multi-dimensional image features. This method incorporates multiple key factors such as defect area, grayscale fluctuation characteristics, edge continuity and disturbance degree into a unified scoring system, and enhances the model's responsiveness to complex morphological defects through weight adjustment and nonlinear functions. Compared with traditional methods that rely only on geometric parameters or grayscale thresholds, this scoring model has stronger evaluation comprehensiveness and flexibility, and can adapt to the differences in defect performance under various welding process conditions. The comprehensive scoring results are output in a standardized numerical form and can be directly used as the core indicator of the weld quality assessment database, supporting application scenarios such as welding quality grading, trend analysis, and anomaly tracing, thereby providing a quantitative basis for subsequent process parameter adjustments, quality control decisions, and automated optimization, thereby significantly improving the accuracy, stability, and intelligence level of welding quality identification.
[0209] The specific calculation formula is:
[0210] ;
[0211] in, represents the area term weight factor, represents the defect area, Indicates the major axis length of the minimum circumscribed ellipse of the defect area.
[0212] This implementation introduces an improved area-weighted factor calculation model to accurately measure the contribution of each defect region in the overall quality assessment of weld images. This model comprehensively considers both the absolute size of the defect and its structural characteristics, constructing a scoring factor that couples area significance with geometric distribution. This allows the system to focus not only on the defect's size but also its shape and structure.
[0213] The specific calculation process is as follows:
[0214] First, the system extracts the area information of each defect area based on the defect segmentation results provided by the image recognition module. The area is defined as the total number of pixels surrounded by the defect outline and converted into physical units (such as square millimeters) to reflect the spatial proportion of the area in the image.
[0215] Next, the system calculates the length of the principal axis of the minimum circumscribed ellipse corresponding to the defect's outline. This value represents the maximum extension direction of the defect's optimally fitting structure in space and is a key shape indicator for measuring the defect's "elongation" or "structural orientation." This value is smaller if the defect is a regular circle or quasi-isometric shape; it is larger if the defect is a slender strip or crack.
[0216] Then, the system jointly processes the area value with the length of the main axis of the circumscribed ellipse to establish an area-dominated, shape-corrected joint factor. This joint factor is used to describe the potential impact of the defect on the overall weld visual quality and process risk. In order to enhance the stability and adaptability of the model, the system introduces logarithmic scaling and dual nonlinear mapping function processing to the joint factor, aiming to prevent extremely large or extremely small defect areas from "over-pulling" or "being ignored" on the final scoring results while maintaining the evaluation discrimination. In particular, when the area of a defect is much larger than the average level, the system will use a nonlinear suppression mechanism to prevent its score from expanding infinitely; and for defects with small edge areas but obviously abnormal morphology, they can also obtain a reasonable evaluation ratio under the action of the main axis correction.
[0217] In addition, the area item weight factor is designed to dynamically participate in the fusion evaluation of multiple quality indicators, including defect severity score, defect distribution weight adjustment, etc., and is one of the key input variables of the entire weld quality assessment system.
[0218] In summary, through coupled modeling of area and shape and nonlinear compression conversion of parameters, the model makes the area scoring not only based on physical scale but also reflects the ability to adjust structural complexity, thereby enhancing the adaptability and controllability of the scoring model under various defect modes, weld structures, and image resolution changes, and providing a repeatable, adjustable, and calibrable quantitative basis for intelligent defect assessment.
[0219] This implementation method effectively improves the responsiveness of image scoring to the spatial scale of weld defects by constructing an area-item weighting factor model that integrates defect area and appearance features. Compared with the traditional linear area weighting method, this solution introduces an adjustment mechanism related to the appearance structure, so that the score reflects not only the absolute size of the defect, but also the comprehensive impact of its geometric features on visual prominence. At the same time, through nonlinear processing means, the adverse interference of extremely large-area defects on the scoring model is effectively suppressed, and the scoring stability is enhanced. This method makes defect scoring more sensitive, hierarchical, and practical, and can adapt to the recognition needs under various size and structure combination conditions, providing more accurate, reliable, and reasonable area features for the weld quality evaluation system.
[0220] The specific calculation formula is:
[0221] ;
[0222] in, represents the grayscale perturbation weight factor, Indicates the standard deviation of local grayscale changes within the defect area, Indicates the mean value of the gradient direction offset;
[0223] described =1- - ;
[0224] in, Represents the morphological complexity adjustment factor.
[0225] This embodiment proposes a weight factor calculation method for adjusting the influence of image grayscale disturbance, which is used to enhance the quantification ability of the complexity of grayscale changes in the defect image scoring process. Specifically, this method comprehensively considers two key factors: one is the amplitude of local grayscale changes in the defect area, and the other is the lateral grayscale offset trend in the image. The local grayscale change is calculated by counting the standard deviation of the pixel grayscale values in the area, which reflects whether the grayscale inside the image is stable. The lower the stability, the greater the image interference. The lateral grayscale offset trend reflects the degree of structural offset of the defect in the direction of the weld, which helps to identify abnormal grayscale changes caused by uneven lighting, reflection or weld deflection. The system performs nonlinear fusion processing on these two factors to obtain a grayscale disturbance weight factor for adjusting the degree of influence of image stability. The larger the factor, the lower the score of the image in the grayscale disturbance dimension should be. Subsequently, in order to ensure the controllability and normalization of the overall scoring factor, the system also constructed a morphological complexity adjustment factor, which is calculated by subtracting the sum of the area and grayscale disturbance contribution factors from the upper limit of the overall score. It is used to dynamically balance the impact of structural morphology on the score, ensure that the total weight of each factor remains consistent, and ensure the convergence and stability of the scoring system.
[0226] This embodiment effectively enhances the scoring accuracy and stability of defective images under complex grayscale conditions by constructing a weight factor model that comprehensively considers the local grayscale disturbance amplitude and the lateral grayscale offset trend. Compared with the traditional single grayscale threshold judgment method, this method can carefully identify the grayscale distribution fluctuations in the image caused by surface reflections, molten pool residues or weld bending, and reasonably control the scoring results through a nonlinear fusion mechanism, thereby avoiding the risk of high or low scores due to interference. At the same time, by introducing a morphological complexity adjustment mechanism, the system scoring weight distribution has elasticity and adaptability, which helps to maintain the consistency and comparability of scoring results in various welding environments, and provides more robust and engineering-practical parameter adjustment support for the weld quality assessment system.
[0227] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A method for identifying mechanical welding gap defects, characterized in that: The method comprises: S1. Collect weld surface image data to obtain a standardized image dataset, perform feature extraction on the standardized image dataset, extract the edge contour, texture distribution, and grayscale change characteristics of the defect, and generate a high-dimensional feature vector containing the spatial position coordinates and morphological characteristics of the defect; S2. Generate a weld quality assessment database including defect distribution uniformity and defect severity scores based on edge continuity parameters and grayscale uniformity parameters in the high-dimensional feature vector; S3. Using an online learning algorithm, based on newly added defect sample data and defect trend analysis results, dynamically adjust the weight update frequency of the multi-scale convolutional neural network and the kernel function selection of the support vector machine, optimize the feature weight distribution and kernel parameters, and generate updated defect recognition model parameters; S4. Calculate the loss function value of the updated defect recognition model through the model convergence evaluation algorithm. Combined with the incremental sample labeling results, determine whether the model classification accuracy meets the preset threshold and determine the optimized intelligent recognition system configuration parameters. The S2 generates a weld quality assessment database including defect distribution uniformity and defect severity score based on the edge continuity parameter and grayscale uniformity parameter in the high-dimensional feature vector. The specific formula is: ; ; in, represents the intelligent evaluation score of defect images, represents the area term weight factor, represents the grayscale perturbation weight factor, represents the morphological complexity adjustment factor, represents the defect area, represents the area power exponent, represents the grayscale standard deviation, represents the grayscale mean, represents the grayscale perturbation power index, represents the defect edge disturbance adjustment parameter, represents the edge discontinuity score, represents the direction angle of the kth edge point, Indicates the number of edge pixels.
2. The method for identifying mechanical welding gap defects according to claim 1, characterized in that: Collecting weld surface image data in S1 to obtain a standardized image data set includes collecting image data of the weld surface in visible light, infrared, and ultraviolet bands through a multispectral imaging device, screening the collected images using an image clarity threshold and a noise level threshold, and eliminating blurred or excessively noisy images to obtain a standardized image data set.
3. The method for identifying mechanical welding gap defects according to claim 1, wherein: The S1 also includes using a multi-scale convolutional neural network to extract features from the standardized image data set, setting convolution kernel sizes of 3x3, 5x5 and 7x7, and extracting the edge contour, texture distribution and grayscale change features of the defects.
4. The method for identifying mechanical welding gap defects according to claim 1, wherein: The S2 includes using a support vector machine classification algorithm to identify defect types based on the edge continuity parameter and grayscale uniformity parameter in the high-dimensional feature vector. If the edge continuity parameter is greater than 0.8, it is judged to be a crack defect. If the grayscale uniformity parameter is less than 0.6, it is judged to be a pore defect, thereby obtaining a preliminary defect classification result.
5. The method for identifying mechanical welding gap defects according to claim 4, characterized in that: The S2 also includes dynamically adjusting the weight coefficient and discrimination threshold of the support vector machine classification algorithm according to the current intensity, welding speed and shielding gas flow parameters of the welding process, integrating the process parameter information through the weighted fusion algorithm, and generating an optimized defect classification result adapted to the current process conditions.
6. The method for identifying mechanical welding gap defects according to claim 5, characterized in that: The S2 also includes using multi-sensor data fusion technology to integrate and optimize defect classification results and process parameter information through a weighted fusion algorithm to calculate a comprehensive confidence score. If the comprehensive confidence score is greater than 0.85, the final recognition result of the defect type and defect location coordinates is confirmed.
7. The method for identifying mechanical welding gap defects according to claim 6, characterized in that: The S2 also includes calculating the defect density distribution and defect space clustering characteristics through a statistical analysis algorithm based on the defect type and defect location coordinates, and combining the defect size statistics and defect type ratio to generate a weld quality assessment database including defect distribution uniformity and defect severity score.
8. The method for identifying mechanical welding gap defects according to claim 1, characterized in that: described The specific calculation formula is: ; in, represents the area term weight factor, represents the defect area, Indicates the major axis length of the minimum circumscribed ellipse of the defect area.
9. The method for identifying mechanical welding gap defects according to claim 1, characterized in that: described The specific calculation formula is: ; in, represents the grayscale perturbation weight factor, Indicates the standard deviation of local grayscale changes within the defect area, Indicates the mean value of the gradient direction offset; described =1- - ; in, Represents the morphological complexity adjustment factor.
Citation Information
Patent Citations
Welding seam tracking method and device based on independent deviation correction type deep learning
CN112589232A
Weld joint surface defect detection method and equipment based on machine vision and medium
CN114693610A