Carbon fiber metal element measuring method, device, storage medium and system

Through machine learning methods, especially the random forest regression model, the spectral intensity data of metal elements are directly obtained from carbon fiber for prediction, which solves the problems of complex and unenvironmental detection process in the prior art, and achieves rapid, accurate and environmentally friendly measurement of metal elements content.

CN119555615AInactive Publication Date: 2025-03-04SHAANXI COAL-BASED SPECIAL FUEL RES INST CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510103504.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the metal element detection process in carbon fibers is complex and not environmentally friendly, requiring inductively coupled plasma mass spectrometers and complex sample pretreatment steps, making it difficult to achieve rapid prediction.

Method used

Using machine learning methods, especially the random forest regression model, the spectral intensity data of metal elements in carbon fibers are obtained for preprocessing and optimization, and the metal element content is directly predicted, avoiding the use of sample preprocessing and complex equipment.

Benefits of technology

It realizes accurate and rapid measurement of the content of carbon fiber metal elements, simplifies the detection process, reduces environmental pollution, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119555615A_ABST
    Figure CN119555615A_ABST
Patent Text Reader

Abstract

The invention provides a carbon fiber metal element measurement method, equipment, a storage medium and a system. The method comprises the following steps: acquiring spectral intensity data corresponding to one or more target metal elements in to-be-detected carbon fibers; inputting the respective corresponding spectral intensity data into the corresponding optimized preprocessing units to obtain respective corresponding optimized spectral intensity data; and inputting the respective corresponding optimized spectral intensity data into the corresponding trained random forest prediction unit to obtain the respective content of the one or more target metal elements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a carbon fiber metal element measurement method, equipment, storage medium and system. Background Art

[0002] The metal in carbon fiber mainly comes from the precursor and its production process. There are a large amount of silicon and a few other alkali metals and other elements in the sizing agent used in the production process. The content of impurity elements such as silicon, potassium, sodium, calcium, magnesium, iron, aluminum, and titanium in carbon fiber has a great influence on the antioxidant performance. The higher the content of alkali metals and alkaline earth metals in carbon fiber, the worse its antioxidant performance, and the higher the oxidation weight loss rate, thereby affecting the quality of carbon fiber. Therefore, it is of great significance to detect the metal elements in carbon fiber, which can measure the antioxidant performance of carbon fiber. However, in the prior art, the detection of the metal element content in carbon fiber mostly requires an inductively coupled plasma mass spectrometer to achieve, specifically, first using inductively coupled plasma atomic emission spectroscopy, atomic absorption spectroscopy, etc., although the above method can obtain accurate quantitative results, it requires complex sample pretreatment (such as digestion, etc.), uses a large amount of strong acid, and increases the special and complex wastewater treatment process. These problems make it difficult to achieve a simple and rapid estimate of the metal element content of carbon fiber. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a method, device, storage medium and system for measuring metal elements in carbon fiber, and to predict the metal element content of carbon fiber by machine learning method, without the need to use an inductively coupled plasma mass spectrometer in the application stage, and without the need to go through the pre-processing steps mentioned in the background technology, thereby solving the problems of complex and environmentally unfriendly carbon fiber metal element detection process in the prior art. The measurement process of the metal elements in the carbon fiber of the present invention is simple, and can accurately and quickly realize the measurement of the metal element content in the carbon fiber.

[0004] To this end, the first aspect of the present invention provides a method for measuring metal elements in carbon fiber, comprising: Obtaining spectral intensity data corresponding to one or more target metal elements in the carbon fiber to be tested; Inputting the respective corresponding spectral intensity data into the corresponding optimized pre-processing unit to obtain the respective corresponding optimized spectral intensity data; and The corresponding optimized spectral intensity data are input into the corresponding trained random forest prediction unit to obtain the content of the one or more target metal elements.

[0005] In a specific embodiment, the method further comprises: Acquire sample data corresponding to one or more sample metal elements in the sample carbon fiber, wherein the sample data includes spectral intensity data and corresponding reference content data; Divide the sample data of each sample metal element into a calibration set and a test set; Based on the calibration set of each sample metal element, the respective first random forest regression model was constructed; The selected preprocessing method is optimized based on the first random forest regression model to obtain the preferred preprocessing method corresponding to the metal element of the sample to form the optimized preprocessing unit and obtain the preprocessed correction set corresponding to the metal element of the sample.

[0006] In a specific embodiment, the selected preprocessing method includes a wavelet transform method and a second-order derivative method; the selected preprocessing method is optimized based on the first random forest regression model to obtain the preferred preprocessing method corresponding to the metal element of the sample, including: according to the first random forest regression model with the minimum average relative error as the judgment criterion, selecting the preferred preprocessing method from the wavelet transform method and the second-order derivative method and determining its optimization parameters.

[0007] In a specific embodiment, the optimization parameters of the wavelet transform method include the selection of wavelet basis functions and decomposition levels, wherein the wavelet basis functions include coif functions and db functions, and the decomposition level ranges from 1 to 15; The optimization parameters of the second-order derivative method include the selection of the number of smoothing points, wherein the number of smoothing points ranges from 3 to 15.

[0008] In a specific embodiment, the target metal elements are K, Ca, Mg, Na and Fe; For K, the preferred preprocessing method is a wavelet transform method, wherein the wavelet basis function of the wavelet transform method is coif4 and the number of decomposition levels is 9; For Ca, the preferred preprocessing method is a wavelet transform method, wherein the wavelet basis function of the wavelet transform method is db10 and the number of decomposition levels is 8; For Mg, the preferred pretreatment method is a wavelet transform method, wherein the wavelet basis function of the wavelet transform method is db8 and the number of decomposition levels is 9; For Na, the preferred preprocessing method is the second-order derivative method, where the number of smoothing points is 9; For Fe, the wavelet basis function of the wavelet transform method is db12, and the number of decomposition levels is 4.

[0009] In a specific embodiment, the method further comprises: Based on the variable importance measurement method, the spectral intensity data in the preprocessed calibration set corresponding to each sample metal element is preliminarily optimized to obtain the respective preliminary optimized characteristic variables; Constructing a second random forest regression model for each sample metal element based on the characteristic variables; Internal validation was used to select the variable importance threshold of the variable importance measurement method to obtain the optimal threshold; The preferred spectral intensity data is determined based on the preferred threshold to construct a random forest regression model based on variable importance measurement.

[0010] In a specific embodiment, the method further comprises: The test set in the sample data of each sample metal element is used to verify the corresponding random forest regression model based on variable importance measurement, so as to obtain the trained random forest prediction unit.

[0011] In a specific embodiment, the variable importance measurement method is based on which the spectral intensity data in the preprocessed calibration set corresponding to each sample metal element is preliminarily optimized to obtain respective preliminary optimized characteristic variables, including: setting a plurality of variable importance thresholds respectively, and extracting respective characteristic variables from the spectral intensity data in the preprocessed calibration set; The constructing a second random forest regression model for each metal element of each sample based on the characteristic variables comprises: constructing a corresponding second random forest regression model using the respective characteristic variables and corresponding reference content data; The step of selecting a variable importance threshold of a variable importance measurement method by internal validation to obtain a preferred threshold comprises: performing internal validation based on the corresponding second random forest regression model to select an optimal threshold from the multiple variable importance thresholds; The method of determining the preferred spectral intensity data based on the preferred threshold and constructing a random forest regression model based on variable importance measurement includes: determining the preferred spectral intensity data from the spectral intensity data in the preprocessed correction set based on the optimal threshold, and constructing a random forest regression model based on variable importance measurement for the metal elements of the sample based on the preferred spectral intensity data and the corresponding reference content data.

[0012] In a specific embodiment, the method further comprises: Based on the variable importance measurement method, the spectral intensity data in the preprocessed calibration set corresponding to each sample metal element is preliminarily optimized to obtain the respective preliminary optimized characteristic variables; Constructing a second random forest regression model for each sample metal element based on the characteristic variables; Internal validation was used to select the variable importance threshold of the variable importance measurement method to obtain the optimal threshold; Determining preferred spectral intensity data based on the preferred threshold to construct a random forest regression model based on variable importance measurement; The parameters of the random forest regression model based on variable importance measurement are optimized based on a grid search method to obtain a random forest regression model based on variable importance measurement and grid search.

[0013] In a specific embodiment, the method further comprises: The test set in the sample data of each sample metal element is used to verify the corresponding variable importance measurement and grid search random forest regression model, so as to obtain the trained random forest prediction unit.

[0014] In a specific embodiment, the variable importance measurement method is based on which the spectral intensity data in the preprocessed calibration set corresponding to each sample metal element is preliminarily optimized to obtain respective preliminary optimized characteristic variables, including: setting a plurality of variable importance thresholds respectively, and extracting respective characteristic variables from the spectral intensity data in the preprocessed calibration set; The constructing a second random forest regression model for each metal element of each sample based on the characteristic variables comprises: constructing a corresponding second random forest regression model using the respective characteristic variables and corresponding reference content data; The step of selecting a variable importance threshold of a variable importance measurement method by internal validation to obtain a preferred threshold comprises: performing internal validation based on the corresponding second random forest regression model to select an optimal threshold from the multiple variable importance thresholds; The step of determining the preferred spectral intensity data based on the preferred threshold to construct a random forest regression model based on variable importance measurement comprises: determining the preferred spectral intensity data from the spectral intensity data in the preprocessed calibration set based on the optimal threshold, and constructing a random forest regression model based on variable importance measurement for the metal element of the sample based on the preferred spectral intensity data and the corresponding reference content data; The grid search method is used to optimize the parameters of the random forest regression model based on variable importance measurement to obtain the random forest regression model based on variable importance measurement and grid search, including: selecting the value range and step size of the parameters to be optimized, wherein the parameters to be optimized include the number range and step size of trees of the random regression model, the range and step size of the number of random seeds, and the maximum depth range and step size; constructing a parameter grid based on the value range and step size of the parameters to be optimized to obtain all parameter combinations; cross-validating and / or externally validating each parameter combination; and selecting the optimal parameters according to the validation results to obtain the random forest regression model based on variable importance measurement and grid search.

[0015] In a specific embodiment, the number of trees ranges from 50 to 300 with a step size of 20; the number of random seeds ranges from 40 to 62 with a step size of 3; and the maximum depth ranges from 10 or 20.

[0016] In a specific embodiment, the cross-validation adopts 5-fold cross-validation.

[0017] In a preferred embodiment, for K, the optimal parameters are: the number of trees is 50, the number of random seeds is 57, and the maximum depth is 10; for Ca, the optimal parameters are: the number of trees is 250, the number of random seeds is 48, and the maximum depth is 10; for Mg, the optimal parameters are: the number of trees is 110, the number of random seeds is 45, and the maximum depth is 10; for Na, the optimal parameters are: the number of trees is 290, the number of random seeds is 48, and the maximum depth is 20; for Fe, the optimal parameters are: the number of trees is 150, the number of random seeds is 42, and the maximum depth is 10.

[0018] In a specific embodiment, internal validation is performed based on the corresponding second random forest regression model, and the optimal threshold is selected from the multiple variable importance thresholds, including: performing the internal validation based on the determination coefficient and the average relative error between the predicted value and the reference content value of the second random forest regression model as evaluation indicators of the model prediction performance.

[0019] In a specific embodiment, the coefficient of determination is greater than 0.97; and the average relative error is less than 0.05.

[0020] In a specific embodiment, the target metal elements are K, Ca, Mg, Na and Fe; For K, the preferred threshold is 3; For Ca, the preferred threshold is 0.5; For Mg, the preferred threshold is 0.1; For Na, the preferred threshold is 0.004; For Fe, the preferred threshold is 1.

[0021] A second aspect of the present invention provides an electronic device, including a processor and a storage medium, wherein the storage medium stores a program, and when the program is executed by the processor, the method described in the first aspect is implemented.

[0022] A third aspect of the present invention provides a storage medium, wherein the storage medium stores a program, and when the program is executed, the method described in the first aspect is implemented.

[0023] A fourth aspect of the present invention provides a system, comprising: The electronic device according to the second aspect of the present invention; The spectrometer system is used to collect the spectral intensity data of metal elements in carbon fiber.

[0024] In a specific embodiment, the system further includes a mass spectrometer system for collecting the content of metal elements in the carbon fiber.

[0025] Compared with the prior art, the present invention has the following beneficial effects: 1) The present invention uses a machine learning method to measure (also known as predict) the metal element content of carbon fiber. It only needs to use a mass spectrometer to obtain the metal element content of the sample during the training of the machine learning model. That is to say, only the pre-treatment method mentioned in the background technology is introduced during the training stage. In the application stage, only a spectrometer and an electronic device loaded with the machine learning model of the present invention are required to complete the measurement. There is no need for complex sample pre-treatment, non-destructive analysis, and no need to use a large amount of acid, which minimizes the special and complex wastewater treatment process, thereby achieving an environmentally friendly, accurate, simple, fast and direct measurement effect.

[0026] 2) In view of the fact that the metal element content of carbon fiber is low and the content of different types of metal elements may vary greatly in the measurement scenario of metal elements, an embodiment of the present invention adopts a scheme of obtaining the preferred spectral data preprocessing method for different metal elements, thereby improving the accuracy of subsequent predictions.

[0027] 3) An embodiment of the present invention further extracts features from the preprocessed data to reduce the data dimension, thereby constructing a random forest regression model, avoiding model complexity, reducing modeling time, and further improving the model's predictive ability and computational efficiency.

[0028] 4) In view of the fact that the metal element content of carbon fiber is low and the content of different types of metal elements may vary greatly in the measurement scenario of metal elements, an embodiment of the present invention adopts a solution of obtaining respective optimal random forest regression models for different metal elements, thereby improving the accuracy of prediction.

[0029] 5) An embodiment of the present invention uses a grid search method to further optimize the random forest regression model based on variable importance measurement, constructs a parameter group for cross-validation, and thus obtains optimized model parameters. The model constructed based on the optimized model parameters can meet the prediction stability requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the specific implementation of the present invention or the technical solution in the prior art, the drawings required for use in the specific implementation or the description of the prior art are briefly introduced below.

[0031] Figure 1 is a schematic diagram of a network architecture for implementing the measurement method of the present invention; Figure 2 is a flowchart of obtaining an optimized preprocessing unit according to one embodiment of the present invention; Figure 3 is a flowchart of obtaining a random forest regression model based on variable importance measurement according to an embodiment of the present invention; Figure 4 is a flowchart of obtaining a random forest regression model based on variable importance measurement and grid search according to an embodiment of the present invention; Figure 5 is a schematic diagram of the hardware and software structure used in the application stage according to an embodiment of the present invention; Figure 6 is a flowchart of a method for measuring metal elements in carbon fiber according to an embodiment of the present invention; and Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention.

[0033] Figure 1 A schematic diagram of a network architecture of an exemplary embodiment of the present application is shown, and the training method and measurement method involved in the present application are executed through the network architecture or part of the network architecture.

[0034] The architecture 1 includes: an electronic device 10, a spectrometer system 12 and a mass spectrometer system 14. The spectrometer system 12 and the mass spectrometer system 14 are connected to the electronic device 10 via a wireless network or a wired network.

[0035] The electronic device 10 may include at least one of a computer, a server, a cloud computing platform, and a virtualization center, but is not limited thereto. As long as the machine learning model modeling and model training method of the present invention and the measurement method of the model application phase can be executed. In a specific example, a random forest regression model is used as the machine learning model of the present invention.

[0036] The spectrometer system 12 may be a laser induced breakdown spectrometer system (LIBS). Specifically, the LIBS used in the present invention is mainly composed of a Q-switched Nd:YAG laser (Dawa300, Beijing Beamtech, China), a spectrometer (Ocean Optics MX2500-3PLUS, USA), a charge coupled device (CCD), a movable sample stage, a computer, etc.

[0037] The role of the spectrometer system 12 in the modeling and training stage is to collect the spectral intensity data of the sample metal elements in the sample carbon fiber, and transmit the spectral intensity data to the electronic device 10 for modeling and model training; the role of the spectrometer system 12 in the application stage is to collect the spectral intensity data of the target metal elements in the carbon fiber to be tested, and transmit the spectral intensity data to the electronic device 10 for predicting the corresponding metal element content.

[0038] The mass spectrometer system 14 may be an inductively coupled plasma-mass spectrometry (ICP-MS) system. The mass spectrometer system 14 is used in the modeling and training stages to collect reference contents of metal elements in the sample carbon fibers. Please note that the mass spectrometer system 14 is only required in the modeling and training stages in the present invention.

[0039] Modeling and model training phase The modeling and model training method of one embodiment of the present invention is an optimization process of the overall spectral data preprocessing unit and an optimization process of the random forest regression model.

[0040] Specifically, if Figure 2 As shown, an optimization process of a spectral data preprocessing unit is provided, comprising: S10, obtaining sample data corresponding to one or more sample metal elements in the sample carbon fiber, wherein the sample data includes spectral intensity data and corresponding reference content data.

[0041] Specifically, the electronic device 10 obtains the spectrum intensity and the reference content of the sample metal element in the sample carbon fiber from the spectrometer system 12 and the mass spectrometer system 14 respectively.

[0042] In one example, a laser induced breakdown spectrometer system is used to collect spectral data of sample metal elements (K, Ca, Mg, Na and Fe) of 15 sample carbon fibers. Considering the uniformity, spectra are collected at different test points of each sample carbon fiber at random. Preferably, when collecting spectral data, 10 different test points are randomly selected for each sample. Therefore, for each sample metal element of each sample carbon fiber, 10 LIBS spectra are obtained, totaling 150 LIBS spectral data, wherein each LIBS spectral data contains, for example, 5000 spectral intensities (depending on the spectrometer system used, only 5000 is used as an example here). Furthermore, for each sample metal element (such as K), a spectral data matrix of 150*5000 can be obtained and transmitted to the electronic device 10.

[0043] On the other hand, in one example, the inductively coupled plasma-mass spectrometry (ICP-MS) system was used to collect the content of the sample metal elements (K, Ca, Mg, Na and Fe) of the 15 sample carbon fibers, and specifically, 10 different test points selected for each sample were tested. Therefore, for each sample metal element, a total of 150 reference content data were obtained, and then, for each sample metal element, a 150*1 content matrix could be obtained and transmitted to the electronic device.

[0044] S12. Divide the sample data of each sample metal element into a calibration set and a test set.

[0045] After the electronic device 10 receives the spectrum data matrix and the content matrix, the sample data of each sample metal element is divided into a calibration set and a test set. The following operations are performed on each sample metal element respectively.

[0046] Still taking K as an example, 150*5000 spectral data and the corresponding 150 reference content data are divided into a calibration set and a test set, for example, by a 2:1 random division method.

[0047] S14. Construct a respective first random forest regression model based on the calibration set of each sample metal element.

[0048] Still taking K as an example, the first random forest regression model of metal element K is constructed based on 100*5000 spectral data and the corresponding 100 reference content data. Similar operations are performed for other metal elements.

[0049] S16. Optimize the selected preprocessing method based on the first random forest regression model to obtain the preferred preprocessing method corresponding to the metal element of the sample to form an optimized preprocessing unit and obtain a preprocessed correction set corresponding to the metal element of the sample.

[0050] In the present invention, since the content of metal elements in carbon fiber is relatively small, and there may be a large difference in the content ratio between each metal element, the obtained spectral intensity data may have noise interference and data is not smooth due to the measurement accuracy of the spectrometer system, so the spectral intensity data needs to be preprocessed. In addition, using only one preprocessing method may cause interference in subsequent modeling.

[0051] To this end, in a preferred embodiment, S16 further includes: According to the first random forest regression model, taking the minimum average relative error as the judgment criterion, a preferred preprocessing method is selected from the wavelet transform method and the second-order derivative method and its optimization parameters are determined.

[0052] That is to say, still taking metal element K as an example, the wavelet transform method and the second-order derivative method are used to pre-process the spectral intensity data respectively and input them as one of the inputs into the first random forest regression model of this metal element. The minimum average relative error is used as the judgment standard to select the preferred pre-processing method from the wavelet transform method and the second-order derivative method and determine its optimization parameters. Similar operations are performed for other metal elements.

[0053] Among them, the optimization parameters of the wavelet transform method include the selection of wavelet basis functions and decomposition levels, wherein the wavelet basis functions include coif function and db function, and the decomposition level range is 1-15; the optimization parameters of the second-order derivative method include the selection of smoothing points, wherein the smoothing points range is 3-15.

[0054] In one embodiment of the present invention, after the above optimization, the following results are obtained: For K, the preferred pretreatment method is the wavelet transform method, wherein the wavelet basis function of the wavelet transform method is coif4, and the number of decomposition levels is 9; for Ca, the preferred pretreatment method is the wavelet transform method, wherein the wavelet basis function of the wavelet transform method is db10, and the number of decomposition levels is 8; for Mg, the preferred pretreatment method is the wavelet transform method, wherein the wavelet basis function of the wavelet transform method is db8, and the number of decomposition levels is 9; for Na, the preferred pretreatment method is the second-order derivative method, wherein the number of smoothing points is 9; for Fe, the wavelet basis function of the wavelet transform method is db12, and the number of decomposition levels is 4.

[0055] For the above five metal elements, five optimized pretreatment units are obtained respectively, such as Figure 5 As shown (ellipsis indicates multiple numbers in the figure).

[0056] In view of the characteristics of low metal element content and large difference in the content of different types of metal elements in the carbon fiber metal element measurement scenario, the present invention adopts a scheme of obtaining respective preferred spectral data preprocessing methods for different metal elements, thereby improving the accuracy of subsequent predictions.

[0057] In addition, the optimized preprocessing method (that is, the optimized preprocessing unit) obtained for each metal element obtained a corresponding preprocessed correction set.

[0058] Due to the complexity of the sample, the obtained preprocessed calibration set includes redundant information in addition to the effective information of the sample. If all spectral data are used for analysis, it is easy to cause the "dimensionality disaster" problem, which will not only complicate the model and increase the modeling time, but also seriously affect the model's prediction ability and computational efficiency. Therefore, it is necessary to select spectra for variables, extract feature information, and reduce data dimensions to reduce time consumption and improve analysis results.

[0059] For this reason, Figure 3 As shown, an optimization process of a random forest prediction unit is provided, including: S20, preliminarily optimizing the spectral intensity data in the preprocessed calibration set corresponding to each metal element of the sample based on the variable importance measurement method (VIM) to obtain respective preliminary optimized characteristic variables; S22, constructing a second random forest regression model for each sample metal element based on the characteristic variables; S24, selecting a variable importance threshold of a variable importance measurement method by internal validation to obtain an optimal threshold; S26. Determine the preferred spectral intensity data based on the preferred threshold to construct a random forest regression model based on variable importance measurement (also known as a VIM-RF regression model).

[0060] In a specific embodiment, S20-S26 further include: setting multiple variable importance thresholds respectively, extracting respective characteristic variables from the spectral intensity data in the preprocessed correction set; and constructing a corresponding second random forest regression model using the respective characteristic variables and the corresponding reference content data; performing internal verification based on the corresponding second random forest regression model, and selecting an optimal threshold from the multiple variable importance thresholds; determining preferred spectral intensity data from the spectral intensity data in the preprocessed correction set based on the optimal threshold, and constructing a random forest regression model based on variable importance measurement for the metal elements of the sample based on the preferred spectral intensity data and the corresponding reference content data.

[0061] For example, still taking K as an example, first randomly select a variable with an importance threshold of 2, extract a part of variables such as 150*1000 and their corresponding content data from the preprocessed correction set to build a second random forest regression model; then randomly select a variable with an importance threshold of 4, extract a part of variables such as 150*800 and their corresponding content data from the preprocessed correction set to build a second random forest regression model, ... and so on.

[0062] Thus, an optimal threshold can be selected from these variable importance thresholds, and based on the optimal threshold, preferred spectral intensity data can be determined from the spectral intensity data in the preprocessed correction set, and a random forest regression model based on variable importance measurement can be constructed for the metal element K based on the preferred spectral intensity data and the corresponding reference content data. Similar operations are performed for other metal elements.

[0063] In a specific embodiment, the internal verification is performed based on the corresponding second random forest regression model, and the optimal threshold is selected from the multiple variable importance thresholds, including: performing the internal verification based on the determination coefficient and the average relative error between the predicted value of the second random forest regression model and the reference content value as evaluation indicators of the model prediction performance.

[0064] In a specific embodiment, the coefficient of determination is greater than 0.97; and the average relative error is less than 0.05.

[0065] At this point, the process of using the calibration set to construct a random forest regression model based on variable importance measurement has been completed. On this basis, the method of the present invention also includes: S28. Use the test set in the sample data of each sample metal element to verify the corresponding random forest regression model based on variable importance measurement, so as to obtain a trained random forest prediction unit. For the above five metal elements, five trained random forest prediction units are obtained respectively, such as Figure 5 As shown, it includes a pre-processing unit 1000 for each metal element and a prediction unit 1005 for each metal element, which together constitute the software part 100 of the present invention.

[0066] Table 1 shows the prediction performance comparison of the VIM-RF regression model and the ordinary random forest regression model for the test set samples. It can be seen that the prediction performance of the VIM-RF regression model is better than that of the ordinary random forest regression model.

[0067] Table 1 Prediction performance of different RF regression models However, the inventors found that when the VIM-RF regression model is used to perform multiple parallel measurements on unknown samples, the stability of the prediction performance is poor (for example, the relative standard deviation is large). To this end, one embodiment of the present invention uses a grid search method to further optimize the VIM-RF regression model: construct a parameter group for cross-validation to obtain optimized model parameters, and then the model constructed based on the optimized model parameters can achieve a satisfactory prediction stability effect.

[0068] For this reason, Figure 4 As shown, Figure 3 The alternative scheme provides another optimization process of the random forest prediction unit, including: S30, performing preliminary optimization on the spectral intensity data in the preprocessed calibration set corresponding to each metal element of the sample based on the variable importance measurement method (VIM) to obtain respective preliminary optimized characteristic variables; S32, constructing a second random forest regression model for each sample metal element based on the characteristic variables; S34, selecting a variable importance threshold of a variable importance measurement method by internal validation to obtain an optimal threshold; S36, determining the preferred spectral intensity data based on the preferred threshold to construct a random forest regression model based on variable importance measurement (also known as a VIM-RF regression model); S37. Optimizing the parameters of the random forest regression model based on variable importance measurement based on a grid search method to obtain a random forest regression model based on variable importance measurement and grid search.

[0069] In a specific embodiment, S30-S37 further includes: setting a plurality of variable importance thresholds respectively, extracting respective characteristic variables from the spectral intensity data in the preprocessed calibration set; and constructing a corresponding second random forest regression model using the respective characteristic variables and the corresponding reference content data; performing internal verification based on the corresponding second random forest regression model, selecting an optimal threshold from the plurality of variable importance thresholds; determining preferred spectral intensity data from the spectral intensity data in the preprocessed calibration set based on the optimal threshold, and constructing the metal element of the sample based on the preferred spectral intensity data and the corresponding reference content data. A random forest regression model based on variable importance measurement; selecting a value range and step size of a parameter to be optimized in the random forest regression model based on variable importance measurement, wherein the parameters to be optimized include the number range and step size of trees of the random regression model, the range and step size of the number of random seeds, and the maximum depth range and step size; constructing a parameter grid based on the value range and step size of the parameter to be optimized to obtain all parameter combinations; performing cross-validation and / or external validation on each parameter combination; and selecting the optimal parameters based on the validation results to obtain the random forest regression model based on variable importance measurement and grid search (also known as the GS-VIM-RF regression model).

[0070] For example, still taking K as an example, first randomly select a variable with an importance threshold of 2, extract a part of variables such as 150*1000 and their corresponding content data from the preprocessed correction set to build a second random forest regression model; then randomly select a variable with an importance threshold of 4, extract a part of variables such as 150*800 and their corresponding content data from the preprocessed correction set to build a second random forest regression model, ... and so on.

[0071] Thus, an optimal threshold can be selected from these variable importance thresholds, and based on the optimal threshold, preferred spectral intensity data can be determined from the spectral intensity data in the preprocessed correction set, and a random forest regression model based on variable importance measurement of metal element K can be constructed based on the preferred spectral intensity data and the corresponding reference content data, and the random forest regression model based on variable importance measurement can be further optimized to obtain a GS-VIM-RF regression model. Similar operations are performed for other metal elements.

[0072] In a specific embodiment, the internal verification is performed based on the corresponding second random forest regression model, and the optimal threshold is selected from the multiple variable importance thresholds, including: performing the internal verification based on the determination coefficient and the average relative error between the predicted value of the second random forest regression model and the reference content value as evaluation indicators of the model prediction performance.

[0073] In a specific embodiment, the coefficient of determination is greater than 0.97; and the average relative error is less than 0.05.

[0074] In a specific embodiment, the number of trees ranges from 50 to 300 with a step size of 20; the number of random seeds ranges from 40 to 62 with a step size of 3; and the maximum depth ranges from 10 or 20.

[0075] In a specific embodiment, the cross-validation adopts 5-fold cross-validation.

[0076] In a preferred embodiment, for K, the optimal parameters are: the number of trees is 50, the number of random seeds is 57, and the maximum depth is 10; for Ca, the optimal parameters are: the number of trees is 250, the number of random seeds is 48, and the maximum depth is 10; for Mg, the optimal parameters are: the number of trees is 110, the number of random seeds is 45, and the maximum depth is 10; for Na, the optimal parameters are: the number of trees is 290, the number of random seeds is 48, and the maximum depth is 20; for Fe, the optimal parameters are: the number of trees is 150, the number of random seeds is 42, and the maximum depth is 10.

[0077] At this point, the process of using the calibration set to construct a random forest regression model based on variable importance measurement and grid search has been completed. On this basis, the method of the present invention also includes: S38. Use the test set in the sample data of each sample metal element to verify the corresponding random forest regression model based on variable importance measurement and grid search, so as to obtain a trained random forest prediction unit. For the above five metal elements, five trained random forest prediction units are obtained respectively, such as Figure 5 shown.

[0078] Table 2 shows the prediction performance comparison of the GS-VIM-RF regression model and VIM-RF for the test set samples. It can be seen that the GS-VIM-RF regression model has better prediction performance and shortens the model running time, greatly improving the prediction efficiency.

[0079] Table 2 Prediction performance of different RF regression models Moreover, it can be seen from Table 2 that compared with the VIM-RF model, the prediction performance of the five GS-VIM-RF regression models of the target elements was more stable and more accurate, and the RSDs of each element were less than 0.07 and the MREs were less than 0.05.

[0080] Application Phase like Figure 6 As shown, based on the above model construction and training, the present invention also provides a method for measuring metal elements in carbon fiber, including: S40, obtaining spectral intensity data corresponding to one or more target metal elements in the carbon fiber to be tested; S42, inputting the respective corresponding spectral intensity data into the corresponding optimized pre-processing unit to obtain the respective corresponding optimized spectral intensity data; S44, inputting the corresponding optimized spectral intensity data into the corresponding trained random forest prediction unit to obtain the content of the one or more target metal elements.

[0081] For example, the spectrum intensity data of the metal element K is input into the first target element preprocessing unit to obtain optimized spectrum intensity data, which is then input into the corresponding first target element random forest prediction unit. Other elements are similar.

[0082] In a specific embodiment, the target metal elements are K, Ca, Mg, Na and Fe.

[0083] It is understandable to those skilled in the art that the present application implements all or part of the processes in the modeling / training method and the measurement method of the above-mentioned embodiments, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.

[0084] The present application also provides an electronic device, such as Figure 7 The electronic device shown includes a processor 31 and a memory 32, wherein the memory stores a program, which can be used to implement the above method when executed by the processor.

[0085] In addition, the present application also provides a system, such as Figure 1 As shown, it includes electronic equipment and the spectrometer system mentioned in the present invention. Further, in the modeling and training stage, the system also includes the mass spectrometer system mentioned in the present invention.

[0086] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order, and they can be executed simultaneously (in parallel) or in other orders. These adjusted schemes are equivalent to the technical schemes described in this application, and therefore will also fall within the scope of protection of this application.

[0087] The above embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify or improve the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein by equivalents; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for measuring metal elements in carbon fiber, characterized in that: include: Obtaining spectral intensity data corresponding to one or more target metal elements in the carbon fiber to be tested; Inputting the respective corresponding spectral intensity data into the corresponding optimized pre-processing unit to obtain the respective corresponding optimized spectral intensity data; and The corresponding optimized spectral intensity data are input into the corresponding trained random forest prediction unit to obtain the content of the one or more target metal elements.

2. The method according to claim 1, characterized in that: The method further comprises: Acquire sample data corresponding to one or more sample metal elements in the sample carbon fiber, wherein the sample data includes spectral intensity data and corresponding reference content data; Divide the sample data of each sample metal element into a calibration set and a test set; Based on the calibration set of each sample metal element, the respective first random forest regression model was constructed; The selected preprocessing method is optimized based on the first random forest regression model to obtain the preferred preprocessing method corresponding to the metal element of the sample to form the optimized preprocessing unit and obtain the preprocessed correction set corresponding to the metal element of the sample.

3. The method according to claim 2, characterized in that The selected preprocessing methods include wavelet transform method and second-order derivative method; The method of optimizing the selected preprocessing method based on the first random forest regression model to obtain the preferred preprocessing method corresponding to the metal element of the sample includes: According to the first random forest regression model, taking the minimum average relative error as the judgment criterion, a preferred preprocessing method is selected from the wavelet transform method and the second-order derivative method and its optimization parameters are determined.

4. The method according to claim 3, characterized in that: The optimization parameters of the wavelet transform method include the selection of wavelet basis functions and decomposition levels, wherein the wavelet basis functions include coif functions and db functions, and the decomposition level ranges from 1 to 15; The optimization parameters of the second-order derivative method include the selection of the number of smoothing points, wherein the number of smoothing points ranges from 3 to 15.

5. The method according to claim 4, characterized in that The target metal elements are K, Ca, Mg, Na and Fe; For K, the preferred preprocessing method is a wavelet transform method, wherein the wavelet basis function of the wavelet transform method is coif4 and the number of decomposition levels is 9; For Ca, the preferred preprocessing method is a wavelet transform method, wherein the wavelet basis function of the wavelet transform method is db10 and the number of decomposition levels is 8; For Mg, the preferred pretreatment method is a wavelet transform method, wherein the wavelet basis function of the wavelet transform method is db8 and the number of decomposition levels is 9; For Na, the preferred preprocessing method is the second-order derivative method, where the number of smoothing points is 9; For Fe, the wavelet basis function of the wavelet transform method is db12, and the number of decomposition levels is 4.

6. The method according to any one of claims 2 to 5, characterized in that: The method further comprises: Based on the variable importance measurement method, the spectral intensity data in the preprocessed calibration set corresponding to each sample metal element is preliminarily optimized to obtain the respective preliminary optimized characteristic variables; Constructing a second random forest regression model for each sample metal element based on the characteristic variables; Internal validation was used to select the variable importance threshold of the variable importance measurement method to obtain the optimal threshold; The preferred spectral intensity data is determined based on the preferred threshold to construct a random forest regression model based on variable importance measurement.

7. The method according to claim 6, characterized in that The method further comprises: The test set in the sample data of each sample metal element is used to verify the corresponding random forest regression model based on variable importance measurement, so as to obtain the trained random forest prediction unit.

8. An electronic device comprising a processor and a storage medium, characterized in that: The storage medium stores a program, and when the program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.

9. A storage medium, characterized in that: The storage medium stores a program, and when the program is executed, the method according to any one of claims 1 to 7 is implemented.

10. A system, characterized in that: include: The electronic device according to claim 8; The spectrometer system is used to collect the spectral intensity data of metal elements in carbon fiber.

Citation Information

Patent Citations

  • Method for detecting metal element by random forest algorithm combined with laser induced breakdown spectroscopy

    CN109884033A

  • Stock yield prediction method based on improved random forest algorithm

    CN110059852A

  • Benthonic animal hyperspectral data classification method based on random forest algorithm

    CN115294404A

  • Forest carbon reserve inversion method based on ICESat-2 satellite-borne LiDAR data and multispectral data

    CN115561773A

  • Iron ore powder classification and quantification method and device based on visible light-near infrared technology

    CN116242798A