Energies 15 08003
Energies 15 08003
Shahriar, Saleh Mohammed, Bhuiyan, Erphan A, Nahiduzzaman, Md, Ahsan, Mominul and
Haider, Julfikar (2022) State of Charge Estimation for Electric Vehicle Battery Management
Systems Using the Hybrid Recurrent Learning Approach with Explainable Artificial Intelligence.
Energies, 15 (21). 8003 ISSN 1996-1073
DOI: https://doi.org/10.3390/en15218003
Publisher: MDPI AG
Version: Published Version
Downloaded from: https://e-space.mmu.ac.uk/630712/
Enquiries:
If you have questions about this document, contact openresearch@mmu.ac.uk. Please in-
clude the URL of the record in e-space. If you believe that your, or a third party’s rights have
been compromised through this document please see our Take Down policy (available from
https://www.mmu.ac.uk/library/using-the-library/policies-and-guidelines)
Article
1 Department of Electrical and Computer Engineering, Rajshahi University of Engineering and Technology,
Rajshahi 6204, Bangladesh
2 Department of Mechatronics Engineering, Rajshahi University of Engineering and Technology,
Abstract: Enhancing the accuracy of the battery state of charge (SOC) estimation is essential in de-
veloping more effective, dependable, and convenient electric vehicles. In this paper, a hybrid CNN
and gated recurrent unit-long short-term memory (CNN-GRU-LSTM) approach, which is a recur-
rent neural network (RNN) based model with an explainable artificial intelligence (EAI) was used
for the battery SOC estimation, where the cell parameters were explicitly synchronized to the SOC.
The complexed link between the monitoring signals related to current, voltage, and temperature,
and the battery SOC, was established using the deep learning (DL) technique. A LG 18650HG2 li-
Citation: Shahriar, S.M.;
ion battery dataset was used for training the model so that the battery was subjected to a dynamic
Bhuiyan, E.A.; Nahiduzzaman, M.;
Ahsan, M.; Haider, J. State of Charge
process. Moreover, the data recorded at ambient temperatures of −10 °C, 0 °C, 10 °C, and 25 °C are
Estimation for Electric Vehicle fed into the method during training. The trained model was subsequently used to estimate the SOC
Battery Management Systems Using instantaneously on the testing datasets. At first, the training process was carried out with all tem-
the Hybrid Recurrent Learning perature data to estimate the SOC by the trained model at various ambient temperatures. The pro-
Approach with Explainable Artificial posed approach was capable to encapsulate the relationships on time into the network weights and,
Intelligence. Energies 2022, 15, 8003. as a result, it produced more stable, accurate, and reliable estimations of the SOC, compared to that
https://doi.org/10.3390/en15218003 by some other existing networks. The hybrid model achieved a mean absolute error (MAE) of 0.41%
Academic Editor: to 1.13% for the −10 °C to 25 °C operating temperatures. The EAI was also utilized to explain the
Piedad Garrido Picazo battery SOC model making certain decisions and to find out the significant features responsible for
the estimation process.
Received: 10 October 2022
Accepted: 25 October 2022
Keywords: state of charge (SOC); lithium-ion; battery management system (BMS); electric vehicle
Published: 27 October 2022
(EV); deep learning; explainable AI; gated recurrent unit
Publisher’s Note: MDPI stays neu-
tral with regard to jurisdictional
claims in published maps and institu-
tional affiliations.
1. Introduction
In the realm of modern power technologies, energy storage systems or batteries are
considered as a major component with a variety of applications traversing from small
Copyright: © 2022 by the authors. Li-
electrical devices to large scale applications e.g., electric vehicles (EVs) [1]. Due to the sig-
censee MDPI, Basel, Switzerland. nificantly low to zero carbon emissions, low noise, great effectives, and the adaptability
This article is an open access article of EVs in grid administration and interconnection, they are a viable technology for estab-
distributed under the terms and con- lishing a sustainable transportation system in the longer term [2–5]. Due to the absence of
ditions of the Creative Commons At- fuel in EVs, the technical structure is much simpler, compared to a vehicle based on an
tribution (CC BY) license (https://cre- internal combustion (IC) engine. Among the different types of battery technologies, lith-
ativecommons.org/licenses/by/4.0/). ium-ion batteries are preferred in EVs for high power and energy density, greater
reliability, longer lifespan, minimal discharge rate, and improved effectiveness. Moreo-
ver, the cost and capacity of these batteries are being optimized gradually, which eventu-
ally increases their usage in the EV industry. As a primary element in all of the battery
applications with multiple cells, a battery management system (BMS) is necessary to pro-
vide a reliable operation during its consumption, in the EVs. The BMS is capable of sens-
ing the voltage, current, and temperature of the battery cells to minimize overcharging
and over discharging scenarios [6].
The most significant roles of the BMS include the SOC, State of Health (SoH), and the
State of Power (SoP) for the assessment of the battery states [7], which enables the users
to evaluate the battery pack’s remaining charge, predict the battery’s ageing level, and the
amount of power the battery pack can offer at any given time. The SOC estimation is also
vital to maintain appropriate functioning of the EV drive systems, as this metric straight-
forwardly measures a vehicle’s available mileage and is required for the battery balancing
system. The SOC estimation is an undeniable objective as the battery cells endure irregular
characteristics with repetitive acceleration and braking, in the EVs. As there exists no di-
rect and specific method to quantify the SOC, it is essential to estimate it precisely. Typi-
cally, open circuit voltage-based techniques and coulomb counting (CC), have been used
to estimate the SOC, but these are widely acknowledged to have certain drawbacks [8].
The methods primarily use a chart or quadratic fitting to define the relationship between
the SOC and the open-circuit voltage (OCV). Nevertheless, they necessitate the battery
being at rest for more than two hours in order to obtain an accurate SOC value [9]. The
hybrid approach has been proposed in the literature, to provide a holistic modeling ap-
proach for Li-ion batteries [5] where CC, the linear Kalman filter (LKF), and OCV-based
methods were combined for accurately estimating the SOC and to ensure a safe battery
operation within the acceptable SOC limits, prolonging its lifetime. Therefore, the SOC
estimation tasks have largely been replaced by more advanced methods, for instance, ar-
tificial intelligence (AI) based methods. In the subsequent literature review, the focus has
been given on the AI based SOC estimation methodologies.
In recent years, a number of AI algorithms for the SOC estimation have been postu-
lated. These strategies have shown the potential to outperform the traditional methods.
The methods utilize a unique learning capability of the AI model for training, which is
able to correlate the interrelationships and patterns among the cell assessment parameters
(i.e., voltage, current, resistance, and temperature) and the SOC, with the help of a massive
quantity of data. The AI model is then applicable to an unknown data set to estimate the
SOC. Feedforward neural network (FNN) models for predicting the SOC, were presented
by Darbar and Bhattacharya [10], using voltage, current, and temperature measurements
as the input variables. Once confronted with a variety of driving conditions at varying
temperatures throughout training and testing, the proposed scheme was adequate in es-
timating the SOC. However, the real-time data layout arrangement for machine learning
(ML) was still considered a work in progress. Vidal et al. [11] proposed an enhanced back
propagation neural network (BPNN) that used evaluated voltage, current, and tempera-
ture as the input features to estimate the precise SOC. The BPNN algorithm, however, had
a slow computation time and was extremely receptive to the preliminary weight [12], alt-
hough it could show gradient dissemination or dropping into a local minimum dilemma.
To overcome this issue, other authors utilized an artificial fish swarm technique to deter-
mine several optimal BP neural network parameters [13]. Notwithstanding, in the partic-
ular instance of a huge quantity of data, this swarm intelligence optimization algorithm
significantly increased the computational cost.
Numerous different AI approaches did not take into account the battery voltage
modeling, but the SOC was rather explicitly represented as a component of the sampled
signals. For the SOC estimation, the assorted recurrent neural networks (RNNs) were used
with reasonable precision. To estimate the SOC, Chemali et al. [14] proposed the exploi-
tation of a long short-term memory (LSTM) network. The voltage, current, and tempera-
ture measurements were supplied actively into an extensive infrastructure, which could
Energies 2022, 15, 8003 3 of 27
discover the delineation between both the input series data and the goal SOC. It predicts
the SOC appropriately and learns the hyperparameters on its own. Bian et al. [15] em-
ployed a bi-directional LSTM (Bi-LSTM) which presented a shortcoming that, when de-
coding started without sufficient input sequence data, the decoding efficiency suffered
significantly [16]. Considering the recorded current, voltage, and temperature infor-
mation, another research work [17] employed the gated recurrent unit recurrent neural
network (GRU-RNN) to estimate the battery SOC. Yang et al. [18] employed the velocity
derivative to adjust the network’s weights, in order to increase the GRU network model’s
predictive performance. However, the practical EV operating characteristics for the bat-
teries might vary from these dynamically balanced trajectories, since they could be
changed for various places, users, and time frames. A network based on certain common
features might not be adequate to reliably estimate the SOC underneath a variety of real-
world EV contexts. In the domain of AI, it could lead to algorithmic breakdowns. Moreo-
ver, these methods did not offer the aspects on the mapping of input and output. There-
fore, it is necessary to find out the feature which is responsible for the output result of the
AI model.
In this research, a hybrid CNN-GRU-LSTM (convolutional neural network-gated re-
current unit-long short-term memory network) model with an explainable AI, has been
proposed, that can reliably and more accurately estimate the SOC while self-learning the
network parameters, in order to contribute to the effective battery management for the
EVs. The novel hybrid lightweight model was employed to minimize the SOC estimation
error with a shorter processing time and a smaller memory use, due to a smaller number
of parameters. The explainable AI would help to identify the most important feature from
all of the input features for an accurate SOC estimation when the SOC data at different
temperatures were used together and separately. The hybrid model was compared with
four other models, such as the LSTM, CNN-LSTM, CNN-bi-directional LSTM, and GRU,
to identify the best performing model. Furthermore, the performance of the hybrid model
was compared with the state-of-the-art (SOTA) models to contribute to a better health
management of the EV batteries.
The rest of the paper is organized as follows. Section 2 provides the materials and
methods used in this paper to develop the model, while Section 3 discusses the models’
architecture. Section 4 presents the full experimental results and analysis. Finally, Section
5 draws conclusions, based on the findings.
(a)
(b)
Figure 1. Sample data plot for the measured parameters of the terminal voltage, current, tempera-
ture, and battery capacity (Ah) while (a) discharging and (b) charging the battery at −10 °C.
not state that it can be used in a BMS as a battery model. Therefore, the optimum model
was also compared with the existing state-of-the-art models, and finally explained with
an explainable AI and the feature importance was calculated using the SHAP library in
Python. An overview of the workflow is shown in Figure 2.
Figure 2. Overall design of the study for the SOC estimation of the EV battery.
Figure 3. The internal architecture of a LSTM unit containing all of the parameters and gates.
The input gate keeps the new information in the unit memory ck. The input gate is
described by Equations (2) and (3).
ik = σ (wk ·[hk−1,xk] + bk) (2)
its memory should function by learning the settings for its gates. Figure 4 explains the
whole process in the GRU.
Figure 4. The internal architecture of a GRU containing all of the parameters and gates.
The reset gate is denoted by ‘r’ and the update gate is denoted by ‘z’. Equations (7)–
(10) represent the whole GRU process [22]. The GRU reduces the complexity of the LSTM
and works very well with small datasets.
zk = σ (wz·[hk−1,xk]) (7)
rk = σ (wr·[hk−1,xk]) (8)
provides the SOC of the battery, but the model cannot determine the importance of each
input feature, which can be explained by the explainable AI.
The Shapley Additive exPlanations (SHAP) is a library using Python, which is used
to calculate the feature importance of a model. At first, SHAP takes a trained model, and
with a sample dataset provided to SHAP, it makes predictions using the obtained dataset
by shuffling the values in a single column. It calculates how much the loss function suf-
fered from shuffling, using these forecasts and the true target values [24]. The importance
of the variable just shuffled, is measured by the performance degradation. Then, it restores
the data to its previous state (undoing the shuffle from step 2). Then, it repeats the step
with the next column in the dataset, until it has computed the importance of all of the
columns.
Lundberg and Lee’s recent work [25] on ML algorithms has created new ways to
comprehend the model outputs. Based on the average of the geometrical contribution
across all potential permutations of the features, the Shapley value is determined. The
following mathematical expression is used for calculating the traditional SHAP value.
|𝑇|! (𝑛 − |𝑇| − 1)!
∅𝑗 = ∑ [𝑓(𝑇 ∪ {𝑗}) − 𝑓(𝑇)] (11)
𝑛!
𝑇⊆𝑁{𝑗}
where Φj stands for the contribution of feature j and N represents all features set. Then, n
denotes the number of the features in set N, T is the subset of N that contains feature j and
without knowing the feature values, the base value, or f(N), is the expected result for each
feature in N. The SHAP value of each feature for a given observation, is added up to esti-
mate the model result for that observation. As a result, the explanation model is defined
by Equation (12).
𝑀
Algorithm 1: The model building and training method for the SOC estimation
• Voltage, Current, Temperature, Average Voltage, Average Current
Inputs • Input Shape = (5,1); Which corresponds (Number of Features, Window Size)
• Here, Number of Features = 5, Window Size = 1
Output • Five trained models and their performance parameters
• Building a model with just LSTM and dense layers
• Building a model with the addition of a one-dimensional convolution layer before the LSTM layers
Model
• Building a model transforming the uni-directional LSTM layers into bi-directional.
Building
• Building a model with just the GRU and dense layers
• Building a hybrid model with a one-dimensional convolution, and GRU and LSTM layers
Model • Defining the loss function as Mean Absolute Error (MAE)
Compiling • Defining the optimizer as “Adam”.
Energies 2022, 15, 8003 9 of 27
Training • Training the five models with training data and calculating the training errors.
and Testing • Testing the five models with test data and calculating the test error. (Errors are Mean Absolute Er-
Models ror, Root Mean Squared Error, and Maximum Error)
where N is the length of the data. Following the training, the models were tested with the
test data. The root mean squared error (RMSE) defined by Equation (14) and the maxi-
mum error defined by Equation (15) were chosen as the test criteria of the models, as well
as the MAE.
𝑁
1
𝑅𝑀𝑆𝐸 = √ ∑(𝑆𝑜𝐶(𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑)𝑘 − 𝑆𝑜𝐶(𝑝𝑟𝑒𝑑𝑖𝑐𝑡𝑒𝑑)𝑘 )2 (14)
𝑁
𝑛=1
4.2. Training with the Data of the Four Ambient Temperatures Altogether
In this experimental analysis, the data of all four ambient temperatures (10 °C, 0 °C,
10 °C, and 25 °C) were used collectively to train the five models with 669,956 training data.
The plot of the measured and predicted SOC values of the LSTM model with the test
data of −10 °C, is given in Figure 10a. Instead of plotting the data for all temperatures, the
results of −10 °C is plotted as determining the SOC at lower ambient temperatures, is more
critical than in higher temperatures [14,28]. From the graph, it was found that the model
worked better with very small errors while charging, but generated more errors during
the discharging process. Because of the experimental process, it is known that the battery
was charged at a constant voltage process of 4.2 V. At the beginning of the charging pro-
cess when the battery is empty, the current flow is normally higher. The current flow is
subsequently decreased with the passage of charging time because the battery becomes
gradually full of charge. Therefore, the charging process is quite simple, whereas dis-
charging is not, as the battery is not discharged with a constant load, rather with the power
profile of different drive cycles. When the battery is used in an electric vehicle, the load
can be changed at almost every moment. Another remarkable phenomenon that happens
during the discharging process is the regenerative braking, which is normally a charging
process, where the loss of kinetic energy does not happen while braking, rather the energy
is again stored in the battery. Therefore, the process of discharging is more complex
Energies 2022, 15, 8003 13 of 27
making it very challenging to predict the accurate SOC while discharging, compared to
the prediction of the SOC during the charging. This can be demonstrated by very smooth
lines of the SOC during the charging process, compared to the noisy lines during the dis-
charging process (Figure 10a). The plot of the absolute errors of the LSTM model on test
data of −10 °C is shown in Figure 10b. The maximum error of the test data at −10 °C
(4.17%), presented in Table 2, was also evidenced in Figure 10b. The error can be both
positive and negative. As the optimization of the model was built, based on the mean
absolute error, the absolute error is plotted for better understanding.
(a)
(b)
Figure 10. Performance of the LSTM model at −10 °C (a) measured and predicted SOC values and
(b) absolute errors from the test data.
(a)
Energies 2022, 15, 8003 15 of 27
(b)
Figure 11. Performance of the CNN-LSTM model at −10 °C (a) measured and predicted SOC values
and (b) absolute errors from the test data.
The average MAE and RMSE of the CNN Bi-LSTM model, based on the four ambient
temperature data, were recorded as 0.69% and 1.18%, respectively, which were either sim-
ilar to or better than the previous two models. Though it required more time to calculate
the SOC, the error was on a satisfactory level. The testing time was almost double that of
the CNN-LSTM model and four times greater than that of the LSTM model, possibly due
to the bi-directional layers. In the normal uni-directional LSTM, the data passes in only
the forward direction, whereas the data passes in both the forward and backward direc-
tions in the bi-directional layers. It was also observed that, similar to the CNN-LSTM
model, the CNN Bi-LSTM model performed best at 25 °C and worst at 10 °C.
The plot of the measured values and predicted values of the CNN Bi-LSTM model,
based on the test data at −10 °C during the charging and discharging, showed a similar
trend to that of the previous models (Figure 12a). From Figure 12b and Table 4, a
Energies 2022, 15, 8003 16 of 27
maximum error value of 5.23% was found for the CNN Bi-LSTM model on the test data
at −10 °C, which was in between the previous two models. The overall lower MAE of the
CNN Bi-LSTM model indicated a sign of a better performance than the previous two mod-
els.
(a)
(b)
Figure 12. Performance of the CNN bi-directional-LSTM model at −10 °C (a) measured and pre-
dicted SOC values and (b) absolute errors from the test data.
models, as it achieved almost the same training error as the CNN Bi-LSTM model. The
test results of the GRU model are presented in Table 5.
The average MAE and RMSE of the GRU model, based on the four ambient temper-
ature data, were found as 1.02% and 1.53%, respectively. Though a smaller training error
was found in the GRU model, the test results were poorer than the LSTM models. Some
sort of over fitting was observed in the test results of the GRU model, but the testing time
was smaller due to it being a lightweight model.
From Table 5, the GRU model performed well at 0 °C and the highest errors were
found at 10 °C. The absolute error results on the test data at −10 °C can be observed in
Figure 13a. Overall, the GRU model could not predict the SOC as correctly as the LSTM
based models, but the complexity and testing times of the model were reduced with a
reduction of the trainable parameters. When the GRU model was compared to a similar
type, such as the LSTM model, which showed a 0.2% less MAE than the GRU model be-
cause the LSTM model performed better with large datasets. The absolute error graph of
the GRU model on the test data at −10 °C (Figure 13b) showed that the max error of 8.34%
was present only at one point, while at other points, all absolute error values were below
6%.
(a)
Energies 2022, 15, 8003 18 of 27
(b)
Figure 13. Performance of the GRU model at −10 °C (a) measured and predicted SOC values and (b)
absolute errors from the test data.
The average MAE and RMSE of the hybrid CNN-GRU-LSTM model, based on the
four ambient temperature data, were recorded as 0.75% and 1.23%, respectively, which
were similar to the LSTM based models but better than the GRU model with a smaller
number of layers and units. The test results and the absolute errors of the hybrid CNN-
GRU-LSTM model on the test data of −10 °C can be observed in Figure 14a and Figure
14b, respectively. The model performed best at 25 °C and worst at 10 °C.
Energies 2022, 15, 8003 19 of 27
(a)
(b)
Figure 14. Performance of the hybrid CNN-GRU-LSTM model at −10 °C (a) measured and predicted
SOC values and (b) absolute errors from the test data.
MAE RMSE
1.8
1.6
1.4
Error 1.2
1
0.8
0.6
0.4
0.2
0
LSTM CNN-LSTM CNN Bi-LSTM GRU CNN-GRU-LSTM
Models
Figure 15. MAE and the RMSE of the five RNN models.
It was clear from the graphs that the CNN Bi-LSTM determined the SOC most cor-
rectly, but its prediction time and number of trainable parameters were the highest among
the tested models. However, the hybrid CNN-GRU-LSTM showed almost the same errors
as the CNN-LSTM model, but its prediction time and number of trainable parameters
were either equal to or smaller than the other models. Therefore, the hybrid model could
be considered as the optimum one among the five models tested.
80
70 20
Processing time (sec)
60
15
50
40
10
30
20 5
10
0 0
LSTM CNN-LSTM CNN Bi-LSTM GRU CNN-GRU-LSTM
Models
Figure 16. Comparison of the models with respect to the processing time and trainable parame-
ters.
Energies 2022, 15, 8003 21 of 27
4.3. Training with the Data of the Four Ambient Temperatures Separately
It is also important to train the optimum hybrid model with separate temperature
data, to determine its performance. Following the training with the separate temperature
data, the training MEAs were found as 0.42%, 0.46%, 0.38%, and 0.35%, for −10 °C, 0 °C,10
°C, and 25 °C, respectively, where the 0.82% training MAE was found while training with
all of the temperature data altogether. Therefore, it can be concluded that if the models
are developed with the data obtained at the different ambient temperatures separately,
the error can be reduced.
Following the training, the model was tested with the test data and the results are
shown in Table 7 and Figure 17. The best performance was obtained for the model devel-
oped with the data at 25 °C. The higher error at 0 °C could be due to an increase in the
battery’s internal resistance [14].
Table 7. The test result when the CNN-GRU-LSTM model is trained using separate temperature
data.
MAE RMSE
1.6
1.4
1.2
1
Error
0.8
0.6
0.4
0.2
0
-10 0 10 25
Temperature (oC)
Figure 17. MAE and the RMSE of the CNN-GRU-LSTM model in the four different temperatures.
Maheshwari et al. [31] proposed the sunflower optimization algorithm extender Kalman
filter method and determined the SOC from 0.82% to 1.37%of the MAE on a LG 18650HG2
3 Ah dataset.
The hybrid CNN-GRU-LSTM model proposed in this work achieved only a 0.41%
MAE at a 25 °C ambient temperature, in contrast to the lowest error of a 0.61% MAE at 25
°C, found in the previous works. At −10 °C and 10 °C ambient temperatures, 0.64%, and
0.65% MAE errors were found, respectively. At 0 °C temperature, a 0.61% MAE was found
when the model was trained with the four temperature data altogether. Therefore, with
the 25 °C temperature data, the model performed best, which reduced by almost 0.2% the
MAE from the previous work. At −10 °C, 0 °C, and 10 °C, the performance was also better
than the previous studies and the proposed hybrid model was lightweight and less com-
plex than the others. For instance, even the best performing LSTM-RNN model [14] had
1000 hidden units in the hidden layers, compared to only 64 hidden units in the hybrid
model. Therefore, it can be concluded that the proposed hybrid model can outperform the
SOTA models.
Figure 18, which revealed that, from the five inputs, the average voltage was the most
important input feature. The prediction of the SOC depends on the average voltage the
most and on the nonlinear behavior of the battery voltage. Since the average voltage is the
average of the voltages (the present voltage and the previous voltage values) of a moving
window, which is a statistical method to quickly identify the changes in the residual mean
value and standard deviation [32], it contains a lot of information on the previous condi-
tion of the SOC. It is the main requirement of the RNN, that the previous important input
and output, should be considered for the present output. Following the average voltage,
the present voltage is another important input feature. As the average voltage contains
information about the previous and present states altogether, the instantaneous voltage
information is also an important feature for the SOC estimation. Furthermore, the average
current containing the information on the present and previous loads on the battery, is
also important information for the SOC estimation. As the battery behavior changes with
the ambient temperature, its importance is shown in the SHAP chart. The instantaneous
current was shown to be a less important feature, as its impact was very low in the SOC
estimation. Therefore, the CNN-GRU-LSTM model could detect the input feature im-
portance from the dataset on the SOC estimation more correctly, based on SHAP values.
Figure 18. Feature importance of the hybrid CNN-GRU-LSTM model trained with the four temper-
ature data altogether.
4.5.2. Models Trained with Separately with the Four Ambient Temperature Data
The feature importance graph, based on the models trained on the four ambient tem-
peratures separately is shown in Figure 19. The top important features at all four temper-
atures, sequentially, were identified as average voltage, voltage, and average current,
though the value of the importance (SHAP value) were variable at different temperatures.
The least important features (current and battery temperature) altered their positions be-
tween 4th and 5th places. If the importance of temperature was observed, it was noticed
that the most impact was made on the model trained with the data of 10 °C. Therefore,
the temperature could be placed at the 4th position before the current, in terms of the
feature importance. However, in the other three models, the position of the feature im-
portance of the temperature was 5th, and current was 4th. The model trained with 25 °C
data showed temperature as the least important feature. The trained model with 0 °C and
−10 °C data, the temperature showed some importance as a feature.
Now, further analysis is required to understand the importance of the input features.
The models that were trained with the four temperature data altogether, the temperature
feature importance was high possibly due to the fact that the SOC behavior of the battery
was constantly changing with the change of temperature. However, when the model was
trained with the data of the four temperatures separately, the temperature was the least
Energies 2022, 15, 8003 24 of 27
important feature in three circumstances out of four. This could be explained by the fact
that, when the model was trained with the data of the same ambient temperature, the
battery behavior was remained constant.
(a) (b)
(c) (d)
Figure 19. Feature importance of the hybrid CNN-GRU-LSTM model trained with the data of (a)
−10 °C (b) 0 °C, (c) 10 °C and (d) 25 °C.
enhance the BMS performance. Moreover, since the average voltage was measured using
the moving window method, an increment of the size of the moving window will boost
up the accuracy of the SOC. From the description of the dataset, the data (voltage, current,
and temperature) were collected at the sample rate of 1 Hz. From the input feature im-
portance bar chart, the voltage is a more important input feature than the current and
temperature. Therefore, the sample rate of the voltage can be increased, while implement-
ing the battery model to the BMS.
5. Conclusions
The study proposed a hybrid CNN-GRU-LSTM network to predict the SOC of lith-
ium-ion batteries in the most optimized way. A total of five RNN models (LSTM, CNN-
LSTM, CNN Bi-LSTM, GRU and CNN-GRU-LSTM) were built, trained, and tested to
identify the optimum model, by comparing the performance parameters, such as the error
values, prediction time, and number of trainable parameters. The SOC is very important
and vital information for the BMS and the EV driver, and the proposed model can estimate
it with a very small amount of error (best result: 0.41% MAE at 25 °C), which is very help-
ful for the BMS of the EVs. Two RNN layers were used in this model’s LSTM and GRU
layers. In the lengthy dataset, the LSTM units were more accurate than the GRU, but add-
ing two LSTM layers would make the model more complex. Therefore, one LSTM layer
and one GRU layer were used, guaranteeing the model’s accuracy and portability. The
hybrid CNN-GRU-LSTM model has the key characteristics of the perfect battery model
for a BMS as it can estimate the SOC while using less memory (11,170,968 bytes) in the
BMS, with the least amount of calculation time (0.000113 s/sample), and with the least
amount of error.
This hybrid CNN-GRU-LSTM model, demonstrated to be a robust tool for battery
management systems, as it estimated the SOC correctly, within the shortest amount of
time and consumed a small amount of memory in the BMS. When all of the temperature
data (−10 °C, 0 °C, 10 °C, and 25°C) were used together, the MAE ranged between 0.61%
to 0.90%. Furthermore, the MAE values were with the range of 0.41% to 1.3% when the
temperature data was used separately. The hybrid model used the least number of input
parameters (925,313) and consumed the least amount of processing time (training time
and testing time), when compared to the other models. The explainable AI has identified
the average voltage as the most influential parameter, in order to accurately estimate the
SOC. This brings a new dimension to effectively manage the EV battery system.
The hybrid model reduced the MAE by 0.20% over the existing best battery model,
with the least number of parameters, which outperforms the existing models. It produced
a 32.79% better accuracy than the existing models in the literature. The number of units
was also reduced in this hybrid model, compared to other existing work, as it made the
hybrid model more lightweight. In future, the most optimum model for determining the
State of Health (SoH) and State of Energy (SoE) will be proposed. Moreover, the BMS has
some special requirements for machine learning-based SOC computational methods. For
example, the BMS should have a powerful CPU/GPU for receiving a fast response. The
future task would be focused on reducing the computational burdens.
Author Contributions: Conceptualization, S.M.S. and E.A.B.; methodology, S.M.S., E.A.B., and
M.N.; validation, S.M.S., E.A.B., M.N., M.A., and J.H.; formal analysis, S.M.S., E.A.B., M.N., M.A.,
and J.H.; investigation, S.M.S., E.A.B., and M.N.; data curation, S.M.S., E.A.B., and M.N.; writing—
original draft preparation, S.M.S., E.A.B., M.N., M.A., and J.H.; writing—review and editing, S.M.S.,
E.A.B., M.N., M.A., and J.H.; visualization, S.M.S., E.A.B., M.A., and J.H.; supervision, M.N., M.A.,
and J.H. All authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Energies 2022, 15, 8003 26 of 27
Data Availability Statement: The data presented in this study are available in the article.
Acknowledgments: The authors would like to thank the team at the Manchester Met. University
and the University of York for supporting this research work and preparing the manuscript.
Conflicts of Interest: The authors declare no conflict of interest.
References
1. Espedal, I.B.; Jinasena, A.; Burheim, O.S.; Lamb, J.J. Current trends for state-of-charge (soc) estimation in lithium-ion battery
electric vehicles. Energies 2021, 14, 3284. https://doi.org/10.3390/en14113284.
2. Macioszek, E. Electric Vehicles—Problems and Issues. In Smart and Green Solutions for Transport Systems; TSTP 2019; Advances
in Intelligent Systems and Computing; Sierpiński, G., ed.; Springer: Berlin/Heidelberg, Germany, 2020; Volume 1091.
https://doi.org/10.1007/978-3-030-35543-2_14.
3. Ling, Z.; Cherry, C.R.; Wen, Y. Determining the Factors That Influence Electric Vehicle Adoption: A Stated Preference Survey
Study in Beijing, China. Sustainability 2021, 13, 11719. https://doi.org/10.3390/su132111719.
4. Macioszek, E. E-mobility infrastructure in the Górnośląsko-Zagłębiowska Metropolis, Poland, and potential for development.
In Proceedings of the 5th World Congress on New Technologies (NewTech’19), Lisbon, Portugal, 18–20 August 2019; pp. 1–4.
https://doi.org/10.11159/icert19.108.
5. Misyris, G.S.; Doukas, D.I.; Papadopoulos, T.A.; Labridis, D.P.; Agelidis, V.G. State-of-charge estimation for li-ion batteries: A
more accurate hybrid approach. IEEE Trans. Energy Convers. 2018, 34, 109–119. https://doi.org/10.1109/TEC.2018.2861994.
6. Okay, K.; Eray, S.; Eray, A. Development of prototype battery management system for pv system. Renew. Energy 2022, 181,
1294–1304.
7. Lipu, M.H.; Hannan, M.; Karim, T.F.; Hussain, A.; Saad, M.H.M.; Ayob, A.; Miah, M.S.; Mahlia, T.I. Intelligent algorithms and
control strategies for battery management system in electric vehicles: Progress, challenges and future outlook. J. Clean. Prod.
2021, 292, 126044.
8. Chang, W.-Y. The state of charge estimating methods for battery: A review. Int. Sch. Res. Not. 2013, 2013, 953792.
9. Xiong, R.; Cao, J.; Yu, Q.; He, H.; Sun, F. Critical review on the battery state of charge estimation methods for electric vehicles.
IEEE Access 2017, 6, 1832–1843.
10. Darbar, D.; Bhattacharya, I. Application of machine learning in battery: State of charge estimation using feed forward neural
network for sodiumion battery. Electrochem 2022, 3, 42–57.
11. Vidal, C.; Kollmeyer, P.; Naguib, M.; Malysz, P.; Gross, O.; Emadi, A. Robust xev battery state-of-charge estimator design using
a feedforward deep neural network. SAE Int. J. Adv. Curr. Pract. Mobil. 2020, 2, 2872–2880.
12. Hannan, M.A.; Lipu, M.S.H.; Hussain, A.; Saad, M.H.; Ayob, A. Neural network approach for estimating state of charge of
lithium-ion battery using backtracking search algorithm. IEEE Access 2018, 6, 10069–10079.
13. Wang, Q.; Wu, P.; Lian, J. Soc estimation algorithm of power lithium battery based on afsa-bp neural network. J. Eng. 2020, 13,
535–539.
14. Chemali, E.; Kollmeyer, P.J.; Preindl, M.; Ahmed, R.; Emadi, A. Long short-term memory networks for accurate state-of-charge
estimation of li-ion batteries. IEEE Trans. Ind. Electron. 2017, 65, 6730–6739.
15. Bian, C.; He, H.; Yang, S. Stacked bidirectional long short-term memory networks for state-of-charge estimation of lithium-ion
batteries. Energy 2020, 191, 116538.
16. Jiao, M.; Wang, D. The savitzky-golay filter based bidirectional long short-term memory network for soc estimation. Int. J.
Energy Res. 2021, 45, 19467–19480.
17. Yang, F.; Li, W.; Li, C.; Miao, Q. State-of-charge estimation of lithium-ion batteries based on gated recurrent neural network.
Energy 2019, 175, 66–75.
18. Jiao, M.; Wang, D.; Qiu, J. A gru-rnn based momentum optimized algorithm for soc estimation. J. Power Sources 2020, 459,
228051.
19. Kollmeyer, P.; Vidal, C.; Naguib, M.; Skells, M. Lg 18650hg2 li-ion battery data and example deep neural network xev soc
estimator script. Mendeley Data 2020, 3. https://doi.org/10.17632/cp3473x7xv.3.
20. Naguib, M.; Kollmeyer, P.; Vidal, C.; Emadi, A. Accurate surface temperature estimation of lithium-ion batteries using feedfor-
ward and recurrent artificial neural networks. In Proceedings of the 2021 IEEE Transportation Electrification Conference & Expo
(ITEC), Chicago, IL, USA, 21–25 June 2021; pp. 52–57.
21. Yang, F.; Zhang, S.; Li, W.; Miao, Q. State-of-charge estimation of lithium-ion batteries using lstm and ukf. Energy 2020, 201,
117664.
22. Zhao, R.; Kollmeyer, P.J.; Lorenz, R.D.; Jahns, T.M. A compact unified methodology via a recurrent neural network for accurate
modeling of lithium-ion battery voltage and state-of-charge. In Proceedings of the 2017 IEEE Energy Conversion Congress and
Exposition (ECCE), Cincinnati, OH, USA, 1–5 October 2017; pp. 5234–5241.
23. Bhattacharjee, A.; Verma, A.; Mishra, S.; Saha, T.K. Estimating state of charge for xev batteries using 1 d convolutional neural
networks and transfer learning. IEEE Trans. Veh. Technol. 2021, 70, 3123–3135.
Energies 2022, 15, 8003 27 of 27
24. Zhang, K.; Xu, P.; Zhang, J. Explainable ai in deep reinforcement learning models: A shap method applied in power system
emergency control. In Proceedings of the 2020 IEEE 4th Conference on Energy Internet and Energy System Integration (EI2),
Wuhan, China, 30 October–1 November 2020; pp. 711–716.
25. Lundberg, S.M.; Lee, S.-I. A unified approach to interpreting model predictions. In Advances in Neural Information Processing
Systems; 2017; p. 30. Available online: https://proceedings.neurips.cc/paper/2017/file/8a20a8621978632d76c43dfd28b67767-Pa-
per.pdf (accessed on 24 October 2022).
26. Dikshit, A.; Pradhan, B. Interpretable and explainable AI (XAI) model for spatial drought prediction. Sci. Total Environ. 2021,
801, 149797.
27. Peyal, H.I.; Shahriar, S.M.; Sultana, A.; Jahan, I.; Mondol, M.H. Detection of tomato leaf diseases using transfer learning archi-
tectures: A comparative analysis. In Proceedings of the 2021 International Conference on Automation, Control and Mechatron-
ics for Industry 4.0 (ACMI), Rajshahi, Bangladesh, 8–9 July 2021, pp. 1–6.
28. Chemali, E.; Kollmeyer, P.J.; Preindl, M.; Emadi, A. State-of-charge estimation of li-ion batteries using deep neural networks: A
machine learning approach. J. Power Sources 2018, 400, 242–255.
29. Du, J.; Liu, Z.; Wang, Y. State of charge estimation for li-ion battery based on model from extreme learning machine. Control.
Eng. Pract. 2014, 26, 11–19.
30. Meng, J.; Luo, G.; Gao, F. Lithium polymer battery state-of-charge estimation based on adaptive unscented kalman filter and
support vector machine. IEEE Trans. Power Electron. 2015, 31, 2226–2238.
31. Maheshwari, A.; Nageswari, S. Real-time state of charge estimation for electric vehicle power batteries using optimized filter.
Energy 2022, 254, 124328.
32. Guo, P.; Bai, N. Wind turbine gearbox condition monitoring with AAKR and moving window statistic methods. Energies 2011,
4, 2077–2093.