Lithium battery health status prediction method based on SD-Crossformer

By using the SD-Crossformer model and frequency-weighted attention mechanism in the prediction of lithium battery health status, the problems of low prediction accuracy and noise sensitivity in the prior art are solved, and higher prediction accuracy and robustness are achieved.

CN118884239BActive Publication Date: 2025-04-04XI'AN POLYTECHNIC UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411021081.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-04-04
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The existing lithium battery health status prediction methods are not very accurate and are sensitive to data noise, making it difficult to retain sorting information, affecting the accuracy of time series prediction.

Method used

The SD-Crossformer-based lithium battery health status prediction method is used to process data through stacked noise reduction autoencoder (SDAE) denoising, and a frequency-weighted attention mechanism is introduced into the Crossformer model to enhance the model's perception of frequency information.

Benefits of technology

It improves the accuracy of lithium battery health status prediction, enhances the robustness of the model to noise, and can more effectively capture the periodic patterns in the time series and the frequency correlation between different dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118884239B_ABST
    Figure CN118884239B_ABST
Patent Text Reader

Abstract

The present invention discloses a lithium battery health state prediction method based on SD-Crossformer. Aiming at the noise problem existing in the input data, a stacked denoising autoencoder is proposed for reconstructing the input data. The module accepts damaged or noisy data as input, trains the autoencoder to restore the original data, and thus forces the model to learn the key features in the data; secondly, in order to capture the periodic pattern of the battery capacity degradation model, a frequency-weighted attention mechanism is designed to perform frequency domain conversion on the segmented embedded dimensional data, and weightedly calculate the attention between dimensions in combination with the frequency domain information, thereby identifying the frequency correlation between different dimensions, and effectively improving the prediction accuracy of the lithium battery health state SOH. The present invention adopts the grid search method to train the model to obtain the optimal parameters, which ensures the search efficiency of the model and the reliability of the results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of lithium battery state prediction, and relates to a lithium battery health state prediction method based on SD-Crossformer. Background Art

[0002] At present, the traditional methods for predicting the state of health (SOH) of lithium batteries mainly include direct observation methods, model-driven methods, and data-driven methods. The traditional direct observation method mainly estimates the SOH value by measuring parameters related to battery capacity decay, but because it requires a long period of static elimination of the battery voltage, it can only effectively predict SOH in the initial or final stages; the model-driven method mainly establishes an equivalent physical or chemical model to simulate the loss state of SOH based on actual usage. The Kalman filter algorithm can estimate the battery SOH more accurately, but the disadvantages of this algorithm include many model parameters, complex model establishment and parameter identification, and poor adaptability; the data-driven method does not need to pay attention to the internal mechanism of the battery, but uses machine learning algorithms to obtain the mapping relationship between battery external data (voltage, current, temperature, etc.) and SOH through offline training, and improves the generalization ability of the model through training with a large amount of historical data. However, the performance of this model is heavily dependent on the scale and quality of data, and is sensitive to data noise, resulting in reduced prediction accuracy.

[0003] As Transformer shines in various fields, the self-attention mechanism has also been widely used in the field of time series prediction and has achieved remarkable results. Peng et al. proposed the CEEMDAN-SE-TR model to combine the Transformer model with decomposition technology to improve prediction accuracy. Li et al. proposed a power plant auxiliary equipment condition monitoring method combining LSTM and SDAE, using autoencoders to capture more intrinsic features and improve the robustness of the model. These models focus more on capturing dependencies across time dimensions but ignore cross-dimensional dependencies between data, resulting in a decrease in model prediction accuracy. In addition, the performance of the Transformer model is too dependent on the data quality of the original data set. This data-sensitive model may cause the model prediction to deviate from the true value by learning noisy data when used. We also found that the Transformer-based prediction model is an order-sensitive task and it is difficult to retain sorting information, because the attention mechanism is permutation-invariant and the absolute position embedding injected into the model is not sufficient for time series prediction. Summary of the invention

[0004] The purpose of the present invention is to provide a lithium battery health state prediction method based on SD-Crossformer, which solves the problem of low accuracy in the existing lithium battery health state prediction.

[0005] The technical solution adopted by the present invention is a lithium battery health status prediction method based on SD-Crossformer, which is specifically implemented according to the following steps:

[0006] Step 1: Obtain a lithium battery capacity attenuation dataset, perform noise reduction on the dataset, and divide it into a training set and a test set in proportion;

[0007] Step 2: Construct the SD-Crossformer model for lithium battery state prediction;

[0008] Step 3: Input the training set into the detection model constructed above, and use the grid search method to obtain the optimal model parameters;

[0009] Step 4: Input the test set into the model trained in step 3 and output the result of lithium battery health status prediction.

[0010] The present invention is also characterized in that:

[0011] In step 1, the data set is a NASA lithium battery capacity attenuation data set, and the present invention uses a stacked denoising autoencoder (SDAE) to denoise the data in the data set.

[0012] SDAE is an unsupervised learning algorithm that accepts damaged or noisy data as input and trains an autoencoder to restore the original data, thereby forcing the model to learn the key features of the data and suppress the noise during reconstruction. It is composed of multiple denoising autoencoders (DAEs) stacked together. The specific denoising method is as follows:

[0013] First, different features in lithium battery data have different units and value ranges, which affect the accuracy of the model's analysis and training of the data. The input battery data must be normalized. Let the variable X = {X1, X2, X3…X n} is n battery capacity data, and the normalized transformation formula is as follows:

[0014]

[0015] In formula (1), for each variable X i ,u i , σ i Its mean and standard deviation, X′ i is the normalized variable value. Normalization can make all features on the same order of magnitude, thereby improving the performance of the model.

[0016] Next, let the variable X′={X′1,X′2,X′3…X′ n} represents sample data with n data capacity. Gaussian noise ∈ is added to the original data, and the output data with added noise is x′=X′ i +∈. The encoder of SDAE maps the noisy input data x′ to the representation of the hidden layer:

[0017] h=f encoder (x′) (2)

[0018] In formula (2), h is the representation of the hidden layer, f encoder (·) is the mapping function of the encoder, which includes activation function, weight, bias and other information.

[0019] Finally, the decoder maps the hidden layer representation h back to a reconstruction of the original input data The decoder of SDAE usually consists of multiple fully connected layers, and the output reconstructed by the activation function is linearly transformed. The difference between the original data x is used as the loss function:

[0020]

[0021] In formula (3), m is the dimension of the sample, x i and are the i-th features of the original data and the reconstructed data, respectively. By minimizing the difference between the reconstructed data and the original data, the stacked denoising autoencoder can learn an effective representation of the data and suppress the influence of Gaussian noise during the reconstruction process.

[0022] After denoising is completed, the data set is divided into training set and test set in a ratio of 6:4.

[0023] In step 2, the frequency-weighted attention mechanism added to the SD-Crossformer model can enhance the model's perception of frequency information. When feature data is interfered by noise, its waveform becomes messy, and the data cannot be distinguished from the noise in time series prediction, but it can be clearly distinguished in the frequency domain. Frequency information is introduced through discrete cosine transform (DCT) to obtain attention weights.

[0024] In step 3, a grid search method is used to obtain the best model parameters. The grid search method first defines the parameter space; secondly, a parameter grid is created to list all possible parameter combinations; then the model is trained and validated. For each combination in the parameter grid, a cross-validation is used to train the model and evaluate its performance; finally, the best performing parameter combination is selected based on the evaluation index.

[0025] The dataset is divided into training set and test set in a ratio of 6:4.

[0026] The SD-Crossformer model described in step 2 is a deep learning lithium battery health status prediction method based on the Crossformer architecture, which can effectively handle noise and outliers in the data. First, the input data is denoised and outliers are processed through SDAE, and the output of SDAE is used as the input of the Crossformer model. Secondly, in the Crossformer model, the decoder layer enhances the model's perception of frequency information by adding a frequency-weighted attention mechanism in the cross-time and cross-dimensional stages. This enables the model to reveal rich frequency information and characteristic patterns, thereby improving the prediction accuracy of lithium battery SOH prediction.

[0027] The method of introducing frequency information based on discrete cosine transform DCT to obtain attention weight is as follows:

[0028] The frequency-weighted attention mechanism introduces frequency information through discrete cosine transform DCT. Formula (4) is the functional expression of one-dimensional DCT:

[0029]

[0030] In formula (4), S α is the length of the battery sequence, It represents the frequency domain coefficient after DCT transformation, l represents the frequency index, and its value range is (0,S α -1), is the i-th data point in the original time domain signal;

[0031] The frequency-weighted attention mechanism divides the input features into n subgroups along the channel dimension, namely [H0, H1, H2…H n-1 ], then, the subgroup will be processed from the DCT frequency components corresponding to low frequency to high frequency, and each single channel will be processed by the same frequency component. Equation (5) is its calculation formula.

[0032]

[0033] Where, Freq i is the frequency vector of the ith subgroup, the result after discrete cosine transform DCT processing, DCT (H i ) represents the frequency component in discrete cosine transform DCT, S α is the length of the battery sequence, H i is the i-th subgroup in the input feature map, j is the index of the frequency component corresponding to H, and its value range is [0,S α -1];

[0034] Freq is obtained by solving i , stack each frequency vector to get the entire frequency vector Freq, and then learn the attention weight.

[0035] In the cross-time stage of the attention mechanism layer, the time series data is converted to the frequency domain, and the frequency domain features are combined in the attention calculation to capture the periodic patterns in the time series. Then, after rearrangement, the data is converted to the frequency domain again in the cross-dimensional stage, and the attention between dimensions is calculated in combination with the frequency domain information to identify the frequency correlation between different dimensions.

[0036] Each decoder layer uses the attention score to perform weighted summation on the values ​​to obtain the attention-weighted representation, and sums the current weighted feature with the prediction result of the previous decoder as the input of the next decoder layer. The formulas for calculating weights and weighted features are as follows:

[0037] Z pos =Z+PE (6)

[0038] Z weighted =Z pos +Attention(Z pos , FWA(Z pos )) (7)

[0039] In the above formula, Z is the input data or the predicted output of the previous attention layer, PE is the relative position encoding matrix, and Z pos represents the new data representation after adding the input data to the relative position encoding, FWA(*) represents frequency weighted attention, Attention(Z pos ,FWA(Z pos )) represents the attention weighted score enhanced by the frequency-weighted attention mechanism, Z weighted Weight features for each layer.

[0040] In step 3, a grid search method is used to obtain the optimal parameters of the model. The grid search method first defines the parameter space; secondly, a parameter grid is created to list all possible parameter combinations; next, the model is trained and validated. For each combination in the parameter grid, cross-validation is used to train the model and evaluate its performance; finally, the parameter combination with the best performance is selected based on the evaluation index.

[0041] Step 3 is as follows:

[0042] First, define the parameter space: determine the hyperparameters that need to be optimized and their possible value ranges; for the SD-Crossformer model, the parameters that need to be optimized are: the number of layers num_layers, the model dimension d_mode1, the number of attention heads num_heads, the dimension of the feedforward network d_ff, and the learning rate learning_rate;

[0043] Secondly, specify the initial value and optimization range for each parameter to be optimized: the optimization range of the number of layers num_layers is [2,4,6], the optimization range of the model dimension d_mode1 is [128,256,512], the optimization range of the number of attention heads num_heads is [4,8], the optimization range of the dimension of the feedforward network d_ff is [512,1024,2048], and the optimization range of the learning rate learning_rate is [1e-4,5e-4,1e-3].

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] (1) The Crossformer model is used to analyze the cross-dimensional and cross-temporal dependencies between various variables. The Crossformer multi-head attention network can accelerate the training performance of the neural network, learn the degradation trend of battery health from the sequence, and improve the overall accuracy of the prediction.

[0046] (2) For the noise problem of input data, a stacked denoising autoencoder is used to reconstruct the input data. The ability to remove noise is learned to extract effective features from battery data, thereby improving the data representation ability.

[0047] (3) In order to solve the problem that the Transformer model is difficult to retain sorting information and is insufficient for time series prediction, resulting in prediction result deviation, a frequency-weighted attention mechanism is introduced. The frequency information is obtained through discrete cosine transform and then the attention weight is obtained to increase the prediction accuracy. The prediction sequences of all dimensions of the input data are summed to output the prediction variable. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a structural diagram of the SD-Crossformer model of the present invention;

[0049] Figure 2 is a flow chart of the attention layer across time and dimensions of the present invention;

[0050] Figure 3The results of the SOH prediction of B0005 lithium battery on NASA data set by the method of the present invention are compared with different models (Transformer, long short-term memory network (LSTM), AE-GRU network, Autoformer network);

[0051] Figure 4 The results of the comparison between the SOH prediction results of B0006 lithium battery using the method of the present invention on the NASA data set and different models (Transformer, long short-term memory network (LSTM), AE-GRU network, Autoformer network);

[0052] Figure 5 The results of the comparison between the SOH prediction results of B0007 lithium battery using the method of the present invention on the NASA data set and different models (Transformer, long short-term memory network (LSTM), AE-GRU network, and Autoformer network);

[0053] Figure 6 This is the comparison result of the SOH prediction result of B0018 lithium battery using the method of the present invention on the NASA data set with different models (Transformer, long short-term memory network (LSTM), AE-GRU network, Autoformer network). DETAILED DESCRIPTION

[0054] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0055] Example 1

[0056] The present invention is based on the lithium battery health status prediction method of SD-Crossformer, and the specific operation steps are as follows:

[0057] Step 1: Obtain a lithium battery capacity attenuation dataset, perform noise reduction on the dataset, and divide it into a training set and a test set in proportion;

[0058] Step 2: Construct the SD-Crossformer model for lithium battery state prediction;

[0059] Step 3: Input the training set into the SD-Crossformer model constructed above, and use the grid search method to obtain the optimal model parameters;

[0060] Step 4: Input the test set into the model trained in step 3 and output the result of lithium battery health status prediction.

[0061] Example 2

[0062] The present invention is based on the lithium battery health status prediction method of SD-Crossformer, and the specific operation steps are as follows:

[0063] Step 1: Obtain a lithium battery capacity attenuation dataset, perform noise reduction on the dataset, and divide it into a training set and a test set in proportion;

[0064] The lithium battery data set is specifically a NASA lithium battery capacity decay data set. The four groups of batteries B0005, B0006, B0007, and B0018 in the experimental data set are used as experimental objects of lithium-ion batteries. The rated capacity of the four lithium batteries is 2Ah. When charging, they are charged at a constant current of 1.5A until the battery voltage reaches 4.2V, and then continue to charge at a constant voltage until the charging current drops to 20mA. When discharging, they are discharged at a constant current of 2A until the voltages of batteries B0005, B0006, B0007, and B0018 drop to 2.7V, 2.5V, 2.2V, and 2.5V, respectively.

[0065] The original data set or the battery data in actual use is always full of noise, and most methods input the noisy data into the neural network for prediction without denoising or purification. This is particularly obvious when the charging condition occurs, which greatly affects the accuracy of the neural network prediction. Therefore, before making a prediction, data denoising must be performed to maintain the accuracy and robustness of the model. The present invention uses a stacked denoising autoencoder (SDAE) for data denoising.

[0066] SDAE is an unsupervised learning algorithm that accepts damaged or noisy data as input and trains an autoencoder to restore the original data, thereby forcing the model to learn the key features of the data and suppress noise during reconstruction. It is composed of multiple denoising autoencoders (DAE) stacked together.

[0067] Let variable X′={X′1,X′2,X′3…X′ n} represents sample data with n data capacity. Gaussian noise ∈ is added to the original data, and the output data with added noise is x′=X′ i +∈. The encoder of SDAE maps the noisy input data x′ to the representation of the hidden layer:

[0068] h=f encoder (x′) (2)

[0069] In formula (4), h is the representation of the hidden layer, f encoder (·) is the mapping function of the encoder, which includes activation function, weight, bias and other information.

[0070] The decoder maps the hidden layer representation h back to a reconstruction of the original input data The decoder of SDAE usually consists of multiple fully connected layers, and the output reconstructed by the activation function is linearly transformed. The difference between the original data x is used as the loss function:

[0071]

[0072] In formula (3), m is the dimension of the sample, x i and are the i-th features of the original data and the reconstructed data, respectively. By minimizing the difference between the reconstructed data and the original data, the stacked denoising autoencoder can learn an effective representation of the data and suppress the influence of Gaussian noise during the reconstruction process.

[0073] After the input data is processed by SDAE for noise reduction, the data set is divided into training set and test set in a ratio of 6:4. Finally, the output of SDAE is used as the input of the Crossformer model.

[0074] Step 2: Construct the SD-Crossformer model for lithium battery status prediction, which mainly includes three steps: data preprocessing, improved Crossformer model and prediction.

[0075] In order to solve the drawbacks of the traditional model, the present invention designs a structure SD-Crossformer network based on the Crossformer model. The SD-Crossformer model structure described in step 2 is shown in the attached figure. Figure 1 As shown, the normalized data is output into the denoising autoencoder SDAE, Gaussian noise is added to the source data inside the denoising autoencoder SDAE to train the main features of the extracted data, and the extracted feature data is input into the SD-Crossformer model for battery health status prediction. In the attention layer, frequency weighting is added in the cross-time stage and the cross-dimensional stage, and the target prediction sequence is output through linear layer mapping.

[0076] The stacked denoising autoencoder SDAE described in step 1 is operated in the data preprocessing stage.

[0077] The Crossformer model can effectively capture relevant information in different dimensions, but faces challenges in predicting univariate data with multi-dimensional inputs, because the prediction of time series is an order-sensitive task, but the Transformer attention mechanism is permutation-invariant, and the absolute position embedding injected into the model is not sufficient for time series prediction. In order to solve this problem, the present invention improves the Crossformer model, and the SD-Crossformer model adds a frequency-weighted attention mechanism, which can output a target prediction sequence affected by multi-dimensional data.

[0078] The frequency-weighted attention mechanism introduces frequency information through discrete cosine transform (DCT), and formula (4) is a functional expression of one-dimensional DCT.

[0079]

[0080] In formula (4), S α is the length of the battery sequence, It represents the frequency domain coefficient after DCT transformation, l represents the frequency index, and its value range is (0,S α -1), is the i-th data point in the original time domain signal.

[0081] The frequency-weighted attention mechanism divides the input features into n subgroups along the channel dimension, namely [H0, H1, H2…H n-1 ], then, the subgroup will be processed from the DCT frequency components corresponding to low frequency to high frequency, and each single channel will be processed by the same frequency component. Equation (5) is its calculation formula.

[0082]

[0083] Where, Freq i is the frequency vector of the ith subgroup, the result after discrete cosine transform (DCT) processing, DCT (H i ) represents the frequency component in discrete cosine transform DCT, S α is the length of the battery sequence, H i is the i-th subgroup in the input feature map, j is the index of the frequency component corresponding to H, and its value range is [0,S α -1].

[0084] Freq is obtained by solving i , stack each frequency vector to get the entire frequency vector Freq, and then learn the attention weight.

[0085] The process of attention layer across time and dimension is shown in the attached figure. Figure 2 As shown in the figure; first, the lithium battery data is segmented and embedded by dimension, and relative position encoding is added to capture the temporal relationship. The data passes through the cross-temporal attention and cross-dimensional attention modules in turn. Frequency weighting, multi-head attention and residual connection normalization are used in each stage to process the dependencies in time and dimension, and the time series data is converted to the frequency domain. The frequency domain features are combined in the attention calculation to capture the periodic patterns in the time series. Then, after rearrangement, the data is converted to the frequency domain again in the cross-dimensional stage, and the attention between dimensions is calculated in combination with the frequency domain information to identify the frequency correlation between different dimensions. Finally, the data processed by the cross-temporal and cross-dimensional attention layers is output for subsequent prediction tasks.

[0086] Each decoder layer uses the attention score to perform weighted summation on the values ​​to obtain the attention-weighted representation, and sums the current weighted feature with the prediction result of the previous decoder as the input of the next decoder layer. The formulas for calculating weights and weighted features are as shown in Equations (6) and (7).

[0087] X pos =Z+PE (6)

[0088] X weighted =X pos +Attention(X pos ,FWA(X pos )) (7)

[0089] In the above formula, Z is the input data or the predicted output of the previous attention layer, PE is the relative position encoding matrix, and X pos represents the new data representation after adding the input data to the relative position encoding, FWA(*) represents frequency weighted attention, Attention(X pos ,FWA(X pos )) represents the attention weighted score enhanced by the frequency-weighted attention mechanism, X weighted Weighted features are added to each layer; this mechanism ensures that features that contribute significantly to SOH prediction receive higher attention scores, thereby improving prediction accuracy.

[0090] This design enables the neural network to extract useful information from multiple variables, realize dynamic weight adjustment at the feature level, and enable the model to adapt to the importance of different features more flexibly, further improving the model's prediction performance and generalization ability. The model integrates and learns the information of multiple variables, and finally outputs a single value as the prediction result.

[0091] Step 3: Input the training set into the detection model constructed above, and use the grid search method to obtain the optimal model parameters;

[0092] The grid search is a method in which a system searches through multiple parameter combinations to find the best parameter combination for a model.

[0093] First, define the parameter space: determine the hyperparameters that need to be optimized and their possible value ranges. For the SD-Crossformer model, the parameters that need to be optimized in this invention are: 'num_layers' (number of layers), 'd_mode1' (model dimension), 'num_heads' (number of attention heads), 'd_ff' (dimensionality of the feedforward network), and 'learning_rate' (learning rate).

[0094] Secondly, specify the initial value and optimization range for each parameter to be optimized: the optimization range of the number of layers num_layers is [2,4,6], the optimization range of the model dimension d_mode1 is [128,256,512], the optimization range of the number of attention heads num_heads is [4,8], the optimization range of the dimension of the feedforward network d_ff is [512,1024,2048], and the optimization range of the learning rate learning_rate is [1e-4,5e-4,1e-3].

[0095] Finally, train and validate the model: for each combination in the parameter grid, use cross-validation to train the model and evaluate its performance; finally, select the parameter combination with the best performance based on the evaluation indicator.

[0096] Step 4: Input the test set into the model trained in step 3 and output the result of lithium battery health status prediction.

[0097] The contents of the prediction module in the SD-Crossformer model described in step 2 are as follows:

[0098] In order to predict the health status of lithium batteries, a fully connected output layer is added to the last Crossformer layer. For the input multivariate sequence data, each variable is used as a feature and the entire sequence is used as a sample. The weights and relationships between the features are learned through the neurons in the fully connected layer, thereby converting the multivariate sequence data into the output result of predicting SOH. The weighted feature accumulation formula is shown in formula (8).

[0099]

[0100] In formula (8), L is the number of decoder layers, X wrighted,i is the weighted output feature of the i-th layer It is the result sequence of weighted feature accumulation, that is, the prediction sequence.

[0101] While maintaining the advantages of the original Crossformer model in deep mining at different times and dimensions, the present invention improves the adaptability and prediction accuracy of the model for complex data through the noise reduction capability of SDAE. At the same time, through the improvement of the Crossformer model, the model has the ability to predict single variable data by inputting multivariate data, thereby improving the accuracy and reliability of lithium battery SOH prediction. The introduction of this model can not only solve the difficulties of existing models in dealing with noise and outliers, but also provide ideas for the future field of multivariate time series prediction.

[0102] Example 3

[0103] In order to compare and distinguish the performance differences between different models, the present invention uses three different evaluation indicators, namely, root mean square error (RMSE), mean absolute error (MAE) and relative error (RE). The calculation formulas of the three evaluation indicators are:

[0104]

[0105] In the formula, is the predicted value of SOH, is the true value of SOH. RMSE and MAE indicate the degree of fit between the true value and the predicted value. RMSE and MAE are used to quantify the size of the prediction error. Lower RMSE and MAE values ​​are generally considered to be better model performance. RE is used to evaluate the overall fit and explanatory power of the model, providing a measure of the prediction error relative to the true value. Unlike RMSE and MAE, RE is not affected by the dimension, so it is easier to compare different problems. The closer RE is to 0%, the closer the model's prediction is to the true value.

[0106] As attached Figure 3-Figure 6 As shown, the comparison results of lithium battery SOH prediction between the method of the present invention and different models (Transformer, long short-term memory network (LSTM), AE-GRU network, Autoformer network) on the same NASA data set are shown; it can be seen from the figure that the SOH prediction fitting result obtained by the method of the present invention is closest to the true value, indicating that the present invention can well predict the SOH of lithium batteries, indicating the effectiveness and practicality of the method of the present invention.

[0107] The prediction accuracy of the model is evaluated using three indicators: root mean square error (RMSE), mean absolute error (MAE), and relative error (RE).

[0108] The RMSE, MAE and RE of the B0005 battery were 0.0104, 0.0118 and 0.0206 respectively;

[0109] The RMSE, MAE and RE of the B0006 battery were 0.0218, 0.0174 and 0.0287, respectively; the RMSE, MAE and RE of the B0007 battery were 0.0189, 0.0208 and 0.0175, respectively; and the RMSE, MAE and RE of the B0018 battery were 0.0498, 0.0329 and 0.0461, respectively.

[0110] It can be further seen from the above three indicators that the error between the predicted value of the model of the present invention and the true value is extremely small, indicating that the prediction model of the present invention has good prediction ability and prediction accuracy.

Claims

1. A lithium battery health status prediction method based on SD-Crossformer, characterized in that: Follow the steps below to implement it: Step 1: Obtain a lithium battery capacity attenuation dataset, perform noise reduction on the dataset, and divide it into a training set and a test set in proportion; Step 2: Construct the SD-Crossformer model for lithium battery state prediction; The SD-Crossformer model is a Transformer-based model for time series prediction, which can effectively process noise and outliers in data. First, the input data is denoised and outliers are processed by stacked denoising autoencoders SDAE, and the output of the stacked denoising autoencoders SDAE is used as the input of the SD-Crossformer model. Secondly, in the SD-Crossformer model, the decoder layer introduces frequency information based on discrete cosine transform DCT by adding a frequency-weighted attention mechanism in the cross-time stage and the cross-dimensional stage to obtain the attention weight. The contents of the prediction module in the SD-Crossformer model are as follows: In order to predict the health status of lithium batteries, a fully connected output layer is added to the last Crossformer layer. For the input multivariate sequence data, each variable is used as a feature and the entire sequence is used as a sample. The weights and relationships between the features are learned through the neurons in the fully connected layer, thereby converting the multivariate sequence data into the output result of predicting SOH. The weighted feature accumulation formula is shown in formula (8): In formula (8), L is the number of decoder layers, X wrighted,i is the weighted output feature of the i-th layer It is the result sequence of weighted feature accumulation, i.e., the prediction sequence; Step 3: Input the training set into the SD-Crossformer model constructed above, and use the grid search method to obtain the optimal model parameters; Step 4: Input the test set into the model trained in step 3 and output the result of lithium battery health status prediction.

2. The lithium battery health status prediction method based on SD-Crossformer according to claim 1 is characterized in that: In step 1, the lithium battery capacity attenuation dataset is a NASA lithium battery aging dataset, and a stacked denoising autoencoder SDAE is used to denoise the data in the dataset; The stacked denoising autoencoder SDAE is formed by stacking multiple denoising autoencoders DAE.

3. The lithium battery health status prediction method based on SD-Crossformer according to claim 2 is characterized in that: The specific method of denoising described in step 1 is as follows: First, the NASA battery data set is normalized, and the variable X = {X1, X2, X3…X n }, the normalized transformation formula is as follows: In formula (1), X i Represents the capacity data in the data set, u i , σ i For X i The mean and standard deviation of n represents the number of capacity data, sample data X i ′ is the normalized variable value; Secondly, suppose the normalized sample data X ′ ={X1 ′ ,X2 ′ ,X3 ′ …X ′ n }, add Gaussian noise ∈ to the original data, then the output data with added noise is x ′ =X i ′ +∈; the stacked denoising autoencoder SDAE converts the noisy input data x ′ Mapped to the representation of the hidden layer: h=f encoder (x ′ ) (2) In formula (2), h is the representation of the hidden layer, f encoder (·) is the mapping function of the encoder, which includes activation function, weight, and bias; Finally, the decoder maps the hidden layer representation h back to a reconstruction of the original input data The decoder consists of multiple fully connected layers, and linearly transforms the output reconstructed by the activation function, using the reconstructed data The difference between the original data x is used as the loss function: In formula (3), m is the dimension of the sample, x i and are the i-th features of the original data and the reconstructed data, respectively. By minimizing the difference between the reconstructed data and the original data, the stacked denoising autoencoder learns an effective representation of the data and suppresses the influence of Gaussian noise during the reconstruction process.

4. The lithium battery health status prediction method based on SD-Crossformer according to claim 1, characterized in that: The data set described in step 1 is divided into a training set and a test set in a ratio of 6:

4.

5. The lithium battery health status prediction method based on SD-Crossformer according to claim 1, characterized in that: The method of introducing frequency information based on discrete cosine transform DCT to obtain attention weight is as follows: The frequency-weighted attention mechanism introduces frequency information through discrete cosine transform DCT. Formula (4) is the functional expression of one-dimensional DCT: In formula (4), S α is the length of the battery sequence, It represents the frequency domain coefficient after DCT transformation, l represents the frequency index, and its value range is (0,S α -1), is the i-th data point in the original time domain signal; The frequency-weighted attention mechanism divides the input features into n subgroups along the channel dimension, namely [H0, H1, H2…H n-1 ], then, the subgroups will be processed by the DCT frequency components corresponding to low frequency to high frequency, and each single channel will be processed by the same frequency components. Formula (5) is its calculation formula: Where, Freq i is the frequency vector of the ith subgroup, the result after discrete cosine transform DCT processing, DCT (H i ) represents the frequency component in discrete cosine transform DCT, S α is the length of the battery sequence, H i is the i-th subgroup in the input feature map, j is the index of the frequency component corresponding to H, and its value range is [0,S α -1]; Freq is obtained by solving i , stack each frequency vector to get the entire frequency vector Freq.

6. The lithium battery health status prediction method based on SD-Crossformer according to claim 5, characterized in that: In the cross-time stage of the attention mechanism layer, the time series data is converted to the frequency domain, and the frequency domain features are combined in the attention calculation to capture the periodic patterns in the time series. Then, after rearrangement, the data is converted to the frequency domain again in the cross-dimensional stage, and the attention between dimensions is calculated in combination with the frequency domain information to identify the frequency correlation between different dimensions. Each decoder layer uses the attention score to perform weighted summation on the values ​​to obtain the attention-weighted representation, and sums the current weighted feature with the prediction result of the previous decoder as the input of the next decoder layer. The formulas for calculating weights and weighted features are as follows: WITH pos =Z+PE (6) WITH weighted =Z pos +Attention(Z pos ,FWA(Z pos )) (7) In the above formula, Z is the input data or the predicted output of the previous attention layer, PE is the relative position encoding matrix, and Z pos represents the new data representation after adding the input data to the relative position encoding, FWA(*) represents frequency weighted attention, Attention(Z pos ,FWA(Z pos )) represents the attention weighted score enhanced by the frequency-weighted attention mechanism, Z weighted Weight features for each layer.

7. The lithium battery health status prediction method based on SD-Crossformer according to claim 3 is characterized in that: In step 3, a grid search method is used to obtain the optimal parameters of the model. The grid search method first defines the parameter space; secondly, a parameter grid is created to list all possible parameter combinations; next, the model is trained and validated. For each combination in the parameter grid, cross-validation is used to train the model and evaluate its performance; finally, the parameter combination with the best performance is selected based on the evaluation index.

8. The lithium battery health status prediction method based on SD-Crossformer according to claim 3 is characterized in that: Step 3 is as follows: First, define the parameter space: determine the hyperparameters that need to be optimized and their possible value ranges; for the SD-Crossformer model, the parameters that need to be optimized are: the number of layers num_layers, the model dimension d_mode1, the number of attention heads num_heads, the dimension of the feedforward network d_ff, and the learning rate learning_rate; Secondly, specify the initial value and optimization range for each parameter to be optimized: the optimization range of the number of layers num_layers is [2,4,6], the optimization range of the model dimension d_mode1 is [128,256,512], the optimization range of the number of attention heads num_heads is [4,8], the optimization range of the dimension of the feedforward network d_ff is [512,1024,2048], and the optimization range of the learning rate learning_rate is [1e-4,5e-4,1e-3].

Citation Information

Patent Citations

  • A building energy consumption prediction method based on a recurrent neural network and a multi-task learning model

    CN109685252A

  • Lithium battery health state estimation method

    CN116449218A