Model for predicting flame retardance of nonmetal electric energy metering box shell
By performing machine learning analysis on the Raman spectral data of the non-metallic energy metering box shell, and using the BO-XGBoost model to predict its flame retardant performance, solving the problem of destructive testing of flame retardant performance in the prior art, achieving a fast and accurate detection effect.
Patent Information
- Application Number
- CN202510119681.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, the detection of flame retardant performance of the non-metallic electrical energy metering box shell requires destructive testing, and the product cannot be detected one by one, resulting in the possibility of unqualified flame retardant performance in actual applications, affecting power safety.
By learning and training the Raman spectral data of the flame retardant test samples, Bayesian optimization improved extreme gradient lift model (BO-XGBoost) is used to achieve predictive analysis of the flame retardant performance of non-metallic energy box housing materials without flame retardant tests.
It realizes quick and accurate detection of the flame retardant performance of the non-metallic electrical energy metering box shell material, avoids damage to the sample by destructive testing, reduces the detection cost, and improves the detection efficiency.
Smart Images

Figure CN120048402A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material detection, and more specifically, the present invention relates to a prediction model for the flame retardancy performance of a non-metallic electric energy metering box housing. Background Art
[0002] The non-metallic electric energy metering box is an important electrical protection device. To ensure the safety of electrical equipment, it is usually required that the flame retardancy performance of the non-metallic shell of the electric energy metering box reaches the highest V0 level (GB / T 2408-2021 Plastics - Determination of burning behaviour - Horizontal and vertical methods). During the procurement and supervision and inspection of electrical materials, it is necessary to test the flame retardancy performance of the non-metallic electric energy metering box. The conventional flame retardancy performance test process is to cut the test sample into a specified specimen, burn the specimen with a flame in a professional device, and observe the combustion state of the specimen in the flame. This is a typical destructive test. Whether the test result is qualified or not, the tested product cannot be put into use continuously. Therefore, it is impossible to test each electric energy metering box product one by one. Due to the limitations of sampling inspection, it has been found in actual applications that there will be cases where the flame retardancy performance of the non-metallic electric energy metering box products put into operation is unqualified, which poses a hazard to electrical safety and the lives and property of electrical users. In order to avoid the destructive operation of the traditional flame retardancy performance detection technology on the test sample, it is necessary to develop a fast test technology with high accuracy to achieve the accurate detection of the flame retardancy performance of the non-metallic shell of the electric energy metering box.
[0003] Machine learning is an intelligent analysis and prediction technology that has been successfully applied in many fields such as transportation and industry. At present, researchers have proved that the combination of machine learning technology and material composition analysis technologies such as spectroscopy and nuclear magnetic resonance can analyze material composition and predict material properties. Chinese invention patent [A discrimination model and method for identifying camel milk based on Raman spectroscopy and machine learning algorithm CN202211201755.9] discloses a discrimination model for camel milk based on collecting Raman spectral data of camel milk powder and establishing an SVM classification model after preprocessing and dimensionality reduction. Chinese invention patent [Ultraviolet Raman spectroscopy DNA oxidation qualitative detection method based on machine learning CN202311752148.6] discloses an ultraviolet Raman spectroscopy DNA oxidation qualitative detection method based on machine learning. This method uses a variety of algorithms to train and evaluate the ultraviolet Raman spectral data of the sample to obtain the best model suitable for the qualitative detection of ultraviolet Raman spectroscopy DNA oxidation. These cases illustrate that the method of combining spectral detection and machine learning can be used for the performance and composition detection of materials.
[0004] According to the procurement specifications of power grid companies and industry manufacturing habits, the chemical composition of the non-metallic electricity meter box housing material is relatively clear - the main raw materials are polycarbonate (PC) and acrylonitrile-butadiene-styrene copolymer (ABS). Although the processing auxiliary materials used by each production enterprise, such as flame retardants, plasticizers, reinforcing agents, etc., are different, their relative contents are relatively low. Raman spectroscopy detection and analysis of the housing material of the non-metallic electricity meter box found that its spectral data has great similarity, but the spectral patterns of products from different manufacturers have different characteristics. Using machine learning technology to analyze the Raman spectral data of the housing material can find the differences between different material composition systems, so it can be used as a solution for predicting and judging the flame retardant performance of materials. Summary of the Invention
[0005] In order to overcome the above defects of the prior art, the present invention provides a prediction model for the flame retardant performance of a non-metallic electricity meter box housing. By learning and training the Raman spectral data of flame retardant test samples, it realizes the prediction and analysis of the flame retardant performance of the non-metallic electricity meter box housing material that has not undergone flame retardant tests, and realizes the rapid detection of the flame retardant performance of the non-metallic electricity meter box housing material, so as to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A prediction model for the flame retardant performance of a non-metallic electricity meter box housing, which realizes the prediction of the flame retardant performance of a sample to be tested. The main raw materials of the non-metallic electricity meter box housing are polycarbonate (PC) and acrylonitrile-butadiene-styrene copolymer (ABS). After collecting the Raman spectral data of the sample, the flame retardant performance of the sample is obtained by combustion testing as the label for machine learning. The extreme gradient boosting model optimized by the Bayesian algorithm (BO-XGBoost) is used to realize the prediction of the flame retardant performance of the sample to be tested. The BO-XGBoost model takes the performance index of extreme gradient boosting - the error term (logloss) and the regularization term (L1 regularization Lasso and L2 regularization Ridge) as the objective function, and finds the best combination of hyperparameters through the Bayesian optimization algorithm.
[0008] As a further aspect of the present invention, the prediction of the machine learning and the BO-XGBoost model includes the following steps:
[0009] Step S1, collect samples of the non-metallic electricity meter box housing. After obtaining the Raman spectral data of the sample using a Raman spectrometer, use a horizontal and vertical burning tester (UL94 combustion test chamber, Zhuhai Jiayi Testing Equipment Co., Ltd.) to test and obtain the flame retardant performance of the sample (GB / T 2408-2021 flame retardant grade: V0, V1, V2, others);
[0010] Step S2: Perform Savitzky-Golay filtering and smoothing, baseline correction, and normalization on the Raman spectroscopy data of the samples to obtain a dataset for machine learning. Divide the dataset into a training set and a validation set;
[0011] Step S3: Use the dataset obtained in Step S2 and the Bayesian optimization-improved Extreme Gradient Boosting (BO-XGBoost) model to perform supervised learning training and testing on the Raman spectroscopy dataset of the samples with the flame retardancy performance of the samples as the label. Correspond the combustion experiment results in Step S1 and the spectral data after preprocessing in Step S2 one by one, and use the combustion test results (V0 level is "qualified", below V0 level is "unqualified") as the label to determine the optimal hyperparameter combination of the model through the Bayesian optimization algorithm;
[0012] Step S4: After the model training is completed, verify and evaluate the robustness of the model, and avoid overfitting through the early stopping mechanism. Use a Raman spectrometer to test the spectral data of the non-metallic electric energy meter box housing samples that have not been tested for flame retardancy performance, and use the BO-XGBoost model established in Step S3 for prediction to judge the flame retardancy performance of the samples to be tested. According to the procurement specifications of the power grid company, the flame retardancy performance of the non-metallic electric energy box housing is required to be V0 level. To further verify the accuracy of the model prediction, in the example test, use the flame retardancy performance testing machine in Step S1 to test the flame retardancy performance of the samples to be tested, and compare and verify it with the results predicted by the model.
[0013] As a further solution of the present invention, during the process of collecting Raman spectroscopy data, for the evaluation of the flame retardancy performance of the non-metallic electric energy meter box housing, a portable Raman spectrometer or a Raman spectrometer with a movable optical fiber probe is selected as the test equipment, and the spectral range collected is 200-3200 cm-1, and the resolution is less than or equal to 2 cm-1 to ensure the high precision and high resolution of the spectral data. To ensure the representativeness and consistency of the collected spectral data, the samples adopt a standardized test process and ensure the stability of the test environment, including strict control of external conditions such as light, temperature, and humidity. During the collection process, to avoid the interference of stray light on the test signal, the spectrometer is equipped with an anti-interference filter system, and at the same time the sample surface is clean and dry to reduce the signal deviation caused by light scattering. In addition, to facilitate batch testing and improve the data collection efficiency, a fiber optic probe type or portable Raman spectrometer is used, which can directly detect non-metallic electric energy meter box housings of different shapes and sizes without sample disassembly or cutting, further realizing non-destructive testing. The collected spectral data is digitally stored for subsequent data processing and training of machine learning models.
[0014] As a further solution of the present invention, the Savitzky-Golay filtering smoothing, baseline correction and normalization of the Raman spectrum data of the sample include the following specific steps:
[0015] Step X1, the window width parameter of Savitzky-Golay filtering is expressed as 2m+1. For each data point y i , construct a sliding window y containing 2m+1 points i-m ,y i-m+1 , …, y i+m . Perform polynomial fitting on the data points in the window and establish a polynomial model P(x), where P(x) satisfies P(x) = C o +C 1 x+C 2 x 2 +…+C p x p , where C j The coefficients of the polynomial fit reflect the contribution of each point in the window to the center point i. The window parameter size determines the coverage of the filter, and the order p of the polynomial determines the complexity of the fit and affects the filtering effect. Use the least squares method to calculate C j Coefficient: C = (X T X) -1 X T y, where X is the independent variable matrix and y is the spectral data. The filtered signal can be expressed as: in, is the value of the filtered signal at position i, y i+j is the value of the original signal at position i+j, j varies from -m to m;
[0016] Step X2, the smoothed Raman spectrum data is subjected to asymmetric least squares method (AsLS) to correct the Raman spectrum baseline. Let y be the signal to be analyzed, z be the smoothed signal, and the length of both vectors is m, then the fidelity of z to y is defined as:
[0017]
[0018] The roughness of z is defined as:
[0019]
[0020] Where: D is the difference matrix, that is, D z =Δz. In order to balance fidelity and smoothness, the above two formulas can be combined and the smoothing parameter λ can be introduced to obtain the cost function Q 0 :
[0021] Q 0 =F+λR=||yz||2 +λ||D z || 2 ;
[0022] Input the fidelity weight matrix W to obtain the new cost function Q:
[0023]
[0024] where: W is a diagonal matrix with diagonal elements w i In the AsLS baseline correction algorithm, w i is selected in an asymmetric manner:
[0025]
[0026] To minimize the new cost function Q, take the derivative and set it to zero to obtain the linear equation:
[0027] (W + λD T D)z = Wy;
[0028] The optimization objective minQ is a convex function and can converge to the optimal solution within a finite number of iterations. Such a framework can perform baseline correction more effectively.
[0029] Step X3, normalize the corrected Raman spectroscopy dataset. Normalization is to convert the data to the same dimension range for subsequent analysis and processing. The maximum - minimum normalization is adopted, and the calculation formula is:
[0030]
[0031] where: y norm is the normalized data point, y i is the original data point, y max is the maximum light intensity in the original spectral data, y min is the minimum light intensity in the original spectral data.
[0032] As a further aspect of the present invention, the Bayesian Optimization - improved eXtreme Gradient Boosting (BO - XGBoost) model uses the performance metrics of eXtreme Gradient Boosting - the error term (logloss) and the regularization terms (L1 regularization Lasso and L2 regularization Ridge) as the objective function. The error term uses the logarithmic loss function, whose expression can quantify the deviation between the model's predicted probability and the true label, reducing the penalty weight for incorrect predictions in the classification task. To control the model complexity and prevent overfitting, two regularization terms are integrated: L1 regularization penalizes the absolute value of the model parameters, making the weights of irrelevant or redundant features in the parameters tend to zero, thus achieving feature selection and model sparsification; L2 regularization constrains the sum of squares of the model parameters, reducing the unstable influence of large weights on the model's prediction results. During the training process of the BO - XGBoost model, through the optimized design of the objective function, a dynamic balance is achieved between error minimization and model complexity. The calculation formula of the objective function is:
[0033]
[0034] In the formula: Γ is the objective function of the BO - XGBoost model, is the error term, Ω(f) is the regularization term, N is the number of samples, y i is the actual label, is the predicted probability of the model. By minimizing l, the BO - XGBoost model can continuously improve the prediction accuracy for the classification task; to achieve dynamic balance, incremental optimization is adopted, and the calculation formula of the incremental optimization is:
[0035]
[0036] In the formula: Γ (t) represents the change value of the objective function in the current t - th round of iteration; Δf(x i ) is the update amount of the model's predicted value for the sample x i in the t - th round of iteration; g i is the first - order derivative of the loss function with respect to the current predicted value ; h i is the second - order derivative of the loss function with respect to the current predicted value .
[0037] As a further aspect of the present invention, the BO - XGBoost model finds the best combination of hyperparameters through the Bayesian optimization algorithm. The specific steps include:
[0038] Step M1, the Bayesian optimization algorithm transforms the hyperparameter optimization problem into an objective function minimization problem. The defined optimization objective is: arg min θτ(θ), where θ is the combination of hyperparameters to be optimized, and τ(θ) is the validation loss of the model given the combination of hyperparameters;
[0039] Step M2: Randomly select several groups of hyperparameters, train an XGBoost model based on these parameters, record the validation set loss values corresponding to each group of hyperparameters to form an initial dataset (θ, τ), and use the initial dataset to train a surrogate model to simulate the relationship between the hyperparameter combination and the objective function value. where is a Gaussian process, the surrogate objective function, μ(θ) is the predicted mean of the hyperparameter combination θ, and k(θ, θ′) is the covariance function between hyperparameter combinations;
[0040] Step M3: According to the surrogate model, select the next group of hyperparameters θ next , θ next satisfying θ next = arg max θ ∈I(θ), where ∈I(θ) is the acquisition function of expected improvement;
[0041] Step M4: Train the model for θ next , calculate its validation set loss value τ(θ next ), add (θ next , τ(θ next )) to the dataset, and retrain the surrogate model based on the updated dataset.
[0042] Step M5: When the maximum number of iterations (1000 times) is reached or the improvement amplitude of the objective function is lower than the threshold (Δτ < 10 -4 ), stop the optimization.
[0043] The best combination of hyperparameters is: the maximum depth of the decision tree max_depth = 6, the number of decision trees n_estimators = 490 - 510, the learning rate of each tree learning_rate = 0.20 - 0.24, and the percentage of training data for each tree subsample = 0.5 - 0.7. The model is trained on a general computing device with an Intel i7-12700H CPU, has the ability of fast prediction, the response time is within 5 seconds, and the prediction accuracy of the sample flame retardant performance reaches 100% in experimental verification.
[0044] As a further aspect of the present invention, in step S4, the 5-fold cross-validation technique is used to complete multiple trainings in a loop, and finally the performance metrics are aggregated to ensure the robustness of the model. At the same time, to avoid the problem of overfitting of the model, an early stopping mechanism (early_stopping_rounds = 30) is set during the validation process. When the performance of the validation set does not improve after 30 consecutive iterations, the training automatically stops, thereby improving the adaptability of the model to new samples.
[0045] Technical effects and advantages of the prediction model for the flame retardancy performance of the non-metallic electric energy meter box housing of the present invention: By quickly detecting samples mainly composed of polycarbonate (PC) and acrylonitrile-butadiene-styrene copolymer (ABS) composites, the present invention realizes high-precision prediction of the flame retardancy performance, breaks through the traditional detection mode that relies on destructive combustion tests, not only eliminates the impact on the physical integrity of the samples, but also reduces the detection cost and resource waste, providing technical guarantee for the one-by-one detection of the non-metallic electric energy meter box housing. In addition, the present invention has extremely high prediction efficiency, and the response speed is less than 5 seconds on ordinary computing devices (such as Intel i7-12700H CPU), and can quickly output the detection results, meeting the actual application requirements of portable and efficient dedicated detection devices. This high-efficiency prediction ability benefits from the design optimization of the BO-XGBoost model, including using the Bayesian algorithm for hyperparameter optimization to improve the training and inference performance of the model, and combining data preprocessing techniques to ensure high-quality input of spectral data. Brief Description of the Drawings
[0046] Figure 1 It is a functional block diagram of a device for predicting the non-metallic flame retardancy in the prior art.
[0047] Figure 2 It is a method flow chart of the prediction model for the flame retardancy performance of the non-metallic electric energy meter box housing of the present invention.
[0048] Figure 3 It is a confusion matrix diagram of the BO-XGBoost model, support vector machine SVM model and XGBoost model of the present invention. Detailed Embodiments
[0049] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0050] Embodiment 1
[0051] Refer toFigure 2 As shown in the method flow chart, an embodiment of the present invention provides a prediction model for the flame retardancy of a non-metallic electric energy metering box housing. The main raw materials of the non-metallic electric energy metering box housing are polycarbonate (PC) and acrylonitrile-butadiene-styrene copolymer (ABS). By performing machine learning on the Raman spectral data of the samples after flame retardancy testing, a prediction model for the flame retardancy of the material is established, realizing the prediction of the flame retardancy of the samples to be tested. The extreme gradient boosting model (BO-XGBoost) improved by the Bayesian optimization algorithm is adopted, including the following steps:
[0052] Step S1, collect samples of the non-metallic electric energy metering box housing. After collecting the Raman spectral data of the samples, use a horizontal and vertical burning tester (UL94 combustion test chamber, Zhuhai Jiayi Testing Equipment Co., Ltd.) to test and obtain the flame retardancy of the samples (GB / T 2408-2021 flame retardancy grade: V0, V1, V2, others);
[0053] Step S2, perform Savitzky-Golay filtering and smoothing, baseline correction, and normalization processing on the Raman spectral data of the samples to obtain a data set for machine learning. Divide the data set into a training set, a test set, and a validation set;
[0054] Step S3, use the extreme gradient boosting (BO-XGBoost) model improved by Bayesian optimization for the data set obtained in Step S2, and perform supervised learning training and testing on the Raman spectral data set of the samples with the flame retardancy of the samples as the label. Correlate the combustion test results in Step S1 and the spectral data preprocessed in Step S2 one by one. Use the combustion test results (V0 level is "qualified", lower than V0 level is "unqualified") as the label, and convert "qualified" and "unqualified" into one-hot vectors for input, where "qualified" is marked as 1 and "unqualified" is marked as 0. The input dimension of each sample spectral data is 3001, and determine the optimal hyperparameter combination of the model through the Bayesian optimization algorithm;
[0055] Step S4, after the model training is completed, verify and evaluate the robustness of the model, and avoid overfitting through the early stopping mechanism. Use a Raman spectrometer to test the spectral data of the non-metallic electric energy metering box housing samples that have not been tested for flame retardancy, and use the BO-XGBoost model established in Step S3 for prediction to judge the flame retardancy of the samples to be tested. According to the procurement specifications of the power industry, the flame retardancy of the non-metallic electric energy box housing is required to be V0 level. In order to further verify the accuracy of the model prediction, in the embodiment test, use the flame retardancy testing machine in Step S1 to test the flame retardancy of the samples to be tested, and compare it with the results predicted by the model.
[0056] Further, in the process of collecting Raman spectral data for the evaluation of the flame retardant performance of the non-metallic electric energy metering box housing, a portable Raman spectrometer or a Raman spectrometer with a movable fiber optic probe is selected as the test equipment. The spectral range collected is 200 - 3200 cm-1, and the resolution is less than or equal to 2 cm-1 to ensure high-precision and high-resolution spectral data. To ensure the representativeness and consistency of the collected spectral data, the samples adopt a standardized test process and ensure the stability of the test environment, including strict control of external conditions such as light, temperature, and humidity. During the collection process, to avoid interference of stray light on the test signal, the spectrometer is equipped with a filter system with anti-interference performance. At the same time, the surface of the sample is clean and dry to reduce the signal deviation caused by light scattering. In addition, to facilitate batch testing and improve data collection efficiency, a fiber optic probe type or portable Raman spectrometer is used, which can directly detect non-metallic electric energy metering box housings of different shapes and sizes without sample disassembly or cutting, realizing non-destructive testing. The collected spectral data is digitally stored for subsequent data processing and training of machine learning models.
[0057] Further, the Savitzky-Golay filtering and smoothing, baseline correction, and normalization processing of the Raman spectral data of the sample include the following specific steps:
[0058] Step X1, the window width parameter of Savitzky-Golay filtering is expressed as 2m + 1. For each data point y i , a sliding window y i-m , y i-m+1 , …, y i+m containing 2m + 1 points is constructed. The data points within the window are subjected to polynomial fitting to establish a polynomial model P(x), and P(x) satisfies P(x) = C o + C 1 x + C 2 x 2 + … + C p x p , where C j represents the coefficient of polynomial fitting, reflecting the contribution of each point within the window to the central point i. The size of the window parameter determines the coverage range of the filter, and the order p of the polynomial determines the complexity of the fitting, affecting the filtering effect. The least squares method is used to calculate the C j coefficient: C = (X T X) -1 X T y, where X is the independent variable matrix and y is the spectral data. The filtered signal can be expressed as: Where, is the value of the filtered signal at position i, y i+jis the value of the original signal at position i+j, j varies from -m to m;
[0059] Step X2, the smoothed Raman spectrum data is subjected to asymmetric least squares method (AsLS) to correct the Raman spectrum baseline. Let y be the signal to be analyzed, z be the smoothed signal, and the length of both vectors is m, then the fidelity of z to y is defined as:
[0060]
[0061] The roughness of z is defined as:
[0062]
[0063] Where: D is the difference matrix, that is, D z =Δz. In order to balance fidelity and smoothness, the above two formulas can be combined and the smoothing parameter λ can be introduced to obtain the cost function Q 0 :
[0064] Q 0 =F+λR=||yz|| 2 +λ||D z || 2 ;
[0065] Substituting into the fidelity weight matrix W, we get the new cost function Q:
[0066]
[0067] Where: W is the diagonal element w i In the AsLS baseline correction algorithm, w i Select in an asymmetric way:
[0068]
[0069] In order to minimize the new cost function Q, take the derivative and set it to zero, and get the linear equation:
[0070] (W+λD T D) z = Wy;
[0071] The optimization objective minQ is a convex function that can converge to the optimal solution within a finite number of iterations. Such a framework can perform baseline correction more effectively.
[0072] Step X3, normalize the corrected Raman spectrum data set. Normalization is to convert the data into the same dimension range to facilitate subsequent analysis and processing. The maximum-minimum value normalization is used, and the calculation formula is:
[0073]
[0074] where: y norm is the normalized data point, y i is the original data point, y max is the maximum light intensity in the original spectral data, y min is the minimum light intensity in the original spectral data.
[0075] Furthermore, in step S4, in the verification session, a 5-fold cross-validation technique is adopted for evaluation, and training is completed through multiple cycles. Finally, the performance metrics are aggregated to ensure the robustness of the model. Meanwhile, to avoid the problem of overfitting of the model, an early stopping mechanism (early_stopping_rounds = 30) is set up during the verification process. When the performance of the validation set does not improve after 30 consecutive iterations, the training automatically stops, thereby enhancing the adaptability of the model to new samples.
[0076] In this embodiment, the Bayesian Optimization eXtreme Gradient Boosting (BO-XGBoost) model uses the performance metrics of eXtreme Gradient Boosting - the error term (logloss) and the regularization terms (L1 regularization Lasso and L2 regularization Ridge) as the objective function. The error term uses the logarithmic loss function, and its expression can quantify the deviation between the model prediction probability and the true label, reducing the penalty weight of misprediction in the classification task. To control the model complexity and prevent overfitting, two regularization terms are integrated: L1 regularization penalizes the absolute value of the model parameters, making the weights of irrelevant or redundant features in the parameters tend to zero, thereby achieving feature selection and model sparsification; L2 regularization constrains the sum of squares of the model parameters to reduce the unstable influence of larger weights on the model prediction results. During the training process of the BO-XGBoost model, through the optimized design of the objective function, a dynamic balance is achieved between error minimization and model complexity. The calculation formula of the objective function is:
[0077]
[0078] where: Γ is the objective function of the BO-XGBoost model, is the error term, Ω(f) is the regularization term, N is the number of samples, y i is the actual label, is the prediction probability of the model. By minimizing l, the BO-XGBoost model can continuously improve the prediction accuracy for the classification task; to achieve dynamic balance, incremental optimization is adopted, and the calculation formula of the incremental optimization is:
[0079]
[0080] where: Γ (t)Denote the change value of the objective function in the current $t$-th iteration; $\Delta f(x i )$ is the update amount of the predicted value of the model for the sample $x i $ at the $t$-th iteration; $g i $ is the first-order derivative of the loss function with respect to the current predicted value $; $h i $ is the second-order derivative of the loss function with respect to the current predicted value $.
[0081] In this implementation, the best combination of hyperparameters found by the Bayesian optimization algorithm is: the maximum depth of the decision tree max_depth = 6, the number of decision trees n_estimators = 490 - 510, the learning rate of each tree learning_rate = 0.20 - 0.24, and the percentage of training data for each tree subsample = 0.5 - 0.7. The model is trained on a general computing device with a CPU of Intel i7-12700H, has the ability of fast prediction, the response time is within 5 seconds, and the prediction accuracy of the sample flame retardant performance reaches 100% in the experimental verification.
[0082] Furthermore, the BO-XGBoost model finds the best combination of hyperparameters through the Bayesian optimization algorithm, and the specific steps include:
[0083] Step M1, the Bayesian optimization algorithm transforms the hyperparameter optimization problem into an objective function minimization problem, and defines the optimization objective as: arg min θ $\tau(\theta)$, where $\theta$ is the combination of hyperparameters to be optimized, and $\tau(\theta)$ is the validation loss of the model when the given hyperparameter combination is used;
[0084] Step M2, randomly select several groups of hyperparameters, and train the XGBoost model based on these parameters, record the validation set loss values corresponding to each group of hyperparameters, form the initial dataset $(\theta,\tau)$, and use the initial dataset to train a surrogate model to simulate the relationship between the hyperparameter combination and the objective function value, where, is a Gaussian process, the surrogate objective function, $\mu(\theta)$ is the predicted mean of the hyperparameter combination $\theta$, and $k(\theta,\theta')$ is the covariance function between hyperparameter combinations;
[0085] Step M3, according to the surrogate model, select the next group of hyperparameters $\theta next $, $\theta next $ that satisfy $\theta next =\ arg\ max θ \in I(\theta)$, where $\in I(\theta)$ is the acquisition function of the expected improvement;
[0086] Step M4, for $\theta nextPerform model training and calculate the validation set loss value τ(θ next ), and add (θ next , τ(θ next )) to the dataset, and retrain the surrogate model based on the updated dataset
[0087] Step M5, when the maximum number of iterations (1000 times) is reached or the improvement of the objective function is lower than the threshold (Δτ < 10 -4 ), stop the optimization.
[0088] In this embodiment, in-situ Raman spectroscopy data of 152 non-metallic power metering box housing samples that have been tested for flame retardancy performance are collected. Among the 152 samples, 120 samples with a flame retardancy performance reaching V0 level are recorded as "qualified", and 32 samples with a flame retardancy performance lower than V0 level are recorded as "unqualified". After performing Savitzky-Golay filtering and smoothing, baseline correction, and normalization on the collected Raman spectroscopy data, the Raman spectroscopy data of the above 152 samples are divided into a learning set and a training set according to a ratio of 7:3. The window width parameter of the Savitzky-Golay filter is set to 11, and the polynomial order is 2. The optimal model hyperparameter combination obtained by training using the BO-XGBoost algorithm is: max_depth = 6, n_estimators = 495, learning_rate = 0.22, subsample = 0.6. The accuracy of the output model prediction is 100%.
[0089] In this embodiment, in order to verify the superiority of the BO-XGBoost model of the present invention, the support vector machine (SVM) and the ordinary XGBoost model are respectively used to train and test the same dataset. Comparative example 1: The same sample spectral data and flame retardancy test results as the BO-XGBoost model are adopted; the same data preprocessing method as the BO-XGBoost model is adopted; the optimal model hyperparameter combination obtained by training using the support vector machine SVM model is: C = 10.0, gamma = 0.001924, kernel = rbf, and the accuracy of the output model prediction is 87.5%. Comparative example 2: The same sample spectral data and flame retardancy test results as the BO-XGBoost model are adopted; the same data preprocessing method as the BO-XGBoost model is adopted; the optimal model hyperparameter combination obtained by training using the XGBoost model is: max_depth = 6, n_estimators = 450, learning_rate = 0.18, subsample = 1.0, and the accuracy of the output model prediction is 92.76%.
[0090] The prediction accuracies of the BO-XGBoost model, support vector machine (SVM) model, and XGBoost model are as shown in the following table:
[0091] Table 1 Prediction Accuracies of the BO-XGBoost Model, Support Vector Machine (SVM) Model, and XGBoost Model
[0092] Model Prediction accuracy BO-XGBoost model 100% Support vector machine SVM model 86.84% XGBoost model 92.76%
[0093] In this embodiment, Figure 1 is a functional block diagram of a device for predicting non-metal flame retardancy in the prior art. The disadvantage is that the device needs to obtain complex formulation information; Figure 2 is the implementation flowchart of this technical solution; Figure 3 shows the confusion matrix diagrams of the BO-XGBoost model, support vector machine (SVM) model, and XGBoost model.
[0094] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0095] Finally: The above are only the preferred embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A prediction model for the flame retardant properties of a non-metallic electric energy meter box housing, which realizes the prediction of the flame retardant properties of a sample to be tested. The main raw materials of the non-metallic electric energy meter box housing are polycarbonate (PC) and acrylonitrile-butadiene-styrene copolymer (ABS), characterized in that: By performing machine learning on the Raman spectral data of the samples after the flame retardant performance test, the extreme gradient boosting model (BO-XGBoost) optimized by the Bayesian algorithm is used to predict the flame retardant properties of the samples to be tested. The BO-XGBoost model uses the performance indicators of extreme gradient boosting - error term (logloss) and regularization term (L1 regularized Lasso and L2 regularized Ridge) as the objective function, and finds the best hyperparameter combination through the Bayesian optimization algorithm.
2. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1 is characterized in that: The extreme gradient boosting (BO-XGBoost) model improved by Bayesian optimization uses the performance indicators of extreme gradient boosting - error term (logloss) and regularization term (L1 regularized Lasso and L2 regularized Ridge) as the objective function. The error term uses the logarithmic loss function, whose expression can quantify the deviation between the model prediction probability and the true label, reducing the penalty weight of wrong prediction in the classification task. In order to control the complexity of the model and prevent overfitting, two regularization terms are integrated: L1 regularization penalizes the absolute value of the model parameters so that the weights of irrelevant or redundant features in the parameters tend to zero, thereby achieving feature selection and model sparsification; L2 regularization constrains the sum of squares of model parameters. During the training process, the BO-XGBoost model achieves a dynamic balance between error minimization and model complexity through the optimization design of the objective function. The calculation formula of the objective function is: Where: Γ is the objective function of the BO-XGBoost model, is the error term, Ω(f) is the regularization term, N is the number of samples, y i is the actual label, is the prediction probability of the model. By minimizing l, the BO-XGBoost model can continuously improve the prediction accuracy of the classification task. In order to achieve dynamic balance, incremental optimization is adopted. The calculation formula of the incremental optimization is: Where: Γ (t) Indicates the change value of the objective function in the current t-th iteration; Δf(x i ) is the model's response to sample x at the tth iteration i The update amount of the predicted value; g i is the loss function for the current prediction value The first derivative of i is the loss function for the current prediction value The second derivative of .
3. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1 is characterized in that: The BO-XGBoost model uses the Bayesian optimization algorithm to find the best hyperparameter combination. The specific steps include: Step M1: The Bayesian optimization algorithm transforms the hyperparameter optimization problem into an objective function minimization problem, and defines the optimization objective as: arg min θ τ(θ), where θ is the hyperparameter combination to be optimized and τ(θ) is the validation loss of the model for a given hyperparameter combination; Step M2, randomly select several sets of hyperparameters, and train the XGBoost model based on these parameters, record the validation set loss value corresponding to each set of hyperparameters, form an initial data set (θ, τ), and use the initial data set to train a proxy model to simulate the relationship between the hyperparameter combination and the objective function value. in, is a Gaussian process, a proxy objective function, μ(θ) is the predicted mean of the hyperparameter combination θ, and k(θ,θ′) is the covariance function between the hyperparameter combinations; Step M3, select the next set of hyperparameters θ based on the surrogate model next ,θ next Satisfy θ next = arg max θ ∈I(θ), where ∈I(θ) is the acquisition function that is expected to be improved; Step M4, θ next Train the model and calculate its validation set loss value τ(θ next ), and (θ next ,τ(θ next ))Add the dataset and retrain the proxy model based on the updated dataset Step M5: When the maximum number of iterations (1000) is reached or the improvement of the objective function is lower than the threshold (Δτ<10 -4 ), stop optimization.
4. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1 is characterized in that: The prediction of the machine learning and BO-XGBoost model includes the following steps: Step S1, collecting and obtaining a non-metallic electric energy meter box shell sample, using a Raman spectrometer to obtain Raman spectrum data of the sample, and then using a horizontal and vertical combustion instrument to test and obtain the flame retardant properties of the sample; Step S2, performing Savitzky-Golay filtering smoothing, baseline correction and normalization on the Raman spectrum data of the sample to obtain a data set for machine learning, and dividing the data set into a training set and a test set; Step S3, using the Bayesian optimization improved extreme gradient boosting (BO-XGBoost) model, the Raman spectrum data set of the sample obtained in step S2 is supervised for learning training and testing, using the flame retardant properties of the sample as the label. The combustion test results of step S1 and the spectral data preprocessed in step S2 are matched one by one, and the combustion test results are used as labels (V0 level is "qualified", and below V0 level is "unqualified"), and "qualified" and "unqualified" are converted into one-hot vector inputs, "qualified" is marked as 1, and "unqualified" is marked as 0. The input dimension of each sample spectral data is 3001, and the optimal hyperparameter combination of the model is determined by the Bayesian optimization algorithm; Step S4, after the model training is completed, the robustness of the model is verified and evaluated, and overfitting is avoided through the early stopping mechanism. The spectral data of the non-metallic electricity meter box shell sample that has not been tested for flame retardancy is tested using a Raman spectrometer, and the BO-XGBoost model established in step S3 is used for prediction to determine the flame retardant properties of the sample to be tested.
5. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1 is characterized in that: The best hyperparameter combination found by the Bayesian optimization algorithm is: the maximum depth of the decision tree max_depth = 6, the number of decision trees n_estimators = 490-510, the learning rate of each tree learning_rate = 0.20-0.24, and the percentage of training data subsample of each tree = 0.5-0.
7.
6. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1 is characterized in that: The Savitzky-Golay filtering and smoothing process of the Raman spectrum data of the sample includes the following specific contents: The window width parameter of the Savitzky-Golay filter is expressed as 2m+1. i , construct a sliding window y containing 2m+1 points i-m ,y i-m+1 , …, y i+m , perform polynomial fitting on the data points in the window and establish a polynomial model P(x), where P(x) satisfies P(x) = C o +C1x+C2x 2 +…+C p x p Among them, C j The coefficients of the polynomial fitting reflect the contribution of each point in the window to the center point i. The size of the window parameter determines the coverage of the filter. The order p of the polynomial determines the complexity of the fitting and affects the filtering effect. The least squares method is used to calculate C j Coefficient: C = (X T X) -1 X T y, where X is the independent variable matrix and y is the spectral data. The filtered signal can be expressed as: in, is the value of the filtered signal at position i, y i+j is the value of the original signal at position i+j, where j varies from -m to m.
7. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1, characterized in that: The baseline correction of the Raman spectrum data of the sample includes the following specific contents: The smoothed Raman spectrum data is subjected to asymmetric least squares method (AsLS) to correct the Raman spectrum baseline. Let y be the signal to be analyzed, z be the smoothed signal, and the length of both vectors is m. Then the fidelity of z to y is defined as: The roughness of z is defined as: Where: D is the difference matrix, that is, D z =Δz, in order to balance fidelity and smoothness, the above two formulas can be combined, and the smoothing parameter λ is introduced to obtain the cost function Q0: Q0=F+λR=‖yz‖ 2 +λ‖D z ‖ 2 ; Enter the fidelity weight matrix W and get the new cost function Q: Where: W is the diagonal element w i The diagonal matrix of the AsLS baseline correction algorithm, w i Select in an asymmetric way: In order to minimize the new cost function Q, take the derivative and set it to zero, and get the linear equation: (W+λD T D)z=Wy; The optimization objective minQ is a convex function that converges to the optimal solution within a finite number of iterations.
8. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1, characterized in that: The normalization process of the Raman spectrum data of the sample includes the following specific contents: The corrected Raman spectral data set is normalized. Normalization is to convert the data into the same dimension range to facilitate subsequent analysis and processing. The normalization process uses maximum-minimum value normalization, and the calculation formula is: Where: y norm is the normalized data point, y i is the original data point, y max is the maximum light intensity in the original spectral data, y min is the minimum light intensity in the original spectral data.
9. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 1, characterized in that: In the process of collecting and obtaining Raman spectral data, a portable Raman spectrometer was selected as the test equipment, with a spectrum collection range of 200 to 3200 cm-1 and a resolution of less than or equal to 2 cm-1. The samples adopt a standardized testing process to ensure a stable testing environment. The spectrometer is equipped with an anti-interference filter system. The sample surface is clean and dry. A fiber optic probe or portable Raman spectrometer is used. The collected spectral data is digitally stored as a training, test or verification data set.
10. The prediction model for flame retardant performance of a non-metallic electric energy meter box housing according to claim 2, characterized in that: In step S4, a 5-fold cross-validation technique is used to randomly divide the training set into 5 subsets. Four subsets are taken for training each time, and the remaining 1 subset is used as a validation set for evaluation. Multiple training cycles are completed and performance indicators are summarized. To avoid overfitting problems in the model, an early stopping mechanism (early_stopping_rounds=30) is set during the validation process. When the performance of the validation set does not improve after 30 consecutive iterations, the training stops automatically.
Citation Information
Patent Citations
Identification model and method for identifying camel milk based on Raman spectrum and machine learning algorithm
CN115586172A
Ultraviolet Raman spectrum DNA oxidation qualitative detection method based on machine learning
CN118032734A
Cited By
Nondestructive testing method for flame retardant property of nonmetal shell of electric energy metering box
CN119846136A
Non-destructive testing method for flame retardant performance of non-metallic shell of electric energy metering box
CN119846136B