1. Introduction
With the rise in electric mobility, Internal Combustion (IC) engines are gradually being phased out of the automotive industry. This transition demands electric vehicles (EVs) that can deliver comparable mileage to IC engine-powered vehicles. Achieving this requires the use of batteries with high power and energy density. However, increasing the battery pack’s capacity can significantly add to the vehicle’s weight, negatively affecting overall performance. Therefore, a balance must be struck between battery size and EV range. While Lithium-Ion Battery (LIB) packs currently meet the demands of both electric vehicles (EVs) and Hybrid Electric Vehicles (HEVs), concerns remain regarding their durability, safety, and lifespan. Key factors influencing LIB longevity include the SoC and the number of charge/discharge cycles [
1,
2].
The SoC is a critical parameter in batteries, representing the amount of energy currently stored. Accurate SoC estimation is vital for Battery Management Systems (BMS) to ensure the safe and efficient operation of batteries. Traditional methods for SoC estimation include Open-Circuit Voltage (OCV) measurement, the Kalman filter, and Coulomb counting [
3].
The Open-Circuit Voltage (OCV) method estimates the SoC by measuring the battery’s voltage at rest and correlating it with a predefined voltage-SoC curve. Coulomb counting, on the other hand, calculates the SoC by integrating the current flowing into and out of the battery over time. The Kalman filter method employs a recursive algorithm, using a mathematical model of the battery along with measured voltage and current values to estimate the SoC [
4].
Despite their widespread use, these traditional methods have certain limitations. The OCV method is influenced by factors such as temperature, battery aging, and other conditions that can cause deviations in the voltage-SoC curve from the predefined standard. The Coulomb counting method is susceptible to errors due to battery aging, self-discharge, and measurement inaccuracies. Similarly, the Kalman filter method relies on precise battery models and can be computationally intensive [
5].
The Kalman filter is a mathematical algorithm that provides estimates of unknown variables by combining a series of measurements observed over time, accounting for statistical noise and other inaccuracies. In the context of battery management systems (BMS) for electric vehicles, the Kalman filter is instrumental in estimating the SoC of lithium-ion batteries. Accurate SoC estimation is crucial for optimizing battery performance, ensuring safety, and extending battery lifespan [
6].
Traditional methods like Coulomb counting, which track the charge entering and leaving the battery, can accumulate errors over time due to factors like temperature variations and battery aging. The Kalman filter addresses these challenges by integrating a predictive model of the battery’s behavior with real-time measurements of voltage, current, and temperature. This integration allows for continuous correction of the SoC estimate, reducing cumulative errors and enhancing reliability [
7].
Given the nonlinear characteristics of battery systems, the Extended Kalman Filter (EKF) is often employed. The EKF linearizes the nonlinear system dynamics around the current estimate, enabling the application of the Kalman filter to systems with nonlinearities. This approach enhances the accuracy of SoC estimation in real-world applications; implementing the Kalman filter for SoC estimation requires a precise battery model and accurate characterization of system noise [
8].
To overcome these limitations, data-driven approaches using Machine Learning (ML) and Artificial Neural Networks (ANN) have gained traction [
9]. However, many existing data-driven models, such as Feedforward Neural Networks (FNNs), are inherently static and lack internal memory, making them less suitable for time-dependent problems like SoC estimation, which involves sequential dependencies and hysteresis effects. Recurrent Neural Networks (RNNs) like Long Short-Term Memory (LSTM) and Nonlinear Auto Regressive models with Exogenous input (NARX) have shown promise in handling sequential data, but their implementation often presents challenges for real-time applications in resource-limited embedded systems [
10]. Furthermore, many studies focus on single-layer architectures, which may not be sufficient to capture the complex, long-term temporal dependencies inherent in battery degradation and behavior [
11].
Motivated by this challenge, this work explores a novel cascaded LSTM architecture to address the limitations of existing SoC estimation methods. The primary research gaps this study addresses is the need for a highly accurate yet computationally efficient model that can effectively capture the complex, nonlinear dynamics, and sequential dependencies of battery behavior. While other studies have used LSTM and NARX models, this work provides a comprehensive comparison of a novel three-cascaded LSTM model against traditional methods and a hybrid NARX-LSTM approach, demonstrating its superior performance [
12].
The fuzzy logic method employs a rule-based approach, utilizing linguistic variables to manage the inherent uncertainty and imprecision within the battery system. Meanwhile, the adaptive observer method applies state estimation techniques, using mathematical models and adaptive algorithms to estimate the SoC [
13].
Recently, there has been increasing interest in data-driven approaches for SoC estimation, particularly those based on machine learning, such as deep learning and reinforcement learning. Deep learning utilizes multi-layered Artificial Neural Networks (ANNs) to identify complex patterns within data [
14]. Reinforcement learning, another form of machine learning, learns through interaction with the environment by trial and error [
15].
SoC estimation plays a crucial role in Battery Management Systems (BMS), ensuring the optimal performance and longevity of batteries [
16]. Traditional methods like the OCV, Coulomb counting, and Kalman filter have notable limitations. To address these, advanced techniques such as the ANN method, fuzzy logic, and adaptive observer methods have been introduced. More recently, data-driven approaches, including deep learning and reinforcement learning, have demonstrated promising potential in enhancing SoC estimation [
17].
Given that SoC is a nonlinear function of both temperature and current, its estimation poses a significant challenge, these advanced methods are based on machine learning and data science algorithms, driven by recent developments in Artificial Intelligence (AI). Lithium-Ion Batteries (LIBs) are the preferred power source for electric vehicles, portable devices, and grid energy storage systems. However, both cycle aging and calendar aging contribute to the degradation of LIB capacity and power over time [
18].
An Artificial Neural Network (ANN) was chosen due to its ability to mimic the way the human brain functions. In a neural network, an artificial neuron receives one or more inputs, which are combined with different weights to generate an output. Among the various ANN techniques available, the Multi-Layer Perceptron (MLP) was selected. MLP models brain activity by creating a complex network of interconnected nodes. These nodes are distributed across several layers: an input layer, an output layer, and one or more hidden layers. The MLP network operates in a feed-forward manner, where connections between layers move in one direction from the input layer to the output layer. Each layer, except for the input layer, processes data from the previous layer and passes the results to the next layer [
19].
The Back-Propagation Neural Network (BPNN) is a type of ANN that uses supervised learning to train the network. The BPNN consists of various layers of neurons, encompassing an input layer, one or more hidden layers, and an output layer. Neurons within each layer establish connections with neurons in the subsequent layer through weighted connections. During training, the weights are fine-tuned to minimize the disparity between the predicted output and the actual output. The BPNN is a commonly used ANN for estimating SoC by training on a large amount of battery operation data [
19].
Recurrent Neural Networks (RNNs) are a type of ANN designed to process sequential data. RNNs contain loops within the network that allow information to persist over time. The output of each neuron is fed back into the network as input to the next neuron in the sequence, enabling the network to learn patterns in sequential data. RNNs have been applied in battery SoC estimation, with one study using RNNs equipped with Long Short-Term Memory (LSTM) cells for this purpose. LSTM cells are specifically designed to retain information over extended periods, effectively addressing the issue of vanishing gradients that can occur in traditional RNNs [
20].
LSTMs feature a memory cell that can maintain its state over time, controlled by three gates: the input gate, output gate, and forget gate. These gates are essential for regulating the flow of information in and out of the memory cell. The input gate manages the information entering the memory cell, while the forget gate determines what information is retained or discarded. The output gate controls the transmission of information from the memory cell to the output layer. Although LSTMs excel at handling long-term dependencies, they require more training cycles and are considered one of the more complex models within the RNN family [
13].
There are different methods used in SoC rather than Recurrent Neural Network and generate impressive results [
21].
The main contributions of this work are as follows, proposing a three-cascaded LSTM model; tailored for SoC estimation using six real-world input features, this architecture is designed to capture more complex temporal dependencies than single-layer models. Comprehensive comparative analysis; comparing the proposed model’s performance against a standard LSTM and a NARX-LSTM model to demonstrate its enhanced accuracy. Rigorous validation: through extensive experiments and statistical analysis using the MATLAB R2024a environment, we provide insights into training dynamics and the practical feasibility of the proposed model.
For the latest studies, this study is among the few that provides a comprehensive comparison between NARX and LSTM for SoC estimation, particularly with a focus on model simplicity and real-time applicability [
22].
In recent years, data-driven approaches such as Artificial Neural Networks (ANN) and Feedforward Neural Networks (FNN) have been explored due to their ability to approximate complex nonlinear functions. However, these methods are inherently static and lack internal memory mechanisms, making them less suitable for time-dependent problems like SoC estimation, which involves sequential dependencies and hysteresis effects. Their inability to account for historical system dynamics limits their accuracy and adaptability, especially under fluctuating load and temperature conditions.
A comparison between the different methods used to estimate SoC is illustrated in
Table 1.
2. NARX-LSTM
NARX stands for Nonlinear Autoregressive Exogenous model, and is illustrated in
Figure 1, which shows its mathematical structure. The model consists of three layers: an input layer, a hidden layer, and an output layer, along with a feedback connection from the output layer back to the input layer. The input layer includes an input block for storing the input time series and an output block for storing the output time series.
NARX is a robust model for time series analysis and forecasting, capable of capturing and predicting future behavior based on historical data. By identifying relationships between past and present values, it constructs a mathematical model to accurately reflect these.
The feedback connections within the model allow the output to loop back into the input, enabling the network to effectively learn and represent patterns in time series data.
The NARX model offers the advantage of rapid convergence and requires fewer training cycles, although it depends on output parameters from previous time steps. As global concerns over traditional fuel supplies and emissions intensify, the demand for electric and hybrid vehicles continues to rise. This increases the need for precise battery system modeling, facilitating the design of smaller, more efficient battery packs. Accurate SoC estimation is a critical element in optimizing Battery Management Systems, directly influencing the performance and lifespan of electric vehicle batteries [
23,
24,
25,
26,
27].
The SoC estimation of a battery can be achieved through various neural network techniques, including FNNs and RNNs. LSTM networks have been widely utilized for SoC estimation, with some models incorporating cascaded configurations of multiple LSTMs to enhance accuracy. Comparative studies of these configurations have been performed to identify the most effective approach for SoC estimation.
Figure 2 presents the mathematical model of the LSTM [
26].
The model of LSTM has three inputs Ct − 1, ht − 1, and Xt. where Ct − 1, ht − 1 are the output of the previous cell in case there is a previous cell, and Xt is the input for the cell from the data that should be processed. The processing in the cell is a combination of sigmoid, tanh, additions, and multiplications. The output of the cell is Ct, and ht. where Ct is the information that is used as a memory to the next cell if there is a next cell, and ht is the output of the processed data.
The NARX-LSTM model has been applied for SoC estimation in batteries [
14]. The verification of this research was conducted using MATLAB, with the dataset sourced from IEEE-DataPort [
27].
The NARX-LSTM model is used by applying the measurements of the current, voltage, and temperature as input vector to the NARX; the output of NARX with also current, voltage, and temperature readings are now considered as inputs for the next layer of LSTM. The LSTM output is the estimated SoC of the battery.
The choice to use the NARX model in this study was initially inspired by prior research [
26], where it demonstrated promising performance in modeling nonlinear dynamic systems with memory. Upon further investigation, it found that NARX is particularly well-suited for the time series prediction tasks due to its ability to incorporate both past input and output data, which aligns well with the temporal dependencies observed in battery SoC estimation.
Additionally, the NARX architecture offers a balance between model complexity and training efficiency, making it a practical choice for real-time or embedded implementations, which are required in battery SoC estimation.
4. Experimental Setup
To ensure reproducibility and provide a clear basis for our results, this section details the dataset, data preprocessing steps, and the specific hyperparameters used for all neural network models.
The dataset used in this study was sourced from IEEE-DataPort. It contains time-series data for three different Lithium-ion batteries. The data was collected under various conditions, including charging and discharging cycles, which capture the dynamic and nonlinear behavior of the batteries. The dataset includes three key features: Load current, Load voltage, and temperature. Data from the first battery was used to train the models, the second battery’s data was used for validation, and the third battery’s data was held out for testing. To manage any potential missing or outlier points, a simple linear interpolation method was applied to ensure the time series was continuous.
Model Hyperparameters are implemented in MATLAB.
Table 2 summarizes the key hyperparameters and configurations used for all models.
The network architecture for the cascaded LSTM model consisted of a sequence input layer, followed by three cascaded LSTM layers, and a final fully connected layer that produced the single-value SoC output. The output of each LSTM layer was passed to the next as an additional input, allowing the network to learn progressively more complex representations of the temporal data.
5. Results
After calculating the error, it was found that the least error occurred when three cascaded LSTM networks were used, as shown in
Figure 3. The addition of more networks beyond this point did not significantly improve the model’s accuracy and, in some cases, led to an increase in error due to overfitting and error propagation. This indicates that the optimal number of cascaded LSTMs is highly dependent on the dataset’s complexity. The best number was determined by finding the minimum values for MAE, MSE, and RMSE across different configurations, with three layers consistently providing the lowest error.
To validate the overfitting concerns, the training and validation loss curves were plotted against the number of epochs. As shown in
Figure 4, the training loss continued to decrease with more epochs, but the validation loss began to plateau and then increase after a certain point. This divergence is a clear indication of overfitting, where the model begins to memorize the training data rather than generalizing to unseen data. This analysis provides convincing evidence that a three-layer configuration strikes the optimal balance between model complexity and generalization ability for this specific dataset.
Figure 4: Training and Validation Loss Curves for the Three-Cascaded LSTM Model. The plot shows the training loss (blue line) and validation loss (orange line) decreasing over the first one hundred epochs, with a minimal increase in validation loss toward the end, confirming the model’s stability without significant overfitting at this configuration.
The performance of the severely overfit model, such as the 10-cascaded LSTM network, is illustrated in
Figure 5. This figure clearly shows a rapid divergence where the training loss continues to drop while the validation loss steeply increases after the initial learning phase. This comparison provides convincing evidence that a three-layer configuration strikes the optimal balance between model complexity and generalization ability for this specific dataset, while configurations with more layers suffer from performance degradation due to overfitting. The problem setup is to optimize SoC estimation to reduce the charging and discharging cycles.
The three networks of LSTM have presented that it has the least error of MAE, MSE, and RMSE compared to other LSTM models,
Table 3 shows the MAE, MSE, and RMSE for the thirteen models of LSTM including the NARX connected to LSTM.
To ensure that the observed improvements were statistically significant and not due to random chance, a paired t-test was conducted to compare the RMSE values of the three-cascaded LSTM model with both the single-layer LSTM and the NARX-LSTM models. The results of the t-test confirmed that the performance gains of the three-cascaded LSTM network were statistically significant at a p-value of less than 0.05. This finding strengthens the claim that this specific architecture provides a robust and repeatable improvement in SoC estimation accuracy.
While MAE, MSE, and RMSE are effective metrics for measuring average prediction errors, they do not fully capture the impact of worst-case scenarios vital for battery safety. To provide a more domain-specific evaluation, we also considered the Maximum Absolute Error (MAE) to assess the largest momentary deviation in SoC estimation, and the SoC Error at Full Discharge, a critical parameter for predicting vehicle range. The three-cascaded LSTM model consistently showed the lowest MAE and a minimal error at the full discharge point, further supporting its robustness in practical applications compared to the other architecture.
Figure 6 shows the Maximum Absolute error for the different models of RNN.
From the above results, it is shown that the error is decreased when the number of LSTM networks has increased to three and after that the error is increasing and decreasing in a random way due to overfitting and error propagation.
6. Discussion
While various techniques exist for estimating the SoC of a battery, this research focuses on data-driven methods, specifically utilizing LSTM and NARX models due to their proven capability in modeling dynamic systems with memory and external influences. This study used RMSE as the primary measurement technique to evaluate the models, allowing for a direct and quantitative comparison. The findings indicate that using three cascaded LSTM layers provides the most accurate SoC estimation. This configuration achieved a reduction in RMSE by 78% when compared to the single-layer LSTM, and by 58% compared to the NARX-LSTM model. The superior performance of the cascaded model can be attributed to its ability to learn more complex, hierarchical features from the input data, effectively overcoming the limitations of single-layer models.
For future work, we recommend several avenues to build upon these findings. First, the model’s generalizability could be enhanced by training on a larger, more diverse dataset that includes multiple battery chemistries and varying states of health. Second, exploring model compression techniques or more computationally efficient architectures, such as gated recurrent units (GRUs) or temporal convolutional networks (TCNs), could address the challenges of real-time implementation. Finally, incorporating explainability methods like SHAP or LIME would provide valuable insights into the contribution of individual input features to the SoC prediction, moving this work from a “black box” model to a more transparent and interpretable solution.