Accurately determining the remaining usable energy in a lithium ion battery is a fundamental challenge that underpins the reliability and safety of modern electric vehicles and energy storage systems. This parameter, known as the State of Charge (SOC), is defined as the ratio of remaining capacity to the battery’s nominal capacity. However, a lithium ion battery is a complex, nonlinear, and time-varying electrochemical system. Its external behavior, manifested through terminal voltage, current, and temperature, is influenced by a multitude of factors including aging, dynamic load profiles, and ambient temperature. Unlike a fuel gauge, SOC cannot be measured directly, making its precise estimation a critical and non-trivial task for Battery Management Systems (BMS).

Traditional methods for SOC estimation, such as the open-circuit voltage (OCV) method and the ampere-hour (Ah) integration method, are fraught with limitations. The OCV method requires the battery to rest for an impractically long time to reach equilibrium, and the OCV-SOC relationship itself shifts with temperature and cycle life. The Ah integration method is simple but suffers from cumulative errors, especially when the initial SOC is unknown. To overcome these issues, model-based approaches utilizing filters like the Kalman Filter and its variants have been extensively studied. While effective, these methods are inherently tied to the accuracy of the underlying battery model—be it an equivalent circuit model or a complex electrochemical model. Developing and parameterizing these models requires deep expertise and they often lack the robustness to generalize across varying operational conditions and battery states of health.
In recent years, the surge in computational power has propelled data-driven methods, particularly deep learning, to the forefront of SOC estimation research. These methods treat the lithium ion battery as a “black box,” learning the complex mapping between easily measurable external parameters (current, voltage, temperature) and the internal SOC. This approach bypasses the need for explicit physical modeling. Among the most promising architectures are Convolutional Neural Networks (CNNs), renowned for extracting spatial features, and Recurrent Neural Networks (RNNs), especially their advanced variants like Long Short-Term Memory (LSTM) networks, which excel at capturing temporal dependencies in sequential data. An LSTM unit overcomes the vanishing gradient problem of traditional RNNs through a gated cell state mechanism, governed by the following equations:
The input gate \(i_t\), forget gate \(f_t\), and candidate cell state \(\tilde{C}_t\) are computed as:
$$i_t = \sigma(W_i \cdot [h_{t-1}, x_t] + b_i)$$
$$f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f)$$
$$\tilde{C}_t = \tanh(W_C \cdot [h_{t-1}, x_t] + b_C)$$
where \(\sigma\) is the sigmoid activation function, \(\tanh\) is the hyperbolic tangent function, \(W\) and \(b\) are weight matrices and bias vectors, \(h_{t-1}\) is the previous hidden state, and \(x_t\) is the current input.
The cell state \(C_t\) is then updated:
$$C_t = f_t * C_{t-1} + i_t * \tilde{C}_t$$
Finally, the output gate \(o_t\) and the new hidden state \(h_t\) are:
$$o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o)$$
$$h_t = o_t * \tanh(C_t)$$
This structure allows the LSTM to retain long-term historical information crucial for understanding the dynamics of a lithium ion battery.
To further enhance temporal feature extraction, Bidirectional LSTM (BiLSTM) networks process data in both forward and reverse directions, capturing contextual information from past and future states within a sequence. The final output at time \(t\) is often a concatenation of both directions:
$$y_t = [\overrightarrow{h_t}, \overleftarrow{h_t}]$$
While powerful for temporal analysis, these networks can benefit from complementary feature extraction. This is where CNNs come in. A 1D-CNN can be effectively applied to time-series data to automatically learn and extract salient local patterns and spatial hierarchies from the raw input signals—current, voltage, and temperature—before the sequence is processed for temporal dynamics. The output of a convolutional layer is given by:
$$y = \text{LeakyReLU}(\omega * x + b)$$
where \(*\) denotes the convolution operation, \(\omega\) is the kernel weight, \(b\) is the bias, and \(x\) is the input sequence.
The fusion of CNN and BiLSTM creates a powerful hybrid architecture for lithium ion battery SOC estimation. The CNN acts as a sophisticated feature extractor, distilling the most relevant spatial patterns from a window of recent measurements. These high-level features are then fed into the BiLSTM layers, which model the long-range temporal evolution and dependencies of the battery’s state. This combination allows the model to learn from both the instantaneous shape of the input signals and their historical progression. However, the performance of such a deep learning model is highly sensitive to its hyperparameters, such as the number of layers, filter sizes, number of units, learning rate, and dropout rate. Manually tuning these parameters is a time-consuming and often suboptimal process.
Common automation strategies like grid search are computationally prohibitive in high-dimensional hyperparameter spaces, while random search, though more efficient, may miss promising regions. Bayesian Optimization (BO) offers a superior, principled approach. It constructs a probabilistic surrogate model of the objective function (e.g., validation error) based on past evaluations and uses an acquisition function to decide the most promising hyperparameters to evaluate next. The Tree-structured Parzen Estimator (TPE) is a particularly efficient Bayesian optimization algorithm. It models the probability distributions of hyperparameters that lead to good (\(l(x)\)) and bad (\(g(x)\)) objective values, relative to a threshold \(y^*\):
$$p(x|y) = \begin{cases} l(x) & \text{if } y < y^* \\ g(x) & \text{if } y \ge y^* \end{cases}$$
The Expected Improvement (EI) acquisition function is then proportional to:
$$\text{EI}_{y^*}(x) \propto \left( \gamma + \frac{g(x)}{l(x)} (1 – \gamma) \right)^{-1}$$
where \(\gamma = p(y < y^*)\). The algorithm iteratively selects hyperparameters that maximize EI, leading to faster convergence to an optimal configuration.
Integrating TPE-based Bayesian optimization with the CNN-BiLSTM architecture forms a robust and automated pipeline for high-accuracy SOC estimation. The process involves defining a search space for key hyperparameters, as illustrated in the following table, and letting the BO algorithm efficiently navigate it to maximize estimation performance.
| Hyperparameter | Search Space | Optimal Value (Example) |
|---|---|---|
| Learning Rate | (0.001, 0.01) | 0.0078 |
| Number of Epochs | (8000, 12000) | 10039 |
| CNN Layer 1 Filters | (100, 300) | 142 |
| CNN Layer 2 Filters | (100, 300) | 255 |
| CNN Kernel Size 1 | (3, 6) | 3 |
| CNN Kernel Size 2 | (3, 6) | 4 |
| BiLSTM Units | (100, 500) | 296 |
| Dropout Rate | (0.1, 0.5) | 0.283 |
The efficacy of this proposed BO-CNN-BiLSTM framework must be validated under rigorous and realistic testing conditions. For any lithium ion battery SOC estimation model, generalization across diverse driving cycles and a wide temperature range is paramount. A robust experimental design uses data from standardized but distinct driving schedules, such as the Dynamic Stress Test (DST), the Federal Urban Driving Schedule (FUDS), and the US06 (highway) cycle, collected at multiple ambient temperatures (e.g., 0°C, 10°C, 20°C, 30°C, 40°C). To test generalization, the model can be trained on data from some cycles (e.g., DST and US06) across a subset of temperatures and then evaluated on a completely unseen cycle (e.g., FUDS) at all temperatures, including those not present in the training set. Data preprocessing is critical; normalizing the input features (current, voltage, temperature) to a common scale, typically [-1, 1], ensures stable and efficient training:
$$x_{\text{norm}} = \frac{2(x – x_{\text{min}})}{x_{\text{max}} – x_{\text{min}}} – 1$$
where \(x_{\text{min}}\) and \(x_{\text{max}}\) are the minimum and maximum values from the training set.
The performance of the model is quantitatively assessed using several key metrics. The Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) provide measures of the average estimation error magnitude, while the Maximum Error (ME) highlights the worst-case deviation. The coefficient of determination (\(R^2\)) indicates how well the model’s predictions explain the variance of the true SOC values. Their formulas are:
$$\text{RMSE} = \sqrt{\frac{1}{N} \sum_{k=1}^{N} (SOC_k – \widehat{SOC}_k)^2}$$
$$\text{MAE} = \frac{1}{N} \sum_{k=1}^{N} |SOC_k – \widehat{SOC}_k|$$
$$\text{ME} = \max(|SOC – \widehat{SOC}|)$$
$$R^2 = 1 – \frac{\sum_{k} (SOC_k – \widehat{SOC}_k)^2}{\sum_{k} (SOC_k – \overline{SOC})^2}$$
where \(N\) is the number of samples, \(SOC_k\) is the true value, \(\widehat{SOC}_k\) is the estimated value, and \(\overline{SOC}\) is the mean of the true SOC.
Applying the BO-CNN-BiLSTM model under such a rigorous protocol yields highly compelling results. The model demonstrates exceptional accuracy and generalization. For instance, when tested on the unseen FUDS driving cycle across various temperatures, the estimation errors remain remarkably low. The following table summarizes typical performance metrics achievable with this approach, showing superiority over a standard CNN-BiLSTM model with manually tuned or randomly searched hyperparameters.
| Temperature (°C) | Model | RMSE (%) | MAE (%) | Max Error (%) | R² |
|---|---|---|---|---|---|
| 0 | BO-CNN-BiLSTM | 0.75 | 0.65 | 1.94 | 0.9993 |
| CNN-BiLSTM | 1.12 | 0.88 | 3.14 | 0.9985 | |
| Room Temp | BO-CNN-BiLSTM | 0.74 | 0.64 | 1.60 | 0.9993 |
| CNN-BiLSTM | 1.01 | 0.80 | 3.03 | 0.9987 | |
| 50 | BO-CNN-BiLSTM | 0.61 | 0.45 | 2.20 | 0.9995 |
| CNN-BiLSTM | 0.81 | 0.67 | 2.48 | 0.9992 |
The results clearly indicate that the Bayesian-optimized model consistently achieves lower errors and higher \(R^2\) values across the temperature spectrum. This underscores the critical value of systematic hyperparameter tuning in unlocking the full potential of the hybrid CNN-BiLSTM architecture. Furthermore, a key requirement for any practical BMS is robustness to inaccurate initial conditions, as the true initial SOC is often unknown. The proposed model exhibits excellent convergence properties. Even when initialized with a highly erroneous SOC value (e.g., 40% offset from the true value), the model’s estimates rapidly converge to the true SOC trajectory within a short period, often just a few seconds of operation, demonstrating strong practical utility.
To fully appreciate the contribution of the hybrid architecture, it is instructive to compare it against its constituent parts. A standalone LSTM network, even with Bayesian optimization, primarily captures temporal dependencies. While effective, it may overlook subtle local patterns in the input data that the CNN layers are specifically designed to extract. The CNN-BiLSTM model, by jointly learning spatial and bidirectional temporal features, provides a more comprehensive representation of the lithium ion battery‘s dynamics. The performance gap between a BO-LSTM and the BO-CNN-BiLSTM, as shown in the comparative analysis, validates this architectural advantage. The hybrid model consistently delivers superior accuracy, lower error bounds, and more stable predictions, particularly during transient phases of the driving cycle.
In conclusion, the integration of a Convolutional Neural Network for spatial feature extraction with a Bidirectional Long Short-Term Memory network for temporal modeling, further refined through a Tree-structured Parzen Estimator Bayesian optimization process, presents a highly advanced and effective solution for lithium-ion battery State-of-Charge estimation. This data-driven approach successfully addresses the core challenges posed by the nonlinear and time-varying nature of the lithium ion battery. It eliminates the dependency on precise physical modeling and demonstrates exceptional generalization capability across unseen driving profiles and operating temperatures. The model’s robustness to initial condition errors and its high estimation accuracy, with RMSE consistently below 1.3% and often below 0.8% in tested scenarios, meet the stringent requirements for real-world BMS applications. As the demand for electric vehicles and large-scale energy storage grows, such intelligent, adaptive, and high-precision estimation frameworks will be indispensable for optimizing performance, ensuring safety, and extending the lifespan of lithium ion battery systems. Future work may focus on integrating state-of-health (SOH) estimation and adapting the model for online, real-time implementation on embedded BMS hardware.
