Accurate State of Charge Estimation for Sodium-Ion Battery Energy Storage Systems Using an Enhanced Deep Learning Approach

The precise management and operational efficiency of modern battery energy storage systems (BESS) hinge critically on the accurate knowledge of a fundamental internal state: the State of Charge (SOC). SOC represents the remaining available energy in a battery, analogous to a fuel gauge. Its accurate estimation is paramount for preventing overcharge and over-discharge (which degrade battery health), optimizing charge/discharge scheduling, and providing reliable runtime predictions. Sodium-ion batteries are emerging as a compelling alternative to lithium-ion in large-scale battery energy storage system applications due to their potential advantages in cost, safety, and resource abundance. However, like all electrochemical systems, the SOC of a sodium-ion battery cannot be measured directly; it must be inferred from external, measurable parameters such as terminal voltage, current, and temperature. This estimation problem is inherently challenging due to the highly non-linear and time-dependent electrochemical processes within the battery, which are influenced by aging, varying load conditions (dynamics), and environmental factors.

Traditional SOC estimation methods include open-circuit voltage (OCV) lookup and coulomb counting (Ampere-hour integration). The OCV method requires long rest periods to reach equilibrium, making it unsuitable for online estimation in an actively managed battery energy storage system. Coulomb counting is simple but suffers from error accumulation due to sensor inaccuracies and unknown initial conditions. Model-based approaches, such as those using Equivalent Circuit Models (ECMs) combined with state observers like the Kalman Filter, have been widely adopted. These methods, however, rely heavily on the accuracy of the predefined model, which may not capture all the complex, non-linear behaviors across the entire lifespan and operational range of a battery in a diverse battery energy storage system. The need for robust, adaptive, and high-precision estimation techniques has led to significant interest in data-driven methods, particularly those leveraging deep learning.

Deep learning models, especially recurrent neural networks (RNNs) designed for sequential data, have shown remarkable promise for SOC estimation. They learn the complex mapping from measurable inputs (current, voltage, temperature) to the target SOC directly from historical operational data, without requiring an explicit physical or electrochemical model. This data-driven approach offers strong potential for generalizing across diverse usage patterns typical in a battery energy storage system. Among RNN variants, Long Short-Term Memory (LSTM) networks are exceptionally well-suited for this task due to their ability to learn long-term temporal dependencies and mitigate the vanishing gradient problem. Nevertheless, a standard LSTM model treats all time steps in a sequence equally, which may not be optimal for SOC estimation where certain operational phases (e.g., high current pulses, relaxation phases) contain more critical information than others.

To address this, the attention mechanism can be integrated. It allows the model to dynamically focus on, or “attend to,” the most relevant parts of the input sequence when making a prediction at each time step. This is conceptually powerful for a battery energy storage system, as the model can learn to weigh recent high-current events or specific voltage relaxation patterns more heavily when determining the present SOC. Furthermore, the performance of any deep learning model, including an LSTM-Attention hybrid, is highly sensitive to its hyperparameters—configurations not learned during training but set beforehand, such as the number of hidden units, learning rate, and training epochs. Manual tuning of these is often suboptimal and inefficient.

In this work, we propose and validate a novel, optimized deep learning framework for high-fidelity SOC estimation in sodium-ion battery energy storage systems. Our model synergistically combines an LSTM network, an attention mechanism, and a systematic hyperparameter optimization strategy using Grid Search (GS). This GS-LSTM-Attention model is designed to capture complex temporal dynamics, prioritize informative sequence segments, and operate at its peak architectural configuration. We demonstrate its superior accuracy and robustness across multiple constant-current operational scenarios, benchmarked against standard LSTM and basic LSTM-Attention models.

Methodology: The GS-LSTM-Attention Framework

The core of our proposed estimation strategy is a deep neural network model with a specific architecture and an optimization wrapper. The workflow involves data preparation, model construction with attention, and rigorous hyperparameter tuning.

Data Preprocessing

The performance and training stability of deep learning models are greatly enhanced by normalizing the input features to a common scale. We apply min-max normalization to each feature channel (current, voltage) and the target SOC. This transformation scales all values to a range between 0 and 1.

$$ x’ = \frac{x – x_{\text{min}}}{x_{\text{max}} – x_{\text{min}}} $$

where \( x \) is the original value, \( x_{\text{min}} \) and \( x_{\text{max}} \) are the minimum and maximum values of that feature in the training dataset, and \( x’ \) is the normalized value. This step ensures that no single feature dominates the learning process due to its original magnitude, which is crucial for the effective training of models in a battery energy storage system analytics pipeline.

Long Short-Term Memory (LSTM) Network Fundamentals

The LSTM unit is designed to remember information over long time periods. It achieves this through a gating mechanism that regulates the flow of information. The key components are the cell state \( C_t \) (the “memory”) and three gates: the forget gate \( f_t \), the input gate \( i_t \), and the output gate \( o_t \).

At each time step \( t \), the LSTM unit receives the current input \( x_t \) and the previous hidden state \( h_{t-1} \). The calculations proceed as follows:

1. Forget Gate: Decides what information to discard from the cell state.
$$ f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f) $$

2. Input Gate: Decides what new information to store in the cell state. It has two parts: a sigmoid layer that decides which values to update, and a tanh layer that creates a vector of new candidate values, \( \tilde{C}_t \).
$$ i_t = \sigma(W_i \cdot [h_{t-1}, x_t] + b_i) $$
$$ \tilde{C}_t = \tanh(W_C \cdot [h_{t-1}, x_t] + b_C) $$

3. Cell State Update: The old cell state \( C_{t-1} \) is updated to the new cell state \( C_t \).
$$ C_t = f_t \odot C_{t-1} + i_t \odot \tilde{C}_t $$

4. Output Gate: Decides what part of the cell state to output as the hidden state.
$$ o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o) $$
$$ h_t = o_t \odot \tanh(C_t) $$

Here, \( \sigma \) denotes the sigmoid activation function, \( \tanh \) is the hyperbolic tangent function, \( \odot \) represents the Hadamard (element-wise) product, \( W \) terms are weight matrices, and \( b \) terms are bias vectors. This structure allows the LSTM to effectively learn and remember long-range dependencies in time-series data from a battery energy storage system.

Incorporating the Attention Mechanism

While LSTMs are powerful, they can struggle to identify which specific past observations are most critical for the current prediction. An attention mechanism addresses this by providing a weighted context vector. In our LSTM-Attention model, the attention layer operates on the sequence of hidden states \( H = [h_1, h_2, …, h_T] \) produced by the LSTM layer.

For a given target time step, the mechanism calculates a set of attention scores \( e_t \) for each hidden state in the sequence, typically using a learnable function (often a simple feedforward network). These scores are normalized into attention weights \( \alpha_t \) using the softmax function:

$$ \alpha_t = \frac{\exp(e_t)}{\sum_{j=1}^{T} \exp(e_j)} $$

The context vector \( c \), which is a summary of the most relevant information from the entire input sequence for the current step, is computed as the weighted sum of all hidden states:

$$ c = \sum_{t=1}^{T} \alpha_t h_t $$

This context vector \( c \), rich with selectively focused historical information, is then concatenated with the final LSTM hidden state (or used directly) and passed through one or more fully connected (dense) layers to produce the final SOC estimate \( \hat{y} \). This enables the model to dynamically emphasize voltage plateaus or current transients that are highly informative for SOC, a significant advantage for managing a complex battery energy storage system.

Hyperparameter Optimization via Grid Search (GS)

The choice of hyperparameters profoundly impacts model performance. We employ Grid Search, an exhaustive optimization technique, to find the optimal combination of key hyperparameters for our LSTM-Attention model. Grid Search works by defining a discrete search space for each hyperparameter and then training and evaluating a model for every possible combination within this grid.

Let \( \Theta = \{\theta_1, \theta_2, …, \theta_n\} \) represent the set of hyperparameters to optimize. For each hyperparameter \( \theta_i \), we define a set of candidate values \( V_i = \{v_{i1}, v_{i2}, …, v_{im}\} \). The Cartesian product of all \( V_i \) forms the full grid of hyperparameter combinations. The optimal combination \( \theta^* \) is selected as the one that minimizes the chosen evaluation metric (e.g., Mean Squared Error) on a held-out validation set:

$$ \theta^* = \arg \min_{\theta \in \Theta} \text{MSE}( M(\theta), D_{\text{val}} ) $$

where \( M(\theta) \) is the model trained with hyperparameter combination \( \theta \), and \( D_{\text{val}} \) is the validation dataset. For this study, we focus on optimizing three critical hyperparameters:
1. Number of LSTM Units: Controls the model’s capacity to learn complex temporal patterns.
2. Learning Rate: Governs the step size during the gradient descent optimization process.
3. Number of Training Epochs: Determines how many times the model iterates over the entire training dataset.

The predefined search space for our GS-LSTM-Attention model is summarized in the table below.

Hyperparameter Search Space Values Description
LSTM Units [32, 64, 128] Number of neurons in the LSTM hidden layer.
Learning Rate [0.001, 0.005, 0.01] Step size for optimizer (Adam).
Training Epochs [50, 100, 150] Number of complete passes through the training data.

Overall Estimation Pipeline

The complete procedure for estimating the SOC of a sodium-ion battery energy storage system using the proposed GS-LSTM-Attention model is as follows:

  1. Data Preparation: Collect time-series data (current, voltage). Calculate the reference SOC (e.g., via coulomb counting with calibration) as the training target. Split the data into training, validation, and testing sets. Apply min-max normalization.
  2. Model Architecture Definition: Construct the LSTM-Attention model with an input layer, one or more LSTM layers, an attention layer, dense layers, and an output layer.
  3. Grid Search Execution: Define the hyperparameter grid as shown above. Iteratively train and validate an LSTM-Attention model for each unique combination in the grid. The model’s performance on the validation set (using Mean Squared Error) dictates the best combination.
  4. Final Model Training & Evaluation: Train the final LSTM-Attention model on the combined training and validation data using the optimal hyperparameters \( \theta^* \) identified by Grid Search. Evaluate the final model’s performance on the independent test set to report its generalization ability.

Experimental Design and Evaluation

Dataset Description

To validate our proposed model, we utilize experimental data from commercial 18650 cylindrical sodium-ion batteries. Each cell has a nominal capacity of 1.0 Ah. Data was collected under laboratory-controlled conditions at a constant ambient temperature of 25°C. The charging and discharging were performed under constant current (CC) regimes. To assess model robustness across different operational intensities relevant to a battery energy storage system, data from three distinct discharge current rates was used: 2 A (0.5C), 5 A (1.25C), and 6 A (1.5C). For each scenario, the measured terminal voltage and current are used as input features, and the corresponding SOC (derived from calibrated coulomb counting) is the target output. Time-series sequences are constructed with a fixed historical window length to provide temporal context to the model.

Performance Evaluation Metrics

To quantitatively assess and compare the estimation accuracy of different models, we employ three standard regression metrics:

1. Mean Squared Error (MSE): Measures the average of the squares of the errors between estimated and true SOC values. It heavily penalizes larger errors.
$$ \text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2 $$

2. Mean Absolute Error (MAE): Measures the average magnitude of the errors, providing a more linear and interpretable scale.
$$ \text{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i – \hat{y}_i| $$

3. Coefficient of Determination (R-squared, \( R^2 \)): Represents the proportion of variance in the true SOC that is predictable from the inputs. A value closer to 1 indicates a better fit.
$$ R^2 = 1 – \frac{\sum_{i=1}^{n} (y_i – \hat{y}_i)^2}{\sum_{i=1}^{n} (y_i – \bar{y})^2} $$
where \( y_i \) is the true SOC, \( \hat{y}_i \) is the estimated SOC, \( \bar{y} \) is the mean of the true SOC, and \( n \) is the number of samples.

Benchmark Models and Implementation Details

We compare the performance of our proposed GS-LSTM-Attention model against two benchmark models:

  1. Standard LSTM: A basic LSTM network followed by dense layers, without an attention mechanism.
  2. LSTM-Attention: An LSTM network integrated with an attention layer, but with its hyperparameters set to common default values (not systematically optimized).

All models are implemented using the TensorFlow/Keras deep learning framework. The dataset for each current rate is split into 70% for training, 15% for validation (used during Grid Search), and 15% for final testing. The models are trained to minimize the MSE loss function using the Adam optimizer.

Results and Comparative Analysis

The performance of the three models across the three different constant-current discharge scenarios is critically evaluated. The following interactive table presents the quantitative results (MSE, MAE, and \( R^2 \)) on the independent test sets. The results clearly demonstrate the progressive improvement from the standard LSTM to the LSTM-Attention, and finally to the optimized GS-LSTM-Attention model.

Model 2 A Discharge (0.5C) 5 A Discharge (1.25C) 6 A Discharge (1.5C)
MSE (×10⁻³) MAE (×10⁻²) MSE (×10⁻³) MAE (×10⁻²) MSE (×10⁻³) MAE (×10⁻²)
Standard LSTM 1.00 2.35 0.8568 0.60 1.88 0.8590 1.80 3.57 0.8318
LSTM-Attention 0.70 2.03 0.9008 0.40 1.48 0.9032 0.70 1.99 0.9388
GS-LSTM-Attention (Proposed) 0.20 0.87 0.9771 0.30 1.34 0.9140 0.50 1.88 0.9527

Analysis of Results

The data presented in the table offers compelling evidence for the effectiveness of our proposed approach:

1. Superior Accuracy of GS-LSTM-Attention: Across all three discharge rates, the proposed GS-LSTM-Attention model achieves the best performance on nearly every metric. It consistently yields the lowest MSE and MAE, and the highest \( R^2 \) scores. Notably, under the 2 A discharge condition, it achieves an exceptional \( R^2 \) of 0.9771, indicating that the model explains over 97.7% of the variance in the true SOC. This represents a significant improvement of 0.1203 and 0.0763 in \( R^2 \) over the standard LSTM and LSTM-Attention models, respectively.

2. Impact of Attention Mechanism: Comparing the LSTM and LSTM-Attention models, the addition of the attention mechanism consistently improves performance. For instance, at 6 A, the \( R^2 \) improves from 0.8318 to 0.9388, and the MSE is reduced by more than half. This validates the hypothesis that allowing the model to focus on critical temporal segments enhances its estimation capability for the non-linear dynamics of a battery energy storage system.

3. Impact of Grid Search Optimization: The final step of applying Grid Search provides a further, crucial boost in performance. The GS-LSTM-Attention model outperforms the non-optimized LSTM-Attention model in all cases. The optimization fine-tunes the model’s capacity and learning dynamics, allowing it to extract features more efficiently and avoid underfitting or overfitting. The reduction in MAE, a very intuitive error metric, is particularly telling for practical deployment in a battery energy storage system.

4. Robustness Across Current Rates: The proposed model maintains high accuracy (\( R^2 > 0.91 \)) across different discharge currents. While the absolute error tends to increase slightly with higher current rates (due to more pronounced polarization effects and potentially noisier dynamics), the model’s relative performance gain over the benchmarks remains clear. This demonstrates its robustness and potential for application in a battery energy storage system experiencing variable load profiles.

The visual alignment of the estimated SOC trajectories with the ground truth further confirms these findings. The GS-LSTM-Attention model’s estimation curve virtually overlays the true SOC curve, with minimal deviation. In contrast, the estimates from the standard LSTM model show noticeable drift and error, especially during certain transition phases. The LSTM-Attention model shows improvement but still exhibits minor inaccuracies that are eliminated by the hyperparameter optimization in our final model.

Discussion

The outstanding performance of the GS-LSTM-Attention model can be attributed to its multi-faceted design that addresses key challenges in SOC estimation for battery energy storage systems. First, the LSTM backbone is inherently capable of modeling the long-range temporal dependencies present in battery data, such as the slow voltage recovery after a load pulse or the cumulative effect of current integration. Second, the attention mechanism acts as an intelligent filter, enabling the model to dynamically assign higher importance to historical states that are most relevant for the current estimation. For example, it can learn to pay more attention to recent high-current events or specific points on the voltage-SOC curve that have higher sensitivity. This is a significant advantage over methods that treat all past observations equally.

Third, and critically, the use of Grid Search automates and optimizes the hyperparameter selection process. The performance gap between the LSTM-Attention and GS-LSTM-Attention models underscores that even a well-designed architecture can perform suboptimally with poorly chosen hyperparameters. By systematically exploring the defined search space, we ensure the model operates at a configuration that balances complexity (to learn non-linearities) and generalization (to avoid overfitting to training noise). This optimization step is essential for developing reliable algorithms for real-world battery energy storage system management, where operational conditions can vary.

From a practical standpoint for battery energy storage system integration, a model with high \( R^2 \) and low MAE, as demonstrated here, translates to more reliable system state awareness. This enables:

  • Enhanced Safety: More accurate prevention of operation beyond safe SOC limits.
  • Improved Durability: Better-informed cycling strategies that reduce stress and prolong battery life within the storage system.
  • Optimized Energy Dispatch: Precise knowledge of available energy for grid services or backup power.
  • Reduced System Oversizing: Confidence in available capacity can reduce the need for large safety margins in system design.

While this study focused on constant-current discharge for clear validation, the true strength of data-driven models lies in handling complex, dynamic load profiles typical of actual battery energy storage system applications. The architecture proposed here is well-suited for such generalization. Future work will involve training and testing the model on highly variable duty cycles, incorporating temperature as an explicit input feature, and exploring online adaptation techniques to account for battery aging throughout the long service life of a grid-scale battery energy storage system.

Conclusion

Accurate State of Charge estimation remains a cornerstone for the efficient, safe, and reliable operation of sodium-ion battery energy storage systems. This work successfully developed and validated a sophisticated deep learning framework, the GS-LSTM-Attention model, to address this challenge. The model synergistically combines the temporal modeling strength of Long Short-Term Memory networks, the focus-enhancing capability of the attention mechanism, and the rigorous optimization power of Grid Search hyperparameter tuning.

Experimental results on sodium-ion battery data under multiple constant-current discharge scenarios demonstrate the model’s superior accuracy and robustness. It consistently outperformed both a standard LSTM model and a non-optimized LSTM-Attention model across all evaluation metrics (MSE, MAE, and R²). The proposed model achieved high coefficients of determination (R² > 0.91) in all tested conditions, with a peak R² of 0.9771 at a 2 A discharge rate. The significant performance improvements underscore the individual and combined value of incorporating an attention layer and conducting systematic hyperparameter optimization.

This study confirms the strong potential of advanced, optimized data-driven models for state estimation in next-generation battery energy storage systems. The GS-LSTM-Attention framework provides a high-precision, adaptive solution for SOC estimation, contributing to the advancement of intelligent battery management systems capable of maximizing the value and lifespan of sodium-ion and other battery technologies within large-scale energy storage applications.

Scroll to Top