A method and device for quantitatively detecting porosity of an ultrasonic welded joint

CN123015408APending Publication Date: 2026-10-30SHENZHEN POLYTECHNIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611108103.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

响应曲面法虽已被尝试,但普遍未将“孔隙率”作为核心质量响应指标引入优化模型,仍依赖拉脱力等宏观性能进行经验判断,导致优化结果与微观缺陷演化机制脱节

Benefits of technology

[0011]根据本发明提供的超声波焊接接头的孔隙率定量检测方法及装置,通过获取待测超声波焊接接头的截面显微图像并进行预处理以获得稳定灰度图像,进而采用反相多阈值二值化分割策略,利用多个阈值对图像灰度层次进行分段处理,有效规避了单一阈值对图像噪声、亮度波动或材料不均匀性所引发的误判风险;随后,将所得二值化图像依次进行形态学开运算以消除孤立噪声点和细小扰动,并结合连通域分析精准识别并标记真实孔隙区域,从而在不依赖人工干预的前提下实现孔隙区域的稳定提取与量化统计。该方法通过多阈值分割与形态学后处理的协同作用,显著降低了孔隙率检测结果对图像灰度阈值选择的敏感性,提升了检测过程的鲁棒性与重复性,从而有效解决现有技术中超声波焊接接头孔隙率定量检测因阈值选择不当而导致的稳定性差、结果波动大的技术问题,实现高精度、高一致性的孔隙率与孔隙数量自动量化分析。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

The present application relates to the technical field of welding engineering, and particularly relates to a porosity quantitative detection method and device for ultrasonic welding joints. The method comprises the following steps: obtaining a cross-section microscopic image of an ultrasonic welding joint to be detected and preprocessing the image to obtain a stable gray image; then, adopting an inverse multi-threshold binaryzation segmentation strategy, the gray level of the image is segmented and processed by using multiple thresholds, so that the risk of misjudgment caused by a single threshold to image noise, brightness fluctuation or material non-uniformity is effectively avoided; subsequently, the obtained binaryzation image is sequentially subjected to a morphological open operation to eliminate isolated noise points and small disturbances, and the real pore area is accurately identified and marked in combination with connected domain analysis, so that stable extraction and quantitative statistics of the pore area are realized without relying on manual intervention. In this way, the porosity of the ultrasonic welding joint can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of welding engineering technology, and in particular to a method and apparatus for quantitative detection of porosity in ultrasonic welded joints. Background Technology

[0002] Ultrasonic metal welding is a fusion-free welding technology that achieves solid-state metallurgical bonding based on high-frequency mechanical vibration. It boasts advantages such as low heat input, high speed, and the elimination of the need for filler materials and shielding gases, making it widely used in fields such as new energy vehicle power battery connections and precision electronic component manufacturing. However, during the welding process between wire harnesses and terminals, the joint is highly susceptible to porosity—microscopic voids in the interface or matrix—due to the combined effects of material cleanliness, geometric compatibility, and process parameters. These pores not only weaken the current conduction path and exacerbate local Joule heating, but also significantly reduce the joint's fatigue life and accelerate electrochemical corrosion, representing a key defect affecting welding reliability.

[0003] Currently, the detection of porosity in ultrasonic welded joints mainly relies on metallographic or scanning electron microscopy (SEM) image analysis. The mainstream methods include: (1) Deep learning methods: such as improved YOLO, U-Net and other models. Although they have certain recognition accuracy, they rely heavily on large-scale labeled datasets and high-performance GPUs. The black box characteristics of the models result in poor physical interpretability of the results, making it difficult to deploy and verify them quickly on the production line; (2) Single threshold image segmentation methods: such as the Otsu method. It is sensitive to the gray distribution of the image and is prone to missegmentation in the gray-scale overlap area between the pores and the metal background. Experiments show that its porosity detection variation coefficient is as high as 17.42%, and the repeatability is poor; (3) Multi-threshold optimization methods: such as entropy optimization threshold segmentation based on the Aquila algorithm. Although it improves robustness, it still lacks a systematic evaluation mechanism for threshold stability and has not established a dynamic analysis framework of "threshold-porosity response".

[0004] In terms of process optimization, existing studies mostly employ single-factor experiments or full-factor designs, neglecting the nonlinear interaction effects among pressure, amplitude, and energy. While response surface methodology has been attempted, it generally fails to incorporate porosity as a core quality response indicator into the optimization model, relying instead on empirical judgments based on macroscopic properties such as pull-out force. This leads to a disconnect between optimization results and the evolution mechanism of microscopic defects. Particularly in the Cu-Al system, the antagonistic effect of pressure and amplitude has not yet been quantitatively revealed, resulting in a lack of scientific basis for process adjustments.

[0005] Based on this, the present invention proposes a method and apparatus for quantitative detection of porosity of ultrasonic welded joints to solve the above-mentioned technical problems. Summary of the Invention

[0006] This invention describes a method and apparatus for quantitatively detecting the porosity of ultrasonic welded joints, which can accurately detect the porosity of ultrasonic welded joints.

[0007] According to a first aspect, the present invention provides a method for quantitatively detecting the porosity of an ultrasonically welded joint, comprising: Obtain a cross-sectional microscopic image of the ultrasonic welded joint to be tested; The cross-sectional microscopic image is preprocessed to obtain a preprocessed grayscale image; The preprocessed grayscale image is subjected to inverse multi-threshold binarization segmentation to obtain the corresponding binarized image; The binarized image is subjected to morphological opening operations and connected component analysis in sequence to identify and mark each pore region, thereby obtaining porosity and the number of pores.

[0008] According to a second aspect, the present invention provides a device for quantitatively detecting the porosity of an ultrasonic welded joint, comprising: The acquisition unit is configured to acquire a cross-sectional microscopic image of the ultrasonic welded joint under test; The first data processing unit is configured to preprocess the cross-sectional microscopic image to obtain a preprocessed grayscale image. The second data processing unit is configured to perform inverse multi-threshold binarization segmentation on the preprocessed grayscale image to obtain the corresponding binarized image; The third data processing unit is configured to sequentially perform morphological opening operations and connected component analysis on the binarized image, identify and mark each pore region, and obtain porosity and pore number.

[0009] Thirdly, embodiments of this specification also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any embodiment of this specification.

[0010] Fourthly, embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described in any embodiment of this specification.

[0011] The present invention provides a method and apparatus for quantitative detection of porosity in ultrasonic welded joints. By acquiring a cross-sectional microscopic image of the ultrasonic welded joint under test and preprocessing it to obtain a stable grayscale image, a multi-threshold binarization segmentation strategy is employed. Multiple thresholds are used to segment the image grayscale levels, effectively avoiding the risk of misjudgment caused by image noise, brightness fluctuations, or material inhomogeneity due to a single threshold. Subsequently, morphological opening operations are performed on the obtained binarized image to eliminate isolated noise points and minor disturbances. Combined with connected component analysis, the true pore regions are accurately identified and marked, thereby achieving stable extraction and quantitative statistics of pore regions without relying on manual intervention. This method, through the synergistic effect of multi-threshold segmentation and morphological post-processing, significantly reduces the sensitivity of porosity detection results to the selection of image grayscale thresholds, improving the robustness and repeatability of the detection process. This effectively solves the technical problems of poor stability and large fluctuations in results caused by improper threshold selection in the quantitative detection of porosity in ultrasonic welded joints in existing technologies, achieving high-precision and highly consistent automatic quantitative analysis of porosity and pore quantity. Attached Figure Description

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

[0013] Figure 1 A flowchart illustrating a method for quantitatively detecting the porosity of an ultrasonically welded joint according to one embodiment is shown. Figure 2 A schematic block diagram of a porosity quantitative detection device for an ultrasonic welded joint according to one embodiment is shown. Figure 3 A porosity-threshold response curve and a schematic diagram of stable interval identification are shown according to one embodiment; Figure 4 A schematic flowchart of an ultrasonic welding process parameter optimization method based on response surface methodology according to one embodiment is shown. Detailed Implementation

[0014] The solution provided by the present invention will now be described with reference to the accompanying drawings.

[0015] Figure 1 This diagram illustrates a flow chart of a method for quantitatively detecting the porosity of an ultrasonically welded joint according to one embodiment. It is understood that this method can be performed by any device, equipment, platform, or cluster of devices with computing and processing capabilities. Figure 1 As shown, the method includes: Step 100: Obtain a cross-sectional microscopic image of the ultrasonic welded joint to be tested; Step 102: Preprocess the cross-sectional microscopic image to obtain a preprocessed grayscale image; Step 104: Perform inverse multi-threshold binarization segmentation on the preprocessed grayscale image to obtain the corresponding binarized image; Step 106: Perform morphological operations and connected component analysis on the binarized image in sequence to identify and mark each pore region, and obtain the porosity and number of pores.

[0016] In this embodiment, firstly, a cross-sectional microscopic image of the ultrasonic welded joint to be tested is acquired to obtain original visual information reflecting the internal structural morphology of the joint. This image directly reflects the distribution characteristics of the welding interface and the porous regions within the material. The cross-sectional microscopic image is preprocessed to transform the original image into a grayscale image suitable for subsequent analysis through a series of image processing operations, ensuring that the image data has a unified grayscale representation. Inverse multi-threshold binarization segmentation is applied to the preprocessed grayscale image. This involves performing binarization operations on multiple thresholds within a preset grayscale range, marking pixels with grayscale values ​​below each threshold as porous regions (value 1), and pixels with grayscale values ​​greater than or equal to the threshold as metal matrix regions (value 0). This generates a corresponding binary image for each threshold, enabling multiple sets of binary representations of the same grayscale image under different segmentation criteria. The binarized image is subjected to morphological opening and connected component analysis sequentially. Morphological opening is used to erode and then dilate the foreground region in the binarized image to eliminate noise artifacts smaller than the structuring element and preserve the basic shape of the pore region. Then, connected component analysis is applied to the image after opening to identify and label all interconnected foreground pixel groups. Each connected region corresponds to an independent pore region. The ratio of the total area of ​​these labeled pore regions to the total area of ​​the image is calculated to directly obtain the porosity and the number of pores. Thus, this invention can accurately detect the porosity of ultrasonically welded joints.

[0017] In one embodiment of the present invention, after performing morphological opening operations and connected component analysis on the binarized image sequentially to identify and label each pore region and obtain porosity and pore number, the method further includes: Construct a porosity threshold response curve with the threshold as the horizontal axis and porosity as the vertical axis; Calculate the local sensitivity at each threshold point on the response curve; where the local sensitivity is the ratio of the absolute value of the porosity difference between adjacent thresholds to the threshold step size; The threshold points with local sensitivity not greater than the preset tolerance limit are selected to form a set of candidate stable points, and multiple continuous stable intervals are obtained by dividing adjacent candidate stable points. The final stable operating range is determined based on multiple continuous stable ranges; The final porosity of the ultrasonically welded joint is determined based on the final stable operating range.

[0018] In this embodiment, after preprocessing and inverse multi-threshold binarization segmentation of the cross-sectional microscopic image of the ultrasonic welded joint, morphological opening operation and connected component analysis are further performed on the binarized image to obtain porosity and pore number. Based on this, a response curve is constructed with the threshold as the horizontal axis and porosity as the vertical axis. By calculating the ratio of the absolute value of the porosity difference between adjacent threshold points to the threshold step size, the local sensitivity of each threshold point is quantified. Then, candidate stable points with sensitivity not exceeding the preset tolerance upper limit are screened out. Multiple continuous stable intervals are divided based on adjacent candidate stable points. Finally, multiple stable intervals are combined to determine a final stable working interval with anti-fluctuation capability. The porosity within this interval is used as the final detection result, thereby effectively avoiding the problem of drastic fluctuations in detection results caused by traditional single-point threshold selection, and achieving high stability and high reliability of quantitative porosity detection.

[0019] For example, when performing quantitative porosity analysis on metallographic cross-sectional images of ultrasonic welded joints, the system first acquires a binarized image and performs morphological opening operations and connected component analysis, outputting the porosity and number of pores corresponding to each threshold. Then, a porosity threshold response curve is constructed with the threshold as the horizontal axis and porosity as the vertical axis. The local sensitivity of each point on the curve is calculated; this local sensitivity is the ratio of the absolute value of the porosity difference between adjacent thresholds to the threshold step size. The system selects threshold points whose local sensitivity is not greater than a preset tolerance upper limit, forming a candidate stable point set, and divides multiple continuous stable intervals based on adjacent candidate stable points. Subsequently, the interval with the longest length and smallest porosity variance is determined from these continuous stable intervals as the final stable working interval. Finally, based on the binarized image corresponding to the threshold point with the smallest discrete curvature within this interval, the final porosity of the ultrasonic welded joint is output.

[0020] In one embodiment of the present invention, the final stable operating interval is determined based on multiple consecutive stable intervals, including: If there are no multiple consecutive stable intervals of the same length, the longest consecutive stable interval is selected as the final stable working interval. If multiple continuous stable intervals of the same length exist, the interval with the smallest porosity sample variance is selected as the final stable working interval.

[0021] In this embodiment, by introducing dual objective criteria based on interval length and porosity sample variance in multiple continuous stable intervals, when there are no multiple stable intervals of the same length, the interval with the longest length is selected as the final stable working interval to ensure that the selected interval covers the widest threshold range and has the most sufficient stability. When there are multiple stable intervals of the same length, the variance of porosity samples in each interval is further compared, and the interval with the smallest variance is selected as the final stable working interval. Thus, while maintaining the consistency of interval length, the region with the smallest porosity fluctuation and the most concentrated data is selected first, effectively avoiding judgment bias caused by subjective selection, significantly improving the stability, consistency and repeatability of the final porosity determination result, fundamentally solving the problem of selection uncertainty when multiple intervals coexist, and realizing high robustness and engineering practicality of quantitative detection of porosity in ultrasonic welded joints.

[0022] In one embodiment of the present invention, determining the final porosity of the ultrasonically welded joint based on the final stable operating range includes: Within the final stable working interval, calculate the discrete curvature of each threshold point in the interval and the absolute value of the ratio of the second-order central difference at the threshold point to the square of the threshold step size. The threshold point with the smallest discrete curvature value is selected as the optimal threshold. The image is then binarized using the optimal threshold, and the final porosity of the ultrasonic welded joint is obtained based on the binarized image. In this embodiment, based on the determined final stable working range, the discrete curvature of each threshold point within this range is further calculated. This discrete curvature is quantified by the absolute value of the ratio of the second-order central difference at the threshold point to the square of the threshold step size, to characterize the local curvature of the porosity threshold response curve within this range. By selecting the threshold point with the smallest discrete curvature as the optimal threshold, the point where the response curve changes most smoothly and is closest to a linear trend within the stable range is essentially located, thus effectively avoiding the porosity calculation fluctuations caused by the random selection of multiple candidate thresholds within the range. Using this optimal threshold to binarize the preprocessed grayscale image yields a binarized image with high consistency and low noise interference. Then, through morphological operations and connected component analysis, the pore region is accurately identified, ultimately achieving high-precision and high-stability quantitative detection of the porosity of ultrasonic welded joints. This solves the problem of decreased accuracy caused by the uncertainty of multiple threshold selection within the stable range, significantly improving the reliability and repeatability of the detection results.

[0023] In one embodiment of the present invention, the preprocessing includes grayscale conversion processing, contrast enhancement processing, and filtering and noise reduction preprocessing; Cross-sectional micrographs include both the porous region and the metal matrix region; The contrast enhancement process is an adaptive histogram equalization process.

[0024] In this embodiment, preprocessing techniques such as grayscale conversion, contrast enhancement, and filtering and denoising are used to eliminate color interference, uneven illumination, and noise pollution caused by differences in imaging conditions in the original image. This makes the grayscale distribution of the pore region and the metal substrate region in the image more stable, thereby improving the consistency of the response of subsequent segmentation steps to grayscale value changes.

[0025] In one embodiment of the present invention, the porosity is determined by the following formula:

[0026] In the formula, Porosity Let W be the pixel area of ​​the i-th aperture, and W be the image width. Image height.

[0027] In one embodiment of the present invention, binary segmentation is performed using the following formula:

[0028] In the formula, For binarized segmented images, Let be the gray value of the filtered grayscale image at pixel position (x, y). Let be the i-th threshold.

[0029] In this embodiment, the ultrasonic welding process parameter optimization method uses the aforementioned quantitative porosity detection method to obtain the porosity of the joint under different welding process parameters, and combines the joint mechanical property test results to optimize the process parameters, including the following steps: S6, determine the welding process parameter factors and their level ranges, and construct an experimental scheme using Box-Behnken experimental design. The welding process parameter factors include three factors: welding pressure, welding amplitude, and welding energy, with three levels set for each factor. S7, prepare welded joint samples according to the experimental scheme, detect the porosity of each sample using the aforementioned quantitative porosity detection method, and conduct mechanical property tests to obtain the joint pull-out force. S8, establish a second-order response surface model with welding process parameters as independent variables and joint pull-out force as the response value, and test the significance of the model through analysis of variance, eliminating insignificant terms. The coefficient of determination R² of the second-order response surface model is not less than 0.95, the difference between the adjusted coefficient of determination and the predicted coefficient of determination does not exceed 0.05, and the p-value of the lack-of-fit term is greater than 0.05. S9. Based on the response surface model, analyze the main effects and interaction effects of each process parameter, and use the expectation function for multi-objective optimization to obtain the optimal parameter combination. S10. Conduct verification experiments under the optimal parameter combination, and use a quantitative porosity detection method to verify the porosity level of the joint.

[0030] In this embodiment, taking a Cu-Al dissimilar metal ultrasonic welding joint as an example, the quantitative porosity detection method of the present invention is described in detail.

[0031] Step S1: Image Acquisition and Preprocessing. Acquire scanning electron microscope (SEM) images of the cross-section of the ultrasonically welded joint, including the porosity region and the metal matrix region. Convert the original color image to grayscale: Where R, G, and B are the pixel intensity values ​​of the red, green, and blue channels, respectively. Contrast-limited adaptive histogram equalization (CLAHE) is applied to the grayscale image for contrast enhancement to address the problem of insufficient contrast between pores and the matrix caused by uneven illumination in metallographic and SEM images. The CLAHE method performs histogram equalization on local image regions while limiting noise amplification through a contrast cropping mechanism. Subsequently, median filtering is used to denoise the enhanced image, removing impulse noise while preserving pore boundary information.

[0032] Step S2: Multi-threshold inverse binarization segmentation. Based on the grayscale histogram of the cross-sectional image, a preset grayscale range is determined. In the SEM image, pores appear as dark areas with low grayscale values ​​due to their low reflectivity, while the metal substrate appears as areas with high grayscale values. Based on grayscale histogram analysis, the threshold search range is set to 50-120 grayscale levels, and a threshold set {50, 60, 70, ..., 120} is constructed with a step size of 10. For each threshold t, inverse binarization segmentation is performed: ,in (x,y) represents the gray value of the filtered grayscale image at pixel position (x,y), and B_t(x,y) represents the binarized image.

[0033] Step S3: Morphological Opening and Connected Component Analysis. A morphological operation of erosion followed by dilation is performed on each binarized image using a pre-defined disk-shaped structuring element. The morphological opening operation effectively removes foreground objects smaller than the structuring element while largely preserving the shape and size of the actual pore regions. Connected component analysis is then performed on the binarized image after the opening operation using the 8-connectivity rule, marking each group of connected foreground pixels as an independent pore region. Based on the identified pore regions, the cross-sectional porosity is calculated.

[0034] Step S4: Construction of porosity-threshold response curve and identification of stable interval. For example... Figure 3As shown, a porosity-threshold response curve is plotted with the threshold value on the horizontal axis and porosity on the vertical axis. As the threshold increases, more and more dark areas are classified as pores, and the porosity increases monotonically. The local sensitivity at each threshold point is calculated. The physical meaning of local sensitivity is the approximate absolute slope of the response curve at the threshold; a larger value indicates that the porosity estimation is more sensitive to grayscale fluctuations near that threshold. An upper limit for sensitivity tolerance is set, and threshold points that meet the conditions are selected to form a candidate stable point set. A continuous stable interval is formed by adjacent candidate stable points. When the longest stable interval is not unique, the interval with the smallest porosity sample variance is selected as the final stable working interval.

[0035] Step S5: Optimal Threshold Selection and Final Porosity Calculation. Within the continuous stable interval, the discrete curvature of each threshold point is calculated. The discrete curvature measures the degree to which the response curve deviates from the linear trend at that point. The threshold point with the smallest discrete curvature is selected as the optimal threshold. This threshold not only lies in the low-sensitivity region but is also the point within that region where the change is most uniform and closest to a straight line, exhibiting optimal local stability. The final porosity of the joint is calculated based on the binarized image corresponding to the optimal threshold.

[0036] Experimental Verification: Taking a Cu-Al ultrasonic welded joint as an example, the porosity of 25 SEM images was detected using the method described in this embodiment. Experimental conditions: The welding materials were 70mm² T2 oxygen-free copper wire harness and 80mm×50mm×4mm 6061-T6 aluminum terminals; the welding energy was 12-14kJ; the welding pressure was 0.3MPa; the welding amplitude was 90%; the cross-section was sampled by wire cutting; the metallographic preparation involved grinding with 320-grit and 800-grit sandpaper followed by ultrasonic cleaning; and the SEM equipment was a JEOL JSM-IT800.

[0037] Table 1 Comparison of porosity results using different detection methods

[0038] The results show that the method of the present invention is superior to the comparative method in terms of detection accuracy and stability, with a coefficient of variation of only 6.96%, which is 60% lower than the traditional Otsu method.

[0039] This embodiment combines a quantitative porosity detection method and a response surface methodology to optimize the ultrasonic welding process parameters for Cu-Al dissimilar metals.

[0040] Step S6: Experimental Design. For example... Figure 4As shown, the welding materials selected were T2 oxygen-free copper wire harness with a cross-sectional area of ​​70 mm² and 5052 / 6061 aluminum terminals with dimensions of 80 mm × 50 mm × 4 mm. The welding equipment was a Branson 20DPACT ultrasonic welding machine. Three process parameter factors were determined: welding pressure (P), welding amplitude (A), and welding energy (E). Based on the Box-Behnken design principle, 15 experimental schemes with three factors and three levels were constructed.

[0041] Table 2 Factor Level Table

[0042] Step S7: Sample Preparation and Performance Testing. Welded joint samples were prepared according to the experimental protocol. Five repeated experiments were performed for each set of parameters (excluding the center point), and the average value was taken after removing the maximum and minimum values. Three sets of experiments were repeated for the center point, totaling 15 experiments. The porosity of the joint cross-section of each sample was detected using the method described in Example 1 of this invention. Simultaneously, a joint pull-out force test was performed, pulling the sample axially at a speed of 5 mm / min until the weld interface detached or the joint broke, and the maximum pull force was recorded.

[0043] Step S8: Establishment of the response surface model. Using the orthogonally coded welding pressure x1, energy x2, and amplitude x3 as independent variables, and the joint pull-out force Y as the response value, a second-order polynomial regression model is established, and the significance of the model is tested by ANOVA analysis.

[0044] Table 3 Statistical Indicators of the Model

[0045] The above results indicate that the model fits well and has good predictive ability. Regression coefficient analysis of each parameter shows that welding pressure has the strongest influence, accounting for approximately 73.37% of all positive main effects. The interaction coefficient between pressure and amplitude is negative, indicating an antagonistic effect between the two parameters, with the antagonistic effect accounting for approximately 13.70% of the total positive effects.

[0046] Step S9: Multi-objective optimization. Numerical optimization is performed using the expectation function to constrain welding pressure, amplitude, and energy within the experimental range, with the objective being the maximum pull-out force. The optimized solution yields the optimal parameter combination: pressure 0.449 MPa, energy 14491.3 J, amplitude 90%, expectation function value 0.980, and the model predicts a theoretical maximum tensile load of 8506.34 N. This optimal solution employs a process combination strategy of high pressure combined with medium-low amplitude, effectively avoiding the antagonistic effect between pressure and amplitude.

[0047] Step S10: Verification Experiment. Ten replicates of the sample were performed using the optimal parameter combination for verification. The results showed that the average pull-out force of the 10 replicated samples was close to the model prediction value, and the relative error was within an acceptable range, verifying the high prediction accuracy and engineering reliability of the optimized model. Simultaneously, the porosity quantitative detection method of this invention was used to verify the joint porosity level, confirming that the porosity was significantly reduced under the optimal parameters.

[0048] This embodiment uses welding energy as a single variable, with a fixed welding pressure of 0.3 MPa and welding amplitude of 90%. A single-factor experiment was conducted within the range of 8-15 kJ in 1 kJ increments to determine the optimal energy window for ultrasonic welding of large-diameter Cu wire harnesses to Al terminals. Experimental results show that when the welding energy is below 9 kJ, an effective connection cannot be formed between the wire harness and the terminal; from 10 kJ to 14 kJ, the average peak load of the joint gradually increases from 278.48 N to 1508.52 N; when the welding energy reaches 15 kJ, over-welding occurs, and the tensile load begins to decrease. Within the optimal energy window of 13 kJ to 14 kJ, the tensile strength of the joint reaches a high level, the porosity decreases by more than 2.32%, and the bonding form between the copper wire cores and between the copper wire cores and the aluminum terminals changes from point and line connections to surface connections, resulting in increasingly tight metallurgical bonding between dissimilar metal materials. The porosity quantitative detection method of this invention is used to quantitatively analyze the cross-sectional porosity of joints under different energies, verifying the trend that porosity gradually decreases as welding energy increases within the optimal window, thus providing a quantitative basis for the precise definition of the energy window.

[0049] The foregoing has described specific embodiments of the invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0050] According to another embodiment, the present invention provides a device for quantitatively detecting the porosity of ultrasonic welded joints. Figure 2 A schematic block diagram of a device for quantitatively detecting the porosity of an ultrasonically welded joint according to one embodiment is shown. It will be understood that this device can be implemented by any apparatus, device, platform, or cluster of devices with computing and processing capabilities. Figure 2 As shown, the device includes: an acquisition unit 200, a first data processing unit 202, a second data processing unit 204, and a third data processing unit 206. The main functions of each component are as follows: The acquisition unit 200 is configured to acquire a cross-sectional microscopic image of the ultrasonic welded joint under test; The first data processing unit 202 is configured to preprocess the cross-sectional microscopic image to obtain a preprocessed grayscale image. The second data processing unit 204 is configured to perform inverse multi-threshold binarization segmentation on the preprocessed grayscale image to obtain the corresponding binarized image. The third data processing unit 206 is configured to sequentially perform morphological opening operations and connected component analysis on the binarized image, identify and mark each pore region, and obtain porosity and number of pores.

[0051] In one embodiment of the present invention, the apparatus further includes a fourth data processing unit, the fourth data processing unit being configured to perform the following operations: Construct a porosity threshold response curve with the threshold as the horizontal axis and porosity as the vertical axis; Calculate the local sensitivity at each threshold point on the response curve; wherein, the local sensitivity is the ratio of the absolute value of the porosity difference between adjacent thresholds to the threshold step size; The threshold points with local sensitivity not greater than the preset tolerance limit are selected to form a set of candidate stable points, and multiple continuous stable intervals are obtained by dividing adjacent candidate stable points. The final stable operating range is determined based on multiple continuous stable ranges; The final porosity of the ultrasonically welded joint is determined based on the final stable operating range.

[0052] In one embodiment of the present invention, the fourth data processing unit, when performing the operation of "determining the final stable working interval based on multiple continuous stable intervals", performs the following operation: If there are no multiple consecutive stable intervals of the same length, the longest consecutive stable interval is selected as the final stable working interval. If multiple consecutive stable intervals of the same length exist, the interval with the smallest porosity sample variance is selected as the final stable working interval.

[0053] In one embodiment of the present invention, the fourth data processing unit, when performing the "determining the final porosity of the ultrasonic welded joint based on the final stable operating range" operation, performs the following operation: Within the final stable working interval, the discrete curvature of each threshold point within the interval is calculated, and the discrete curvature is the absolute value of the ratio of the second-order central difference at the threshold point to the square of the threshold step size. The threshold point with the smallest discrete curvature value is selected as the optimal threshold. The image is binarized using the optimal threshold, and the final porosity of the ultrasonic welded joint is obtained based on the binarized image.

[0054] In one embodiment of the present invention, the preprocessing includes grayscale conversion processing, contrast enhancement processing, and filtering and noise reduction preprocessing; The cross-sectional micrograph includes a porous region and a metal substrate region; The contrast enhancement process is an adaptive histogram equalization process.

[0055] In one embodiment of the present invention, the porosity is determined by the following formula:

[0056] In the formula, Porosity Let W be the pixel area of ​​the i-th aperture, and W be the image width. Image height.

[0057] In one embodiment of the present invention, the binarization segmentation is performed using the following formula:

[0058] In the formula, For binarized segmented images, Let be the gray value of the filtered grayscale image at pixel position (x, y). Let be the i-th threshold.

[0059] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 1 The method described.

[0060] According to another embodiment, an electronic device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 1 The method described.

[0061] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0062] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0063] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for quantitatively detecting the porosity of an ultrasonically welded joint, characterized in that, include: Obtain a cross-sectional microscopic image of the ultrasonic welded joint to be tested; The cross-sectional microscopic image is preprocessed to obtain a preprocessed grayscale image; The preprocessed grayscale image is subjected to inverse multi-threshold binarization segmentation to obtain the corresponding binarized image; The binarized image is subjected to morphological opening operations and connected component analysis in sequence to identify and mark each pore region, thereby obtaining porosity and the number of pores.

2. The method according to claim 1, characterized in that, After performing morphological opening operations and connected component analysis on the binarized image sequentially to identify and label each pore region and obtain porosity and pore number, the method further includes: Construct a porosity threshold response curve with the threshold as the horizontal axis and porosity as the vertical axis; Calculate the local sensitivity at each threshold point on the response curve; wherein, the local sensitivity is the ratio of the absolute value of the porosity difference between adjacent thresholds to the threshold step size; The threshold points with local sensitivity not greater than the preset tolerance limit are selected to form a set of candidate stable points, and multiple continuous stable intervals are obtained by dividing adjacent candidate stable points. The final stable operating range is determined based on multiple continuous stable ranges; The final porosity of the ultrasonically welded joint is determined based on the final stable operating range.

3. The method according to claim 2, characterized in that, The determination of the final stable operating range based on multiple continuous stable ranges includes: If there are no multiple consecutive stable intervals of the same length, the longest consecutive stable interval is selected as the final stable working interval. If multiple consecutive stable intervals of the same length exist, the interval with the smallest porosity sample variance is selected as the final stable working interval.

4. The method according to claim 2, characterized in that, The determination of the final porosity of the ultrasonically welded joint based on the final stable operating range includes: Within the final stable working interval, the discrete curvature of each threshold point within the interval is calculated, and the discrete curvature is the absolute value of the ratio of the second-order central difference at the threshold point to the square of the threshold step size. The threshold point with the smallest discrete curvature value is selected as the optimal threshold. The image is binarized using the optimal threshold, and the final porosity of the ultrasonic welded joint is obtained based on the binarized image.

5. The method according to claim 1, characterized in that, The preprocessing includes grayscale conversion processing, contrast enhancement processing, and filtering and noise reduction preprocessing. The cross-sectional micrograph includes a porous region and a metal substrate region; The contrast enhancement process is an adaptive histogram equalization process.

6. The method according to claim 1, characterized in that, The porosity is determined by the following formula: In the formula, Porosity Let W be the pixel area of ​​the i-th aperture, and W be the image width. Image height.

7. The method according to claim 1, characterized in that, The binarization segmentation is performed using the following formula: In the formula, For binarized segmented images, Let be the gray value of the filtered grayscale image at pixel position (x, y). Let be the i-th threshold.

8. A device for quantitatively detecting the porosity of an ultrasonic welded joint, characterized in that, include: The acquisition unit is configured to acquire a cross-sectional microscopic image of the ultrasonic welded joint under test; The first data processing unit is configured to preprocess the cross-sectional microscopic image to obtain a preprocessed grayscale image. The second data processing unit is configured to perform inverse multi-threshold binarization segmentation on the preprocessed grayscale image to obtain the corresponding binarized image; The third data processing unit is configured to sequentially perform morphological opening operations and connected component analysis on the binarized image, identify and mark each pore region, and obtain porosity and pore number.

9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to perform the method described in any one of claims 1-7.