A method for detecting defects in a weld seam of a weld based on a visual image

By integrating multimodal data acquisition and analysis, a weld defect index is generated, which solves the problems of insufficient detection accuracy and poor adaptability in existing weld inspection technologies, and realizes efficient and accurate weld defect detection.

CN120352432BActive Publication Date: 2026-06-16JINING LIANWEI WHEEL MFG CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINING LIANWEI WHEEL MFG CO LTD
Filing Date
2025-04-27
Publication Date
2026-06-16

Smart Images

  • Figure CN120352432B_ABST
    Figure CN120352432B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of welding quality detection, and specifically relates to a welding weld defect detection method based on visual images, which comprises the steps of image acquisition, image preprocessing, data analysis, data output, defect classification and decision, system closed-loop optimization and the like; the present application synchronously acquires two-dimensional images, three-dimensional topography and thermal distribution data of metal welds, adopts a combination scheme of a polarization filter and a ring-shaped LED light source, realizes multidimensional joint analysis of physical defects and thermodynamic characteristics, extracts basic characteristic data through primary processing, generates quantifiable defect coefficient indexes through secondary processing, finally generates a comprehensive defect index through a multimodal fusion algorithm, constructs a hierarchical intelligent analysis and decision chain, realizes real-time interaction of detection results and algorithm models, establishes a self-evolution mechanism of "data acquisition-analysis decision-model iteration", and the system can continuously optimize detection thresholds and characteristic weight parameters according to actual working conditions of a production line, so that the detection sensitivity is continuously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of welding quality inspection, and specifically discloses a method for detecting welding defects based on visual images. Background Technology

[0002] Weld inspection is widely used in various fields. As the core area of ​​metal connection, the weld seam can become a stress concentration point due to internal or surface defects, which can cause the structure to break under stress and lead to catastrophic accidents.

[0003] Currently, the weld inspection technologies widely used in the industrial field are mainly traditional non-destructive testing methods such as radiographic testing, ultrasonic testing, and magnetic particle testing. Radiographic testing can identify internal defects such as porosity and slag inclusions through X-ray imaging. Magnetic particle testing, through manual spraying of magnetic powder and visual interpretation, has high sensitivity to surface cracks and can detect micron-level defects, but it suffers from bottlenecks such as low detection efficiency, complex operation, and limited applicability. Modern intelligent technologies acquire surface images through machine vision systems and combine them with deep learning models to achieve defect segmentation and classification, significantly improving detection accuracy. However, they still suffer from limitations such as modal simplification, poor adaptability to dynamic environments, flattened data processing, and lagging model iteration. Specifically:

[0004] Traditional detection systems often rely on a single sensor, resulting in a lack of defect detection dimensions. Furthermore, heterogeneous data lacks an effective joint analysis framework, making it impossible to establish a mapping relationship between physical defects and thermodynamic anomalies through feature-level fusion.

[0005] Conventional industrial vision systems are susceptible to interference from reflections when inspecting metal surfaces, requiring complex post-processing algorithms to compensate for imaging defects. Furthermore, traditional combinations of light sources and filters cannot dynamically adjust the light field distribution according to the surface material, making it difficult to achieve stable imaging under complex working conditions.

[0006] Traditional methods often employ single-stage feature extraction, lack hierarchical derivation from basic features to quantitative indicators, and decision-level fusion often relies on fixed rules, without introducing an attention mechanism to dynamically adjust the multimodal contribution.

[0007] Traditional detection systems rely on offline model training, making it impossible to optimize detection thresholds and feature weights using real-time data. They also lack a system-level bias assessment layer, making it difficult to automatically correct fusion errors when multimodal data is redundant or conflicting, thus reducing the reliability of the defect index.

[0008] Therefore, a high-precision, interference-resistant, highly robust, and continuously optimized weld defect detection method is needed to overcome the current technological bottlenecks. Summary of the Invention

[0009] In view of this, the present invention proposes a welding defect detection method based on visual images. The method acquires surface images of welds without reflective interference, as well as three-dimensional morphology and thermal distribution data. After preprocessing, the method obtains a defect index through multimodal fusion, analyzes it, and determines the defect type and confidence level. Finally, the detection data is uploaded to the management platform in real time. The method combines active learning and incremental training to continuously optimize the model, forming a "collection-analysis-optimization" closed loop, thereby achieving dynamic improvement in detection accuracy and efficiency.

[0010] The objective of this invention can be achieved through the following technical solution: a method for detecting weld defects based on visual images, characterized by comprising the following steps:

[0011] S1. Image Acquisition: A high-resolution industrial camera is used in conjunction with a ring LED light source and a polarizing filter to eliminate the interference of reflection from the metal surface and acquire visible light images of the weld surface; and an integrated laser displacement sensor and infrared thermal imager are added to the industrial camera to simultaneously acquire the three-dimensional morphology and thermal distribution data of the weld.

[0012] S2. Image preprocessing: The acquired weld surface image is processed once to obtain crack feature data and porosity feature data of the weld surface. The heat distribution data is processed once to obtain temperature feature data. The three-dimensional morphology is processed once to obtain three-dimensional feature data of the defect area.

[0013] S3. Data Analysis: Crack characteristic data and porosity characteristic data are processed in a secondary manner to obtain crack coefficient and porosity coefficient, and a comprehensive defect score is generated through the two types of defects to obtain the welding quality index; temperature characteristic data are processed in a secondary manner to obtain the maximum temperature difference between the defect area and the base material and the average temperature gradient; three-dimensional characteristic data are processed in a secondary manner to obtain defect depth, surface roughness and fractal dimension.

[0014] S4. Data Output: The defect index is obtained by multimodal fusion of the geometric features, thermal distribution features and three-dimensional morphology features obtained from the secondary processing.

[0015] S5. Defect Classification and Decision: Analyze the fused defect index, output the defect category and confidence score, and trigger the manual review process when the confidence score is less than X.

[0016] S6. System closed-loop optimization: The detection results are transmitted to the management platform in real time, and the model performance is continuously optimized through algorithms.

[0017] Combining all the above technical solutions, the positive effects of this invention are as follows:

[0018] 1. This invention integrates visible light imaging, laser three-dimensional scanning and infrared thermography to simultaneously acquire two-dimensional images, three-dimensional morphology and thermal distribution data of metal welds, thereby achieving multi-dimensional joint analysis of physical defects and thermodynamic characteristics and greatly improving the comprehensiveness of detection parameters.

[0019] 2. This invention adopts a combination of polarizing filter and ring LED light source to effectively eliminate the interference of specular reflection on metal surface, and with the help of high-resolution industrial camera to realize the visualization of micron-level surface defects, thus improving the accuracy of traditional industrial visual inspection.

[0020] 3. The present invention extracts basic feature data through primary processing, generates quantifiable defect coefficient indicators through secondary processing, and finally generates a comprehensive defect index through a multimodal fusion algorithm, thus constructing a hierarchical intelligent analysis and decision-making chain.

[0021] 4. This invention establishes a self-evolution mechanism of "data acquisition - analysis and decision-making - model iteration" through real-time interaction between detection results and algorithm models. The system can continuously optimize the detection threshold and feature weight parameters according to the actual working conditions of the production line, and maintain a continuous improvement in detection sensitivity. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Appendix Figure 1 This is a step diagram of the present invention.

[0024] Appendix Figure 2 This is a diagram illustrating the image acquisition steps. Detailed Implementation

[0025] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] See Figure 1 As shown, this invention proposes a method for detecting weld defects based on visual images.

[0027] The specific implementation steps of this invention include the following steps:

[0028] S1. Image Acquisition: A high-resolution industrial camera is used in conjunction with a ring LED light source and a polarizing filter to eliminate the interference of reflection from the metal surface and acquire visible light images of the weld surface; and an integrated laser displacement sensor and infrared thermal imager are added to the industrial camera to simultaneously acquire the three-dimensional morphology and thermal distribution data of the weld.

[0029] S2. Image preprocessing: The acquired weld surface image is processed once to obtain crack feature data and porosity feature data of the weld surface. The heat distribution data is processed once to obtain temperature feature data. The three-dimensional morphology is processed once to obtain three-dimensional feature data of the defect area.

[0030] S3. Data Analysis: Crack characteristic data and porosity characteristic data are processed in a secondary manner to obtain crack coefficient and porosity coefficient, and a comprehensive defect score is generated through the two types of defects to obtain the welding quality index; temperature characteristic data are processed in a secondary manner to obtain the maximum temperature difference between the defect area and the base material and the average temperature gradient; three-dimensional characteristic data are processed in a secondary manner to obtain defect depth, surface roughness and fractal dimension.

[0031] S4. Data Output: The defect index is obtained by multimodal fusion of the geometric features, thermal distribution features and three-dimensional morphology features obtained from the secondary processing.

[0032] S5. Defect Classification and Decision: Analyze the fused defect index, output the defect category and confidence score, and trigger the manual review process when the confidence score is less than X.

[0033] S6. System closed-loop optimization: The detection results are transmitted to the management platform in real time, and the model performance is continuously optimized through algorithms.

[0034] It should be noted that the image acquisition steps are as follows: Figure 2 As shown, specifically:

[0035] A1. Use a 3D line laser profilometer to scan the workpiece, identify the weld location and geometry, and generate a detection path plan;

[0036] A2. Set the detection area range and adjust the laser power, camera exposure time, and gain parameters according to the material.

[0037] A3. Equip industrial cameras with a ring-shaped LED array light source and a polarizing filter to dynamically adjust the illumination angle;

[0038] A4. Industrial cameras, laser scanners, and thermal imagers are used to cover the entire trajectory of the weld seam and simultaneously acquire visible light images, three-dimensional morphology, and thermal distribution data.

[0039] The industrial camera is equipped with a telecentric lens or a fixed-focus lens to reduce distortion and provide clear imaging for different weld sizes. The equipment controls the inspection head to move along the weld trajectory through a multi-axis servo system or a robotic arm, maintaining a constant distance and supporting straight, curved, or circular welds.

[0040] After obtaining the visible light image, grayscale conversion and median filtering are used for noise reduction; contrast is enhanced and uneven illumination is eliminated through algorithms.

[0041] The grayscale processing specifically involves:

[0042] Weighted average grayscale conversion: Using the YUV / RGB channel weighting method, the green channel information with high human eye sensitivity is prioritized to reduce color interference. The effect is to reduce the data dimension to a single channel and reduce memory usage.

[0043] Specifically, noise suppression includes:

[0044] Adaptive median filtering: Based on a local window, such as 5×5 pixels, the filtering intensity is dynamically adjusted to suppress salt-and-pepper noise and Gaussian noise. First, the extreme values ​​of pixels within the window are detected. If they exceed a certain range, they are identified as noise points. Then, the noise points are replaced with the median of the neighborhood while preserving edge sharpness. It is recommended that the number of iterations be ≤2 to avoid excessive smoothing that leads to loss of details.

[0045] The contrast enhancement specifically includes:

[0046] First, contrast-limited adaptive histogram equalization is performed: the image is processed in blocks, such as 64×64 pixel blocks, and histogram equalization is performed on each sub-region. The local contrast enhancement is limited by a clipping threshold. Then, gamma correction is used to adjust the non-linear mapping of gray values ​​to enhance dark details. Its advantage is to eliminate global illumination unevenness, such as in shadow areas, while avoiding noise amplification.

[0047] Eliminating uneven lighting specifically involves:

[0048] Homomorphic filtering is used for illumination compensation: The illumination and reflection components are processed through frequency domain decomposition. First, a logarithmic transform separates the low-frequency illumination component from the high-frequency reflection component. Then, a high-pass filter is designed to suppress low-frequency illumination interference. This method is generally suitable for reflective metal surfaces or non-uniform lighting environments, such as industrial flaw detection scenarios.

[0049] To segment defect regions in visible light images, pixel-level defect segmentation must be performed first, and then a binarized mask must be output to mark suspected defect regions.

[0050] Pixel-level defect segmentation involves both traditional image processing layers and deep learning layers.

[0051] The traditional image processing layer specifically consists of:

[0052] An improved algorithm is used for initial threshold segmentation, and the local threshold range is dynamically adjusted to adapt to uneven areas of light and dark on the metal surface.

[0053] By combining edge detection and region growing algorithms, high-gradient regions are used as seed points to fill the contours of connected regions based on gray-level similarity.

[0054] The deep learning layer specifically consists of:

[0055] An encoder-decoder structure is constructed using the U-Net architecture, which integrates shallow texture features and deep semantic features through skip connections to enhance the recognition of small defects such as microcracks and pores.

[0056] By integrating a multi-scale residual module, contextual information of defects of different sizes can be extracted, thereby improving segmentation accuracy.

[0057] The output binarized mask markers include binarization processing and morphological post-processing.

[0058] The binarization process specifically involves mapping the segmentation result to a binary image of 0 and 255, storing it in an 8-bit single-channel PNG format, where 0 represents the background region and 255 represents the defect region.

[0059] The morphological post-processing specifically includes: cascading opening and closing operations, with the kernel size set according to the minimum physical size of the defect; based on connected component analysis, filtering out noise points with an area smaller than a fixed value pixel and linear artifacts with abnormal aspect ratios, where opening operations represent noise removal and closing operations represent hole filling.

[0060] It should be noted that the data preprocessing operations are as follows:

[0061] The collected weld surface images are processed once to obtain crack feature data and porosity feature data of the weld surface. Crack defects are characterized by elongated strips with irregular serrated edges; porosity defects are characterized by circular or elliptical isolated areas with smooth, textureless surfaces. Crack data is used to extract crack length, width, and number data, while porosity data is used to extract porosity area, number, and density data.

[0062] The specific operation for obtaining crack feature data from crack data through a single processing step is as follows:

[0063] All crack lengths were obtained through visible light image processing and recorded as a dataset. The maximum value is denoted as The median is the middle value after sorting in ascending order. Calculate the arithmetic mean Where t is the number of cracks. Let be any crack length.

[0064] The obtained crack lengths were then classified according to grade:

[0065] Level I: Crack length ≤ x mm, considered a minor defect, with a weighting factor of [value missing]. The value of x is between 1.2 and 1.5. The value is between 0.1 and 0.15;

[0066] Level II: x mm < crack length ≤ y mm, considered a medium defect, with a weighting factor of [value missing]. The value of y is between 2.5 and 3. The value is between 0.25 and 0.3;

[0067] Level III: Crack length y mm < z mm is considered a relatively serious defect, with a weighting factor of [value missing]. The value of z is between 4.5 and 5. The value is between 0.45 and 5;

[0068] Level IV: Crack length > g mm, considered a serious defect, with a weighting factor of [value missing]. ,in The value is between 0.1 and 0.15;

[0069] The weight allocation logic is as follows:

[0070] Level III has the highest weight: because medium-length cracks have a significant impact on structural safety and have a high priority for repair;

[0071] Level IV (low weight): Extremely long cracks may be directly deemed unacceptable and require separate handling.

[0072] Crack count by grade:

[0073] Level I quantity Level II quantity Level III quantity Level IV quantity ;

[0074] Calculate the average length of each grade:

[0075] (k=1,2,3,4);

[0076] Then calculate the weighted average:

[0077] ;

[0078] in Corresponding weights for each level;

[0079] The final average is determined by combining the statistical measure with a weighted average to design a comprehensive weight.

[0080] ;

[0081] The value of b is between 0.45 and 0.5, which is the main factor; the value of c is between 0.2 and 0.25; and the values ​​of d and e are between 0.1 and 0.15.

[0082] The width is handled in the same way as the length and is denoted as w. This embodiment will not provide a specific explanation.

[0083] The specific steps for obtaining stomatal feature data from stomatal data through a single processing step are as follows:

[0084] All pore areas were obtained through visible light image processing. Invalid data was identified: pores with areas exceeding the physical range (e.g., <0 or > the maximum theoretical value) were removed and recorded as a dataset.

[0085] ;

[0086] Let the maximum value be denoted as And calculate the average value. Where n is the number of pores, For any given pore area, data points that deviate from the mean by ±3 standard deviations are removed to reduce the impact of random errors.

[0087] Set a threshold T from the total dataset Extract all that satisfy The pore area > T, yielding a subset S = { | Given m items (T), calculate the average area:

[0088] ;

[0089] Similarly, calculate the average value of pores that do not exceed the standard. The quantity is in nm, which will not be specifically described in this embodiment.

[0090] The percentage of pores exceeding the threshold. Directly recorded as weight Calculate the weighted average:

[0091] ;

[0092] The heat distribution data is processed once to obtain temperature characteristic data, including heat input power, thermal resistivity ratio, and material thermal susceptibility coefficient.

[0093] The three-dimensional topography data is processed once to obtain the three-dimensional feature data of the defect area, including the three-dimensional coordinate point set of the defect area.

[0094] The data analysis was then conducted, specifically as follows:

[0095] Crack and porosity feature data are processed twice to obtain crack coefficient and porosity coefficient, and a comprehensive defect score is generated from the two types of defects to obtain the welding quality index. Temperature feature data is processed twice to obtain the maximum temperature difference between the defect area and the base material and the average temperature gradient. Defect depth, surface roughness and fractal dimension are obtained through secondary processing of three-dimensional feature data.

[0096] The process of performing secondary processing on crack feature data and porosity feature data to obtain crack coefficient and porosity coefficient, and then generating a comprehensive defect score based on the two types of defects to obtain the welding quality index is as follows:

[0097] The crack coefficient is specifically:

[0098] ;

[0099] in For length normalization operation, This represents the maximum allowable crack length.

[0100] For width normalization operation, The maximum allowable crack width.

[0101] For quantity normalization operation, The maximum number of cracks allowed.

[0102] in The weighting coefficients are dynamically adjusted through machine learning to match different materials.

[0103] Porosity:

[0104] ;

[0105] ‌ For the maximum area normalization operation, The area of ​​the largest pore in the sample, where This is the critical value for the maximum permissible pore area.

[0106] Weighted average area normalization operation, This is the allowable average area threshold.

[0107] This is a density normalization operation, where r is the stomatal density, i.e., the total stomatal area divided by the region area. , T represents the area of ​​the detection region.

[0108] in These are weighting coefficients. In practical applications, the critical values ​​and weighting parameters need to be calibrated according to material standards and process requirements.

[0109] Overall Defect Rating:

[0110] S = u·(C+P+v·C·P;

[0111] C+P is a linear superposition term, representing the cumulative effect of independent defects; v·C·P is a nonlinear coupling term, representing the synergistic effect of cracks and porosity on quality deterioration, v needs to be experimentally calibrated; u is used to adjust the total score range.

[0112] Welding quality index

[0113] ;

[0114] k is the slope adjustment coefficient.

[0115] when , High quality, exempt from inspection;

[0116] when , Qualified and suitable for regular use;

[0117] when , Early warning and process optimization;

[0118] when , It is invalid and must not be put into use.

[0119] in The value is between 20 and 30. The value is between 50 and 60. The value is between 80 and 90; The value is between 80 and 90. The value is between 60 and 70. The value is between 40 and 50.

[0120] The following are the maximum temperature difference and average temperature gradient values ​​between the defect area and the base material obtained by secondary processing of the temperature characteristic data:

[0121] The maximum temperature difference is specifically calculated as: the product of welding heat input power and thermal resistance ratio, multiplied by the defect projection area and the material thermal sensitivity coefficient.

[0122] The welding heat input power is calculated using welding process parameters such as current / voltage; the thermal resistance ratio is determined by the difference in thermal conductivity between the base material and the defect area; the defect projected area is determined through three-dimensional morphology measurement or radiographic analysis; and the material's thermal sensitivity coefficient is calibrated through welding tests on X80 pipeline steel.

[0123] The mean temperature gradient is specifically calculated as the ratio of the maximum temperature difference to the effective length of the defect multiplied by a geometric correction factor.

[0124] The effective length of the defect, such as crack length or pore diameter, is measured based on geometric features; the geometric correction factor is fitted using thermal imager measurement data.

[0125] The defect depth, surface roughness, and fractal dimension obtained through secondary processing of the three-dimensional feature data are as follows:

[0126] The defect depth is specifically defined as the maximum vertical dimension of the defect minus the minimum vertical dimension.

[0127] It should be explained that the three-dimensional coordinate point set of the defect area is obtained by three-dimensional laser scanning, where the vertical coordinate value of the defect area represents the vertical dimension of the defect.

[0128] The specific surface roughness parameters are:

[0129] Sum the absolute values ​​of the vertical dimensions of any defect minus the average vertical dimension, and then divide by the total number of defects.

[0130] The surface roughness parameter represents the average roughness, which is calculated based on height deviation statistics to quantify the microscopic irregularities of volumetric defects such as inclusions and pores.

[0131] Furthermore, the fractal dimension is introduced to describe its irregularity, with the specific formula being:

[0132] ;

[0133] in The number of grids containing at least one defective pixel at each scale. The dimension value is determined by the logarithmic relationship between the scaling ratio and the number of covering cells, where the grid side length is given.

[0134] The defect index is obtained by multimodal fusion of the geometric features, thermal distribution features, and three-dimensional morphology features obtained from the secondary processing. The specific formula is as follows:

[0135] Each parameter is multiplied by its weight, the sum is added together, and then divided by the sum of the weights. The weights are dynamically allocated based on the importance of the features.

[0136] It should be noted that internal welding defects mainly include: cracks, porosity, slag inclusions, incomplete penetration, and lack of fusion.

[0137] The crack defect determination is specifically based on the local high thermal gradient caused by the abrupt change in geometric depth due to the crack and the thermal conduction blocking effect. The weight of the crack is mainly allocated to the defect depth, the maximum temperature difference, and the average temperature gradient.

[0138] The specific criteria for determining porosity defects are as follows: the gas inside the pores has low thermal conductivity, exhibits a high temperature region but a gentle gradient, and has a highly complex three-dimensional morphology. Its weight is mainly allocated to the maximum temperature difference and the average temperature gradient.

[0139] The determination of inclusion defects is as follows: inclusions cause abnormal surface roughness, but have little impact on heat distribution, and their weight is mainly allocated to surface roughness.

[0140] The determination of incomplete penetration defects is specifically as follows: Incomplete penetration is characterized by a large depth but a gentle curvature, a moderate thermal gradient, and localized thermal resistance due to partial fusion. Its weight is primarily allocated to the defect depth.

[0141] The incomplete fusion judgment is specifically as follows: incomplete fusion is manifested by local low temperature, uneven thermal gradient distribution, and microscopic unevenness at the incomplete fusion interface. Its weight is mainly distributed on the average temperature gradient and surface roughness.

[0142] After determining the defect category, calculate and output the corresponding confidence score for the defect.

[0143] It should be noted that the confidence score is used to quantify the reliability of the model's determination of the defect category, and its design must meet the following requirements:

[0144] Normalized output: Maps feature parameters of different dimensions to the interval [0, 1];

[0145] Physical interpretability: The score must directly reflect the significance of the defect characteristics;

[0146] Dynamic adaptability: Automatically adjusts sensitivity based on the detection environment, such as material type and welding process.

[0147] The crack confidence formula is as follows: the maximum temperature difference divided by the calibration threshold of the thermal imager in the weld, and then multiplied by a coefficient; where the maximum temperature difference reflects the heat conduction blocking effect caused by the crack, and the calibration threshold of the thermal imager in the steel weld corresponds to the crack characteristic saturation value; the coefficient is between 0.9 and 0.95 to retain the error tolerance space and avoid overfitting to noisy data.

[0148] The formula for stoma confidence is as follows: the maximum fractal dimension of the stoma group minus the fractal dimension, divided by the statistical standard deviation, and then multiplied by a coefficient. The fractal dimension represents the three-dimensional morphological complexity of the stoma group, and the maximum fractal dimension minus the fractal dimension represents the degree to which the stoma features deviate from the standard value. The coefficient between 0.8 and 0.9 reduces the decision weight of the single feature of fractal dimension and compensates for measurement errors.

[0149] The confidence formula for inclusions is as follows: the lower limit of severe inclusions minus the difference between the surface roughness and the upper and lower limits of inclusions, and then multiplied by a coefficient. This maps the upper and lower limits of inclusions to 1-0, intuitively reflecting the degree of roughness exceeding the standard. Since the determination of inclusions needs to be combined with thermal distribution verification, the coefficient is set between 0.8 and 0.85 to reduce the single weight.

[0150] The formula for the confidence level of incomplete penetration is as follows: the defect depth divided by the maximum defect depth and then multiplied by a coefficient. The incomplete penetration depth should be avoided from being confused with the crack depth and is usually greater than the maximum crack depth. The maximum defect depth is set according to the allowable limit of incomplete penetration in the standard. The coefficient is between 0.7 and 0.8 to reduce the independent influence of depth characteristics.

[0151] The confidence formula for non-fusion is as follows: the sum of the ratio of the melt depth deviation to the maximum allowable melt depth plus the ratio of the highest proportion of the low temperature zone to the proportion of the low temperature zone, multiplied by a coefficient. When the melt depth deviation exceeds the maximum allowable melt depth, it is judged as serious non-fusion. If the proportion of the low temperature zone is too low, it may be normal thermal diffusion. If it is too high, it may be other defects. The coefficient between 0.6 and 0.65 is an implicit correction for the roughness of the fusion surface.

[0152] The difference between the actual and theoretical melting depth deviation reflects the degree of incomplete fusion at the bevel; the low-temperature zone ratio is the proportion of the low-temperature zone area caused by the obstruction of heat conduction in the incomplete fusion area.

[0153] The confidence score threshold is between 8.5 and 9. If it is lower than the threshold, the human-machine collaborative review interface will be triggered.

[0154] It should be noted that the aforementioned closed-loop optimization of the system includes manual review and annotation as well as dynamic model upgrades.

[0155] The manual review and annotation process involves the system automatically filtering out low-confidence segmentation results and pushing them to quality inspectors for manual review. The annotated and corrected data is then stored in the training library for model iteration.

[0156] The dynamic model upgrade specifically refers to the process where, when newly labeled data accumulates to a set threshold or the detection accuracy decreases, the model is retrained, and the updated model is automatically deployed to the production line equipment to achieve continuous improvement in segmentation accuracy.

Claims

1. A method for detecting weld defects based on visual images, characterized in that, Specifically, the following steps are included: S1. Image Acquisition: An industrial camera is used in conjunction with a ring LED light source and a polarizing filter to eliminate the interference of reflection from the metal surface and acquire visible light images of the weld surface; and an integrated laser displacement sensor and infrared thermal imager are added to the industrial camera to simultaneously acquire the three-dimensional morphology and thermal distribution data of the weld. S2. Image preprocessing: The acquired weld surface image is processed once to obtain crack feature data and porosity feature data of the weld surface. The heat distribution data is processed once to obtain temperature feature data. The three-dimensional morphology is processed once to obtain three-dimensional feature data of the defect area. Crack data includes crack length, width, and number data. Crack feature data is obtained by processing the crack length and width data, specifically: Crack length and width are divided into 4 levels. The average value of each level is calculated and then weighted. The average value is then calculated together with the maximum value, median and arithmetic mean to calculate the final average value. Stomatal data includes stomatal area and quantity data. Stomatal feature data is obtained by processing the stomatal area data, specifically: Calculate the average stomatal area and remove data that deviate from the mean by ±3 standard deviations. Extract the area exceeding the stomatal area threshold and calculate the average value. Then, perform a weighted average with the average stomatal area that does not exceed the threshold to obtain the final average value. S3. Data Analysis: Crack characteristic data and porosity characteristic data are processed in a secondary manner to obtain crack coefficient and porosity coefficient, and a comprehensive defect score is generated through the two types of defects to obtain the welding quality index; temperature characteristic data are processed in a secondary manner to obtain the maximum temperature difference between the defect area and the base material and the average temperature gradient; three-dimensional characteristic data are processed in a secondary manner to obtain defect depth, surface roughness and fractal dimension. The crack coefficient is specifically: The crack coefficient is obtained by normalizing the final average values ​​of crack length and width and the number of cracks and then weighting them. The porosity coefficient is specifically: The porosity coefficient is obtained by normalizing the maximum stomatal area, the final average stomatal area, and the stomatal density, and then weighting them. The comprehensive defect score is as follows: ; C+P is a linear superposition term, representing the cumulative effect of independent defects; v·C·P is a nonlinear coupling term, representing the synergistic effect of cracks and porosity on quality degradation, v needs to be experimentally calibrated; u is used to adjust the total score range. The welding quality index is specifically as follows: ; k is the slope adjustment coefficient; S4. Data Output: The defect index is obtained by multimodal fusion of the geometric features, thermal distribution features and three-dimensional morphology features obtained from the secondary processing. S5. Defect Classification and Decision: Analyze the fused defect index, output the defect category and confidence score, and trigger the manual review process when the confidence score is less than X. S6. System closed-loop optimization: The detection results are transmitted to the management platform in real time, and the model performance is continuously optimized through algorithms.

2. The method for detecting weld defects based on visual images as described in claim 1, characterized in that: The specific data collection steps are as follows: A1. Use a 3D line laser profilometer to scan the workpiece, identify the weld location and geometry, and generate a detection path plan; A2. Set the detection area range and adjust the laser power, camera exposure time, and gain parameters according to the material. A3. Equip industrial cameras with a ring-shaped LED array light source and a polarizing filter to dynamically adjust the illumination angle; A4. Industrial cameras, laser scanners, and thermal imagers are used to cover the entire trajectory of the weld seam and simultaneously acquire visible light images, three-dimensional morphology, and thermal distribution data.

3. The method for detecting weld defects based on visual images as described in claim 1, characterized in that: The heat distribution data is processed once to obtain temperature characteristic data, including thermal input power, thermal resistance ratio, and material thermal susceptibility coefficient; The three-dimensional topography is processed once to obtain the three-dimensional feature data of the defect area, which includes the three-dimensional coordinate point set of the defect area.

4. The method for detecting weld defects based on visual images as described in claim 1, characterized in that: The temperature characteristic data is processed in a secondary manner to obtain the maximum temperature difference and the average temperature gradient between the defect area and the base material. The defect depth, surface roughness, and fractal dimension are obtained through secondary processing of the three-dimensional feature data.

5. The method for detecting weld defects based on visual images as described in claim 4, characterized in that: ‌ The defect depth, surface roughness, and fractal dimension obtained through secondary processing of the three-dimensional feature data are as follows: The defect depth is specifically defined as: the maximum vertical dimension of the defect minus the minimum vertical dimension. The vertical dimension of the defect is the vertical coordinate value of the three-dimensional coordinate point set; The specific surface roughness parameters are: Sum the absolute values ​​of the vertical dimensions of any defect minus the average vertical dimensions, and then divide by the total number of defects. Furthermore, the fractal dimension is introduced to describe its irregularity, with the specific formula being: ; in The number of grids containing at least one defective pixel at each scale. The dimension value is determined by the logarithmic relationship between the scaling ratio and the number of covering cells, where the grid side length is given.

6. The method for detecting weld defects based on visual images as described in claim 1, characterized in that: The formula for obtaining the defect index through multimodal fusion is as follows: Each parameter is multiplied by its weight, summed, and then divided by the sum of the weights; the fusion method is feature-level weighted fusion, where the weights are dynamically allocated based on the importance of the features.