An Improved Harris Hawks Optimized Kernel Extreme Learning Machine for Accurate State of Charge Estimation in Lithium-Ion Batteries

As the world pushes towards low-carbon energy transformation to meet the ambitious “carbon peaking and carbon neutrality” goals, the transportation sector’s reliance on fossil fuels has become a critical bottleneck. The significant carbon emissions from conventional vehicles have acted as a catalyst, accelerating the development of electric vehicles (EVs) and their associated battery energy storage systems. Among various battery technologies, the lithium-ion battery stands out due to its high energy density, long cycle life, and relatively low environmental impact, making it the dominant power source for modern EVs. The safe, durable, and efficient operation of these batteries hinges on the intelligent management provided by the Battery Management System (BMS). A cornerstone function of the BMS is the accurate and reliable estimation of the State of Charge (SOC), which indicates the remaining available capacity akin to a fuel gauge. Precise SOC knowledge is paramount for preventing over-charge and over-discharge, enabling effective cell balancing, and optimizing the vehicle’s driving range and power performance.

Traditional SOC estimation methods, such as the Ampere-hour (Ah) integration and Open Circuit Voltage (OCV) methods, are straightforward but suffer from significant drawbacks. The Ah integration method accumulates errors from current sensor inaccuracies and temperature drift, while the OCV method requires long rest periods to reach equilibrium, rendering it unsuitable for real-time applications. Model-based approaches, including various Kalman filter variants (Extended, Unscented), offer a closed-loop solution but are heavily dependent on the accuracy of the battery model and its parameters, which change with aging and operating conditions. Data-driven methods, in contrast, treat the lithium-ion battery as a black box, establishing a direct nonlinear mapping from easily measurable inputs like current, voltage, and temperature to the target SOC. This approach bypasses the need for complex electrochemical or equivalent circuit models and demonstrates strong self-learning and adaptive capabilities.

Among data-driven techniques, the Extreme Learning Machine (ELM) offers advantages over traditional Back-Propagation (BP) neural networks due to its faster learning speed and deterministic hidden layer structure. However, the random initialization of its input weights and biases can lead to unstable predictions. The Kernel Extreme Learning Machine (KELM) addresses this by replacing the random feature mapping with a stable kernel function, significantly improving generalization performance and robustness. The efficacy of a KELM model is highly sensitive to the choice of its two key hyperparameters: the penalty coefficient $$C$$ and the kernel parameter $$S$$ (for a Gaussian kernel). Suboptimal selection can degrade estimation accuracy. Metaheuristic optimization algorithms are well-suited for this parameter tuning task. The Harris Hawks Optimization (HHO) algorithm, inspired by the cooperative hunting behavior of Harris’ hawks, has shown commendable performance in global search and convergence. However, like many population-based algorithms, it can suffer from premature convergence and an imbalance between exploration and exploitation phases. In this work, we propose an Improved HHO (IHHO) algorithm to optimize the KELM parameters, resulting in a superior IHHO-KELM model for SOC estimation in lithium-ion batteries.

1. Methodology

1.1 Kernel Extreme Learning Machine (KELM) Model

Given a training dataset with $$N$$ samples $$\{ (\mathbf{x}_i, y_i) \}_{i=1}^N$$, where $$\mathbf{x}_i \in \mathbb{R}^n$$ is the input vector (e.g., voltage, current, temperature) and $$y_i \in \mathbb{R}$$ is the output (SOC), the standard ELM with $$L$$ hidden nodes and activation function $$g(\cdot)$$ can be formulated as:

$$
\sum_{i=1}^{L} \beta_i g(\mathbf{w}_i \cdot \mathbf{x}_j + b_i) = y_j, \quad j=1, \ldots, N
$$

where $$\mathbf{w}_i$$ is the input weight vector, $$b_i$$ is the bias for the $$i$$-th hidden node, and $$\beta_i$$ is the output weight. This can be written in matrix form as:

$$
\mathbf{H} \boldsymbol{\beta} = \mathbf{Y}
$$

Here, $$\mathbf{H}$$ is the hidden layer output matrix. The output weights are then calculated using the regularized least-squares solution:

$$
\boldsymbol{\beta} = \left( \frac{\mathbf{I}}{C} + \mathbf{H}^T \mathbf{H} \right)^{-1} \mathbf{H}^T \mathbf{Y}
$$

where $$C$$ is the penalty coefficient and $$\mathbf{I}$$ is an identity matrix. To enhance stability, KELM employs a kernel function. The kernel matrix $$\boldsymbol{\Omega}$$ is defined as:

$$
\boldsymbol{\Omega} = \mathbf{H} \mathbf{H}^T: \quad \Omega_{i,j} = K(\mathbf{x}_i, \mathbf{x}_j)
$$

Using a Gaussian (RBF) kernel $$K(\mathbf{x}_i, \mathbf{x}_j) = \exp(-S \|\mathbf{x}_i – \mathbf{x}_j\|^2)$$ with kernel parameter $$S$$, the output function of KELM becomes:

$$
f(\mathbf{x}) = \begin{bmatrix} K(\mathbf{x}, \mathbf{x}_1) \\ \vdots \\ K(\mathbf{x}, \mathbf{x}_N) \end{bmatrix}^T \left( \frac{\mathbf{I}}{C} + \boldsymbol{\Omega} \right)^{-1} \mathbf{Y}
$$

Thus, the performance of the KELM model for lithium-ion battery SOC estimation critically depends on the proper selection of the hyperparameter pair $$(C, S)$$.

1.2 Improved Harris Hawks Optimization (IHHO)

The standard HHO algorithm simulates the surprise pounce hunting strategy of Harris’ hawks, which involves exploration, transitioning to exploitation, and finally exploitation via four besieging tactics. The algorithm’s behavior is controlled by the prey’s escape energy $$E$$, which decays over iterations:

$$
E = 2 E_0 \left(1 – \frac{t}{T}\right)
$$

where $$E_0$$ is a random initial energy in $$(-1, 1)$$, $$t$$ is the current iteration, and $$T$$ is the maximum iteration. While effective, HHO can be enhanced. Our proposed IHHO incorporates three key improvements.

1.2.1 Logistic Chaotic Mapping for Population Initialization. To improve population diversity and the quality of initial solutions, we replace the random parameters in the exploration phase with sequences generated by a Logistic chaotic map. The map is defined as:

$$
c_{m+1} = a c_m (1 – c_m), \quad c_m \in (0,1), a=4
$$

where $$m$$ is the chaotic variable index. This ensures a more uniform distribution of the initial hawk population across the search space, promoting better global exploration from the outset.

1.2.2 Adaptive Jump Distance. In the standard HHO, the prey’s jump distance $$J$$ is a random number in $$[0, 2]$$. In nature, the prey’s ability to jump should diminish as it tires. We model this by making $$J$$ dependent on the escape energy $$E$$, setting its upper bound to $$1 + |E|$$. This allows larger jumps in early iterations for exploration and finer, more precise jumps in later iterations for exploitation:

$$
J_{\text{new}} = (1 + |E|) \cdot \text{rand}(0,1)
$$

1.2.3 Nonlinear Control Mechanism with a Regulating Operator. To better balance the global and local search capabilities, we introduce a nonlinear regulating operator $$w$$ into the position update equations for the “soft besiege with progressive rapid dives” and “hard besiege with progressive rapid dives” phases. The operator is defined as:

$$
w = \exp\left(-\left(\frac{2t}{T}\right)^8\right)
$$

This operator is close to 1 at the start, preserving the global exploration characteristics. It decays rapidly in the middle iterations and approaches 0 at the end, sharply focusing the search on local exploitation. For example, the position update for the progressive rapid dive during a soft besiege (when $$|E| \ge 0.5$$ and $$r < 0.5$$) is modified from $$\mathbf{Y} = \mathbf{X}_{\text{rabbit}}(t) – E |J \mathbf{X}_{\text{rabbit}}(t) – \mathbf{X}(t)|$$ to:

$$
\mathbf{Y} = w \mathbf{X}_{\text{rabbit}}(t) – E |J \mathbf{X}_{\text{rabbit}}(t) – \mathbf{X}(t)|
$$

A similar modification is applied to the calculation of $$\mathbf{Z}$$ using the Levy flight. This mechanism gives the algorithm more control over the transition between its search phases.

1.3 The IHHO-KELM Framework for SOC Estimation

The proposed framework integrates IHHO for hyperparameter optimization with KELM for regression. The SOC estimation process is as follows:

  1. Data Preparation: Collect measurable lithium-ion battery operational data (voltage $$V$$, current $$I$$, temperature $$T_{emp}$$) and corresponding true SOC values from laboratory tests (e.g., low-current OCV tests). Normalize the data and split it into training and testing sets.
  2. IHHO Initialization: Define the search spaces for the KELM hyperparameters (e.g., $$C \in [0.1, 50]$$, $$S \in [0.1, 10]$$). Set IHHO parameters (population size, maximum iterations). The fitness of a hawk (a candidate $$(C, S)$$ pair) is the root mean square error (RMSE) of the KELM model on the training data.
  3. Optimization Process: The IHHO algorithm runs iteratively. Hawks update their positions (i.e., their $$(C, S)$$ values) based on the improved hunting strategies. The algorithm converges towards the hyperparameter pair that minimizes the KELM training error.
  4. SOC Estimation: The optimal $$(C^*, S^*)$$ found by IHHO is used to construct the final KELM model. This model takes the real-time measured $$[V, I, T_{emp}]$$ as input and outputs the estimated SOC.

2. Algorithm Performance Validation

Before applying IHHO to the SOC estimation problem, we first verify its enhanced optimization capability against the standard HHO, Grey Wolf Optimizer (GWO), and Whale Optimization Algorithm (WOA). We use five well-known benchmark functions (Sphere-F1, Schwefel’s 2.22-F2, Schwefel’s 1.2-F3, Quartic-F4, and Rosenbrock-F5) with a dimension of 30. Each algorithm is run independently 30 times. The convergence curves demonstrate that IHHO achieves faster convergence and higher precision. The statistical results (mean, worst, best, standard deviation) over 30 runs are summarized in the table below, clearly showing IHHO’s superior performance.

Table 1: Performance Comparison of IHHO, HHO, GWO, and WOA on Benchmark Functions
Function Algorithm Mean Worst Best Std
F1 (Sphere) IHHO 2.7045e-05 2.6813e-05 2.8619e-05 0
HHO 6.0275e-06 5.9653e-06 7.3656e-06 1.1997e-07
GWO 1.5500e-02 1.4353e-02 1.6338e-02 6.9811e-04
WOA 4.3667e-02 4.1194e-02 5.0534e-02 3.5436e-03
F2 (Schwefel 2.22) IHHO 3.4294e-08 3.3862e-08 5.6538e-08 1.5737e-08
HHO 1.1329e-03 1.0252e-03 2.4035e-03 5.1059e-04
GWO 9.1384e-01 8.2441e-01 1.0418e+00 8.1817e-02
WOA 2.5255e-02 2.2815e-02 3.4148e-02 6.6104e-03
F5 (Rosenbrock) IHHO 2.3561e-02 1.4225e-01 1.3722e-06 3.7592e-02
HHO 2.9466e-02 1.6465e-01 5.4052e-06 3.5281e-02
GWO 2.7570e+01 2.8879e+01 2.6134e+01 8.1463e-01
WOA 2.8310e+01 2.8790e+01 2.7618e+01 3.4965e-01

3. Experimental Results for Lithium-Ion Battery SOC Estimation

3.1 Data and Experimental Setup

We utilize public experimental data for an INR 18650-20R lithium-ion battery (2 Ah, 4.2 V) from the University of Maryland. Data from low-current OCV tests at 0°C, 25°C, and 45°C are used. A total of 3000 sample points, each containing measured current, voltage, temperature, and the corresponding reference SOC, are randomly selected. 2800 samples are used for training and 200 for testing. All data is normalized. The IHHO parameters are set as: population size = 20, maximum iterations = 30. The search bounds are $$C \in [0.1, 50]$$ and $$S \in [0.1, 10]$$.

3.2 Results and Comparison

The proposed IHHO-KELM model is compared against two established methods: an Unscented Kalman Filter (UKF) and a GWO-optimized BP Neural Network (GWO-BP). The estimation results and the absolute errors for the test set are visually compared. It is evident that the IHHO-KELM predictions closely follow the reference SOC curve, with significantly smaller and more stable errors compared to the other two methods. The performance is quantitatively evaluated using Mean Squared Error (MSE), Mean Absolute Error (MAE), and the Coefficient of Determination ($$R^2$$):

$$
\text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (SOC_{m,i} – SOC_{est,i})^2
$$
$$
\text{MAE} = \frac{1}{n} \sum_{i=1}^{n} |SOC_{m,i} – SOC_{est,i}|
$$
$$
R^2 = 1 – \frac{\sum_{i=1}^{n} (SOC_{m,i} – SOC_{est,i})^2}{\sum_{i=1}^{n} (SOC_{m,i} – \overline{SOC}_m)^2}
$$

Table 2: Performance Comparison of SOC Estimation Models on Constant Current Test Data
Model MSE MAE $$R^2$$
UKF 3.26e-02 3.63e-02 0.9721
GWO-BP 1.42e-02 1.33e-02 0.9868
IHHO-KELM (Proposed) 1.30e-03 7.00e-03 0.9979

The results clearly demonstrate the superiority of the proposed model. The IHHO-KELM achieves an order-of-magnitude lower MSE (0.13%) and the lowest MAE (0.7%) while achieving an $$R^2$$ value closest to 1, indicating an excellent fit.

3.3 Robustness Verification under Dynamic Stress Test (DST)

To verify the model’s robustness under more realistic and dynamic loading conditions, we employ data from a Dynamic Stress Test (DST) profile. We extract 6500 data points, using 6400 for training and 100 for testing. The estimation performance of the basic KELM, the standard HHO-KELM, and the proposed IHHO-KELM is compared. The results, summarized in the table below, confirm that the IHHO optimizer significantly improves the base KELM’s performance and outperforms the standard HHO-KELM. The IHHO-KELM model maintains high accuracy ($$R^2 = 0.9972$$) with low error (MSE = 0.0023, MAE = 0.83%) even under the dynamic DST cycle, proving its strong robustness and practical applicability for lithium-ion battery SOC estimation in real-world EV driving scenarios.

Table 3: Robustness Performance under DST Working Condition
Model MSE MAE $$R^2$$
KELM 5.64e-02 4.10e-02 0.9683
HHO-KELM 1.57e-02 1.45e-02 0.9841
IHHO-KELM (Proposed) 2.30e-03 8.30e-03 0.9972

4. Conclusion

Accurate State of Charge estimation remains a critical challenge for advanced Battery Management Systems in lithium-ion battery-powered applications. This work presents a novel data-driven solution by developing an Improved Harris Hawks Optimization algorithm to optimize the hyperparameters of a Kernel Extreme Learning Machine. The enhancements to the HHO algorithm—Logistic chaotic initialization, an energy-dependent adaptive jump distance, and a nonlinear regulating operator—collectively address issues of premature convergence and search phase imbalance, yielding a more powerful optimizer as validated by benchmark functions.

The resultant IHHO-KELM model is applied to the SOC estimation problem. Experimental results using both constant-current and dynamic DST cycle data demonstrate its exceptional performance. Compared to the UKF and GWO-BP models, the proposed model achieves superior accuracy, with the lowest MSE and MAE, and the highest $$R^2$$ value. Furthermore, its consistent high performance under the dynamic DST profile confirms excellent robustness. The IHHO-KELM framework provides a reliable, accurate, and practical data-driven approach for real-time SOC estimation, contributing to the safer and more efficient utilization of lithium-ion batteries in electric vehicles and energy storage systems.

Scroll to Top