State-of-health prediction of lithium-ion battery based on improved gate recurrent unit

State of health (SOH) prediction of lithium-ion batteries is still a very important issue in evaluating the safety and reliability of battery-powered systems. This paper uses the lithiumion battery data in NASA Ames Research Center for research, analyzes the correlation between the relevant feature data, selects the data the most relevant to the capacity through the threshold, and uses it as the input of the neural network. We combine Particle Swarm Optimization (PSO) algorithm and Gate Recurrent Unit (GRU) to form PSO-GRU, and use the PSO-GRU method to find the time step and the number of neurons for the best prediction effect. The experimental results show that, compared with the LSTM method, the PSO-GRU method has higher prediction accuracy and has fewer weight parameters for the neural network training model.


Introduction
State of Health (SOH) research is conducive to mastering battery aging factors and providing theoretical guidance for battery use and maintenance. For battery use and maintenance, understanding the factors that affect battery aging can reduce high and low temperature, overcharge and over discharge, and other detrimental conditions such as battery usage. Knowing the current battery health status of the battery can help determine the hidden dangers and lifespan of the battery, and provide a reference for battery maintenance and replacement [1]. Therefore, in order to ensure that the battery can operate safely and reliably on the device, it is essential to accurately predict the SOH.
In this article, the SOH of a lithium-ion battery represents the percentage of the maximum available capacity of the current battery to the rated capacity, and is used to measure the degree of degradation of the battery. The SOH of the lithium-ion battery will gradually decrease with use. When the SOH is reduced to 70% of the rated capacity, the life of the lithium-ion battery is considered to be terminated. The definition of SOH is as follows: Among them: current C is the current maximum capacity of the lithium-ion battery, and initial C is the rated capacity of the lithium-ion battery.
In recent years, the research of SOH by domestic and foreign scholars has derived many different estimation methods. The battery mathematical model proposed in [2][3] can't accurately estimate the battery dynamics, resulting in considerable estimation errors. Combining mathematical and electrochemical models [4] can provide better results, but will increase complexity and require more computing resources. This type of model requires fine parameters and has a high degree of complexity. The test for aging factors is more complicated, and it is difficult to establish a perfect aging mechanism model. The physical and chemical processes of the battery itself are complex, and many laws are difficult to describe directly through mechanism research. The method of describing battery performance from the perspective of test data is called a data-driven method. [5][6] use the parameters of battery current, voltage and temperature during battery charging and discharging to establish a battery model based on Support Vector Machine (SVM), and use it to predict the remaining battery life and instantaneous resistance. But algorithms such as SVM/RVM require a lot of data for training to provide good accuracy. The current literature shows that such algorithms give very good results for short data windows, while for long data sequences, the results tend to be lower. RNN (Recurrent neural network) was introduced into the SOH estimation of lithium-ion batteries in [7]. This method is based on the model of the equivalent circuit method and uses RNN to predict the degradation of battery performance. However, the traditional RNN is easy to cause the phenomenon of gradient disappearance or gradient explosion during training. In [8], the Long short-term memory (LSTM) algorithm is used to predict the RUL and SOH of the battery. It solves the problem of traditional RNN that easily cause gradients to disappear or explode.
Gated Recurrent Unit (GRU) is a simplified long and short memory deep learning algorithm. It receives attention because it solves the vanishing gradient problem, but has fewer parameters, which leads to more efficient network training and prediction relative to the required time. Even with fewer parameters, the estimation accuracy of the GRU network remains within a good range. In this paper, GRU is introduced into the lithium-ion battery SOH prediction and the particle swarm Optimization (PSO) is introduced to update the algorithm input to optimize the neural network structure and input parameters. The results show that compared with the LSTM and GRU methods. The model designed by PSO-GRU has higher accuracy for SOH prediction and uses fewer parameters than LSTM.

GRU theory
LSTM uses the input gate, output gate and forget gate structure to solve the problem of gradient explosion and gradient disappearance in RNN [9]. The GRU has been improved on the basis of LSTM, which can also solve the two problems of gradient disappearance and gradient explosion, simplify the network structure, and facilitate calculations. The GRU structure is shown in the figure below. GRU has a reset gate and an update gate. The main calculation expression of its gate control structure is: In the above formula, tanh is the hyperbolic tangent function,  is the sigmoid function, t x is the input data at the current moment,

Particle swarm algorithm
Particle Swarm Optimization (PSO) is a group-based stochastic optimization technique developed by [10]. PSO finds the global optimal solution by simulating the predation behaviour of fish/birds. In the particle swarm algorithm, each candidate solution can be regarded as a particle in the solution space. The specific process is as follows: Suppose that in a D-dimensional target search space, m particles form a community, and the i-th particle is represented as a D-dimensional vector Among them, the position of the i-th particle in the D-dimensional search space is i x  , and will be substituted into the fitness function, and the pros and cons of the solution will be judged according to the calculated size. The PSO formulas proposed in [10] are as follows: Among them: In the formulas, thresholds set by the user. The iteration stop condition is that the value of the fitness function meets the requirement or meets the maximum number of iterations.

The overall structure of PSO-GRU
The structure of the PSO-GRU model is as follows: CISAT  Figure 2 The structure of the PSO-GRU model. The model in the figure above consists of an input layer, a GRU layer, and a dense layer. The dense layer is a regular neural network layer that connects neurons. The dense layer collects all the outputs from the last GRU layer and outputs a value as the predicted value. x t indicates the input battery capacity, the specific number is determined by time_step. time_step indicates the number of data in B0005 used for prediction.  This article uses the B0005 lithium-ion battery in the NASA data set for research. In each cycle, we calculate the measured voltage, measured current, temperature, charger current, and the average measured value of the charger voltage of the charging type in each cycle of the CC stage, and take the cut-off time of the CC stage as the charging time. And we calculate the average measured value of the measured voltage, measured current, temperature, charger current, and charger voltage discharged with constant current time. The discharge time takes the time until the voltage reaches 2.7v. According to the above data, the Spearman correlation coefficients with the original capacity data are obtained, and the results are shown in Table 2.

Correlation analysis
Because there is no capacity data in the charging data, the correlation coefficient is null in type charge. Filter out the most relevant features with Correlation greater than 0.9, and set the threshold: , we calculated _ spearman Threshold =0.9667, so we choose Time and Capacity in discharge data as the data features for model training.

Test
Using 50% of the B0005 data in the NASA data set, the final model architecture parameter obtained by PSO-GRU training is that: the number of units in GRU layer is 110, the value Time_step is 14, the train epochs are 2000. Basic requirement for the test: The number of GRU neuron units in the PSO-GRU model is set to 110, and the time_step is set to 14; The number of neurons in the GRU and LSTM model is set to 100, and the time_step is set to 12. The number of parameters used by PSO-GRU and LSTM are 37731 and 41301 respectively.
This model structure was used in NASA data set B0006, B0007, B0018 for testing. The test results are shown figure 3. Using PSO-GRU, GRU, LSTM to train models by using the first 50% of the data in B0005. Then using the models to predict the battery packs B0006, B0007, and B0018. The RMSE results are shown in Table 3.
Using 50% of the data of battery B0005 to train PSO-GRU, GRU, LSTM models, and then use these models on different batteries to predict SOH and calculate their RMSE. The prediction results are shown in Figure 3 and Table 3. It can be seen from the Table4 that the error of the PSO-GRU method is smaller than that of GRU and LSTM. From the analysis of the SOH prediction results in Figure 3, it shows that PSO-GRU has good generalization ability. The prediction is closer to the true curve before and after the prediction, and the difference error between the true value and the predicted value of PSO-GRU is reduced to a certain extent compared with the other two methods. And the prediction result of PSO-GRU is closer to the real SOH. However, due to the electrochemical reaction inside the lithium-ion battery, during the process of capacity decay, there will be partial regeneration of the capacity. This phenomenon leads to multiple sharp fluctuation points in the curve, which affects the accuracy of capacity prediction. In addition, the difference between the predicted point and the real SOH is small.    0.00491 0.00590 0.00697 Using the same model structure as above. PSO-GRU, GRU, LSTM are used to train the top 30%, 50%, and 70% of the B0005. The experimental results are shown in Table 4. It can be seen from the table that for the amount of data used for training, the larger the training ratio, the more the prediction result on the test set tends to be the true value. For the 30% of the data before the battery is used, due to the small amount of training data, the error for the later prediction results is large and even deviates from the true value. PSO-GRU has found the most suitable set of parameters, which greatly reduces the degree of deviation, and can better track the true attenuation curve of the lithium-ion battery.