Energy storage battery fire multi-parameter detection method based on XGBoost

Through the XGBOOST -based energy storage battery fire multi -parameter detection method, the problem of lack of multi -parameter monitoring of the existing technology in the existing technology in the existing technology in the high -parameter storage battery fire warning, and the accurate detection and early warning of energy storage battery fires. The accuracy and reliability of early warning.

CN119357838APending Publication Date: 2025-01-24SHANGHAI FIRE RES INST OF MEM +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411563235.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, energy storage battery fire warning lacks multi-parameter monitoring, and the multi-parameter detection method for energy storage battery fire based on XGBoost is not yet mature.

Method used

The multi -parameter detection method of energy storage battery fire based on XGBOOST is used to build the XGBOOST model, optimize the target function, adjust the model parameters, and achieve accurate detection of multiple parameters of energy storage battery fires, and trigger the fire warning mechanism and emergency response measures.

Benefits of technology

It improves the accuracy and reliability of energy storage battery fire warning, realizes comprehensive monitoring and early warning of energy storage battery status, and reduces fire risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357838A_ABST
    Figure CN119357838A_ABST
Patent Text Reader

Abstract

The invention discloses an XGBoost-based energy storage battery fire multi-parameter detection method. The method comprises the following steps: step 1, constructing an XGBoost model; 2, representing a target function as a function about the number of samples and the number of trees, and approximating a loss function through second-order expansion of a Taylor formula to optimize the target function; step 3, for each sample, updating a prediction value through an iteration mode; and 4, according to the actual data of the energy storage battery fire, adjusting the parameters of the XGBoost model, including the learning rate, the depth of the tree and the regularization coefficient, and training the model to realize the accurate detection of the multiple parameters of the energy storage battery fire. By introducing the XGBoost algorithm, efficient and accurate detection of multiple fire parameters of the energy storage battery is achieved, and important technical support is provided for improving the safety management level of an energy storage power station, reducing fire risks and guaranteeing equipment and personal safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy storage battery fire warning, and in particular to an energy storage battery fire multi-parameter detection method based on XGBoost. Background Art

[0002] As an indispensable part of the modern energy system, the safety of energy storage batteries is directly related to the stable operation of the entire system and the safety of personnel and property. The prevention and early warning of energy storage battery fires are important links in ensuring energy security. The occurrence of energy storage battery fires often involves multiple complex factors, including but not limited to abnormal internal battery temperature, current and voltage fluctuations, gas release, etc. Therefore, multi-parameter monitoring and detection of energy storage batteries has become the key to improving the sensitivity and accuracy of fire warning.

[0003] Traditional energy storage battery fire warning methods mostly rely on the monitoring of a single parameter, such as warning only through temperature or smoke sensors. However, this method has great limitations, because the occurrence of energy storage battery fires is the result of the combined effect of multiple factors, and the monitoring of a single parameter is often difficult to fully reflect the actual status of the battery. In addition, there are also differences in fire warning thresholds for different battery types and different usage environments, which limits the universality and accuracy of traditional warning methods.

[0004] In recent years, with the rapid development of machine learning algorithms, ensemble learning algorithms such as XGBoost have shown strong performance in prediction and classification tasks. These algorithms can process high-dimensional data, automatically learn complex nonlinear relationships, and have high generalization capabilities. Therefore, applying the XGBoost algorithm to multi-parameter detection of energy storage battery fires is expected to achieve comprehensive analysis and intelligent early warning of multiple parameters, and improve the accuracy and reliability of fire early warning.

[0005] However, the current multi-parameter detection method for energy storage battery fires based on XGBoost is still in the research and exploration stage, and has not yet formed a mature technical solution. Therefore, it is necessary to develop a multi-parameter detection method for energy storage battery fires based on XGBoost to achieve comprehensive monitoring and early warning of the energy storage battery status and improve the safety and stability of the energy system. Summary of the invention

[0006] In view of this, the present invention proposes a multi-parameter detection method for energy storage battery fire based on XGBoost to solve the problems in the prior art that energy storage battery fire warning lacks multi-parameter monitoring and XGBoost application is yet to be mature.

[0007] The specific technical solutions of the present invention are as follows: A multi-parameter detection method for energy storage battery fire based on XGBoost, comprising: Step 1: Build the XGBoost model. Step 2, express the objective function as a function of the number of samples and the number of trees, and approximate the loss function by the second-order expansion of Taylor's formula to optimize the objective function; Step 3: For each sample, update the predicted value in an iterative manner; Step 4: Adjust the parameters of the XGBoost model according to the actual data of the energy storage battery fire, including the learning rate, the depth of the tree, and the regularization coefficient, so as to accurately detect the multiple parameters of the energy storage battery fire by training the model; Step 5: Apply the trained XGBoost model to the real-time monitoring of energy storage battery fires, trigger the corresponding fire warning mechanism based on the model's prediction results, and automatically execute the preset emergency response measures to minimize the losses caused by the fire.

[0008] Furthermore, step 1 includes: using the XGBoost algorithm to construct a strong learner by integrating multiple weak learners, each weak learner is trained by minimizing the objective function based on the previous learner, and the weak learner here is a decision tree.

[0009] Furthermore, the objective function consists of a loss function and a regularization term. The loss function is used to measure the difference between the model's predicted value and the true value, and the regularization term is used to control the complexity of the model to prevent overfitting.

[0010] Furthermore, in step 2, when the loss function is approximated by the second-order expansion of Taylor's formula, the objective function is simplified into a function of the newly added prediction value and the regularization term by using the first-order derivative and second-order derivative of the loss function with respect to the previous step prediction value, so as to solve the optimal weight and the optimal objective function value.

[0011] Furthermore, the iterative updated prediction value in step 3 is: the prediction value of the tth step is the prediction value of the previous t-1 step plus the newly added prediction value of the tth step.

[0012] Furthermore, in step 4, when adjusting the parameters of the XGBoost model, it also includes optimizing the splitting criterion of the tree, determining whether to split the node by calculating the gains before and after the split, using a greedy algorithm to traverse all possible splitting points, and selecting the splitting point with the largest gain for splitting, so as to improve the model's detection accuracy of multiple parameters of energy storage battery fires.

[0013] Furthermore, when the amount of data is too large to fit into the memory, an approximate algorithm is used to reduce the amount of calculation. Candidate splitting points are selected by the quantiles of the feature distribution, and continuous features are mapped to corresponding regions based on these splitting points. The sum of the first-order derivatives and the sum of the second-order derivatives of each region are then accumulated to determine the optimal splitting point on the set of candidate splitting points through a greedy algorithm.

[0014] Furthermore, the method also includes the step of using the SHAP interpretation model to interpret the XGBoost model, and by drawing a density scatter plot and a feature importance plot of the SHAP value, analyzing the contribution of different features to the multi-parameter detection results of the energy storage battery fire, and the correlation between important features, so as to improve the interpretability and prediction accuracy of the model; The application of the SHAP explanatory model also includes analyzing the impact of the dynamic changes of key parameters such as temperature, voltage and gas emissions during the thermal runaway of lithium batteries on the model prediction results, and displaying the correlation between key parameters through joint distribution diagrams to further guide the optimization and practical application of multi-parameter detection methods for energy storage battery fires.

[0015] Furthermore, it also includes the step of using accuracy, precision, recall rate and AUC value as model performance evaluation indicators, and calculating these indicators by constructing a confusion matrix to comprehensively evaluate the performance of the model in the multi-parameter detection task of energy storage battery fire.

[0016] Furthermore, the method also includes the steps of drawing the ROC curve and calculating the AUC value. The ROC curve is used to intuitively display the performance of the model at different thresholds, and the AUC value is used as a quantitative indicator to measure the classification performance of the model. The closer the AUC value is to 1, the better the model performance is.

[0017] The beneficial effects of the present invention are: 1. Efficient data processing capabilities: The XGBoost algorithm, with its parallel computing characteristics, can quickly process large-scale data sets from multiple sensors, ensuring that the fire detection system can respond in real time, effectively reducing the risk of fire.

[0018] 2. High classification accuracy: By integrating multiple weak classifiers, XGBoost can accurately identify fire characteristics in complex environments and significantly improve classification accuracy. This feature enables the method to maintain stable detection performance under different environmental conditions.

[0019] 3. Strong adaptability: XGBoost can process various types of data, including continuous and categorical features. It is particularly critical for integrating data from sensors such as temperature, smoke, and humidity, enhancing the flexibility and adaptability of the system.

[0020] 4. Simplify data preprocessing: XGBoost has the ability to automatically handle missing values, which reduces the complexity and workload of data preprocessing and improves the overall detection efficiency.

[0021] 5. Reduce the risk of overfitting: By introducing a regularization mechanism, XGBoost effectively reduces the risk of overfitting while maintaining high accuracy, ensuring that the model achieves a good balance between high accuracy and high generalization ability.

[0022] 6. Enhance system transparency: The feature importance scores provided by XGBoost help researchers and decision makers understand the decision basis of the model, enhance the transparency and credibility of the system, and provide strong support for further optimization and improvement.

[0023] 7. Excellent model performance: Experimental results show that the fire detection model based on XGBoost performs well in key indicators such as accuracy, precision, recall rate and AUC value, verifying the efficiency and accuracy of this method.

[0024] 8. In-depth feature analysis: Combined with the SHAP interpretation model, this paper further reveals the specific impact of each feature on the fire prediction results, providing a scientific basis for correctly understanding and responding to fire risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0026] Figure 1 This is a diagram before thermal runaway of the lithium battery of the present invention; Figure 2 This is a diagram of the lithium battery after thermal runaway of the present invention; Figure 3 It is the layout diagram of the thermocouple of the present invention; Figure 4 This is a temperature voltage variation diagram of the present invention; Figure 5 It is the gas change diagram of the present invention; Figure 6 It is the temperature hierarchical clustering and correlation coefficient heat map of the present invention; Figure 7 It is the heat map of gas hierarchical clustering and correlation coefficient of the present invention; Figure 8 This is the XGBoost modeling idea diagram of the present invention; Fig. 9 It is the temperature confusion matrix diagram of the present invention; Fig.10 It is the gas confusion matrix diagram of the present invention; Fig.11 It is the temperature ROC diagram of the present invention; Fig.12 It is the gas ROC diagram of the present invention; Fig.13 It is the temperature PR diagram of the present invention; Fig.14 It is the gas PR diagram of the present invention; Fig.15 It is the temperature SHAP density scatter plot of the present invention; Fig.16 It is the gas SHAP density scatter plot of the present invention; Fig.17 is the importance diagram of temperature characteristics of the present invention; Fig.18 is a gas characteristic importance diagram of the present invention; Fig.19 This is the combined distribution diagram of T2 and T3 of the present invention; Fig. 20 This is the combined distribution diagram of HF and NO in the present invention. DETAILED DESCRIPTION

[0027] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0028] The present invention proposes a multi-parameter detection method for energy storage battery fire based on XGBoost.

[0029] XGBoost is an ensemble learning algorithm based on the gradient boosting framework, which further optimizes and improves the gradient boosting decision tree (GBDT). Unlike the traditional GBDT that only considers the first-order derivative information of the loss function, XGBoost innovatively introduces the second-order Taylor formula, which improves the accuracy when estimating the loss function by utilizing the second-order derivative information of the loss function. In addition, XGBoost also reduces the generalization error of the model by minimizing the regularization term of the objective function, thereby improving the performance of each tree. In addition to CART (Classification and Regression Tree) as a weak classifier, XGBoost also supports other types of weak classifiers, such as linear classifiers, further enhancing its flexibility and applicability.

[0030] In the field of fire detection, XGBoost's efficient processing capabilities and parallel computing characteristics enable it to quickly analyze data from multiple sensors, making real-time monitoring possible. By integrating multiple weak classifiers, XGBoost can effectively identify fire characteristics in complex environments and improve classification accuracy. At the same time, XGBoost's high adaptability to data types, its ability to automatically handle missing values, and the introduction of regularization mechanisms all enable it to demonstrate excellent performance in fire detection, providing a strong guarantee for efficient and accurate real-time monitoring.

[0031] In XGBoost, let the training set ,in , p represents the pth eigenvalue of sample i. Assuming there are k decision trees in the ensemble algorithm, the prediction result given by the algorithm for the i-th sample is: (1) in, is a set of CART, K represents the total number of weak classifiers, f k Represents the kth base learner (decision tree).

[0032] XGBoost adds a regularization term after the loss function to obtain the objective function (2) Among them, Ω( ) is a regularization term used to prevent overfitting. represents the loss function, which is used to measure the gap between the model's predicted value and the true value. Since the algorithm is trained each time based on the previous one, , the predicted value at step t can be written as (3) in, is the predicted value in step t-1, is the newly added prediction value in the tth step. At the same time, after the previous t-1 step is determined, the tree structure has no longer changed, and the regularization term is also determined accordingly, which can be replaced by a constant, that is, the result of formula (3) is obtained.

[0033] According to the second-order expansion of Taylor's formula (4) The objective function can be replaced by (5) in, They represent the first-order derivative and second-order derivative of the loss function respectively. Delete all constant terms and get the final objective function (6) Therefore, in the XGBoost algorithm, it is relatively easy to customize the loss function. You only need to give the first-order derivative and the second-order derivative.

[0034] The regularization term of the decision tree is affected by two factors, namely the number of leaf nodes T and the weight w of the leaf node. , represents all samples in leaf node j , the relationship from sample to leaf node is ,in represents the weight of each leaf node of tree q, which is a one-dimensional vector with a length of M. So the regularization term can be written as (7) Among them, w j represents the weight of the jth leaf node; γ is a hyperparameter in the regularization term that controls the complexity of the tree. Specifically, γ can be regarded as a penalty term. For each additional leaf node, a penalty of γ is added. λ is also a hyperparameter in the regularization term that controls the penalty of the sum of squares of weights. By increasing λ, the weight of the leaf node can be suppressed, making the model smoother and reducing the risk of overfitting.

[0035] At the same time, the objective function can be rewritten as (8) Formula (8) is the sum of the loss functions of each sample obtained by traversing all samples and the sum of the loss functions of each leaf node obtained by traversing all leaf nodes.

[0036] To simplify the expression, Since the first t-1 steps have been determined, both are constants, representing the sum of the first-order derivatives and the sum of the second-order derivatives of the samples in the leaf node j.

[0037] The process of finding the optimal objective function can be transformed into a problem of solving the maximum value of a quadratic function. Find the first-order derivative and set it to 0 to get the optimal weight And the corresponding objective function is obtained (9) When the node is split, L is the left node and R is the right node. Then the objective function before the split is (10) The objective function after splitting is (11) The gain is (12) Among them, HL is the sum of the second-order derivatives of the left child nodes, which is also the diagonal sum of the Hessian matrix; HR is the sum of the second-order derivatives of the right child nodes, which is also the diagonal sum of the Hessian matrix.

[0038] At this time, the nodes are split. In order to get the best choice, all possible splits of the feature can be listed, and then the best split can be found. This method is called a greedy algorithm, which can be implemented in scikit-learn in Python and gbm packages in R. At the same time, in order to improve efficiency, the data must first be sorted according to the feature value and accessed in order.

[0039] Greedy algorithm is a powerful way to find the optimal split point, but it will cause problems when the amount of data is too large to fit into the memory. To address this situation, an approximate algorithm is proposed: first, some optional split points are selected using the quantiles of the feature distribution, then the continuous features are mapped to the regions divided by these points, the statistical information is processed, and the optimal split point is found based on the summarized statistical information.

[0040] There are two ways of approximate algorithm. The first way is to propose all candidate splitting points before the tree structure is established, and always implement it, and use this method for each split. The second way is to perform calculations after each classification and re-propose new candidate splitting points. From the perspective of operation steps, the first method requires fewer steps, but since it will not be updated after each split, it usually has more candidate classification points. The second method will update the candidate splitting points after each split node, so this method is more suitable for trees with greater depth. In short, the candidate splitting points of the approximate algorithm are determined based on the distribution of features, and then the corresponding samples are placed in the region based on these splitting points. Then, the sum of the first-order derivatives G and the sum of the second-order derivatives H of each region are accumulated, and the optimal splitting point is determined by the greedy algorithm on the candidate splitting point set.

[0041] Although the XGBoost algorithm can give the importance of features and has good prediction effects, it cannot reflect how each feature affects the prediction results, nor can it reflect whether the feature has a positive or negative impact on the prediction results. The SHAP explanation model just makes up for this shortcoming of XGBoost.

[0042] SHAP is a commonly used machine learning model interpretation framework that helps understand the mechanism of how model input affects output. SHAP values ​​can not only quantify the impact of each feature on the model results, but also analyze how each feature in a single sample affects the model prediction results. The model can be expressed as (13) Where: is the corresponding explanatory model; is whether the kth feature of sample x exists (if it exists, the value is 1, otherwise it is 0); M is the number of features; E( ) is the average prediction value of the prediction model on the data set, It is the contribution of the kth feature to the prediction of sample x, that is, the SHAP value of the feature.

[0043] XGBoost models usually require a suitable evaluation system for model evaluation. For common classification problems in fire detection, accuracy, precision, recall, and AUC values ​​are selected as performance evaluation indicators of the model. The accuracy, precision, and recall indicators come from the confusion matrix, as shown in the following table.

[0044]

[0045] The accuracy rate is the ratio of the number of correctly classified samples to the total number of samples; the precision rate indicates the proportion of samples predicted to be correct that are actually correct; the recall rate indicates the proportion of correct student samples that are predicted to be correct; the calculation formulas for each evaluation index are: (14) (15) (16) The ROC curve is a graphical tool used to represent the performance of a classification model. It depicts the performance of a classifier at different thresholds by using the true positive rate (TPR) and the false positive rate (FPR) as the horizontal and vertical coordinates. TPR is also commonly referred to as the recall rate. In this article, TPR can be understood as the ratio of all correct samples detected correctly, so the closer the TPR is to 1, the better. Its calculation formula is: (17) FPR refers to the proportion of samples that are incorrectly predicted as positive examples by the model among all samples that are actually negative examples. In the article, the false positive rate can be understood as the ratio of all students who fail to pass the test, so the closer the FPR is to 0, the better. Its calculation formula is: (18) AUC is the area under the ROC curve, which is used to measure the performance of the classifier. The closer the AUC value is to 1, the better the classifier performance is; conversely, the closer the AUC value is to 0, the worse the classifier performance is.

[0046] The embodiments of the present application are as follows: Data acquisition and preprocessing: The data comes from the temperature of 11 different positions of the lithium battery in different time periods, the voltage status of the lithium battery, and the information of different gases emitted by the lithium battery thermal runaway monomer experiment verification in the dynamic perception and detection alarm system of the whole chain of fire risks. The experiment is equipped with a 314Ah lithium iron phosphate battery, using a 600W heating plate to trigger thermal runaway, and using thermocouples, voltage monitoring, and Fourier infrared online analyzers for data collection. The experimental picture is as follows Figure 1 , Figure 2 shown.

[0047] In the experimental design, the thermocouples were installed around the battery, with the following specific locations: T1 to T5 were located on the side of the battery, T6 to T8 were located on the top of the battery, and T9 to T11 were located above the battery, 20 cm away from the battery. This layout can fully capture the temperature distribution of the battery during thermal runaway, providing rich information for subsequent data analysis. Figure 3 shown.

[0048] Through data collection and analysis, the temperature continued to rise before thermal runaway, the pressure relief valve opened, and the voltage did not drop; as time passed at 12:13:45, thermal runaway occurred, the temperature suddenly changed, and the voltage dropped. The data graph is as follows Figure 4 shown.

[0049] Similarly, for the collection and analysis of gas data, some gas was generated before thermal runaway; as time passed 12:13:45, thermal runaway occurred and the gas production became more obvious. Figure 5 shown.

[0050] For the acquired data, we search and process the missing values ​​of the data, and use the isna function to test the missing values ​​of the data set. If missing values ​​are found, the corresponding missing data will be deleted in order not to affect the prediction effect of the model. At the same time, in order to more clearly understand the clustering situation between the data, we perform cluster analysis on the data before model testing, and use the clustermap function of the seaborn library to perform statistical analysis on the correlation coefficient of the data, such as Figure 6 , Figure 7 shown.

[0051] for Figure 6 For example, we found a perfect positive correlation between variables T1 and T2, indicating that the two variables are almost identical and may reflect the same feature or measurement. The correlation between T2 and T3 is also high, which also indicates a strong linear relationship between the two variables. This trend continues for multiple variables, such as the correlation between T4 and T6, which is 0.96, indicating that there are multiple interrelated features in the dataset.

[0052] Relatively speaking, T10 has a lower correlation, with correlation coefficients below 0.60 with T6, T7, and T8. This may mean that T10 represents a different feature or is unique in the dataset.

[0053] for Figure 7 For example, the graph shows that HCN (hydrogen cyanide) has a correlation of 1.00 with itself, which is obvious. Further observation shows that HCN has different correlations with other gases, the most notable of which is 0.39 with formaldehyde, which is not particularly high, but still indicates a certain positive correlation between the two. This may suggest that under certain conditions, hydrogen cyanide and formaldehyde may exist at the same time or be affected by similar sources.

[0054] Secondly, the correlation between methane and various gases is relatively low, especially the correlation with HCl (hydrogen chloride), which is only -0.10, indicating a certain negative correlation between the two. This means that when the concentration of methane increases, the concentration of hydrogen chloride may decrease, suggesting that under certain chemical reactions or environmental conditions, the concentration changes of the two may show opposite trends.

[0055] Another point worth noting is that the correlation between ethylene and other gases is generally high, especially with CO, which is 0.83, indicating a strong positive correlation between them. This situation may reflect the mutual influence between ethylene and carbon monoxide during thermal runaway.

[0056] In addition, the correlation of carbon dioxide (CO2) is also noteworthy. Its correlation with ethylene is 0.70, indicating a strong positive correlation between the two. Its correlation with propylene is 0.54, showing a moderate correlation. This may suggest that in thermal runaway, the generation of carbon dioxide is closely related to the concentration changes of ethylene and propylene.

[0057] In order to further explore the role of temperature, voltage and gas in monitoring thermal runaway of lithium batteries, we added a thermal runaway column to the data set, set the data before 12:13:45 to 0, and the data after 12:13:45 to 1 to distinguish whether thermal runaway occurred, and finally used the thermal runaway column as the target value.

[0058] Using the train-test-split function of the scikit-learn library, the processed data set is divided into 4:1, with 80% as the training set and 20% as the test set. GridSearchCV is used for grid search and 5-fold cross validation to adjust the important parameters of the prediction model based on the XGBoost algorithm to improve the performance of the model. The parameters optimized in this study include: learning_rate, max_depth, n_estimator, gamma, and min_child_weight. The main idea of ​​XGBoost modeling can be seen in Figure 8 .

[0059] GridSearchCV was used to perform grid search and 5-fold cross validation to adjust the important parameters of the prediction model of the base XGBoost algorithm. The adjustment results are shown in Table 2.

[0060]

[0061] After the parameter tuning is completed, the best model is obtained. The model at this time is based on the training set. The generalization ability of the model is tested using the test set samples. The confusion matrix results for temperature and gas are shown in Fig. 9 and Fig.10 .

[0062] From the results in the figure, we can see that there is no FN and FP situation, and the prediction results are all good, which shows that the model has good prediction ability.

[0063] The area under the ROC curve (AUC) value (the area between the true positive rate and the false positive rate) is used to test the prediction accuracy of the XGBoost model. Fig.11 and Fig.12 , and the AUC values ​​are 1.00 and 1.00 respectively, which means that both models have good predictive ability.

[0064] At the same time, the area under the PR curve AUPRC value (the area between precision and recall) is used to test the prediction accuracy of the XGBoost model, and is tested together with the ROC curve. Fig.13 and Fig.14 , and the AUPRC values ​​are 1.00 and 1.00 respectively, which means that both models have good predictive ability.

[0065] Although the XGBoost algorithm works well in prediction, the model lacks good interpretability. Although the prediction results can be obtained, it is not clear how different features affect the occurrence and severity of thermal runaway. At this time, SHAP needs to be introduced to explain the output of the machine learning model.

[0066] In order to analyze the contribution of high contribution features to the temperature of each region and the contribution of the emitted gas to thermal runaway, density scatter plots of the SHAP values ​​of 800 sample features and 40 sample features were drawn respectively. The results are shown in the figure below. Fig.15 and Fig.16 As shown in the figure, each point corresponds to a sample. The horizontal axis in the figure is the SHAP value, and its positive and negative values ​​represent the positive or negative correlation between the feature value and the prediction result. The larger the SHAP value, the stronger the correlation. The vertical axis is the high contribution feature, which is arranged in descending order from top to bottom according to the contribution of the feature. The color of the sample point represents the size of the feature value. The redder the color, the larger the feature value. If the red sample point corresponds to a positive SHAP value and the blue sample point corresponds to a negative SHAP value, the possibility that the sample is a certain type of defect is positively correlated with the feature value, that is, the sample with a larger feature value is more likely to be a certain type of defect, and vice versa. It is negatively correlated. Each row represents a feature. The more dispersed the sample points are in the horizontal direction, the greater the contribution of the feature to the model recognition. The wider the vertical area is, the more samples are gathered.

[0067] Depend on Fig.15 It can be seen that the three features T3, T2, and T1 are at the top of the figure, indicating that these three features are important influencing factors in the prediction model and are also the three factors with the greatest contribution. For the temperature of these three positions, their red sample points correspond to positive SHAP values, and blue sample points correspond to negative SHAP values. That is to say, as the temperature of the three positions increases, the possibility of thermal runaway becomes greater. On the contrary, as the temperature decreases, the possibility of thermal runaway becomes smaller. Combined with the experiment, the three positions are located on the back of the battery in contact with the heating plate. As the heating plate continues to heat up, thermal runaway occurs. The sharp increase in temperature at the three positions also shows that the prediction results are consistent with the actual situation. For the six features T6, T7, T5, T8, T4, and T11, although they have a large number of red sample values ​​in the positive SHAP value part, there are also many red sample values ​​in the negative SHAP value area, which indicates that the model output may have the opposite effect under different circumstances. This feature may push the model output to the positive class under certain conditions, but may lead to negative prediction results under other conditions. For T9 and T10, although the sample points of these two features are mainly concentrated in the SHAP positive value area, showing that they play a positive role in pushing the model to predict the positive class, their importance is slightly lower than that of other features and their contribution to the model is not high.

[0068] Depend on Fig.16It can be seen that the SHAP value range of NO (nitrogen oxides) is relatively wide, and the red sample points are mainly concentrated in the SHAP positive value area, indicating that the NO concentration has a significant positive effect on the model output. The SHAP value of HF (hydrogen fluoride) also shows a significant positive effect, although its value is relatively low. Especially at high HF concentrations, it has an important impact on the output of the model. The positive effects of these two gases are also in line with the expected contribution to thermal runaway of lithium batteries. For other gases, although they contribute more or less to the prediction model, their sample points are mainly concentrated in the origin area, the SHAP value range is narrow, and the contribution to the model is not high.

[0069] We can also use the feature importance graph to verify the above conclusions, see Fig.17 and Fig.18 .

[0070] With the above analysis of the prediction results, we have obtained the contribution and importance of different features of thermal runaway temperature and gas of lithium batteries, but have not involved the relationship between important features. In order to further explore the relationship between important features, we call two different joint distribution maps in the seaborn library for display and analysis, such as Fig.19 and Fig. 20 .

[0071] Depend on Fig.19 It can be seen that the relationship between T3 and T2 shows an obvious trend. As the T3 value increases, the T2 value shows an upward trend, especially when T3 is close to 200 and above, the T2 value increases significantly. This shows that T3 may have a positive effect on T2, especially in the high concentration area, the difference between normal and thermal runaway samples is more obvious.

[0072] For the scatter points of normal and thermal runaway, normal (blue dots): samples under normal conditions are mainly concentrated in lower T3 values ​​(below about 100), and the corresponding T2 values ​​are also low, showing stability during normal operation. The distribution of these samples is relatively concentrated, indicating that under normal conditions, the T2 and T3 values ​​of the system are relatively consistent and stable. Thermal runaway (orange dots): The distribution of thermal runaway samples is relatively wide, and the T3 values ​​are distributed from low to high. Especially when T3 is higher than 200, the T2 value increases significantly, indicating that under thermal runaway, the two indicators of the system have significant changes. This trend suggests that thermal runaway may be accompanied by a significant increase in T3, resulting in a sharp increase in T2.

[0073] There are two marginal distribution plots on the top and bottom and on the left and right sides of the figure, showing the univariate distribution of T2 and T3. The blue marginal plot shows the distribution under normal conditions, while the orange marginal plot shows the distribution under thermal runaway conditions.

[0074] Marginal distribution of T2: Under normal conditions, the values ​​of T2 are concentrated between 50 and 150, while the values ​​of T2 in thermal runaway are mainly concentrated between 150 and 350, indicating that the system performance in the thermal runaway state is significantly improved.

[0075] Marginal distribution of T3: The T3 values ​​in the normal state are mainly concentrated below 100, while those in the thermal runaway state are widely distributed, especially in the area above 200, showing a significant increase in T3 values ​​under thermal runaway conditions.

[0076] Depend on Fig. 20 It can be seen that the scatter plot shows a clear positive correlation between HF and NO, with a correlation coefficient r of 0.838 and a p value of less than 0.001. This shows that an increase in NO concentration is usually accompanied by an increase in HF concentration, showing a strong linear relationship between the two. In the figure, as the NO value increases, the HF value also shows a stable upward trend, especially when the NO value reaches more than 10ppm, the increase in HF is more obvious.

[0077] For the category distribution, the data points are distributed in the range of 0 to 40 ppm of NO. The concentration of HF varies between 0 and 3.5 ppm, showing an overall upward trend. The lower NO values ​​(0-10 ppm) correspond to relatively low HF values, indicating that less hydrogen fluoride is produced under low nitrogen oxide concentrations. When the NO value is higher than 10 ppm, the HF value increases significantly, suggesting that the generation or release of hydrogen fluoride will increase significantly under high NO conditions.

[0078] For the marginal distribution, the marginal distribution of HF shows a right skewness, mainly concentrated between 0.5 and 2.5 ppm, indicating that the HF concentration of most samples is relatively low, but there are also some samples in the high concentration area. The marginal distribution of NO shows a multi-peak feature, indicating that the samples are more concentrated in certain specific NO concentration ranges (such as 5-15 ppm and 25-35 ppm).

[0079] In terms of statistical significance, an r value close to 1 indicates a strong positive correlation between the two, while a p value less than 0.001 indicates that the relationship is statistically significant. This significance suggests that in practical applications, the concentration of NO can be used as an important indicator to predict HF concentration.

[0080] In summary, the combination of scatter plots and marginal distributions clearly demonstrates the strong correlation between T2 and T3, and between HF and NO. The clarity of this relationship is of great guiding significance for subsequent analysis and prediction. Understanding the relationship between the two variables can help us better manage and predict model performance in subsequent experiments and scientific research, and better predict the various processes of thermal runaway of lithium batteries.

[0081] The present invention proposes a multi-parameter fire detection method for energy storage batteries based on XGBoost. By efficiently integrating the application of the XGBoost algorithm in the field of fire detection, the accuracy and real-time performance of fire warning for energy storage batteries are significantly improved, providing strong technical support for the safe operation of energy storage power stations. Specifically, the beneficial effects of this method are mainly reflected in the following aspects: 1. Efficient data processing capabilities: The XGBoost algorithm, with its parallel computing characteristics, can quickly process large-scale data sets from multiple sensors, ensuring that the fire detection system can respond in real time, effectively reducing the risk of fire.

[0082] 2. High classification accuracy: By integrating multiple weak classifiers, XGBoost can accurately identify fire characteristics in complex environments and significantly improve classification accuracy. This feature enables the method to maintain stable detection performance under different environmental conditions.

[0083] 3. Strong adaptability: XGBoost can process various types of data, including continuous and categorical features. It is particularly critical for integrating data from sensors such as temperature, smoke, and humidity, enhancing the flexibility and adaptability of the system.

[0084] 4. Simplify data preprocessing: XGBoost has the ability to automatically handle missing values, which reduces the complexity and workload of data preprocessing and improves the overall detection efficiency.

[0085] 5. Reduce the risk of overfitting: By introducing a regularization mechanism, XGBoost effectively reduces the risk of overfitting while maintaining high accuracy, ensuring that the model achieves a good balance between high accuracy and high generalization ability.

[0086] 6. Enhance system transparency: The feature importance scores provided by XGBoost help researchers and decision makers understand the decision basis of the model, enhance the transparency and credibility of the system, and provide strong support for further optimization and improvement.

[0087] 7. Excellent model performance: Experimental results show that the fire detection model based on XGBoost performs well in key indicators such as accuracy, precision, recall rate and AUC value, verifying the efficiency and accuracy of this method.

[0088] 8. In-depth feature analysis: Combined with the SHAP interpretation model, this paper further reveals the specific impact of each feature on the fire prediction results, providing a scientific basis for correctly understanding and responding to fire risks.

[0089] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A multi-parameter detection method for energy storage battery fire based on XGBoost, characterized in that: include: Step 1, construct an XGBoost model; Step 2, express the objective function as a function of the number of samples and the number of trees, and approximate the loss function through the second-order expansion of Taylor's formula to optimize the objective function; Step 3, for each sample, update the predicted value in an iterative manner; Step 4, adjust the parameters of the XGBoost model according to the actual data of energy storage battery fires, including learning rate, tree depth, and regularization coefficient, and train the model to achieve accurate detection of multiple parameters of energy storage battery fires; Step 5, apply the trained XGBoost model to the real-time monitoring of energy storage battery fires, trigger the corresponding fire warning mechanism according to the prediction results of the model, and automatically execute the preset emergency response measures to minimize the losses caused by the fire.

2. The multi-parameter detection method for energy storage battery fire based on XGBoost as claimed in claim 1, characterized in that: The step 1 includes: using the XGBoost algorithm to construct a strong learner by integrating multiple weak learners, each weak learner is trained by minimizing the objective function based on the previous learner, and the weak learner here is a decision tree.

3. The XGBoost-based multi-parameter detection method for energy storage battery fire according to claim 2, characterized in that: The objective function consists of a loss function and a regularization term. The loss function is used to measure the difference between the model prediction value and the true value, and the regularization term is used to control the complexity of the model to prevent overfitting.

4. The XGBoost-based multi-parameter detection method for energy storage battery fires according to claim 1, characterized in that: In step 2, when the loss function is approximated by the second-order expansion of Taylor's formula, the objective function is simplified into a function of the newly added prediction value and the regularization term by using the first-order derivative and second-order derivative of the loss function with respect to the previous step prediction value, so as to solve the optimal weight and the optimal objective function value.

5. The XGBoost-based multi-parameter detection method for energy storage battery fires according to claim 1, characterized in that: The iterative updated prediction value in step 3 is: the prediction value of the tth step is the prediction value of the previous t-1 step plus the newly added prediction value of the tth step.

6. The XGBoost-based multi-parameter detection method for energy storage battery fires according to claim 1, characterized in that: In step 4, when adjusting the parameters of the XGBoost model, it also includes optimizing the splitting criterion of the tree, determining whether to split the node by calculating the gain before and after the split, using a greedy algorithm to traverse all possible splitting points, and selecting the splitting point with the largest gain for splitting, so as to improve the model's detection accuracy of multiple parameters of energy storage battery fires.

7. The multi-parameter fire detection method for energy storage batteries based on XGBoost as described in claim 6, when the amount of data is too large to be put into the memory, an approximate algorithm is used to reduce the amount of calculation, and the candidate splitting points are selected by the quantile of the feature distribution, and the continuous features are mapped to the corresponding areas according to these splitting points, and then the sum of the first-order derivatives and the sum of the second-order derivatives of each area are accumulated to determine the optimal splitting point on the set of candidate splitting points through a greedy algorithm.

8. The XGBoost-based multi-parameter detection method for energy storage battery fires according to claim 1, characterized in that: It also includes the step of using the SHAP explanatory model to interpret the XGBoost model. By drawing the density scatter plot and feature importance diagram of the SHAP value, the contribution of different features to the multi-parameter detection results of energy storage battery fires and the correlation between important features are analyzed to improve the interpretability and prediction accuracy of the model. The application of the SHAP explanatory model also includes analyzing the impact of the dynamic changes of key parameters such as temperature, voltage and gas emissions during the thermal runaway of lithium batteries on the model prediction results, and displaying the correlation between key parameters through a joint distribution diagram to further guide the optimization and practical application of the multi-parameter detection method of energy storage battery fires.

9. The XGBoost-based multi-parameter detection method for energy storage battery fires according to claim 1, characterized in that: It also includes steps of using accuracy, precision, recall and AUC values ​​as model performance evaluation indicators. These indicators are calculated by constructing a confusion matrix to comprehensively evaluate the performance of the model in the multi-parameter detection task of energy storage battery fires.

10. The XGBoost-based multi-parameter detection method for energy storage battery fires according to claim 1, characterized in that: It also includes the steps of drawing the ROC curve and calculating the AUC value. The ROC curve can intuitively show the performance of the model at different thresholds, and the AUC value is used as a quantitative indicator to measure the classification performance of the model. The closer the AUC value is to 1, the better the model performance.