Battery early thermal runaway prediction method based on attention multi-type feature driving
By adopting an attention-based multi-type feature-driven approach, the accuracy problem of existing battery thermal runaway prediction under complex operating conditions is solved. An improved variational self-encoding and decoding network is established to achieve accurate prediction of early thermal runaway risk of batteries with a low false alarm rate, thereby improving the safety and reliability of battery systems.
Patent Information
- Application Number
- CN202610703640.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-07-03
AI Technical Summary
Existing battery thermal runaway prediction strategies struggle to accurately capture early-stage thermal runaway risks under complex operating conditions, especially due to the neglect of multi-type information and its cross-scale correlations, and the difficulty of single-task network models in distinguishing subtle heterogeneous differences, resulting in insufficient prediction capabilities and poor reliability.
An attention-based multi-type feature-driven approach is adopted. By acquiring multi-type charging data, feature extraction and self-attention feature fusion are performed to establish an improved variational self-encoding and decoding network. Combined with multi-expert decoders and auxiliary decoders, differentiated reconstruction of heterogeneous working conditions is achieved.
It improves the safety and reliability of battery systems, accurately predicts the early thermal runaway risk of batteries under complex operating conditions, reduces false alarm rates, and ensures stable operation over long periods.
Smart Images

Figure CN122330719A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of early warning technology for battery safety and prediction of battery risk status, and particularly to an attention-based multi-type feature-driven method for predicting early thermal runaway of marine power batteries. Background Technology
[0002] Under high-speed charging and discharging and extremely complex operating conditions, the batteries in marine energy storage equipment are prone to performance and lifespan degradation due to electrical, thermal, and mechanical abuse, and may even experience severe thermal runaway events. Therefore, developing predictive strategies capable of accurately identifying battery thermal runaway risks in their early stages is of significant practical importance for ensuring the safe and reliable operation of marine energy storage equipment.
[0003] Existing battery thermal runaway prediction strategies can be broadly categorized into three types: model-driven, signal analysis, and data-driven. Model-driven methods rely on high-frequency sampling from multiple sensors to update parameters in real time. Their models are often built based on laboratory data, making it difficult to guarantee predictive performance under actual operating conditions. Signal analysis methods typically target time-frequency domain features that characterize battery anomalies, using statistical tests or threshold discrimination to identify batteries deviating from a preset distribution to achieve prediction. However, these methods are highly sensitive to prior experience and threshold settings, and are easily affected by measurement noise and environmental disturbances.
[0004] While data-driven approaches have shown considerable potential, they still face certain limitations under complex operating conditions. First, existing studies often use raw voltage sequences or their local statistics as predictive features, neglecting multiple types of information such as temperature and internal resistance, and their cross-scale correlations. This results in insufficient early characterization capabilities for high-risk batteries and presents a trade-off between information completeness and computational complexity. Second, mainstream models generally employ single-task network models for unified training of multi-source features. When the external characteristics of high- and low-risk batteries are highly similar in the early stages, the model struggles to distinguish subtle heterogeneous differences. Furthermore, the scarcity of precisely labeled outlier samples further restricts the model's generalization performance and predictive reliability. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a method for predicting early thermal runaway of batteries based on attention-driven multi-type features, which solves the problems existing in the prior art.
[0006] This invention provides a method for predicting early thermal runaway of batteries based on attention-driven multi-type features, the method comprising: S1: Acquire various types of charging data for lithium-ion batteries under actual operating conditions; S2: Perform feature extraction on the multi-type charging data; S3: Perform multi-head self-attention-based feature fusion on the extracted features to obtain global fused features; Specifically, S3 is: S3.1: The extracted features are projected into a 32-dimensional vector space through the embedding layer to form the input matrix X; S3.2: Generate a query matrix, a key matrix, and a value matrix based on the input matrix X; S3.3: Calculate the self-attention weights based on the query matrix, the key matrix, and the value matrix; S3.4: Achieve feature fusion based on the self-attention weights; S4: Establish an improved variational self-encoding / decoding network for predicting early thermal runaway in batteries; S5: Train the improved variational auto-encoder / decoder network; S6: Input the features extracted from the multi-type charging data of the battery to be predicted into the improved variational self-encoding and decoding network to obtain the early thermal runaway prediction results.
[0007] Preferably, in step S3.1, the extracted features are input into the embedding layer, and the extracted features are uniformly projected into a 32-dimensional vector space through the embedding layer, and then stacked and combined to form the input matrix X.
[0008] Preferably, in step S3.2, a multi-head self-attention mechanism is used for feature fusion on the input matrix X, with the number of attention heads set to 4, and the dimension of each attention head being... For the 8th, Each attention head is used with a weight matrix. , , Generate the corresponding query matrix Key matrix Sum matrix The expression is: .
[0009] Preferably, in S3.3, for the first... One point of attention, It is the query matrix corresponding to the attention head h. The line, indicating the first Query vectors for a subset of features yes The line, indicating the first The key vector of a feature subset yes The line, indicating the first A vector of values for a subset of features; Then the first Under each attention head, feature subset With feature subset The dot product similarity score can be defined as: ; For each feature subset It applies to all feature subsets dot product similarity score It can be represented as: ; Then the first Under each attention head, each feature subset It applies to all feature subsets Self-attention weights It can be represented as: ; In the formula, For the first Under each attention head, the dot product similarity score between feature subset i and feature subset m; For the Individual attention head, feature subset Output It can be represented as: ; General matrix form for: ; In the formula, for In matrix form, For the first The value matrix generated by the attention head.
[0010] Preferably, in step S3.4, the outputs of all attention heads are concatenated along the feature dimension to form an overall attention output matrix. , is represented as: ; In the formula, For the first The self-attention matrix output by each attention head; Finally, through the projection matrix After mapping and average pooling, the global fused features Represented as: .
[0011] Preferably, in step S4, the improved variational self-coding / decoding network includes three parts: a unified encoder, a multi-expert decoder, and an auxiliary decoder.
[0012] Preferably, the unified encoder takes the globally fused features as input, progressively compresses the feature dimensions through a multi-layer fully connected network, uses the LeakyReLU activation function in the hidden layers, and uses the tanh activation function in the output layer. The unified encoder ultimately outputs a latent mean vector. Sum of logarithmic variance vector .
[0013] Preferably, construct Each of the five parallel expert decoders corresponds to samples from different clusters. Each expert decoder shares latent variables for parallel decoding mapping. Simultaneously, the gating network of each expert decoder dynamically generates adaptive weights for the outputs of each expert decoder based on global fusion features, expressed as: ; In the formula, Indicates the first Adaptive weights corresponding to each expert decoder For the first The weight matrix corresponding to each expert decoder For the first The bias term corresponding to each expert decoder; The outputs of each expert decoder are weighted and fused to obtain the overall expert decoding output. Represented as: ; In the formula, It is the first The output of expert decoding.
[0014] Preferably, the auxiliary decoder adopts a two-stage fully connected mapping structure. First, the LeakyReLU activation function is used to output the overall expert decoding. Mapped to the hidden layer, as shown below: ; In the formula, and These are the weight matrix and bias term of the hidden layer, respectively; Based on this, an independent output head is designed for each feature subset, and differential reconstruction is performed on a subset-by-subset basis, as follows: ; In the formula, Let e be the reconstructed vector of the feature subset e. and They represent the first The weight matrix and bias terms of each output head.
[0015] Preferably, the total loss function of the improved variational self-encoding / decoding network is determined by jointly optimizing the reconstruction loss, KL divergence loss, gated cross-entropy loss, and information entropy regularization term. For the reconstruction loss, the mean squared error is used to quantize the difference between the output and the input, and the expression is: ; In the formula, The reconstruction loss is represented by B, where B is the number of samples in the batch. and They are the first The first sample The reconstructed features and original features of each feature subset, where E is the number of feature subsets; The KL divergence loss is expressed as: ; In the formula, For KL divergence loss, For the dimension of the potential space, It is the first The nth sample mean vector One portion, These are the corresponding variance components; Gated cross-entropy loss is defined as: ; In the formula, To focus parameters, These are the category weight coefficients; The information entropy regularization term is represented as: ; In summary, the total loss function Defined as: ; In the formula, , , These are the coefficients corresponding to the KL divergence loss, gated cross-entropy loss, and information entropy regularization term, respectively.
[0016] The embodiments of the present invention have the following technical effects: This invention aims to fully consider the early warning technology requirements for thermal runaway in marine energy storage equipment battery systems facing complex environments. Through feature extraction methods and network structure design, it establishes a method for predicting early thermal runaway of marine power batteries based on attention-driven multi-type features. This method is based on multiple types of signals and designs a comprehensive feature extraction scheme spanning the time and frequency domains. Secondly, it constructs a variational autoencoder network architecture with an attention feature fusion mechanism. A self-attention mechanism is embedded in the traditional variational autoencoder network for multi-type feature fusion, and a cluster partitioning method is combined to construct a multi-expert decoder and auxiliary decoder structure, achieving differentiated reconstruction for heterogeneous operating conditions. This solution improves the safety and reliability of the battery system, ensuring long-term stable operation. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the battery early thermal runaway prediction method based on attention-driven multi-type features provided in the embodiments of the present invention; Figure 2 This is a schematic diagram illustrating the changes of four evaluation indicators under different numbers of clusters provided in the embodiments of the present invention; Figure 3 This is a flowchart of feature fusion based on multi-head self-attention for extracted features provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the improved variational self-coding / decoding network provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the prediction performance of high-risk thermal runaway batteries from four examples in the test set across the entire data segment. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0020] Example 1 like Figure 1As shown, the battery early thermal runaway prediction method based on attention-driven multi-type features includes: S1: Acquire various types of charging data for lithium-ion batteries under actual operating conditions; The multi-type charging data includes voltage data, temperature data, and current data, and also includes battery internal resistance data calculated based on the voltage data and current data.
[0021] S2: Perform feature extraction on the multi-type charging data; In this step, the feature extraction operation includes voltage feature extraction, temperature feature extraction, internal resistance feature extraction, and feature normalization operation; Specifically, the voltage feature extraction involves mapping the voltage time sequence of each battery within a complete charging segment in the multi-type charging data into an 18-dimensional feature vector set to characterize the global characteristics of the original sequence. This 18-dimensional feature vector set describes the voltage characteristics from three dimensions: numerical statistics, time-domain dynamics, and frequency domain. All features are organized into a matrix form, expressed as: ; In the formula, Let voltage be the feature set of the k-th battery in the j-th data segment, wherein the voltage feature set includes a subset of statistical features. Dynamic feature subset Frequency domain feature subset Where V1 is the mean feature, V2 is the standard deviation feature, V3 is the maximum value feature, V4 is the minimum value feature, V5 is the skewness feature, V6 is the kurtosis feature, V7 is the energy feature, V8 is the first-order difference mean feature, V9 is the second-order difference mean feature, and V... 10 For the maximum rate of change characteristic, V 11 V represents the first-order difference standard deviation characteristic. 12 V represents the mean characteristic of the moving average. 13 V represents the maximum value characteristic of the moving average. 14 V is the minimum characteristic of the moving average. 15 V represents the mean characteristic of the moving variance. 16 V represents the maximum value of the sliding variance. 17 For frequency band energy characteristics, V 18 Main frequency characteristics.
[0022] Temperature directly reflects the thermal stability of a battery and is a crucial indicator for assessing the risk of thermal runaway. Compared to voltage data, temperature sampling accuracy is lower and the change curve is flatter. Therefore, it is necessary to extract global features to enhance its discriminative ability. Specifically, the temperature feature extraction involves: for each charging segment of the multi-type charging data, extracting 6-dimensional features from the temperature sequence and dividing them into 3 subsets to equivalently replace the original charging data. Here, the complete set of temperature features is defined as... T Among them, t1-t4 are statistical feature subsets, namely the maximum value, minimum value, average value and standard deviation, respectively; t5 is the trend feature subset, specifically the temperature data change trend of each charging segment; and t6 is the normalized cumulative difference feature subset of the temperature data of each charging segment.
[0023] Furthermore, for ease of understanding, the normalized cumulative difference characteristics of the temperature data for each charging segment are explained in detail. First, the average temperature sequence of all batteries in the temperature data for each charging segment is constructed as follows: ; In the formula, Let be the average temperature of the battery at time t for the i-th temperature sampling point, where k represents the k-th battery, M is the total number of batteries, and i is the sampling point; For the temperature data of each battery, calculate the difference between it and the average value, as shown below: ; In the formula, Let be the difference between the temperature value of the k-th battery at time t (i-th sampling point) and the average temperature. Let be the temperature value of the k-th battery at time t of the i-th sampling point; To ensure the rationality of the normalized cumulative difference feature of temperature data for each charging segment, this embodiment introduces the SOC change factor, dividing all normalized cumulative difference features into several sub-intervals according to SOC. The SOC starting point of the p-th SOC interval is denoted as... The destination is recorded as Then the change in temperature difference within the interval is: ; In the formula, Let be the change in temperature difference within interval p at time t for the k-th battery. Let be the temperature difference at the end of interval p at time t for the k-th battery. This represents the temperature difference at the starting point of interval p at time t for the k-th battery. Therefore, the change in difference under a unit change in SOC can be expressed as: ; In the formula, Let be the change in the difference of the state of charge (SOC) within the interval p at time t for the k-th battery. The SOC value for the interval p+1 Let SOC be the value in the p interval.
[0024] By summing and averaging the differences in temperature across all SOC intervals, the normalized cumulative difference in temperature data for each charging stage of the battery can be obtained, as shown below: ; In the formula, Let N be the difference in SOC variation at time t for the k-th battery, where N is the number of SOC intervals. This feature can serve as a standardized indicator, allowing for comparison even when the SOC variation magnitudes differ across different data segments.
[0025] Internal resistance is a sensitive indicator of battery consistency and aging, and an important reference characteristic for predicting thermal runaway. However, in actual operation, voltage and current fluctuations are significant, making it difficult to obtain accurate internal resistance measurements. Multi-stage charging strategies offer a feasible alternative. A rough estimate of internal resistance can be made at the current switching points, although its accuracy is limited, it is sufficient for large-scale data analysis. Therefore, this step uses the following formula to estimate the internal resistance at the current switching points in each charging stage: ; In the formula, It is the internal resistance value at time i when the current switches. and These are the battery voltages before and after the current change. and These are the battery currents before and after the current change; Then, the sparse internal resistance data is refined into a unified feature quantity that can describe the change of internal resistance with SOC. It should be noted that, given that the estimated internal resistance values are sparse and of variable number during charging, this step fits the internal resistance estimated at the current switching point using the least squares method, as shown in the following formula: ; In the formula, This indicates the normalized internal resistance characteristic. It is the i-th internal resistance value. It is the average value of the internal resistance. It is the SOC value corresponding to the i-th internal resistance. is the average value of SOC, and n represents the total number of current switching points. This method effectively characterizes the information of all internal resistances by the increase or decrease rate of internal resistance under unit SOC, and enhances the sensitivity to changes in internal resistance while ensuring characteristic stability.
[0026] To eliminate scale bias caused by inconsistent feature value ranges across different types and measurement units, max-min normalization was used to linearly map all features to the [0,1] interval. To characterize the structural distribution of samples in the latent feature space, K-Means clustering was applied to the normalized training set features for unsupervised clustering. Iterative minimization of intra-cluster differences ensured high similarity among training set samples within the same cluster. After clustering, each training set sample was assigned to the nearest cluster based on its distance from the centroids of each cluster to determine its category. Four evaluation metrics—profile coefficient, variance ratio, DB coefficient, and variational distance statistics—were used to determine the number of clusters. Experimental results are shown below. Figure 2 As shown, the optimal number of clusters is 4, therefore, the optimal number of clusters is determined to be 4, and the number of expert decoders and their corresponding decoding weights in the subsequent network model are determined accordingly.
[0027] S3: Perform multi-head self-attention-based feature fusion on the extracted features to obtain global fused features; like Figure 3 As shown, S3 specifically includes: S3.1: The extracted features are projected into a 32-dimensional vector space through the embedding layer to form the input matrix X; Multi-head self-attention feature fusion is employed to adaptively fuse multiple types of input features, and corresponding attention weights are dynamically assigned to different types to highlight the important information carried by key types when generating joint representations. In this step, the extracted features are input into the embedding layer, and the extracted features are uniformly projected into a 32-dimensional vector space, and then stacked and combined to form the input matrix X.
[0028] S3.2: Generate a query matrix, a key matrix, and a value matrix based on the input matrix X; The input matrix X is subjected to feature fusion using a multi-head self-attention mechanism, with 4 attention heads and each attention head having a dimension of [missing information]. For the 8th, Each attention head is used with a weight matrix. , , Generate the corresponding query matrix Key matrix Sum matrix The expression is: .
[0029] S3.3: Calculate the self-attention weights based on the query matrix, the key matrix, and the value matrix; For the One point of attention, It is the query matrix corresponding to the attention head h. The line, indicating the first Query vectors for a subset of features yes The line, indicating the first The key vector of a feature subset yes The line, indicating the first A vector of values for a subset of features; Then the first Under each attention head, feature subset With feature subset The dot product similarity score can be defined as: ; For each feature subset It applies to all feature subsets dot product similarity score It can be represented as: ; Then the first Under each attention head, each feature subset It applies to all feature subsets Self-attention weights It can be represented as: ; In the formula, For the first Under each attention head, the dot product similarity score between feature subset i and feature subset m; For the Individual attention head, feature subset Output It can be represented as: ; General matrix form for: ; In the formula, for In matrix form, For the first The value matrix generated by the attention head.
[0030] S3.4: Perform feature fusion based on the attention weights; The outputs of all attention heads are concatenated along the feature dimension to form a comprehensive attention output matrix. , is represented as: ; In the formula, For the first The self-attention matrix output by each attention head; Finally, through the projection matrix After mapping and average pooling, the global fused features Represented as: ; This is how it was obtained. This is the final global fusion output representation. It's important to note that although average pooling is a simple averaging process, the weights for each type have been adaptively adjusted based on the input query and key vector during the preceding self-attention calculation, thus implicitly containing dynamically weighted information. The resulting global fusion features... It condenses the features most relevant to the current task from all types, and realizes the effective transformation of multi-type data into a single representation.
[0031] Compared to traditional feature concatenation or weighted average fusion strategies, attention-based fusion methods adaptively emphasize complementary information between related types. The resulting global representation vector more accurately characterizes the key information of the battery than traditional fusion methods, which helps downstream VAE encoders to more effectively model the distribution characteristics of multi-type data.
[0032] S4: Establish an improved variational self-encoding / decoding network for predicting early thermal runaway in batteries; An improved variational auto-encoder network is used to learn the latent behavioral patterns of normal batteries, such as... Figure 4 As shown, it includes a unified encoder, an expert decoder, and an auxiliary decoder. The design of each component is described below.
[0033] The multi-branch variational encoding / decoding structure comprises three parts: a unified encoder, a multi-expert decoder, and an auxiliary decoder. The unified encoder takes the globally fused features as input and progressively compresses the feature dimensions through a multi-layer fully connected network. The hidden layers employ the LeakyReLU activation function to enhance the fitting ability to complex nonlinear relationships, while the output layer uses the tanh activation function to ensure the stability of the latent variable's numerical range. The unified encoder ultimately outputs a latent mean vector. Sum of logarithmic variance vector .
[0034] Considering the significant heterogeneity of various feature types, a single decoding map is insufficient to cover the reconstruction needs of samples from different modes. Therefore, this embodiment constructs a shared... Each of the five parallel expert decoders corresponds to samples from different clusters. Each expert decoder shares latent variables for parallel decoding mapping. Simultaneously, the gating network of each expert decoder dynamically generates adaptive weights for the outputs of each expert decoder based on global fusion features, which can be expressed as: ; In the formula, Indicates the first Adaptive weights corresponding to each expert decoder For the first The weight matrix corresponding to each expert decoder For the first The bias term corresponding to each expert decoder; The outputs of each expert decoder are weighted and fused to obtain the overall expert decoding output. Represented as: ; In the formula, It is the first The output of expert decoding.
[0035] The auxiliary decoder employs a two-stage fully connected mapping structure. First, it utilizes the LeakyReLU activation function to output the overall expert decoding. Mapped to the hidden layer, as shown below: ; In the formula, and These are the weight matrix and the bias term, respectively. Based on this, an independent output head is designed for each feature subset, and differential reconstruction is performed on a subset-by-subset basis, as follows: ; In the formula, Let e be the reconstructed vector of the feature subset e. and They represent the first The weight matrix and bias terms of each output head.
[0036] In terms of loss function design, this embodiment combines reconstruction loss, KL divergence loss, gated cross-entropy loss and information entropy regularization term for joint optimization to determine the total loss function of the improved variational self-encoding / decoding network.
[0037] For the reconstruction loss, this embodiment uses mean square error to quantize the difference between the output and the input, and the expression is: ; In the formula, The reconstruction loss is represented by B, where B is the number of samples in the batch. and They are the first The first sample The reconstructed features and original features of each feature subset, where E is the number of feature subsets; The KL divergence loss, used to constrain the distance between the posterior and prior distributions of the latent variables output by the unified encoder, is expressed as: ; In the formula, For KL divergence loss, For the dimension of the potential space, It is the first The nth sample mean vector One portion, These are the corresponding variance components; The gated cross-entropy loss, used to guide the gated network to allocate expert weights reasonably according to the cluster to which the sample belongs, is defined as follows: ; In the formula, To focus parameters, These are the category weight coefficients; To prevent the gating weight distribution from becoming too extreme, an information entropy regularization term is added to smooth the gating output, as follows: ; In summary, the total loss function Defined as: ; In the formula, , , These are the coefficients corresponding to the KL divergence loss, gated cross-entropy loss, and information entropy regularization term, respectively.
[0038] S5: Train the improved variational auto-encoder / decoder network; The mean square error of the input and output of the improved variational self-encoding / decoding network is used as an indicator to measure whether the battery is at high risk of thermal runaway. The calculation method is as follows: ; In the formula, is the value after reconstructing the j-th dimension feature, and N is the dimension of the feature.
[0039] Using the total loss function as the basis for backpropagation, the improved variational autoencoder network is continuously optimized until training is complete. Simultaneously, based on the test set data, recall and false positive rates are used as evaluation metrics to further optimize the improved variational autoencoder network to achieve better performance until the model meets the requirements.
[0040] The predictive ability of the proposed strategy is evaluated using recall and false positive rate (FPR) as evaluation metrics. The calculation methods are as follows: ; ; In the formula, TP predicts positive samples as positive samples, FN predicts positive samples as negative samples, FP predicts negative samples as positive samples, and TN predicts negative samples as negative samples. It should be noted that in the prediction process, the feature set of normal batteries is defined as negative samples, and the feature set of batteries with high risk of thermal runaway is defined as positive samples.
[0041] S6: Input the features extracted from the charging data of the battery to be predicted into the improved variational auto-decoder network to obtain the early thermal runaway prediction results; After the improved variational self-encoding and decoding network is trained, the data collected in actual operation is input into the model to identify which batteries are high-risk batteries for thermal runaway by judging the value of the root mean square error and the preset threshold.
[0042] Figure 5 This demonstrates the prediction performance of high-risk batteries in four different thermal runaway states across all data segments in the test set. The horizontal axis represents the data segment number, and the vertical axis represents the reconstruction error. The adaptive threshold and battery reconstruction error for each data segment are marked with different colored bars. Figure 5 As shown in (a)-(d), in all four examples, the proposed method was able to provide effective predictions for batteries at high risk of thermal runaway, with the first prediction completed no later than the 49th data segment. This means that during long-term ship operations, the proposed method can provide multiple prediction signals in advance, before the risk of thermal runaway accelerates or an accident occurs, allowing sufficient decision-making and operational time for maintenance and risk mitigation. It can also be observed that the operating conditions and battery aging levels differ significantly across examples, resulting in strong individual variability in the reconstruction error distribution of batteries at high risk of thermal runaway in each example. Nevertheless, the proposed method maintained a 100% recall rate in all four examples, with an overall false alarm rate as low as 1.92%, indicating that the model remains robust in the face of complex operating conditions and individual differences.
[0043] The results of the comparison with several common prediction methods are shown in Table 1. The longitudinal outlier method achieved 100% recall, but had a high false positive rate (12.63%). This indicates that the method is too sensitive and prone to generating a large number of false positives, which may lead to frequent unnecessary maintenance and resource waste in practical applications. The outlier method had a lower false positive rate (6.32%), but failed to accurately identify all high-risk batteries for thermal runaway. This indicates that the detection capability of this method is weak, and its low false positive rate is also due to the weak detection capability. Using this method may lead to serious safety hazards. In addition, the isolated forest method and the support vector machine method both achieved 100% recall, but the false positive rates were 19.5% and 17.58%, respectively. Especially in large-scale battery systems, a high false positive rate will significantly increase the economic and maintenance burden of system operation. Compared with the above methods, the method proposed in this embodiment shows obvious advantages. Not only does it achieve a 100% recall rate, effectively avoiding the risk of missed detection, but more importantly, the false positive rate is significantly reduced to 1.92%.
[0044] Table 1. Comparison of effectiveness with other common early warning methods
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A battery early thermal runaway prediction method based on attention multi-type feature driving, characterized in that, The method includes: S1: Acquire various types of charging data for lithium-ion batteries under actual operating conditions; S2: Perform feature extraction on the multi-type charging data; S3: Perform multi-head self-attention-based feature fusion on the extracted features to obtain global fused features; Specifically, S3 is: S3.1: The extracted features are projected into a 32-dimensional vector space through the embedding layer to form the input matrix X; S3.2: Generate a query matrix, a key matrix, and a value matrix based on the input matrix X; S3.3: Calculate the self-attention weights based on the query matrix, the key matrix, and the value matrix; S3.4: Achieve feature fusion based on the self-attention weights; S4: Establish an improved variational self-encoding / decoding network for predicting early thermal runaway in batteries; S5: Train the improved variational auto-encoder / decoder network; S6: Input the features extracted from the multi-type charging data of the battery to be predicted into the improved variational self-encoding and decoding network to obtain the early thermal runaway prediction results.
2. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 1, characterized in that, In step S3.1, the extracted features are input into the embedding layer, and the extracted features are uniformly projected into a 32-dimensional vector space through the embedding layer, and then stacked and combined to form the input matrix X.
3. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 2, characterized in that, In S3.2, the input matrix X is subjected to multi-head self-attention mechanism for feature fusion, the number of attention heads is set to 4, and the dimension of each attention head is 8 For the first attention head, the corresponding query matrix , key matrix and value matrix are generated by using weight matrix , , , and the expression is as follows: 。 4. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 3, characterized in that, In S3.3, for the first One point of attention, It is the query matrix corresponding to the attention head h. The line, indicating the first Query vectors for a subset of features yes The line, indicating the first The key vector of a feature subset yes The line, indicating the first A vector of values for a subset of features; Then the first Under each attention head, feature subset With feature subset dot product similarity score , can be defined as: ; For each feature subset It applies to all feature subsets dot product similarity score It can be represented as: ; Then the first Under each attention head, each feature subset It applies to all feature subsets Self-attention weights It can be represented as: ; In the formula, For the first Under each attention head, the dot product similarity score between feature subset i and feature subset m; For the Individual attention head, feature subset Output It can be represented as: ; General matrix form for: ; In the formula, for In matrix form, For the first The value matrix generated by the attention head.
5. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 4, characterized in that, In step S3.4, the outputs of all attention heads are concatenated along the feature dimension to form an overall attention output matrix. , represented as: ; In the formula, For the first The self-attention matrix output by each attention head; Finally, through the projection matrix After mapping and average pooling, the global fused features Represented as: 。 6. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 1, characterized in that, In S4, the improved variational self-coding network includes three parts: a unified encoder, a multi-expert decoder, and an auxiliary decoder.
7. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 6, characterized in that, The unified encoder takes the globally fused features as input and progressively compresses the feature dimensions through a multi-layer fully connected network. The hidden layers use the LeakyReLU activation function, and the output layer uses the tanh activation function. The unified encoder ultimately outputs a latent mean vector. Sum of logarithmic variance vector .
8. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 7, characterized in that, Build There are 12 parallel expert decoders, each corresponding to samples from different clusters. Each expert decoder shares latent variables for parallel decoding mapping. Simultaneously, the gating network of each expert decoder dynamically generates adaptive weights for the outputs of each expert decoder based on global fusion features, expressed as: ; In the formula, Indicates the first Adaptive weights corresponding to each expert decoder For the first The weight matrix corresponding to each expert decoder For the first The bias term corresponding to each expert decoder; The outputs of each expert decoder are weighted and fused to obtain the overall expert decoding output. Represented as: ; In the formula, It is the first The output of expert decoding.
9. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 8, characterized in that, The auxiliary decoder employs a two-stage fully connected mapping structure. First, it utilizes the LeakyReLU activation function to output the overall expert decoding. Mapped to the hidden layer, as shown below: ; In the formula, and These are the weight matrix and bias term of the hidden layer, respectively; Based on this, an independent output head is designed for each feature subset, and differential reconstruction is performed on a subset-by-subset basis, as follows: ; In the formula, The reconstructed vector of feature subset e. and They represent the first The weight matrix and bias terms of each output head.
10. The method for predicting early thermal runaway of a battery based on attention-driven multi-type features according to claim 9, characterized in that, The total loss function of the improved variational auto-encoder network is determined by jointly optimizing the reconstruction loss, KL divergence loss, gated cross-entropy loss and information entropy regularization term. For the reconstruction loss, the mean squared error is used to quantize the difference between the output and the input, and the expression is: ; In the formula, The reconstruction loss is represented by B, where B is the number of samples in the batch. and They are the first The first sample The reconstructed features and original features of each feature subset, where E is the number of feature subsets; The KL divergence loss is expressed as: ; In the formula, For KL divergence loss, For the dimension of the potential space, It is the first The nth sample mean vector One portion, These are the corresponding variance components; Gated cross-entropy loss is defined as: ; In the formula, To focus parameters, These are the category weight coefficients; The information entropy regularization term is represented as: ; In summary, the total loss function Defined as: ; In the formula, , , These are the coefficients corresponding to the KL divergence loss, gated cross-entropy loss, and information entropy regularization term, respectively.
