Performance comparison of lithium polymer battery SOC estimation using GWO-BiLSTM and cutting-edge deep learning methods

In this study, the GWO-BiLSTM method has been proposed by successfully estimating the SOC with the BiLSTM deep learning method using the hyper-parameter values determined by the GWO method of the lithium polymer battery. EV, HEV, and robots are used more healthily with successful, reliable, and fast SOC estimation, which has an important place in the Battery Management System. In studies using deep learning methods, it is important to solve the problems of underfitting, overfitting, and estimation error by determining the hyper-parameters appropriately. Thus, this study aims to solve an important problem by investigating the problem of determining the hyperparameter values for the deep learning method with metaheuristic optimization methods. This study was designed to compare the prediction success of the BiLSTM method trained with the optimal hyperparameter values obtained by the GWO method with cutting-edge deep learning methods trained with hyperparameter values obtained by trial and error. The success of the proposed method was verified by comparing the cutting-edge data-based deep learning methods and the BiLSTM method with the SOC estimation MAE, MSE, RMSE, and Runtime(s) metrics. According to the findings obtained during the hyperparameter determination studies, it takes longer time to determine the hyperparameters by trial and error than to determine the hyperparameters by metaheuristic optimization method when estimating lithium battery SOC with the deep learning method. Also, the GWO-BiLSTM method was the most successful method with an RMSE of 0.09244% and an R2 of 0.9987 values according to the average results of SOC estimation made with the lithium polymer battery data set, which was created by experiments performed at different discharge levels and is new in the literature.


Introduction
While it is thought that the CO 2 emissions caused by light commercial vehicles will be reduced by approximately 30% by the use of EVs and HEVs by 2050, it is concluded that the use of electrical energy is very important [1]. The storage of electrical energy with lithium-based batteries in EVs, HEVs, and robots has increased the use of batteries and the research on these batteries. With the sales of lithium-based batteries increasing approximately eight times from 2010 to 2018 and reaching 160 GWh, it is concluded that there will be demand for these batteries in the coming years, and work on these batteries will continue as they are used in many areas [2]. Lithium-based batteries need an appropriate BMS to ensure reliable, efficient, and full potential use. The task of the BMS is to ensure that the battery, which supplies the energy needs of a system, operates safely within the appropriate operating limits determined by the manufacturer [3]. SOC estimation in BMS structure is among the most important parameters that should be known reliably [4,5]. Model-based, data-based, etc. can be used to estimate the SOC of batteries. SOC estimation of batteries is made with many methods such as deep learning, neural networks, and machine learning methods, which are among the data-based methods [6]. It is very critical when making SOC estimation because of the advantages that deep learning can be applied to nonlinear systems, it can be easily modeled with current, voltage, and temperature, and it is an advanced neural network [7,8]. In this way, it will be possible to use the saved processing capacity to predict the information of other important situations instead of taking up space in the processor memory with the intensive mathematical modeling operations of the BMS. One of the biggest problems when making SOC estimation with deep learning is that hyper-parameters such as batch size, learning rate, and units cannot be determined properly [9,10]. It is a very important problem that when determining hyper-parameters, the need for knowledge consists of experience gained through long-lasting deep learning training. In addition, with appropriate parameter selection, hyper-parameter selection makes a great contribution to the successful determination of metrics such as runtime, accuracy, and estimation error used in deep learning methods [11].
To overcome the problem of determining hyper-parameters, experience gained after experiments traditionally involving long-term deep learning training is utilized. When estimating the SOC of the lithium polymer battery with deep learning methods, it is an important problem that problems such as errors, overfitting, and underfitting [12] occur in the estimation due to the inability to determine the hyper-parameters appropriately. Furthermore, the time spent determining the hyper-parameters through trial and error is an additional problem.
This problem will be solved with the determination of hyper-parameters by the optimization methods while estimating the lithium polymer battery SOC with deep learning methods. Using optimization methods such as meta-heuristic methods to determine the hyper-parameter values of deep learning techniques speeds up the decision process and solves this problem. Furthermore, it quickly overcomes problems like overfitting and underfitting, allowing for the efficient and effective use of deep learning. As a result, the SOC was estimated in this study by applying the hyper-parameters determined by the GWO method to the lithium polymer data set. The following items represent the study's contributions to the literature: The lithium polymer battery was successfully used with the GWO optimization method in the determination of hyperparameters while using the deep learning method for SOC estimation in this study. Furthermore, future research with cutting-edge deep learning methods in the SOC estimation of lithium polymer batteries is provided by demonstrating the runtime and estimation successes of these models. Through GWO optimization and trial-and-error, knowledge has been gained about which method will be more successful and which will speed up the process of selecting hyperparameters.

Related work
The use of data-based methods in the estimation of lithiumbased battery parameters such as SOC and SOH reduces the mathematical battery modeling workload. Convolutional networks use in the CNN method to extract complex features from parameters such as temperature, current, and voltage [13]. Among the networks used in battery SOC estimation are Conv2D and Conv1D in addition [14]. Although models such as ResNet and VGG from convolutional-based networks have proven their success on image datasets, they are also used in studies such as regression estimation [15]. However, due to runtime and data size parameters, in deep learning and SOC estimation use different methods. As a result, data-driven methods for estimating battery SOC are available, including RNN, CNN, LSTM, GRU, and their advanced methods [16]. In the RNN method, recurrent networks emerged to solve a memory problem by transferring the learned output to other information. However, with the emergence of the vanishing gradient problem over time, methods such as LSTM and GRU have been developed. The LSTM method aims to reveal a long-term memory by solving the vanishing gradient problem and transferring the learning state to other cells [17]. However, due to the heavy mathematical processing load of the LSTM method, the GRU method has emerged as a simpler method. The GRU method is one of the most used methods in battery SOC estimation as it consists of fewer gates and performs faster processing [18]. Additionally, the BiLSTM method, which is used in studies to estimate battery SOC, is based on the LSTM method and transfers information in both directions [19]. However, determining hyper-parameters is one of the most difficult challenges when using deep learning models to estimate battery SOC. Setting parameters in other data-based or model-based models used in battery SOC estimation is also a significant issue. As a result, optimization or trial and error methods are used to determine these parameters. In Table 1, recent studies using optimization methods in battery SOC estimation are presented from the literature. Table 1 shows that battery state estimation studies using optimization in the literature have been investigated. PSO and improved PSO variants have been identified as the most commonly used optimization methods. Furthermore, it has been found that using optimization with model-based and databased methods effectively solves problems in determining SOH, SOC, and capacity estimates of batteries. The GWO method was chosen for this study because it is a popular optimization method for solving problems in everyday life, and there aren't enough studies with data-based methods for estimating battery SOC. According to the literature review, it has been seen that the GWO method provides competitive results with PSO and many other known optimization methods [37]. However, it has been observed that this method is not used enough to determine the appropriate parameter of data-based methods in the SOC estimation of lithium polymer batteries. For this reason, the GWO-BiLSTM method has been used as a method to improve forecasting success and runtime performance in the existing literature.

Material and methods
Deep learning experiments were conducted in this study using a computer running the Ubuntu operating system, the Python programming language, and appropriate libraries [38].

Lithium polymer battery dataset
Lithium-polymer batteries, which are part of the lithium-ion battery stack, are the most popular because they provide high voltage, but thermal stability issues must be addressed [39]. By estimating the parameters of the batteries such as SOC and SOH, such stability problems are minimized, and healthier use of energy is ensured. However, the methods used in battery SOC calculations are equivalent circuit model, Coulomb counting, Neural Network, Kalman filter, etc. methods. In Fig. 1, a lithium-polymer battery equivalent circuit model is given.
The state-space equation of the model is given in Eqs. 1 and 2 [40]. In Table 2, the battery properties used in the experiments in which the data set used in this study was obtained are given. This study was carried out using the dataset created in the study in Reference [41].
The Coulomb counting method was used in this study to calculate lithium-polymer battery capacity and SOC value, which were then used to train deep learning networks. The .5 gr ± 0.5 g coulomb counting method is given in Eq. 3 [42].
From Eq. 3, η denotes efficiency, Q n capacitance, and I t current. The coulomb counting method, in which the initial SOC state is determined as an estimation, determines the charge state of the battery by summing it over time depending on the capacity and current. The advantage of this method is that it does not involve heavy calculations [43]. In this study, Fig. 2 BiLSTM cell structure the SOC status of the lithium polymer battery was first determined by the coulomb counting method. Then, using deep learning methods, training was made with current, voltage, temperature, and SOC status information, and the SOC status was estimated with current, voltage, and temperature data for the tests.

BiLSTM
LSTM is a member of the RNN set. RNN, which is famous for transferring previous weights to new inputs, has developed advanced models such as LSTM and GRU over time [44]. BiLSTM, on the other hand, obtains the information flow bidirectionally by the bidirectional shifting of the LSTM network. BiLSTM is a deep learning method that produces solutions to problems such as natural language processing and time series problems. The mathematical expression of the BiLSTM method is given in Eqs. 4, 5, and 6. In these equations, h f t is forward hidden layer, h b t is backward hidden layer and y t is output. In addition, x stands for input, h for hidden layer and b for bias. [45,46]. Figure 2 shows the structure of the BiLSTM method's internal structure. The figure represents the bi-directional progression of the LSTM structure in the BiLSTM network.
The hyperparameter values obtained by the GWO algorithm and the model used in this study are given in Fig. 3. Figure 4 shows the steps of this study. The first stage of the study starts with the acquisition of the dataset, and the last stage ends with the acquisition of the hyperparameter values of the BiLSTM deep learning method by the GWO method. For this reason, Fig. 4 consists of four separate stages. It

Grey wolf optimizer
Grey wolves are animals that are considered predators of the population with alpha, beta, delta, and omega social hierarchy. In the GWO algorithm, the best solution is alpha, beta, and delta, respectively, followed by omega. While alpha, beta, and delta form the search community of the herd during hunting, omega follows this team. Omega consists of the oldest wolves of the wolf pack. While the alpha is the wolf leading the pack, the beta is the best candidate to lead the pack [47]. Grey wolf hierarchy is given in Fig. 5.
In the case of hunting, the position of the top three classes in the wolf pack hierarchy is looked at. The positions of wolves while hunting are given in Eqs. 7 and 8. The positions of the wolves are updated according to these equations.
In the above equation, t represents the number of iterations, A and C coefficient vectors, X p is the position of the prey, and X is the position of the wolf. In Eqs. 9 and 10,

− →
In the above expressions, a is the linear decreasing value, and r 1 and r 2 are random values between 0 and 1. In Fig. 6, the principle of the positions of the wolf pack during the hunt is given.
Distance equations are given in Eqs. 11, 12 and 13, indicating the difference between the current individual and the position of individuals in the individual hierarchical order. While − → X a , − → X β , − → X δ expressions indicate the positions ofa, β, δ individuals, the C factor represents the randomly generated vector and X represents the position of the current individual.

Results
In this study, the performances of current methods used in the literature for SOC estimation of lithium batteries were compared. Since the robots require different currents at the time of operation, SOC estimation was made using the data set created by conducting experiments according to this situation. By using the GWO meta-heuristic method, the hyper-parameter values of the BiLSTM deep learning method were obtained and used for comparison. The hyperparameter values of the other methods were obtained by trial and error as a result of long experiments. The search parameters for GWO are given in Table 3.
These parameter values and the values obtained as a result of trial and error were applied to other deep learning methods.  The hyperparameter differences of GWO-BiLSTM and BiL-STM structures were found by the GWO algorithm, while the hyperparameters of one method were obtained by trial and error. The parameter values and limits are given in Table 4 when searching for BiLSTM hyper-parameters of the GWO method.
In the experiments, the parameter values obtained with GWO were specified with the GWO-BiLSTM model, and the models were compared. Also, it is intended to make the comparison appropriate by determining all other model parameter values to be approximately the same. Consequently, the best results for all C values were obtained with the GWO-BiLSTM method. Deep learning training was conducted with the lithium polymer battery data set, and the results are given in Table 5. According to Table 5, for the 2C discharge level, the most unsuccessful method was the GRU-RNN method, which has a 4.68% estimation error value of RMSE. For the 4C discharge level, the most unsuccessful methods were the DeepRNN and DeepGRU methods. At the 5C discharge level, the DeepRNN method was the most unsuccessful, with an RMSE error value of 6.8%. The GRU-RNN method has an RMSE error value of 3.3% in deep learning training at the same discharge level. The DeepGRU method, which is one of the deep learning methods trained with the data obtained as a result of the experiments performed at the 6C discharge level, was the most unsuccessful method with an RMSE estimation error value of 4.83%. Among the FCN and CNN methods at the same discharge level, the most unsuccessful method was the FCN method with a 2.35% RMSE estimation error value. For the 10C discharge level, the DeepGRU method was the most unsuccessful, with an RMSE estimation error value of 7.16%. At 15C and 20C discharge levels, the most unsuccessful method was the DeepRNN method. The most successful result was the GWO-BiLSTM method in the experiments performed at all discharge levels.  Bold numbers show the most successful model The average results of the SOC estimation for all discharge rates are given in Table 6. According to the R2 metric in average results, the GWO-BiLSTM method reached the most successful result of 0.998. According to Table 6, the most unsuccessful method was the DeepRNN method with an RMSE error value of 5.75%. In Convolution-based methods, the CNN method made more successful predictions than the FCN method. The GRU-RNN method reached 0.9873 R2_scrore and made a better prediction than the DeepRNN and Deep GRU methods. BiLSTM method obtained a 1.44% RMSE estimation error value. However, the GWO-BiLSTM method reached an RMSE error value of 0.92%. A 0.52% RMSE estimation error rate difference was found between these two methods. Figures 7,8,and 9 show estimation comparisons and prediction error results from deep learning training. In Fig. 7, the SOC estimation values made by the BiLSTM, GWO-BiLSTM, CNN, FCN, DeepGRU, DeepRNN, and GRU-RNN methods and the actual SOC value of the test data are compared. In Fig. 8, the difference is shown by presenting a zoomed-in representation of the estimation results consisting of many points. In Fig. 9, MSE and MAE show the estimation error metric values of seven methods during deep learning training. As can be seen from Fig. 9, GWO-BiLSTM has the fastest rate and the lowest level of estimation error rate. In Fig. 7, the data evaluated as test data are among the data obtained as a result of the experiments performed with the constant current/constant voltage method, and the estimates made are given. The data set is split into 67% training and 33% test data. It is seen that the charge curve reaches its highest point later, while the discharge curve reaches its highest point earlier.
In Fig. 8, the SOC predictions made by cutting-edge deep learning methods and the actual SOC prediction values are compared by presenting a zoomed graphic. According to the average results, the convolution-based CNN network RMSE made a 1.97% prediction error, while the FCN method RMSE made a 2.81% prediction error. Among the RNNbased methods, DeepGRU and DeepRNN achieved 0.97 and 0.95 prediction successes, respectively, according to the R2 metric.
In Fig. 9, the error metric values that occur during the SOC estimation of cutting-edge deep learning methods are given. The differences between the methods according to the MAE and MSE metrics of prediction errors during deep learning trainings are shown. The GWO-BiLSTM method has the lowest error value, with an error value of 0.76% in the MAE estimation error. The BiLSTM method, on the other hand, has an error value of 1.24% in MAE estimation error. The CNN method, on the other hand, made 0.61% less error in the value of the MAE compared to the FCN method. Among the DeepGRU, DeepRNN, and GRU-RNN methods, the GRU-RNN method made the least estimation error with an error value of 2.46% in the MAE value.

Conclusion
In this study, SOC estimation made by the GWO-BiLSTM method using a lithium polymer battery data set obtained by experiments with different discharge levels is proposed. This study contributes to knowledge by proposing a metaheuristic optimization method for the determination of hyperparameters, which is one of the biggest problems encountered when  Intuition is very important when estimating the SOC of lithium batteries for electric vehicles and robots with deep learning. For this reason, it is very important to propose the GWO metaheuristic optimization method for the policy of how to determine the hyperparameters when estimating lithium battery SOC with deep learning. The success seen in the experimental studies with this study for solving this problem in daily life will be an important intuition for future studies for the readers. Moreover, with the result of this study, the hyperparameters of deep learning methods can be determined by metaheuristics optimization methods, which leads to new research.
Panasonic NCR18650B and Samsung ICR18650-26F lithium-ion battery data are used in Reference [49]. The values of trees and leaves were determined by the DSA method to make the SOC estimation correctly with the RFR machine learning method. Two battery datasets were used in the study in Reference [19]. The first dataset is the 18,650-20R, and the second is the 18,650 NCA dataset. The hyperparameter values of the BiLSTM method were obtained by Bayes optimization using datasets created by experiments at different temperature values. The results of this study, Reference [49] and [19] are given in Table 7. According to Table 7, it is seen that the results of this study and the results of SOC estimation studies of the battery with deep learning or machine learning methods, in which hyperparameters are determined using optimization methods, are similar.
According to the results obtained from this study, newly developed optimization methods can be used when determining the hyperparameter values of deep learning methods.
Among these methods, optimization methods such as swarm intelligence and bio-inspired can be applied to deep learning methods by determining hyperparameters. The authors aim to compare success in SOC estimation by applying different optimization methods to the data sets obtained by applying different driving methods in future studies.
Author contributions GT: wrote the main manuscript text. CB, and AU: Project administration and supervision. GT: visualization and investigation, conceptualization. All authors reviewed the manuscript.
Data availability Graphics and tables are shared in this article. The dataset obtained from another study cited in this article was used.