
==== Front
Heliyon
Heliyon
Heliyon
2405-8440
Elsevier

S2405-8440(24)12263-3
10.1016/j.heliyon.2024.e36232
e36232
Research Article
Research on precise lithium battery state of charge estimation method based on CALSE-LSTM model and pelican algorithm
Ding Zujun
Hu Daiming
Jing Yang
Ma Mengyu
Xie Yingqi
Yin Qingyuan
Zeng Xiaoyu
Zhang Chu
Peng Tian
Ji Jie jijie@hyit.edu.cn
⁎
Huaiyin Institute of Technology, Huaiyin, Jiangsu, 223002, China
⁎ Corresponding author. jijie@hyit.edu.cn
16 8 2024
30 8 2024
16 8 2024
10 16 e362321 4 2024
10 8 2024
12 8 2024
© 2024 The Authors. Published by Elsevier Ltd.
2024

https://creativecommons.org/licenses/by-nc/4.0/ This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
This paper presents an innovative fusion model called “CALSE-LSTM,” which integrates Convolutional Neural Networks (CNNs), Long Short-Term Memory Networks (LSTMs), self-attention mechanisms, and squeeze-and-excitation attention mechanisms to optimize the estimation accuracy of the State of Charge (SoC). The model incorporates battery historical data as input and employs a dual-attention mechanism based on CNN-LSTM to extract diverse features from the input data, thereby enhancing the model's ability to learn hidden information. To further improve model performance, we fine-tune the model parameters using the Pelican algorithm. Experiments conducted under Urban Dynamometer Driving Schedule (UDDS) conditions show that the CALSE-LSTM model achieves a Root Mean Squared Error (RMSE) of only 1.73 % in lithium battery SoC estimation, significantly better than GRU, LSTM, and CNN-LSTM models, reducing errors by 31.9 %, 31.3 %, and 15 %, respectively. Ablation experiments further confirm the effectiveness of the dual-attention mechanism and its potential to improve SoC estimation performance. Additionally, we validate the learning efficiency of CALSE-LSTM by comparing model training time with the number of iterations. Finally, in the comparative experiment with the Kalman filtering method, the model in this paper significantly improved its performance by incorporating power consumption as an additional feature input. This further verifies the accuracy of CALSE-LSTM in estimating the State of Charge (SoC) of lithium batteries.

Keywords

Battery state of charge
Convolutional neural network
Long short-term memory
Attention Mechanism、Pelican algorithm
==== Body
pmc1 Introduction

The state of charge (SoC) of lithium batteries is a key indicator that reflects their remaining capacity during a charge and discharge cycle. Inaccurate SoC assessment not only affects the capacity and service life of the battery [1], but also may cause safety issues such as short circuit or thermal runaway in extreme cases [2]. As the interior of lithium batteries is a complex nonlinear time-varying electrochemical system, accurate SoC assessment mainly depends on current, voltage, and other measurable parameters. Therefore, improving the accuracy of SoC assessment has been a research focus in the field of battery state monitoring. Currently, researchers have explored various SoC assessment algorithms, which can be roughly divided into direct methods, model methods, and data-driven methods. Direct methods mainly include ampere-hour integration and open-circuit voltage methods.

The ampere-hour integration method estimates SoC by monitoring the change in current over time [3], but its accuracy depends heavily on the selection of the initial value, and it is sensitive to sensor measurement errors, which can easily lead to cumulative errors that affect the accuracy of SoC estimation. In practical applications, current sensors are always affected by various factors (such as measurement noise), which inevitably leads to errors in current measurement. These errors gradually accumulate during the integration process, causing the estimated SoC value to gradually deviate from its true value.

The open-circuit voltage method utilizes the correspondence between the open-circuit voltage and the SoC of a battery after it has been left to stand for a period of time to estimate the SoC of the battery [4]. However, this method presents several challenges in practical applications. Firstly, the measurement of open-circuit voltage is susceptible to external factors such as temperature and error, requiring high-precision measurement equipment and methods to ensure accuracy. Secondly, the relationship between open-circuit voltage and SoC is non-linear, and the estimation of SoC is also affected by factors such as battery aging and charge/discharge rate. In particular, under the working state of the battery, the voltage will change due to factors such as current and internal resistance, which can lead to increased measurement error in the open-circuit voltage method and make it difficult to meet the requirements for real-time accurate evaluation [5], limiting its practicality and accuracy.

The above-mentioned SoC estimation method is also known as the “traditional method”, which is susceptible to external factors and leads to low estimation accuracy, so it is only used for battery research in laboratory settings. In order to solve the accuracy problem, scholars at home and abroad have conducted a lot of research and proposed model-based estimation methods [6], in which electrochemical models have the ability to accurately and precisely describe the complex internal electrochemical reactions during battery charging and discharging, and accurately reflect the electrochemical changes in the battery during charging and discharging [7]. However, due to the highly complex dynamic changes of the internal electrochemical reactions in batteries, this leads to the high complexity of electrochemical models [8], which is not suitable for practical applications. In order to solve the problem of practical application, researchers have proposed an estimation method based on equivalent circuit models. By modeling the dynamic characteristics of power batteries using circuits composed of different circuit elements such as voltage sources, resistors, and capacitors [9]. Common equivalent circuit models include Rint model [10,11], Thevenin model [[12], [13], [14]], PNGV model [15,16], etc., which are currently the most widely used battery models.

However, the battery SoC estimation based on the equivalent circuit model ultimately depends on the OCV-SoC curve, which makes it impossible to accurately estimate the SoC value under specific working conditions [17]. Subsequently, model-based methods combine the Ampere-hour integral method and OCV method with sophisticated filtering techniques such as Kalman filtering and variants of particle filtering. In literature [18], a battery SoC estimation based on Kalman filter is proposed, using a second-order RC equivalent circuit model of the battery. The model parameters are identified through charging and discharging tests on the battery. In literature [19], a new fractional interpolation quadrature Kalman filter based on interpolation and quadrature rules is proposed, and a robust new fractional interpolation quadrature Kalman filter is formed by combining it with an uncertainty estimator, and a switching mechanism is established. The simulation results show that this model is superior to existing filters with the same degree of freedom when it has appropriate free parameters.In literature [20],An optimized long short-term memory-weighted fading extended Kalman filtering model with wide temperature adaptation for the state of charge estimation of lithium batteries, which inputs classified battery data into the LSTM model to estimate SoC, and then optimizes it using the weighted fading extended Kalman filter (WFEKF) method. The experimental results show the high adaptability of the model over a wide temperature range. In the literature [21], an Accurate capacity and remaining useful life estimation of lithium batteries based on improved particle swarm optimization and particle filter. This method combines improved particle swarm optimization (IPSO) and particle filter (PF) algorithms to achieve the estimation of lithium battery capacity and remaining life.

In recent years, thanks to the technological breakthroughs in graphics processing units (GPUs) and the continuous improvement of machine learning frameworks, as well as the significant increase in computing power, the research community has developed a strong interest in deep learning methods based on neural networks.The neural network method directly maps the relationship between battery parameters and battery SoC by extracting battery parameters [22]. so some researchers have proposed a hybrid-aided approach with adaptive state update for estimating the state-of-charge of LiFePO4 batteries considering temperature uncertainties is proposed [23]. This method combines random weights, variational methods, and LSTM to form a multi-layer LSTM to process battery input data, and then automatically filters noise through the AWEKF method to achieve SoC estimation. Similarly, in the literature [24], An enhanced lithium battery state-of-charge estimation method using long short-term memory with an adaptive state update filter incorporating battery parameters. This method inputs identification data into an LSTM neural network through an adaptive multi-timescale identification strategy (AMIS) and frequency feature decomposition based on a dual-polarized EECM, and uses transfer learning (TL) mechanism and Monte-Carlo (MC) to improve model accuracy and versatility. In literature [25], A novel model is proposed, which combines improved particle swarm optimization (IPSO) and long short-term memory network (LSTM). A specific initialization strategy is used to address the problem of premature convergence of the algorithm, and model analysis is conducted using three different operating conditions. Experiments show that the model has good accuracy and robustness. In literature [26], a joint estimation method using LSTM and multiple linear regression algorithms is proposed, and a flexible multi-step forward strategy is adopted. Experimental verification shows that the method has good stability, flexibility, and robustness. In literature [27], an innovative CNN-LSTM-based lithium SoC estimation method is proposed. By jointly obtaining the multivariate characteristics of the battery dataset through a network, the results show that it is superior to single network estimation results. Furthermore, the literature [28] proposes a cross-condition lithium battery SoC estimation based on the CNN-BILSTM deep learning model, which is tested in the Federal Urban Driving Schedule (FUDS) and Dynamic Stress Test (DST). The results show that the model also exhibits good estimative performance and strong generalization ability across different conditions.

Based on the above analysis, this paper introduces the attention mechanism on the basis of the CNN-LSTM model, and proposes a battery SoC estimation method based on CALSE-LSTM. Unlike the general introduction of the attention mechanism, this paper introduces a dual attention mechanism (self attention mechanism and Squeeze-and-Excitation attention), which further improves the estimation accuracy. The main contributions of this work can be summarized as follows.1. Based on the CNN-LSTM model, introduce the dual attention mechanism.

2. Aiming at the problem of difficult parameter tuning in traditional neural network models, the Pelican algorithm is adopted to improve the training stability of the model.

3. Prove the effectiveness of self attention mechanism and Squeeze-and-Excitation attention through ablation experiments.

4. Verify the learning efficiency of the model through a comprehensive comparison of training time and accuracy.

5. By conducting comparative experiments with Kalman filter-based algorithms, the performance of the model presented in this paper is further evaluated.

The structure of this article is outlined as follows. Section 1 introduces the theoretical basis of related algorithms. Section 2 describes the estimation framework and algorithm tuning based on the CALSE-LSTM method. Section 3 validates the performance of the proposed method through comparative experiments and ablation experiments. Section 4 presents the conclusion.

2 The principle of CALSE-LSTM

2.1 Convolutional neural Network(CNN)

CNN, a deep neural network characterized by its distinct convolutional structure, conducts advanced analysis and feature extraction on inputted data through a combination of convolutional and pooling layers. Its versatility has led to its widespread application in areas such as speech recognition, facial recognition, natural language processing, and beyond [29]. The weight sharing mechanism of CNN effectively reduces model complexity and reduces modeling parameters, thereby improving the efficiency of feature extraction. In this paper, when processing normalized data, we use 1D-CNN to extract features from battery data. The convolutional layer is responsible for accurately capturing data features. The calculation formula is shown as follows:(1) cit=∑i=0nωi,jt*xit+bit

Where, ωi,jt is the convolution kernel, xit is the input, bit is the threshold, and cit is the output feature.

The pooling layer then compresses these features efficiently, simplifying the computational process while preserving core information, as shown in the formula:(2) μit=polling(cit)

Wherein, polling is the pooling operation and μit is the simplified output.

These two layers work together to form a powerful feature extractor, which can both deeply explore the inherent value of input data and effectively remove redundant information.

2.2 Squeeze-and-excitation attention mechanism

The Squeeze-and-Excitation attention mechanism is a technique for determining weights in the channel attention mode. It achieves the goal of prioritizing important channels by assigning different weights to different channels [30]. As shown in Fig. 1, it is a schematic diagram of the Squeeze-and-Excitation attention mechanism.Fig. 1 Squeeze-and-Excitation attention Mechanism Principle.

Fig. 1

The structure is mainly divided into three operations: Squeeze operation, Excitation operation, and Scale operation. The Squeeze operation converts the feature map from a size of (N, C, H, W) to (N, C, 1, 1) through global average pooling, which achieves the fusion of global context information. Then the Excitation operation is performed, using two fully connected layers. The first fully connected layer compresses the feature dimensions after the Squeeze operation in the channel dimension to reduce the computation load. Then it passes through a ReLU layer to maintain the stability of the feature dimensions; the second fully connected layer restores the feature dimensions to the state after the Squeeze operation and uses a Sigmoid activation function to limit the weight value between 0 and 1. The complexity of the model is increased through the nonlinear relationship between these two layers, thus determining the weights between different channels. The final Scale operation multiplies the reshaped weight values with the original feature map channel by channel, that is, multiplying the weight of each channel with the corresponding two-dimensional matrix. Therefore, each channel of the original feature map will receive a different weighted representation, generating a feature map with different weights.

This article combines CNN and Squeeze-and-Excitation attention mechanisms to enhance the model's sensitivity to key features while reducing the interference of irrelevant features, thereby significantly improving the model's performance. However, this combination inevitably brings about a certain computational burden. In order to maintain computational efficiency while improving performance, this article performs dimensionality reduction on the first fully connected layer in the SE module, setting the output dimension of this layer to 1/4 of the input dimension. This measure effectively reduces the number of parameters and computational complexity of the model, achieving a balance between performance and efficiency.

2.3 Self-attention mechanism

Self-attention mechanism, as a variant of attention mechanism, has shown its unique advantages in many fields such as natural language processing and image processing. It determines the degree of attention to other elements when processing the current element by evaluating the correlation between each element in the input sequence and other elements. This mechanism enables the model to adaptively learn and focus on key information in the input data, thereby improving the model's performance and generalization ability [31].

This article introduces the self-attention mechanism, which aims to compensate for the information loss that may be caused by CNN and Squeeze-and-Excitation attention mechanisms when processing input information. By expanding the self-attention mechanism, the model can process input data in parallel, using another feature extraction method to effectively focus the model's attention and reduce information loss. This integration of multiple strategies not only improves the efficiency and accuracy of task processing, but also enables the model to better adapt to complex and dynamic environments. By reasonably screening and filtering information, the model can make decisions quickly and accurately, thereby further improving its overall performance. This optimization strategy injects stronger flexibility and adaptability into the model, enabling it to better cope with complex and dynamic environments.

2.4 Long short-term memory network (LSTM)

The LSTM neural network, a modified version of the RNN, effectively addresses the gradient explosion and vanishing gradient issues encountered by RNNs when handling lengthy sequences [32]. This is achieved through a specialized information storage component. As depicted in Fig. 2, the memory structure of LSTM is displayed. The heart of LSTM lies in its “three-gate architecture” comprising an input gate, a forget gate, and an output gate. This configuration allows for the selective retention and disposal of information. The input gate is responsible for extracting effective information from the current input time of the network and adding these new information to the storage unit. The forget gate determines to discard invalid parts from historical information. The output gate selectively maps past information and current input to output, and at the same time serves as an input to the information storage unit for the next moment. These three gates cooperate with each other to perform weighted learning on historical input, current input, and historical output to update unit information, so that key information from the past and present can be accurately transmitted, ensuring that the network has the ability to learn long-term sequences [33]. The specific calculation of LSTM unit is shown in Equation -:(3) ft=δ(Wf*[ht−1,xt]+bf)

(4) it=δ(Wi*[ht−1,xt]+bi)

(5) Ct˜=tanh(Wc*[ht−1,xt]+bc)

(6) Ct=ft*Ct−1+it*Ct˜)

(7) ot=δ(Wo*[ht−1,xt]+bo)

(8) Ht=ot*tanh(Ct)

Where, ht−1 is the output at the previous time, ft is the forget gate output, Wf and. bf is the weight and threshold of the forget gate, it is the output of the input gate, W and bi is the weight and threshold of the reset gate, Ct˜ is the memory cell, Wc and bc is the weight and threshold of that cell, is the output of the memory gate, ot is the output gate, Wo and bo is the weight and threshold of the output gate, Ht is the output of the current layer.Fig. 2 LSTM neural network structure.

Fig. 2

3 Proposed methodology

3.1 The structure of CALSE-LSTM

The CALSE-LSTM model is a combination of three powerful deep learning models: convolutional neural networks, long short-term memory networks, and attention mechanisms. The CNN can extract local features from the input sequence, while the LSTM can capture long-term dependencies in the time series. This combination of multi-level feature extraction enables the model to understand the input data from different scales and perspectives. The attention mechanism is a dual attention mechanism consisting of self attention mechanism and Squeeze-and-Excitation attention, which enhances the model's ability to dynamically allocate weights when processing sequences, focusing on important parts while ignoring unimportant information. This improves the model's interpretability and flexibility. As shown in Fig. 3, the CALSE-LSTM framework.Fig. 3 CALSE-LSTM framework.

Fig. 3

In summary, the CALSE-LSTM model combines the advantages of various deep learning techniques and is able to effectively handle various time series estimation and sequence labeling tasks. The CALSE-LSTM estimation network model established in this paper is shown in Fig. 4. The model combines the advantages of convolutional networks and LSTM networks, effectively reducing invalid information by combining CNN with self-attention mechanism, which has excellent feature extraction ability, while fully utilizing the perception ability of different scales, thus strengthening the role of key features. After processingtime series capabilityThe integration of excellent LSTM networks further improves the accuracy of estimation. This model is mainly divided into 4 layers: input layer, CNN and Self-attention layer, LSTM layer, output layer (see Fig. 5).Fig. 4 CALSE-LSTM structure.

Fig. 4

Fig. 5 Pelican algorithm optimization model process.

Fig. 5

Input layer. The battery historical data with length n is preprocessed and then input to the model.

CNN layer. This layer performs feature extraction on the input data. The model is equipped with two convolutional layers, one max pooling layer, and one average pooling layer. The second convolutional layer outputs in parallel with the Squeeze-and-Excitation attention mechanism, where the activation function is relu function. The data is extracted by the CNN layer and input into the LSTM neural network together with the attention layer.

The attention layer filters input data to reduce or avoid the input of invalid information. It is parallel to the CNN layer, allowing the network to obtain information at different scales.

LSTM layer. This layer learns from the data processed by the CNN layer and the attention layer, ensuring the model's ability to process time series while incorporating the advantages of both. The model is equipped with a Dropout layer to prevent overfitting during training.

The output layer. The input of this layer is the output of the LSTM layer. The calculation formula of the output layer is as follows:(9) ypre=sigmoid(woLt+bo)

In the formula, ypre represents the estimated value of the model, wo represents the output layer weight, Lt represents the output of the LSTM layer, and bo represents the threshold of the output layer.

3.2 Pelican algorithm tuning

Due to the diversity and complexity of neural network structures, appropriate parameter configuration is crucial for improving model performance. Therefore, this paper uses the Pelican algorithm to optimize the parameter configuration of neural networks. The algorithm is inspired by the unique hunting behavior of pelicans and belongs to the metaheuristic algorithm. It has excellent global search ability and convergence performance, and the parameter setting is simple and easy to implement. After a series of standard test function comparisons, the Pelican algorithm significantly outperforms other algorithms such as PSO, GA, and DE in terms of convergence speed and stability [34].

The Pelican Optimization algorithm updates candidate solutions by simulating the behaviors and strategies of pelicans during attack and hunting, in order to find the optimal solution. The hunting process of this algorithm is divided into two stages: approaching the prey (exploration stage) and flying over the water (development stage). During the simulation of the pelican dive phase, the algorithm draws on the strategy of the pelican rapidly approaching the target prey from a high altitude. Based on this strategy, the algorithm conducts a wide-ranging search of neural network parameters, updating the location of the parameters and their direction of movement, gradually approaching the optimal solution to the problem. The mathematical expression for simulating the dive process is expressed as:(10) xi,jP1={xi,j+rand⋅(pj−I⋅xi,j),Fp<Fixi,j+rand⋅(xi,j−pj),else

where: xi,jP1 is the j-dimensional position of the i-th pelican after the first stage update; rand is a random number in the range [0,1]; I is a random integer of 1 or 2; pj is the j-dimensional position of the prey; and Fp is the objective function value of the prey.

During the simulated pelican flight phase on the water surface, the algorithm absorbs the behavioral characteristics of pelicans adjusting their flight state on the lake surface after catching prey to swallow it. Through the simulation of the water surface flight phase, the position and speed of the search agent are finely adjusted, which not only serves to better “digest” the found solutions, but also provides opportunities for the algorithm to further optimize the current set of solutions.(11) xi,jP2=xi,j+R⋅(1−tT)⋅(2⋅rand−1)⋅xi,j

where: xi,jP2 is the j-dimensional position of the i-th pelican based on the updated second stage; rand is a random number in the range [0,1]; R is a random integer of 0 or 2; t is the current iteration number; and T is the maximum iteration number.

Through these two stages of simulation, Pelican optimization algorithm has demonstrated its strong optimization ability, and achieved remarkable results in many fields such as function optimization, multi-objective optimization, and constrained optimization problems.

4 Experimental verification and result analysis

4.1 Experiment preparation

The neural network model in this article is based on the WIN11 system and the programming software is MATLAB2023b. The hardware used is i7-12700H 2.3 GHz with GeForce GTX 3060. The data used is based on the University of Maryland public dataset, with a test temperature of 25 °C, relative humidity of 40 %, initial voltage of 4.16V, end voltage of 2.50V, and discharge capacity attenuation rate of 100 %. The sampling time interval for urban dynamometer driving schedule (UDDS) conditions is 1s.

To assess the CALSE-LSTM model's performance, we compared it with CNN-LSTM, LSTM, and GRU networks using the same historical data for SoC estimation. After parameter tuning, the CALSE-LSTM model's specifications are: two convolutional layers with ReLU activation, the first CNN layer has a [1,2] kernel [1,1], stride, 6 channels, and the second has a [1,1] kernel [1,1], stride, 12 channels. Two max pooling layers with a pool_size of 1, a flatten layer, and an added Squeeze-and-Excitation Attention layer. The LSTM layer has 22 neurons. The batch_size is 30, with 100 iterations per epoch, an initial learning rate of 0.0055, using the Adam algorithm.

4.2 Evaluation indicators

In the evaluation of the performance of each model, this article uses commonly used evaluation metrics. Among them, y_true represents the actual output value of the test set, y_pre represents the output value estimated by the model, and n represents the number of samples in the test set.

Mean Absolute Error (MAE):(12) MAE=1n∑i=1n∣ytrue−ypre∣

Mean Absolute Percentage Error (MAPE):(13) MAPE=(1n∑i=1n|ytrue−ypre|)×100%/ytrue

Root Mean Squared Error (RMSE):(14) RMSE=1n∑i=1n(ytrue−ypre)2

4.3 Analysis of experimental results

In order to verify the effectiveness of the CALSE-LSTM estimation model proposed in this paper, we selected the UDDS conditions as the test data set for estimation experiments. In the experiment, we compared the LSTM estimation model, GRU estimation model, and CNN-LSTM estimation model on the same data set and then compared the estimation results with those of the model proposed in this paper. It should be noted that, to ensure fair comparison, we set the same hidden layer node number and batch size parameters in all models to further verify the superiority of the model proposed in this paper in terms of estimation accuracy.

Fig. 6 shows the comparative experimental results of four models, namely, GRU, LSTM, CNN-LSTM, and CALSE-LSTM, under the UDDS conditions (see Table 1). Fig. 7 presents the estimated results of the ablation experiments. According to the estimated error data of different experiments in Table 2, Table 3, it is evident that the model proposed in this paper significantly outperforms several other similar models in all evaluation metrics.Fig. 6 Comparison of estimation results of four similar models under UDDS conditions.

Fig. 6

Fig. 7 Comparison of ablation experiments under UDDS conditions.

Fig. 7

Table 1 Optimized parameter for CALSE-LSTM after Pelican Algorithm.

Table 1Variable	Parameters	Optimized value	
First Convolutional layers	Number of filter
Size of filter
Activation	6 [1,2]
‘ReLU’	
Second Convolutional layers	Number of filter
Size of filter
Activation	12 [1,1]
‘ReLU’	
LSTM layers	Number of hidden nodes	22	
Learning configuration	Learning rate
Dropout rate
LearnRateDropPeriod	0.01
0.2181
20	
SelfattentionLayer	numHeads
numKeyChannels	1
12	

Table 2 Comparison of estimation performance of various similar algorithms under UDDS conditions.

Table 2Model	RMSE(%)	MSE(%)	MAE(%)	MAPE(%)	
GRU	2.54	6.47e-02	2.0339	7.89	
LSTM	2.52	6.36e-02	1.9452	7.35	
CNN-LSTM	1.99	3.99e-02	1.7121	6.32	
CALSE-LSTM	1.73	3.01e-02	1.34	5.16	

Table 3 Comparison of estimated performance of ablation experiments.

Table 3Model	RMSE(%)	MSE(%)	MAE(%)	MAPE(%)	
Remove self attention mechanism	1.92	3.69e-02	1.65	6.05	
Remove Squeeze-and
-Excitation attention	1.89	3.58e-02	1.67	5.98	
CALSE-LSTM	1.73	3.01e-02	1.34	5.16	

In Fig. 8, a comprehensive comparison is made between the model proposed in this paper and several Kalman filtering methods. These methods include the Extended Kalman Filter (EKF), the Dual Extended Kalman Filter, and the Multi-Information Unscented Kalman Filter (MIUKF). It is noteworthy that the system models of these three algorithms all adopt the second-order RC equivalent circuit model. The CALSE-LSTM (3-input) model mentioned in this paper takes power consumption as an input in addition to battery voltage and current. The data in Table 5 shows that as the inputs increase, our model's evaluation metrics significantly outperform these Kalman filtering algorithms in all aspects.1) As shown in Fig. 6, during the phased non-constant current discharge under the UDDS condition, the continuous change in discharge current causes the battery state of charge to change continuously, resulting in large fluctuations in the fitted curve between the estimated value and the actual value. The SoC estimation values obtained by the four estimation methods are consistent with the actual SoC decline trend, and the GRU and LSTM methods are similar in effect, both considering global features, but LSTM is slightly better in terms of RMSE. It can be seen from the figure that GRU and LSTM have some estimation bias in some time periods, and both perform poorly in global estimation. In contrast, the combined model of CNN + LSTM integrates global and local features to some extent, and therefore outperforms single LSTM in terms of RMSE and R2 indicators.

Fig. 8 Comparison with Kalman filtering method under UDDS conditions.

Fig. 8

Table 4 Comprehensive comparison of model training time and accuracy.

Table 4Model	CALSE-LSTM	CNN -LSTM	LSTM	
	MaxEpochs	Training time（s）	MaxEpochs	Training time（s）	MaxEpochs	Training time（s）	
30	89	30	52	30	23	
RMSE(%)	1.98	2.29	2.98	
MSE(%)	3.91e-02	5.27e-02	8.88e-02	
MAE(%)	1.62	1.793	2.21	
MAPE(%)	6.04	8.59	6.51	
	MaxEpochs	Training time（s）	MaxEpochs	Training time（s）	MaxEpochs	Training time（s）	
45	135	65	131	180	132	
RMSE(%)	1.82	2.05	2.51	
MSE(%)	3.33e-02	4.19e-02	6.32e-02	
MAE(%)	1.31	1.49	1.92	
MAPE(%)	5.26	5.38	6.51	

Table 5 Comparison of estimation performance with Kalman filtering method under UDDS conditions.

Table 5Model	RMSE(%)	MSE(%)	MAE(%)	MAPE(%)	
EKF	2.65	7.01e-02	2.4513	12.59	
DEKF	2.15	4.65e-02	1.7791	8.22	
MIUKF	1.23	1.53e-02	0.54	2.66	
CALSE-LSTM (2intput)	1.73	3.01e-02	1.34	5.16	
CALSE-LSTM (3intput)	0.24	5.71e-04	0.168	0.85	

The estimation results obtained by the method proposed in this article are most consistent with the actual SoC change trajectory. As can be clearly seen from Fig. 6, compared with other models, the estimation of the model proposed in this article is more accurate after the rapid change data converges. At the same time, it can be seen from Table 2 that the estimation value of the model proposed in this article is superior to other models in various indicators, with a RMSE of 1.73 %, which is 31.9 %, 31.3 %, and 15 % lower than GRU, LSTM, and CNN-LSTM, respectively. The estimation error is lower than that of the other three estimation models, indicating that the proposed model has obvious advantages in accuracy.2) To verify the role of each part of CALSE-LSTM, ablation experiments were conducted to test the model. The model in this article was compared with models that removed the self-attention mechanism and the se-attention mechanism, respectively. As shown in Table 3, the model with Remove Squeeze-and-Excitation attention showed a decrease in all indicators compared to the model with Remove self attention mechanism, indicating that the self-attention mechanism in the model improves accuracy better than Squeeze-and-Excitation attention. Fig. 7 also show that the combined effect of self-attention mechanism and Squeeze-and-Excitation attention is closer to the actual SoC curve. At the same time, the evaluation indicators of each ablation model are better than those of the CNN-LSTM model. Compared to the estimation results of CNN-LSTM, the RMSE estimation indicators of the ablation models with Remove Squeeze-and-Excitation attention and Remove self attention mechanism decreased by 5.1 % and 3.6 %, respectively, indicating that the introduction of attention mechanism can effectively improve model accuracy. The combined effect of the two attention mechanisms results in higher estimation accuracy of the model. Therefore, on the basis of the already advantageous CNN-LSTM model for estimating SoC, by introducing attention mechanism, the accuracy of SoC estimation is further improved.

3) The model proposed in this article performs best in all evaluation metrics, but the complexity of the network structure is high. Through comparing the training time of the model, it is possible to verify whether the complexity of the model affects computational efficiency. In the experiment, to ensure the effectiveness of the learning rate, we adjusted the LearnRateDrop Period to 12 as the maximum number of iterations decreases, while keeping other conditions unchanged. As shown in Table 4, when the maximum number of iterations is the same, the LSTM model has the shortest training time, but its accuracy is also relatively low. In contrast, the model proposed in this paper improves both training time and accuracy. Specifically, when the training time difference is not significant, the accuracy of the model proposed in this paper and the CNN-LSTM model is significantly better than that of the single LSTM model. It is worth noting that when the maximum number of iterations is 45, the accuracy of the model proposed in this paper is even higher than that of the CNN-LSTM model with a maximum of 65 iterations. This result proves from another perspective that after introducing the dual attention mechanism, the model proposed in this paper has a stronger ability to extract feature information under the same number of iterations than the CNN-LSTM model. Therefore, although the complexity of the model proposed in this paper increases, its learning efficiency does not decrease, and it still has advantages compared with other models.

4) In order to further verify the accuracy and precision of the proposed model for estimating the State of Charge (SOC) of lithium batteries, we conducted comparative experiments using three Kalman filtering algorithms. As shown in Table 5, when only using battery voltage and current as inputs, the accuracy of our model is better than that of Extended Kalman Filter (EKF) and Unscented Kalman Filter (DKF), but slightly inferior to Multi Input Unscented Kalman Filter (MIUKF). However, after adding power consumption as an input feature, all evaluation indicators of the model in this paper achieved significant improvements. Specifically, the RMSE of the model is reduced to 0.24 %, which is much lower than the RMSE of MIUKF, the most accurate of the three Kalman filtering algorithms, which is 1.23 %.

From Fig. 8, it can be seen that in the case of dual inputs, whenever there is a significant change in the waveform, the estimated values of our model will have significant errors. Although its accuracy is still higher than EKF and DKF, the smoothness of the curve is far inferior to these two. After increasing the input, the estimated curve becomes smoother, indicating that the model in this paper has higher requirements for the input data. When the mapping relationship between input data and output is good, the estimation accuracy can be greatly improved. In contrast, Kalman filtering algorithms can improve estimation accuracy and robustness by adopting more accurate system models and changing the algorithm structure. In the case of limited battery data, the Kalman filter algorithm can still maintain a certain level of accuracy. Therefore, the model presented in this article is more suitable for applications with a large amount of training data.

In summary, both neural networks and Kalman filtering have shown their unique advantages and limitations in the field of battery SOC estimation, and similarly, other methods also have their own characteristics. In practical applications, in order to pursue higher SOC estimation accuracy and stronger robustness, the most suitable algorithm can be flexibly selected according to specific needs and conditions, or new approaches and methods that effectively combine multiple algorithms can be actively explored.

5 Conclusion

In response to the problem of low accuracy in estimating the SoC of lithium batteries, this paper proposes a battery state estimation model based on POA algorithm optimization and CALSE-LSTM. This model not only gives full play to the advantages of CNN in feature extraction, but also skillfully integrates the professional ability of LSTM in processing time series data, effectively making up for the shortcomings of single model in feature extraction and estimation. In addition, by introducing dual attention mechanisms, namely self attention mechanism and squeeze and stimulate attention mechanism, the feature recognition ability of the model is further enhanced, enabling the estimation model to more sensitively capture the changing features of historical data at different times, thereby significantly improving the accuracy and stability of SoC estimation. The results of the ablation experiment and the comparative experiment both confirmed the effectiveness of the self attention mechanism and the squeezing and stimulating attention mechanism. Meanwhile, by comprehensively comparing the training time and estimation accuracy of the model, it has been proven that the model also has significant advantages in learning efficiency. Finally, through comparative experiments with Kalman filtering algorithms, the accuracy and precision of the model in lithium battery SoC estimation were further verified, and both methods were comprehensively evaluated. In summary, the lithium battery SoC estimation method based on CALSE-LSTM demonstrates significant advantages in estimation accuracy and application potential. The core direction of future research will be to integrate this technology into battery management systems or cloud computing platforms, and promote its widespread deployment in practical applications.

Data availability statement

The data that support the findings of this study are available on request from the corresponding author-Prof Ji upon reasonable.

CRediT authorship contribution statement

Zujun Ding: Supervision, Conceptualization. Daiming Hu: Writing – original draft. Yang Jing: Data curation. Mengyu Ma: Data curation. Yingqi Xie: Data curation. Qingyuan Yin: Data curation. Xiaoyu Zeng: Data curation. Chu Zhang: Supervision, Data curation. Tian Peng: Supervision, Data curation. Jie Ji: Writing – review & editing.

Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
==== Refs
References

1 Ji J. Zhou M. Guo R. A electric power optimal scheduling study of hybrid energy storage system integrated load estimation technology considering ageing mechanism Renew. Energy 215 2023 118985
2 Yu Q. Nie Y. Peng S. Evaluation of the safety standards system of power batteries for electric vehicles in China Appl. Energy 349 2023 121674
3 Vogel E.H. Ponce F.P. Wagner A.R. The development and present status of the SOP model of asSoCiative learning Q. J. Exp. Psychol. 72 2 2019 346 374
4 Chen Guisheng, Xu Yangsong, Li Junda, et al. SOC estimation of lithium-ion batteries based on SOC-OCV curve reconstruction at different temperatures [J]. J. Power Sources: 1-11. .
5 Kai W. Xiao F. Jinbo P. State of charge (SOC) estimation of lithium-ion battery based on adaptive square root unscented kalman filter Int. J. Electrochem. Sci. 15 9 2020 9499 9516
6 Adaikkappan M. Sathiyamoorthy N. Modeling, state of charge estimation, and charging of lithium‐ion battery in electric vehicle: a review Int. J. Energy Res. 46 3 2022 2141 2165
7 Jianlin Li Heng Xiao Review on the status of lithium-ion battery modeling Energy Storage Science and Technology 11 2 2022 697 703
8 Wenhua Xu Research on Equivalent Modeling and Health Status Evaluation of Aviation Lithium-Ion Batteries 2022 [D]
9 Chen Linhua Chen Jian Zhiqiang Xu State estimation of lithium-ion batteries in energy storage systems based on real-time circuit models J. Cent. S. Univ. 52 2 2021 458 464
10 Huang Lili Xingxing Ren Miao BoBo SOC estimation of lithium-ion batteries based on improved Rint model Battery Industry 26 4 2022 177 180
11 Yao He Liu Xingtao Zhang Chenbin Insulation detection algorithm based on internal resistance model of power battery pack Journal of Jilin University (Engineering Edition) 43 5 2013 1165 1170
12 Wu Daoming Liu Min Qiang Xu State parameter identification of lithium batteries based on the second-order Thevemin model Proceedings of the 2021 Annual Conference and Exhibition of the SoCiety of Automotive Engineers of China, Shanghai, China, F 2021 [C]
13 Huan Li Wang Shunli Zou Chuanyun Research on SOC estimation based on Thevenin model and adaptive Kalman filter Automation Instrumentation 42 1 2021 46 51
14 Ran Xiong Wang Shunli Chunmei Yu SOC estimation method for lithium-ion batteries of special robots based on Thevenin model and improved extended Kalman filter Energy Storage Science and Technology 10 2 2021 695 704
15 Liu Xin Chen Ziqiang State of charge estimation of lithium-ion batteries based on the PNGV model Equipment Environmental Engineering 20 11 2023 81 90
16 Chen Zheng Zhide Wang Wenbiao Mou State of charge estimation of lead-carbon batteries based on the PNGV model and adaptive Kalman filtering Energy Storage Science and Technology 12 3 2023 941 950
17 Sun Daoming Research on SOC and Capacity Estimation Methods for Dynamic Lithium-Ion Batteries 2021 [D]
18 Liyou Xu Ma Ke Yang Qingxia Estimation of SOC of power battery based on Kalman filter J. Jiangsu Univ. (Nat. Sci. Ed.) 45 1 2024 24 29
19 Ramezani A. Safarinejadian B. Zarei J. Novel hybrid robust fractional interpolatory cubature Kalman filters J. Franklin Inst. 357 1 2020 704 725
20 Takyi-Aninakwa P. Wang S. Zhang H. An optimized long short-term memory-weighted fading extended Kalman filtering model with wide temperature adaptation for the state of charge estimation of lithium-ion batteries Appl. Energy 326 2022
21 Pang H. Chen K. Geng Y. Accurate capacity and remaining useful life estimation of lithium-ion batteries based on improved particle swarm optimization and particle filter Inside Energy 2024 293
22 Cui Z. Wang L. Li Q. A comprehensive review on the state of charge estimation for lithium‐ion battery based on neural network Int. J. Energy Res. 46 5 2022 5423 5440
23 Peng J. Takyi-Aninakwa P. Wang S. A hybrid-aided approach with adaptive state update for estimating the state-of-charge of LiFePO4 batteries considering temperature uncertainties J. Energy Storage 76 2024
24 Takyi-Aninakwa P. Wang S. Liu G. An enhanced lithium-ion battery state-of-charge estimation method using long short-term memory with an adaptive state update filter incorporating battery parameters Eng. Appl. Artif. Intell. 2024 132
25 Bobobee E.D. Wang S. Takyi-Aninakwa P. Improved particle swarm optimization-long short-term memory model with temperature compensation ability for the accurate state of charge estimation of lithium-ion batteries J. Energy Storage 84 2024
26 Hong J. Wang Z. Chen W. Online joint-estimation of multi-forward-step battery SOC using LSTM neural networks and multiple linear regression for real-world electric vehicles J. Energy Storage 30 2020 101459
27 Liu Juan Hui Lei Jin Lv Estimation of lithium-ion SOC based on CNN-LSTM Electrical Transmission 54 2 2024 26 31
28 Wenbo Lei Canxin Geng Ye Zou Cross-condition SOC estimation of lithium batteries based on CNN-BILSTM deep learning model China New Technology and New Products 1 2024 4 7
29 Lei W. Geng C. Zou Y. Estimation of lithium battery SOC across different operating conditions based on CNN-bilstm deep learning model China New Technology and New Products 1 2024 4 7
30 Hu J. Shen L. Sun G. Squeeze-and-excitation networks Proceedings of the Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, F 2018 [C]
31 Vaswani A. Shazeer N. Parmar N. Attention is all you need Adv. Neural Inf. Process. Syst. 2017 30
32 Pan Siyuan Zhang Wei Estimation of lithium battery SOC based on improved LSTM algorithm Comput. Mod. 8 2023 25 30
33 Shuiping Ni Huifang Li Battery state of charge estimation method based on one-dimensional convolutional neural network and long short-term memory network Comput. Appl. 41 5 2021 1514 1521
34 Wang Kexin Jun Zhou Yan Wang Health state estimation of lithium-ion batteries based on pelican optimization and extreme learning machine Electrical Applications 42 11 2023 16 25
