A method for detecting defect size of metal components

By generating three-dimensional models and feature fusion technology, it solves the problem of defect detection of multi-type and multi-size metal components in the existing technology, achieves accurate identification of defect types and precise detection of sizes, and is suitable for industrial applications.

CN118583842BActive Publication Date: 2024-09-27CHANGCHUN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411068483.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-09-27
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

Existing metal component defect detection methods are difficult to effectively detect multiple types and sizes of defects. In particular, there is a lack of research on technical coupling issues for diverse defect types and sizes in industrial applications.

Method used

By preparing metal component samples with different defect sizes, collecting LIBS spectra, extracting characteristic spectral lines, calculating the intensity ratio of the characteristic spectral lines, generating a three-dimensional model, combining random forests and PCA models for feature fusion, establishing a defect recognition model, and identifying defect types in real time and detect defect size.

Benefits of technology

It achieves accurate identification of defects in multiple types of metal components and accurate detection of sizes, can handle multiple types and sizes of defects, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118583842B
    Figure CN118583842B
Patent Text Reader

Abstract

The present application belongs to the technical field of metal component defect detection, and in particular, relates to a metal component defect size detection method, comprising: using a metal plate of the same material as the metal component to prepare metal component defect samples with different defect sizes under each defect type; collecting LIBS spectrum of each defect sample; calculating the intensity ratio of multiple groups of characteristic spectrum lines based on the intensity values ​​of the extracted multiple characteristic spectrum lines; generating a three-dimensional model of each group of characteristic spectrum lines based on the defect size of each defect sample under the same defect type and the intensity ratio of each group of characteristic spectrum lines, and constructing a three-dimensional model of each defect type respectively; collecting LIBS spectrum of the metal component in real time, identifying the defect type of the metal component using a defect recognition model, and detecting the defect size of the metal component based on the three-dimensional model of the defect type to obtain a detection result. The method can realize accurate discrimination of defect types and can accurately detect defect sizes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of metal component defect detection, and in particular, relates to a method for detecting the defect size of a metal component. Background Art

[0002] Traditional methods for detecting defects in metal components include destructive testing and non-destructive testing. Among them, non-destructive testing methods (such as thermal imaging, ultrasonic and eddy current testing) can depict the surface information of defects without damaging the components and classify and identify the defects. However, in the context of industrial globalization, in order to carry out more specific and accurate subsequent processing work, people's demand for component defect detection, such as defect size detection, is increasing.

[0003] The existing defect size detection methods are as follows: 1) Infrared thermal imaging nondestructive testing method, using infrared thermal imaging technology to establish the relationship between defect size and depth and detection probability, and evaluate the detectability of 3D printed spherical defects through improved probability functions. 2) Defect size detection technology TIM, using pixel-level temperature integration and contour line parameters, realizes the reconstruction of defect size, which is independent of visual images and material properties. 3) Quantitative reconstruction method, used for the detection of fracture fatigue cracks on surfaces of different shapes, this method significantly improves the pathological nature of the inversion problem through characteristic parameters and hybrid inversion strategies.

[0004] However, although the above defect size detection methods have achieved certain results, most of these studies are carried out from the perspective of specific types of defects or specific sizes. There are no reports on the research on the technical coupling problem caused by the diversification of metal defect types and sizes in field applications. Therefore, considering the coupling between metal defect type identification and size estimation, how to achieve multi-type and multi-size metal defect detection has become an urgent problem to be solved. Summary of the invention

[0005] In view of this, the purpose of the present application is to provide a method for detecting the defect size of a metal component, to accurately identify the defect type through a defect recognition model, and to accurately detect the defect size using a three-dimensional model of the defect type.

[0006] The present application provides a method for detecting defect size of a metal component, the detection method comprising:

[0007] Using a metal plate made of the same material as the metal component, metal component defect samples with different defect sizes under various defect types are prepared; the defect types include: pit defects and crack defects; the defect sizes include: defect depth and defect width;

[0008] For each defective sample, collect the LIBS spectrum of the defective sample;

[0009] For each LIBS spectrum, a plurality of characteristic spectral lines of the LIBS spectrum are extracted, and based on the intensity values ​​of the extracted plurality of characteristic spectral lines, the intensity ratios of the plurality of groups of characteristic spectral lines of the defective sample are calculated;

[0010] For each group of characteristic spectral lines, a three-dimensional model of the group of characteristic spectral lines is generated based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines;

[0011] Based on the three-dimensional models of multiple groups of characteristic spectra under the same defect type, three-dimensional models of each defect type are constructed respectively; the three-dimensional models include: a three-dimensional model of a pit defect and a three-dimensional model of a crack defect;

[0012] The LIBS spectrum of the metal component is collected in real time, the defect type of the metal component is identified using a defect recognition model, and the defect size of the metal component is detected based on a three-dimensional model of the defect type to obtain a detection result.

[0013] Furthermore, the intensity ratios of multiple groups of characteristic spectral lines of the defective sample are calculated based on the intensity values ​​of the extracted multiple characteristic spectral lines, including:

[0014] Selecting a specific characteristic spectrum line from the extracted multiple characteristic spectrum lines as a first characteristic spectrum line, and selecting the remaining characteristic spectrum lines as second characteristic spectrum lines;

[0015] The intensity value of the first characteristic spectrum line is used as a denominator value, and the intensity value of the second characteristic spectrum line is used as a numerator value, and the intensity ratios of multiple groups of characteristic spectrum lines of the defective sample are calculated respectively.

[0016] Furthermore, the three-dimensional model of the group of characteristic spectral lines is generated based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines, including:

[0017] For each defect sample, the defect depth and defect width of the defect sample are used as independent variables, and the intensity ratio of the group of characteristic spectral lines of the defect sample is used as a dependent variable to generate three-dimensional data of the defect sample;

[0018] Based on the three-dimensional data of each defect sample under the same defect type, interpolation and smoothing processing are performed to generate a continuous surface, and the continuous surface is used as the three-dimensional model of the group of characteristic spectrum lines.

[0019] Furthermore, the defect recognition model is obtained by the following method:

[0020] For each defective sample, the LIBS spectrum of the defective sample is copied to obtain a LIBS spectrum copy;

[0021] For each defective sample, the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy are fused using a random forest model and a PCA model to obtain a LIBS fusion feature that can characterize the defect type of the defective sample;

[0022] The defect recognition model is trained by taking the LIBS spectrum as input and the LIBS fusion feature as output, so that the defect recognition model can output the LIBS fusion feature capable of characterizing the defect type according to the input LIBS spectrum.

[0023] Furthermore, the random forest model and the PCA model are used to perform feature fusion on the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum replica to obtain the LIBS fusion features that can characterize the defect type of the defective sample, including:

[0024] Extracting a first LIBS initial spectrum feature from the LIBS spectrum;

[0025] Using the PCA model, performing PCA dimensionality reduction processing on the first LIBS initial spectrum feature, and using the random forest model to obtain the dimensionality reduction feature and the first prediction accuracy of the LIBS spectrum;

[0026] Extracting a second LIBS initial spectrum feature from the LIBS spectrum copy;

[0027] Using the importance ranking function of the random forest feature model, the second LIBS initial spectrum features are ranked in importance to obtain the selected features of the LIBS spectrum copy and the second prediction accuracy;

[0028] Based on the first prediction accuracy and the second prediction accuracy, the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy are weightedly fused to obtain a LIBS fusion feature capable of characterizing the defect type of the defective sample.

[0029] Further, the PCA model is used to perform PCA dimensionality reduction processing on the first LIBS initial spectrum feature, and a random forest model is used to obtain the dimensionality reduction feature and the first prediction accuracy of the LIBS spectrum, including:

[0030] Using the principal component analysis method of the PCA model, the first LIBS initial spectral feature is subjected to PCA dimensionality reduction processing in order from low dimension to high dimension, and the LIBS spectral features and variance values ​​corresponding to each dimension are obtained;

[0031] For each dimension, the LIBS spectral features corresponding to the dimension are input into the random forest model to obtain the prediction accuracy of the LIBS spectral features corresponding to the dimension;

[0032] The optimal dimension is selected according to the principle that the variance value is greater than 95%, is closest to the number of the defective samples, and has the highest prediction accuracy of the corresponding LIBS spectral characteristics;

[0033] The LIBS spectrum feature corresponding to the optimal dimension is used as the dimension reduction feature of the LIBS spectrum, and the prediction accuracy of the LIBS spectrum feature is used as the first prediction accuracy.

[0034] Furthermore, the importance ranking of the second LIBS initial spectrum features to obtain the selection features and the second prediction accuracy of the LIBS spectrum copy includes:

[0035] According to the importance ranking of the features of the second LIBS initial spectrum, the same number of features as the optimal dimension are selected as the selected features of the LIBS spectrum copy;

[0036] Based on the selected features of the LIBS spectrum replica, the second prediction accuracy is obtained using a random forest feature model.

[0037] Furthermore, the three-dimensional model based on the defect type is used to detect the defect size of the metal component to obtain a detection result, including:

[0038] Extracting a plurality of characteristic spectral lines of the LIBS spectrum of the metal component, and calculating intensity ratios of a plurality of groups of characteristic spectral lines of the metal component based on intensity values ​​of the extracted plurality of characteristic spectral lines;

[0039] Inputting the intensity ratios of the multiple groups of characteristic spectral lines of the metal component into the three-dimensional defect model of the defect type to obtain multiple intersecting lines in the three-dimensional space;

[0040] For each intersection line, a single-value contour extraction method is used to convert the intersection line into plane data in a two-dimensional space, and a linear fitting is performed on the plane data to obtain a fitting curve;

[0041] In a specific coordinate range, the number of intersections between a plurality of fitting curves is determined, and based on the number of intersections, the detection result of the metal component is obtained.

[0042] Furthermore, obtaining the detection result of the metal component based on the number of intersections includes:

[0043] When the number of the intersection is 1, the abscissa and ordinate of the intersection are determined as the defect size of the metal component; wherein the abscissa is determined as the defect depth, and the ordinate is determined as the defect width;

[0044] When there are multiple intersections, the defect size of the metal component is determined based on the abscissas and ordinates of the multiple intersections.

[0045] Furthermore, the determining of the defect size of the metal component based on the abscissa and ordinate of the plurality of intersections includes:

[0046] For each intersection point, the abscissa and ordinate of the intersection point are input into the three-dimensional model of the defect type to obtain the intensity ratios of multiple groups of characteristic spectral lines corresponding to the intersection point;

[0047] For each intersection point, calculating the root mean square error value between the intensity ratio of the multiple groups of characteristic spectral lines corresponding to the intersection point and the intensity ratio of the multiple groups of characteristic spectral lines of the metal component;

[0048] The abscissa and ordinate of the intersection point with the smallest RMS error value are determined as the defect size of the metal component.

[0049] The metal component defect size detection method provided in the present application uses a metal plate made of the same material as the metal component to prepare metal component defect samples with different defect sizes under various defect types; the defect types include: pit defects and crack defects; the defect sizes include: defect depth and defect width; for each defect sample, a LIBS spectrum of the defect sample is collected; for each LIBS spectrum, multiple characteristic spectral lines of the LIBS spectrum are extracted, and based on the intensity values ​​of the extracted multiple characteristic spectral lines, the intensity ratio of multiple groups of characteristic spectral lines of the defect sample is calculated; for each group of characteristic spectral lines, a three-dimensional model of the group of characteristic spectral lines is generated based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines; based on the three-dimensional models of multiple groups of characteristic spectral lines under the same defect type, three-dimensional models of each defect type are respectively constructed; the three-dimensional models include: a pit defect three-dimensional model and a crack defect three-dimensional model; the LIBS spectrum of the metal component is collected in real time, the defect type of the metal component is identified by using a defect recognition model, and the defect size of the metal component is detected based on the three-dimensional model of the defect type to obtain a detection result. This detection method can accurately distinguish the defect type and accurately detect the defect size. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A flow chart of a method for detecting defect size of a metal component provided in an embodiment of the present application is shown;

[0051] Figure 2 A sample diagram of a pit defect and a sample diagram of a crack defect of a metal component provided in an embodiment of the present application are shown;

[0052] Figure 3A schematic diagram of the structure of a spectrum acquisition device provided in an embodiment of the present application is shown;

[0053] Figure 4 The LIBS average spectrum of the pit defect sample provided in the embodiment of the present application is shown;

[0054] Figure 5 A schematic diagram of a three-dimensional model of the same set of characteristic spectral lines generated by using a pit defect sample and a crack defect sample respectively provided in an embodiment of the present application is shown;

[0055] Figure 6 A schematic diagram of a three-dimensional model for determining intersection lines based on a three-dimensional model of characteristic spectral lines and an intensity ratio provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the technical solution more clear, the technical solution is further described in detail below in conjunction with specific implementation methods. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the technical solution.

[0057] See also Figure 1 , Figure 1 The flowchart of the metal component defect size detection method provided in the embodiment of the present application is shown. Figure 1 As shown, the detection method comprises:

[0058] S101. Use a metal plate made of the same material as the metal component to prepare metal component defect samples with different defect sizes under various defect types.

[0059] In this step, two problems are considered when directly using defective components formed by processing: (1) the defect size is uncertain, and it is difficult to form defects of the same type with a continuous gradient; (2) the defect formation process is complicated, and the defect size is easily affected by other factors. Therefore, the embodiment of the present application uses a metal plate made of the same material as the metal component to prepare metal component defect samples with different defect sizes under different defect types, so that defect samples with a continuous gradient of defect size can be prepared while ensuring that the composition of the metal component remains unchanged.

[0060] Among them, the defect types include: pit defects and crack defects; the defect sizes include: defect depth and defect width.

[0061] Specifically, the defect depth refers to the distance from the surface of the defect sample to the top of the defect, and the defect width refers to the lateral diameter of the defect; for pit defect samples, the defect width is the pit diameter, and for crack defect samples, the defect width is the crack width.

[0062] As an example, the metal plate used in the embodiment of the present application is an AlSi10Mg metal plate with a size of 10cm×5cm×1cm. AlSi10Mg is a material commonly used in metal additive manufacturing components. According to different depths and widths, a series of pits or cracks with gradients of crack defects and pit defects are respectively manufactured using CNC machine tools, thereby obtaining pit defect samples and crack defect samples of metal components with different defect sizes.

[0063] It is worth noting that in order to more accurately detect the depth and width of the defect, the embodiment of the present application fixes the length of the crack defect to 0.8 cm.

[0064] Here, please refer to Table 1, which shows a defect size table of pit defects and crack defects characterized by defect depth and defect width.

[0065] Table 1. Defect size table of pit defects and crack defects

[0066]

[0067] Also, see Figure 2 , Figure 2 The figure shows a sample image of a pit defect and a sample image of a crack defect of a metal component provided in an embodiment of the present application. Figure 2 As shown, according to the defect size table of pit defects and crack defects, 49 pit defect samples were prepared on one AlSi10Mg metal plate, and 49 crack defect samples were prepared on another AlSi10Mg metal plate. In the embodiment of the present application, multiple defect samples were prepared on a metal plate without separating them. The purpose of doing so is to facilitate the subsequent spectrum acquisition process, that is, to fix the metal plate on the stage, and to achieve the purpose of replacing the sample by moving the stage.

[0068] S102: For each defective sample, collect a LIBS spectrum of the defective sample.

[0069] In this step, the LIBS spectrum of the defective sample is collected through the self-built spectrum collection device. For details, please refer to Figure 3 , Figure 3 Shown is a schematic diagram of the structure of a spectrum acquisition device provided in an embodiment of the present application.

[0070] As an example, the embodiment of the present application uses a Q-switched Nd:YAG laser (Vlite-200 model) with a wavelength of 1064nm, a pulse width of 8ns, and a repetition rate of 1Hz, and adjusts the laser energy to adjust the output single pulse energy to 80mJ; the output laser is reflected by a reflector and focused to 2mm below the surface of the metal sample by a plano-convex quartz lens with a focal length of 120mm, thereby inducing plasma; the spectral radiation emitted by the plasma is collected by a fiber optic probe and transmitted to a spectrometer (model ME5000, Andor), and then detected by an ICCD detector (1024×1024 pixels, DH334T, The laser and ICCD were synchronized by a digital pulse delay generator (BNC-575) to set the delay time of the laser and ICCD to 1μs and 2μs respectively. The metal plate was fixed on a three-dimensional mobile platform to accurately adjust the position of the defective sample and avoid repeated acquisition at the same position. The acquisition process was carried out in an air environment under atmospheric pressure, with a temperature of 23°C and an ambient relative humidity of 26%.

[0071] It should be noted that in order to ensure the accuracy and representativeness of the LIBS spectrum, 20 LIBS spectra are collected for each defective sample, and the collected 20 LIBS spectra are integrated three times respectively. The average of the 20 integrated LIBS spectra is taken as the LIBS spectrum of the defective sample. Figure 4 , Figure 4 The figure shows the average LIBS spectrum of the pit defect sample provided in the embodiment of the present application. Figure 4 As shown, the x-axis represents the wavelength, the y-axis represents the spectral intensity (offset is 0.5), the spectral range is 250-650nm, and the dimension is 1×23719, wherein the defect sizes corresponding to the LIBS spectra from bottom to top are shown in 1-1, 1-1.5, ..., 1-4 in Table 1 above.

[0072] In addition, during the spectral acquisition process, the following two points need to be noted. First, when replacing defective samples, the focus needs to be re-adjusted to ensure the accuracy of the laser focus position and avoid defocusing that affects the experiment. Second, when collecting a single defective sample, the three-dimensional mobile platform can be used to fine-tune the position, but it must not exceed the range to avoid repeated data collection.

[0073] After collecting the LIBS spectrum of the defective sample, the detection method further comprises:

[0074] Based on the collected LIBS spectra of each defective sample, the wavelength positions where the shift occurs are determined, and compared with the NIST database to determine the characteristic spectral lines corresponding to each wavelength position.

[0075] Here, you can refer to Figure 4 The wavelength positions at which the average spectrum is cut are shown.

[0076] S103 . For each LIBS spectrum, extract a plurality of characteristic spectral lines of the LIBS spectrum, and calculate intensity ratios of a plurality of groups of characteristic spectral lines of the defective sample based on the intensity values ​​of the extracted plurality of characteristic spectral lines.

[0077] In this step, multiple characteristic spectral lines of the LIBS spectrum are extracted based on the characteristic spectral lines determined in advance.

[0078] As an example, the embodiment of the present application extracts 7 characteristic spectral lines: AlⅠ line 308.22nm, AlⅠ line 309.27nm, AlⅠ line 394.41nm, AlⅠ line 396.15nm, AlⅡ line 559.33nm, FeⅠ line 570.54nm and AlⅡ line 618.16nm.

[0079] In specific implementation, the intensity ratios of multiple groups of characteristic spectral lines of the defective sample can be calculated based on the intensity values ​​of the extracted multiple characteristic spectral lines through the following steps:

[0080] Step 1031: Select a specific characteristic spectral line from the extracted multiple characteristic spectral lines as the first characteristic spectral line, and use the remaining characteristic spectral lines as the second characteristic spectral lines.

[0081] As an example, the embodiment of the present application takes the FeⅠ line 570.54nm as the first characteristic spectral line, and the remaining 6 characteristic spectral lines: AlⅠ line 308.22nm, AlⅠ line 309.27nm, AlⅠ line 394.41nm, AlⅠ line 396.15nm, AlⅡ line 559.33nm and AlⅡ line 618.16nm as the second characteristic spectral lines.

[0082] Step 1032: Using the intensity value of the first characteristic spectrum line as the denominator value and the intensity value of the second characteristic spectrum line as the numerator value, respectively calculate the intensity ratios of the multiple groups of characteristic spectrum lines of the defective sample.

[0083] As an example, there are 6 groups of characteristic spectral lines in the embodiment of the present application: AlⅠ line 308.22nm and FeⅠ line 570.54nm, AlⅠ line 309.27nm and FeⅠ line 570.54nm, AlⅠ line 394.41nm and FeⅠ line 570.54nm, AlⅠ line 396.15nm and FeⅠ line 570.54nm, AlⅡ line 559.33nm and FeⅠ line 570.54nm, and AlⅡ line 618.16nm and FeⅠ line 570.54nm; further, the intensity value of each characteristic spectral line can be used to calculate the intensity ratio of each group of characteristic spectral lines: I308.22nm / I 570.54nm ,I 309.27nm / I 570.54nm ,I 394.41nm / I 570.54nm ,I 396.15nm / I 570.54nm ,I 559.33nm / I 570.54nm and I 559.33nm / I 570.54nm ; Where I represents the intensity value of the characteristic spectral line.

[0084] S104. For each group of characteristic spectral lines, a three-dimensional model of the group of characteristic spectral lines is generated based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines.

[0085] In specific implementation, the following steps may be used to generate a three-dimensional model of the group of characteristic spectral lines based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines:

[0086] Step 1041: For each defective sample, the defect depth and defect width of the defective sample are taken as independent variables, and the intensity ratio of the group of characteristic spectral lines of the defective sample is taken as a dependent variable to generate three-dimensional data of the defective sample.

[0087] As an example, the following will take the AlⅠ line 394.41nm and the FeⅠ line 570.54 as examples to introduce the process of generating three-dimensional data for each defect sample. First, the defect size of the defect sample, that is, the defect depth and defect width, is identified, and the defect depth is used as the independent variable x, and the defect width is used as the independent variable y; secondly, the intensity ratio of the group of characteristic spectral lines of the defect sample is identified, that is, I 308.22nm / I 570.54nm , and I 308.22nm / I 570.54nm As the dependent variable z; finally, the three-dimensional data of the defective sample is generated. Similarly, for each defective sample, the three-dimensional data of the defective sample can be generated using a similar method.

[0088] Step 1042: interpolation and smoothing are performed based on the three-dimensional data of each defect sample under the same defect type to generate a continuous surface, and the continuous surface is used as the three-dimensional model of the group of characteristic spectral lines.

[0089] As an example, the following will take the AlⅠ line 394.41nm and FeⅠ line 570.54 of the pit defect sample as an example to introduce the process of generating a three-dimensional model of this group of characteristic spectral lines. First, the three-dimensional data of 49 pit defect samples are extracted; secondly, the three-dimensional data of the 49 pit defect samples are interpolated and smoothed to generate a continuous surface; finally, the continuous surface is used as the three-dimensional model of this group of characteristic spectral lines (AlⅠ line 394.41nm and FeⅠ line 570.54). Similarly, for crack defect samples, a similar method can be used to generate a three-dimensional model of this group of characteristic spectral lines. Here, please refer to Figure 5 , Figure 5 The figure shows a schematic diagram of a three-dimensional model of the same set of characteristic spectral lines generated by using a pit defect sample and a crack defect sample respectively provided in an embodiment of the present application. The characteristic spectral lines are AlⅠ line 394.41nm and FeⅠ line 570.54. Similarly, for the remaining 5 sets of characteristic spectral lines, a similar method can be used to generate the three-dimensional model of the characteristic spectral lines.

[0090] S105, based on the three-dimensional models of multiple groups of characteristic spectra under the same defect type, construct three-dimensional models of each defect type respectively.

[0091] Wherein, the three-dimensional model includes: a three-dimensional model of pothole defects and a three-dimensional model of crack defects.

[0092] As an example, a three-dimensional model of 6 groups of characteristic spectral lines is obtained using a pit defect sample, and then a three-dimensional model of the pit defect is obtained based on the three-dimensional model of the 6 groups of characteristic spectral lines under the pit defect; a three-dimensional model of 6 groups of characteristic spectral lines is obtained using a crack defect sample, and then a three-dimensional model of the crack defect is obtained based on the three-dimensional model of the 6 groups of characteristic spectral lines under the crack defect.

[0093] S106, collecting the LIBS spectrum of the metal component in real time, identifying the defect type of the metal component using a defect recognition model, and detecting the defect size of the metal component based on the three-dimensional model of the defect type to obtain a detection result.

[0094] In this step, a defect recognition model is pre-established, and the defect recognition model can identify the defect type of the metal component based on the LIBS spectrum. The spectral feature dimension of the LIBS spectrum of the embodiment of the present application reached 23719, while the number of defective samples was 98 in total. It can be seen that the number of defective samples is much lower than the spectral feature dimension, which will cause the curse of dimensionality and overfitting problems. Therefore, the embodiment of the present application adopts a sparse algorithm, that is, feature extraction and feature selection are used to solve the above problems. Among them, feature extraction is achieved by mapping features from the original space to a relatively low-dimensional space, such as principal component analysis; however, although some principal components have a large variance, they may not be the most important features because they are irrelevant to the task or have low relevance. Feature selection aims to find the optimal subset, but when selecting features, some features will be discarded, which may result in the loss of some useful information.

[0095] Based on the above analysis, an embodiment of the present application proposes a feature fusion method to obtain more comprehensive and accurate features, and combines the feature fusion method with a random forest model to obtain a defect recognition model.

[0096] Specifically, the defect recognition model can be obtained in the following manner:

[0097] Step 201: For each defective sample, copy the LIBS spectrum of the defective sample to obtain a LIBS spectrum copy.

[0098] Step 202: for each defective sample, the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy are fused using a random forest model and a PCA model to obtain a LIBS fusion feature that can characterize the defect type of the defective sample.

[0099] In a specific implementation, the following steps can be used to fuse the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy using a random forest model and a PCA model to obtain a LIBS fusion feature that can characterize the defect type of the defective sample:

[0100] Step 2021: extract a first LIBS initial spectrum feature from the LIBS spectrum.

[0101] Step 2022: Use the PCA model to perform PCA dimensionality reduction processing on the first LIBS initial spectrum feature, and use the random forest model to obtain the dimensionality reduction feature and the first prediction accuracy of the LIBS spectrum.

[0102] In a specific implementation, the following steps can be used to perform PCA dimensionality reduction processing on the first LIBS initial spectrum feature using a PCA model, and to obtain the dimensionality reduction feature and the first prediction accuracy of the LIBS spectrum using a random forest model:

[0103] Step 301: Using the principal component analysis method of the PCA model, perform PCA dimensionality reduction processing on the first LIBS initial spectral features in order from low dimension to high dimension, and obtain the LIBS spectral features and variance values ​​corresponding to each dimension.

[0104] In this step, first, the first LIBS initial spectral feature is reduced to 2 dimensions, and the variance value of the LIBS spectral feature after being reduced to 2 dimensions, that is, the variance value corresponding to 2 dimensions, is obtained; secondly, the variance value corresponding to 2 dimensions is compared with 95%. If it is greater than 95%, the LIBS spectral feature after being reduced to 2 dimensions and the variance value corresponding to 2 dimensions are stored and the dimension reduction is continued. If it is not greater than 95%, the dimension reduction is continued.

[0105] Step 302: for each dimension, input the LIBS spectral feature corresponding to the dimension into the random forest model to obtain the prediction accuracy of the LIBS spectral feature corresponding to the dimension.

[0106] Step 303, selecting the best dimension according to the principle that the variance value is greater than 95%, is closest to the number of defective samples, and has the highest prediction accuracy of the corresponding LIBS spectrum characteristics;

[0107] In this step, it is generally believed that if the variance value of the LIBS spectral feature after dimension reduction is greater than 95%, then the LIBS spectral feature after dimension reduction can represent the original feature. Therefore, the variance value greater than 95% is used as the first principle for dimension selection, the closest to the number of defective samples is used as the second principle for dimension selection, and the highest prediction accuracy of the LIBS spectral feature is used as the third principle for dimension selection. Here, the ideal situation of the second principle is the same as the number of defective samples. However, if the variance value corresponding to the dimension that is the same as the number of defective samples is not greater than 95%, or the prediction accuracy of the corresponding LIBS spectral feature is not high, then the dimension closest to the number of defective samples can be selected as the optimal dimension.

[0108] Step 304: Using the LIBS spectrum feature corresponding to the optimal dimension as the dimension reduction feature of the LIBS spectrum, and using the prediction accuracy of the LIBS spectrum feature as the first prediction accuracy.

[0109] Step 2023: extract a second LIBS initial spectrum feature from the LIBS spectrum copy.

[0110] Step 2024: Use the importance ranking function of the random forest feature model to rank the second LIBS initial spectrum features to obtain the selected features and the second prediction accuracy of the LIBS spectrum copy.

[0111] In a specific implementation, the importance of the second LIBS initial spectrum features can be sorted by the following steps to obtain the selected features of the LIBS spectrum copy and the corresponding second prediction accuracy:

[0112] Step 401: According to the importance ranking of the features of the second LIBS initial spectrum, the same number of features as the optimal dimension are selected as the selection features of the LIBS spectrum copy.

[0113] As an example, when the optimal dimension is m, the first m features are selected from the importance ranking of the second LIBS initial spectrum features as the selected features of the LIBS spectrum copy.

[0114] Step 402: Based on the selected features of the LIBS spectrum replica, the second prediction accuracy is obtained using a random forest feature model.

[0115] Step 2025: Based on the first prediction accuracy and the second prediction accuracy, weighted fusion is performed on the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy to obtain a LIBS fusion feature that can characterize the defect type of the defective sample.

[0116] Step 203: Taking the LIBS spectrum as input and the LIBS fusion feature as output, the defect recognition model is trained so that the defect recognition model can output the LIBS fusion feature that can characterize the defect type according to the input LIBS spectrum.

[0117] In this step, the defect recognition model can output a LIBS fusion feature according to the LIBS spectrum, and identify the defect type corresponding to the LIBS spectrum based on the LIBS fusion feature.

[0118] In a specific implementation, the defect size of the metal component can be detected based on the three-dimensional model of the defect type through the following steps to obtain a detection result:

[0119] Step 1061: extract a plurality of characteristic spectral lines of the LIBS spectrum of the metal component, and calculate intensity ratios of a plurality of groups of characteristic spectral lines of the metal component based on the intensity values ​​of the extracted plurality of characteristic spectral lines.

[0120] In this step, the intensity ratios of multiple groups of characteristic spectral lines of the metal component are calculated using the same method as the above-mentioned method for calculating the intensity ratios of multiple groups of characteristic spectral lines of the defective sample, and the embodiments of the present application will not be repeated here.

[0121] Step 1062: Input the intensity ratios of the multiple groups of characteristic spectral lines of the metal component into the three-dimensional defect model of the defect type to obtain multiple intersecting lines in the three-dimensional space.

[0122] In this step, since the defect type of the metal component has been identified by the defect recognition model, the defect size can be further detected by using the three-dimensional model of the identified defect type. Since the defect three-dimensional model is determined based on the defect size and the intensity ratio of the characteristic spectrum line, that is, the defect size and the intensity ratio of the characteristic spectrum line have a linear relationship, then the defect size can be inferred by inputting the intensity ratio of the characteristic spectrum line into the defect three-dimensional model of the defect type.

[0123] Specifically, for each set of characteristic spectral lines, the intersection lines in the three-dimensional space are determined based on the three-dimensional model of the set of characteristic spectral lines and the intensity ratio of the set of characteristic spectral lines. Figure 6 , Figure 6 The figure shows a schematic diagram of a three-dimensional model based on a characteristic spectrum line and a three-dimensional model for determining intersection lines based on intensity ratios provided in an embodiment of the present application. Figure 6 As shown in the figure, the defect size corresponding to the determined characteristic spectral line intensity ratio is found, where the three-dimensional space (x, y, z) corresponds to the defect depth, defect width and the characteristic spectral line intensity ratio respectively. Similarly, for the remaining groups of characteristic spectral lines, the intersection lines in the three-dimensional space are determined in a similar way.

[0124] As an example, the embodiment of the present application inputs the intensity ratios of six groups of characteristic spectral lines of the metal component into the three-dimensional defect model of the defect type to obtain six intersecting lines in the three-dimensional space.

[0125] Step 1063: for each intersection line, use the single-value contour line extraction method to convert the intersection line into plane data in a two-dimensional space, and perform linear fitting on the plane data to obtain a fitting curve.

[0126] In this step, the defect depth and defect width are extracted using a single-value contour extraction method to obtain plane data, and a linear fit is performed on the plane data to obtain a fitting curve.

[0127] Step 1064: Determine the number of intersections between multiple fitting curves within a specific coordinate range, and obtain the detection result of the metal component based on the number of intersections.

[0128] In this step, a specific coordinate range (x, y) corresponds to a defect depth and a defect width. During the processing of metal components, the size of the metal components will limit the defect size. Therefore, the unnecessary determination process of the number of intersections can be reduced by determining the number of intersections within a specific coordinate range.

[0129] In a specific implementation, the detection result of the metal component can be obtained based on the number of intersections through the following steps:

[0130] Step 501: When the number of the intersection is 1, the horizontal coordinate and the vertical coordinate of the intersection are determined as the defect size of the metal component; wherein the horizontal coordinate is determined as the defect depth, and the vertical coordinate is determined as the defect width.

[0131] In this step, ideally, the number of intersections is 1, that is, the ratio of the defect size to the intensity of the characteristic spectrum line is uniquely determined, and then the horizontal and vertical coordinates of the intersection can be determined as the defect size of the metal component.

[0132] Step 502: When there are multiple intersection points, the defect size of the metal component is determined based on the horizontal coordinates and vertical coordinates of the multiple intersection points.

[0133] In a specific implementation, the defect size of the metal component can be determined based on the abscissas and ordinates of the multiple intersections through the following steps:

[0134] Step 5021: For each intersection point, input the horizontal coordinate and the vertical coordinate of the intersection point into the three-dimensional model of the defect type to obtain the intensity ratio of multiple groups of characteristic spectral lines corresponding to the intersection point.

[0135] In this step, when the defect size and the intensity ratio of the characteristic spectrum line are not uniquely determined, the most likely intersection point is determined by comparing the intensity ratio of the characteristic spectrum line corresponding to each intersection point (ie, the intensity ratio of the characteristic spectrum line corresponding to each intersection point in theory).

[0136] Step 5022: For each intersection point, calculate the root mean square error between the intensity ratio of the multiple groups of characteristic spectral lines corresponding to the intersection point and the intensity ratio of the multiple groups of characteristic spectral lines of the metal component.

[0137] In this step, the most likely intersection point is determined according to the characteristic that the intersection point of the fitting curve has the smallest root mean square error value.

[0138] Step 5023: Determine the horizontal coordinate and vertical coordinate of the intersection point with the smallest root mean square error value as the defect size of the metal component.

[0139] The above contents are only preferred embodiments of the present invention. For ordinary technicians in this field, many changes can be made in the specific implementation methods and application scopes based on the ideas of the present technical content. As long as these changes do not deviate from the concept of the present invention, they all fall within the scope of protection of this patent.

Claims

1. A method for detecting defect size of a metal component, characterized in that: The detection method comprises: Using a metal plate made of the same material as the metal component, metal component defect samples with different defect sizes under various defect types are prepared; the defect types include: pit defects and crack defects; the defect sizes include: defect depth and defect width; For each defective sample, collect the LIBS spectrum of the defective sample; For each LIBS spectrum, a plurality of characteristic spectral lines of the LIBS spectrum are extracted, and based on the intensity values ​​of the extracted plurality of characteristic spectral lines, the intensity ratios of the plurality of groups of characteristic spectral lines of the defective sample are calculated; For each group of characteristic spectral lines, a three-dimensional model of the group of characteristic spectral lines is generated based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines; Based on the three-dimensional models of multiple groups of characteristic spectra under the same defect type, three-dimensional models of each defect type are constructed respectively; the three-dimensional models include: a three-dimensional model of a pit defect and a three-dimensional model of a crack defect; The LIBS spectrum of the metal component is collected in real time, the defect type of the metal component is identified using a defect recognition model, and the defect size of the metal component is detected based on a three-dimensional model of the defect type to obtain a detection result.

2. The method according to claim 1, characterized in that The step of calculating the intensity ratios of multiple groups of characteristic spectral lines of the defective sample based on the intensity values ​​of the extracted multiple characteristic spectral lines includes: Selecting a specific characteristic spectrum line from the extracted multiple characteristic spectrum lines as a first characteristic spectrum line, and taking the remaining characteristic spectrum lines as second characteristic spectrum lines; The intensity value of the first characteristic spectrum line is used as a denominator value, and the intensity value of the second characteristic spectrum line is used as a numerator value, and the intensity ratios of multiple groups of characteristic spectrum lines of the defective sample are calculated respectively.

3. The method according to claim 1, characterized in that The method of generating a three-dimensional model of the group of characteristic spectral lines based on the defect size of each defect sample under the same defect type and the intensity ratio of the group of characteristic spectral lines comprises: For each defect sample, the defect depth and defect width of the defect sample are used as independent variables, and the intensity ratio of the group of characteristic spectral lines of the defect sample is used as a dependent variable to generate three-dimensional data of the defect sample; Based on the three-dimensional data of each defect sample under the same defect type, interpolation and smoothing processing are performed to generate a continuous surface, and the continuous surface is used as the three-dimensional model of the group of characteristic spectrum lines.

4. The method according to claim 1, characterized in that The defect recognition model is obtained by: For each defective sample, the LIBS spectrum of the defective sample is copied to obtain a LIBS spectrum copy; For each defective sample, the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy are fused using a random forest model and a PCA model to obtain a LIBS fusion feature that can characterize the defect type of the defective sample; The defect recognition model is trained by taking the LIBS spectrum as input and the LIBS fusion feature as output, so that the defect recognition model can output the LIBS fusion feature capable of characterizing the defect type according to the input LIBS spectrum.

5. The method according to claim 4, characterized in that The random forest model and the PCA model are used to fuse the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy to obtain the LIBS fusion features that can characterize the defect type of the defective sample, including: Extracting a first LIBS initial spectrum feature from the LIBS spectrum; Using the PCA model, performing PCA dimensionality reduction processing on the first LIBS initial spectrum feature, and using the random forest model to obtain the dimensionality reduction feature and the first prediction accuracy of the LIBS spectrum; Extracting a second LIBS initial spectrum feature from the LIBS spectrum copy; Using the importance ranking function of the random forest feature model, the second LIBS initial spectrum features are ranked in importance to obtain the selected features of the LIBS spectrum copy and the second prediction accuracy; Based on the first prediction accuracy and the second prediction accuracy, the dimension reduction features of the LIBS spectrum and the selected features of the LIBS spectrum copy are weightedly fused to obtain a LIBS fusion feature capable of characterizing the defect type of the defective sample.

6. The method according to claim 5, characterized in that The PCA model is used to perform PCA dimensionality reduction processing on the first LIBS initial spectrum feature, and a random forest model is used to obtain the dimensionality reduction feature and the first prediction accuracy of the LIBS spectrum, including: Using the principal component analysis method of the PCA model, the first LIBS initial spectral feature is subjected to PCA dimensionality reduction processing in order from low dimension to high dimension, and the LIBS spectral features and variance values ​​corresponding to each dimension are obtained; For each dimension, the LIBS spectral features corresponding to the dimension are input into the random forest model to obtain the prediction accuracy of the LIBS spectral features corresponding to the dimension; The optimal dimension is selected according to the principle that the variance value is greater than 95%, is closest to the number of the defective samples, and has the highest prediction accuracy of the corresponding LIBS spectral characteristics; The LIBS spectrum feature corresponding to the optimal dimension is used as the dimension reduction feature of the LIBS spectrum, and the prediction accuracy of the LIBS spectrum feature is used as the first prediction accuracy.

7. The method according to claim 6, characterized in that The importance ranking of the second LIBS initial spectrum features to obtain the selected features of the LIBS spectrum copy and the second prediction accuracy includes: According to the importance ranking of the features of the second LIBS initial spectrum, the same number of features as the optimal dimension are selected as the selected features of the LIBS spectrum copy; Based on the selected features of the LIBS spectrum replica, the second prediction accuracy is obtained using a random forest feature model.

8. The method according to claim 1, characterized in that The three-dimensional model based on the defect type is used to detect the defect size of the metal component to obtain a detection result, including: Extracting a plurality of characteristic spectral lines of the LIBS spectrum of the metal component, and calculating intensity ratios of a plurality of groups of characteristic spectral lines of the metal component based on intensity values ​​of the extracted plurality of characteristic spectral lines; Inputting the intensity ratios of the multiple groups of characteristic spectral lines of the metal component into the three-dimensional defect model of the defect type to obtain multiple intersecting lines in the three-dimensional space; For each intersection line, a single-value contour extraction method is used to convert the intersection line into plane data in a two-dimensional space, and a linear fitting is performed on the plane data to obtain a fitting curve; In a specific coordinate range, the number of intersections between a plurality of fitting curves is determined, and based on the number of intersections, the detection result of the metal component is obtained.

9. The method according to claim 8, characterized in that The obtaining of the detection result of the metal component based on the number of intersections includes: When the number of the intersection is 1, the abscissa and ordinate of the intersection are determined as the defect size of the metal component; wherein the abscissa is determined as the defect depth, and the ordinate is determined as the defect width; When there are multiple intersections, the defect size of the metal component is determined based on the abscissas and ordinates of the multiple intersections.

10. The method according to claim 9, characterized in that The step of determining the defect size of the metal component based on the abscissas and ordinates of the plurality of intersection points comprises: For each intersection point, the abscissa and ordinate of the intersection point are input into the three-dimensional model of the defect type to obtain the intensity ratios of multiple groups of characteristic spectral lines corresponding to the intersection point; For each intersection point, calculating the root mean square error value between the intensity ratio of the multiple groups of characteristic spectral lines corresponding to the intersection point and the intensity ratio of the multiple groups of characteristic spectral lines of the metal component; The abscissa and ordinate of the intersection point with the smallest RMS error value are determined as the defect size of the metal component.