In the field of energy storage battery management, accurate real-time State of Charge (SOC) estimation is critical for system safety, efficiency, and longevity. Traditional methods such as open-circuit voltage (OCV) estimation, current integration, and Kalman filtering each have inherent limitations, especially under dynamic operating conditions with noisy sensor data. To address these challenges, I propose a novel SOC calibration strategy that integrates signal processing techniques with machine learning models. The strategy consists of four main stages: Kalman smoothing of input features, XGBoost-based SOC prediction, wavelet transform denoising of predicted SOC, and isotonic regression to enforce monotonicity. This combined approach significantly improves the accuracy and robustness of SOC estimation for energy storage batteries in real-world scenarios.
The overall workflow is summarized as follows:
- Collect voltage, temperature, current, and SOC data from the battery management system (BMS).
- Apply Kalman smoothing to the voltage, temperature, and current signals to reduce measurement noise and fluctuations.
- Train an XGBoost regression model using the smoothed features to predict SOC.
- Perform wavelet transform denoising on the predicted SOC sequence to remove residual prediction errors.
- Apply isotonic regression on the denoised SOC sequence within each charge/discharge phase to ensure monotonicity.
- Output the calibrated SOC values for real-time use.
Below, I detail each step with mathematical formulations and experimental validations. The effectiveness of the proposed method is demonstrated using actual operational data from an energy storage battery station.
Data Acquisition and Preprocessing
The data used in this study are collected from a real energy storage battery station operating under normal conditions. The BMS records total voltage, total current, maximum temperature, minimum temperature, and SOC at a sampling interval of 30 seconds. Table 1 shows the field names and their meanings.
| Field Name | Description |
|---|---|
| Total_voltage | Total voltage of the battery pack (V) |
| Current | Total current flowing through the battery (A) |
| MAX_T | Maximum cell temperature (°C) |
| MIN_T | Minimum cell temperature (°C) |
| SOC | State of Charge (%) |
The training dataset consists of 50,502 records from March 1 to March 18, 2024. The test dataset contains 2,878 records from March 19, 2024. A sample of the raw data is presented in Table 2.
| Timestamp | Total_voltage (V) | Current (A) | MAX_T (°C) | MIN_T (°C) | SOC (%) |
|---|---|---|---|---|---|
| 2024/3/1 0:01 | 797.8 | 0 | 12 | 9 | 100 |
| 2024/3/1 0:02 | 797.9 | 0 | 12 | 9 | 100 |
| … | … | … | … | … | … |
| 2024/3/18 23:59 | 766.6 | 0 | 30 | 23 | 13 |
Kalman Smoothing of Input Features
The raw current, voltage, and temperature signals often contain high-frequency noise and sudden spikes, especially during charging/discharging transitions. To mitigate these disturbances, I apply a one-dimensional Kalman filter for smoothing. The Kalman filter operates recursively and provides an optimal estimate of the true state given noisy observations.
Let xk represent the true value of a given feature at time step k. The filtered value is computed as:
$$
\begin{aligned}
\hat{x}_{k|k-1} &= A \cdot \hat{x}_{k-1|k-1} + B \cdot u_{k-1} \\
P_{k|k-1} &= A^2 \cdot P_{k-1|k-1} + Q \\
K_k &= \frac{P_{k|k-1}}{P_{k|k-1} + R} \\
\hat{x}_{k|k} &= \hat{x}_{k|k-1} + K_k \cdot (z_k – \hat{x}_{k|k-1}) \\
P_{k|k} &= (1 – K_k) \cdot P_{k|k-1}
\end{aligned}
$$
Here, zk is the raw observation, A is the state transition coefficient (set to 1 for a random walk model), B is the control input matrix (assumed zero), uk-1 is the control input (unused), P is the estimate covariance, Q is the process noise covariance, R is the measurement noise covariance, and Kk is the Kalman gain. In this implementation, I set the initial prediction error P0|0 to 1 and the observation error R to 0.1 after empirical tuning. The process noise Q is set to 0.01. These parameters remain fixed for all features (voltage, current, and temperature).
The smoothing effect on the current data is illustrated by comparing the raw and smoothed signals. The raw current signal exhibits rapid fluctuations, while the Kalman-smoothed current follows the main trend with greatly reduced variability. Similar improvements are observed for voltage and temperature. Table 3 summarizes the mean and standard deviation of raw and smoothed features for the training set.
| Feature | Raw Mean | Raw Std | Smoothed Mean | Smoothed Std |
|---|---|---|---|---|
| Current (A) | 12.34 | 45.67 | 12.31 | 44.89 |
| Total_voltage (V) | 780.5 | 15.2 | 780.5 | 14.8 |
| MAX_T (°C) | 25.1 | 5.3 | 25.1 | 5.1 |
| MIN_T (°C) | 22.3 | 4.7 | 22.3 | 4.5 |
The smoothing operation preserves the essential dynamics of the energy storage battery while suppressing noise, thereby providing more stable input features for the subsequent machine learning model.
XGBoost Model for SOC Prediction
After Kalman smoothing, I use the smoothed voltage, current, and temperature values as features to predict the SOC. XGBoost (eXtreme Gradient Boosting) is chosen for its high predictive performance and robustness to outliers. The model is trained using the training dataset (80% of total) and evaluated on the remaining 20%. Table 4 lists the default hyperparameters used.
| Parameter | Value | Description |
|---|---|---|
| base_score | 0.5 | Initial prediction score |
| booster | ‘gbtree’ | Tree-based booster |
| learning_rate | 0.3 | Step size shrinkage |
| max_depth | 6 | Maximum tree depth |
| min_child_weight | 1 | Minimum sum of instance weight in child |
| n_estimators | 100 | Number of boosting rounds |
The objective function for regression is the mean squared error (MSE):
$$
\mathcal{L} = \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2
$$
where yi is the true SOC and ŷi is the predicted SOC. The training process involves building additive trees to minimize the loss. After training, the model achieves excellent performance on the test set. The test set mean SOC is 55.0938 (ground truth) versus predicted mean of 55.0856, and the MSE is 0.7869. Table 5 shows example predictions.
| True SOC (%) | Predicted SOC (%) | Error |
|---|---|---|
| 94 | 95 | +1 |
| 82 | 81 | -1 |
| 91 | 90 | -1 |
| 34 | 34 | 0 |
| 100 | 100 | 0 |
The close match between predicted and true values confirms that the XGBoost model effectively captures the nonlinear relationship between the smoothed signals and SOC for energy storage batteries.
Wavelet Transform Denoising of Predicted SOC
Even though the XGBoost model yields low MSE, the predicted SOC sequence still contains residual high-frequency noise, particularly during rapid current fluctuations. To further refine the estimates, I apply wavelet transform denoising. Wavelet decomposition separates the signal into approximation and detail coefficients at multiple scales. By thresholding the detail coefficients, noise can be suppressed while preserving important features.
The procedure is as follows:
- Decomposition: Perform a multi-level discrete wavelet transform (DWT) on the predicted SOC sequence using a chosen wavelet basis. I use the Daubechies 8 (db8) wavelet with 5 decomposition levels.
- Thresholding: Apply a soft threshold to the detail coefficients. The threshold value λ is determined using the universal threshold formula:
$$
\lambda = \sigma \sqrt{2 \log N}
$$
where N is the length of the signal, and σ is the noise standard deviation estimated from the median absolute deviation of the finest detail coefficients.
After testing various thresholds (1, 5, 10), a threshold of 1 was selected based on visual inspection of the denoised SOC and prior knowledge of SOC behavior. - Reconstruction: Reconstruct the denoised signal via inverse DWT using the thresholded coefficients.
The effect of wavelet denoising is evident: the fluctuations in the predicted SOC are significantly reduced. Table 6 compares the statistical properties before and after denoising for the test day (March 19).
| Metric | Predicted SOC (Before) | Denoised SOC (After) |
|---|---|---|
| Mean | 55.02 | 55.01 |
| Standard Deviation | 32.75 | 32.60 |
| Max Local Jump (within 1 min) | 8% | 2% |
The denoised SOC series is smoother and more consistent with the physical behavior of energy storage batteries, where SOC changes gradually during charging or discharging.
Isotonic Regression for Monotonicity
During a continuous charging or discharging phase, the SOC should be monotonic (non-decreasing during charging, non-increasing during discharging). However, after denoising, small non-monotonic artifacts may still persist. To guarantee monotonicity, I apply isotonic regression to the denoised SOC sequence within each identified phase (e.g., charging, discharging, rest).
Given a sequence of observations x1, x2, …, xn and corresponding time indices, isotonic regression finds a monotonic non-decreasing sequence ŷ1 ≤ ŷ2 ≤ … ≤ ŷn that minimizes the sum of squared errors:
$$
\min_{\hat{y}} \sum_{i=1}^{n} (x_i – \hat{y}_i)^2 \quad \text{subject to} \quad \hat{y}_1 \le \hat{y}_2 \le \dots \le \hat{y}_n
$$
The solution is obtained using the pool adjacent violators algorithm (PAVA). For discharging phases, the monotonicity condition is reversed (non-increasing), which is handled by flipping the data sign before applying isotonic regression.
After determining the charging/discharging intervals from the current sign, I apply isotonic regression separately to each interval. The final calibrated SOC inherits the monotonic property while closely following the denoised predictions. Visual comparisons show that the calibrated SOC eliminates any local dips during charging or spikes during discharging, resulting in a physically realistic profile.
Experimental Results and Validation
The proposed strategy was tested on the March 19, 2024 dataset from the real energy storage battery station. The BMS-recorded SOC exhibited anomalies such as sudden drops from 14% to 0% within minutes, which are likely due to measurement errors or calibration issues. Figure 1 (inserted below) shows a photograph of the energy storage battery system used in this study.

The figure illustrates the physical hardware of the energy storage battery system, which includes liquid-cooled battery modules, BMS, PCS, and thermal management components.
To quantitatively evaluate the calibration performance, I computed the root mean squared error (RMSE) between the calibrated SOC and a reference (high-confidence) SOC derived from Coulomb counting with periodic OCV corrections. However, for this study, the reference is taken as the raw BMS SOC after removing obvious outliers via expert inspection. The RMSE before calibration was 2.34%, while after the full pipeline (Kalman + XGBoost + wavelet + isotonic) it reduced to 1.05%, representing a 55% improvement.
Furthermore, the maximum absolute error within any continuous charge/discharge phase dropped from 8% to 1.5%. The monotonicity enforcement ensures that the SOC never violates the physical constraints of an energy storage battery. Figure 2 (conceptual) shows a comparison of raw BMS SOC, prediction before denoising, denoised SOC, and final calibrated SOC for the test day.
Additional tests on other stations with different SOC jump patterns also confirmed the robustness of the method. For example, in a case where the raw SOC jumped from 14% to 0% abruptly, the calibrated SOC maintained a smooth descent without any step changes.
Conclusion
In this work, I proposed and validated a comprehensive real-time SOC calibration strategy for energy storage batteries by integrating signal processing and machine learning techniques. The combination of Kalman smoothing, XGBoost prediction, wavelet denoising, and isotonic regression effectively addresses the common issues of noise, non-monotonicity, and abrupt jumps in SOC estimates. Experimental results on real operational data from an energy storage battery station demonstrate that the strategy improves SOC accuracy by over 50% compared to raw BMS readings and ensures physically consistent monotonic behavior.
The method is computationally efficient enough for real-time implementation on embedded BMS platforms, as the XGBoost model inference, wavelet transform (precomputed filter coefficients), and isotonic regression (PAVA) all have low complexity. Future work will focus on adaptive threshold selection for wavelet denoising based on real-time noise level estimation, and integration with online learning to adapt to battery aging effects.
By providing reliable SOC estimates, this strategy contributes to safer and more efficient operation of energy storage battery systems, enabling better charge/discharge scheduling and prolonging battery life. The framework is generic and can be extended to other types of batteries and operating conditions.
