State of Charge Estimation for Lithium-Ion Batteries Using an Enhanced Seagull Optimization Algorithm Optimized Backpropagation Neural Network

The accurate and reliable estimation of the State of Charge (SOC) is a cornerstone for ensuring the safety, longevity, and efficient energy management of lithium-ion batteries, which are the dominant energy storage solution in modern electric vehicles (EVs) and grid storage systems. SOC, defined as the ratio of remaining capacity to nominal capacity, is a critical internal state that cannot be measured directly. Traditional estimation methods, such as Coulomb counting and model-based filters like Kalman filters, often struggle with error accumulation, model inaccuracy, and computational complexity, especially under dynamic operating conditions typical of EV drive cycles. Consequently, data-driven approaches, particularly Artificial Neural Networks (ANNs), have gained significant traction due to their powerful ability to model complex, non-linear relationships without requiring explicit knowledge of the intricate electrochemical processes inside a lithium-ion battery.

Among ANNs, the Backpropagation (BP) neural network is widely employed for SOC estimation. Its multilayer structure allows it to learn the mapping from easily measurable parameters like current, voltage, and temperature to the corresponding SOC value. However, the conventional BP algorithm is inherently plagued by several shortcomings that impede its performance in this sensitive application. It is highly sensitive to the random initialization of weights and thresholds, often causing the training process to converge to undesirable local minima instead of the global optimum. Furthermore, its convergence speed can be slow, and the determination of the optimal network architecture (e.g., number of hidden neurons) is largely empirical. These limitations can lead to reduced estimation accuracy and poor robustness, which are unacceptable for a reliable Battery Management System (BMS).

To overcome these challenges, this work proposes a novel hybrid estimation strategy that synergistically combines an enhanced Seagull Optimization Algorithm (SOA) with a BP neural network. The core idea is to leverage the superior global exploration and exploitation capabilities of the metaheuristic SOA to optimize the initial weights and thresholds of the BP network before the commencement of the standard gradient-based backpropagation training. By providing a near-optimal starting point in the solution space, the optimized network is less prone to getting trapped in local minima and can achieve higher convergence accuracy and speed. We further enhance the basic SOA by incorporating a chaos initialization strategy and a non-linear decreasing inertia weight to improve its population diversity and convergence behavior. The proposed SOA-BP model is validated using real-world driving cycle data from a lithium-ion battery. Comparative analysis with a standard BP network and a Genetic Algorithm optimized BP (GA-BP) network demonstrates the superior estimation accuracy and robustness of our approach.

Methodology

1. The BP Neural Network Model for SOC Estimation

The BP neural network is a multi-layer feedforward network trained by error backpropagation. For SOC estimation of a lithium-ion battery, a three-layer structure (input, one hidden, output) is typically sufficient. The model establishes a non-linear functional mapping:

$$ SOC = f(I, V, \theta) $$

where \( I \) is the input current (positive for discharge), \( V \) is the terminal voltage, and \( \theta \) represents the network parameters (weights and biases).

The forward propagation for a network with \(n\) input neurons, \(m\) hidden neurons, and one output neuron is as follows:

Hidden Layer Output: The output of the \(j\)-th hidden neuron \(h_j\) is calculated using a sigmoid activation function:
$$ h_j = \frac{1}{1 + e^{-(\sum_{i=1}^{n} w_{ij}^{(1)} x_i + b_j^{(1)})}} $$
where \(x_i\) is the \(i\)-th input (e.g., \(I, V\)), \(w_{ij}^{(1)}\) is the weight connecting input \(i\) to hidden neuron \(j\), and \(b_j^{(1)}\) is the bias of hidden neuron \(j\).

Output Layer Output (SOC estimate): The final SOC estimate \(\hat{y}\) is:
$$ \hat{y} = \sum_{j=1}^{m} w_{j}^{(2)} h_j + b^{(2)} $$
where \(w_{j}^{(2)}\) is the weight connecting hidden neuron \(j\) to the output neuron, and \(b^{(2)}\) is the output layer bias.

The network is trained by minimizing the Mean Squared Error (MSE) between the predicted SOC \(\hat{y}_k\) and the true SOC \(y_k\) over \(N\) training samples:
$$ E = \frac{1}{N} \sum_{k=1}^{N} (y_k – \hat{y}_k)^2 $$
The standard BP algorithm uses gradient descent to iteratively adjust all weights and biases (\(w_{ij}^{(1)}, b_j^{(1)}, w_{j}^{(2)}, b^{(2)}\)) based on \(\partial E / \partial w\). The choice of initial values for these parameters is critical and is the target of our optimization.

2. The Seagull Optimization Algorithm (SOA)

SOA is a nature-inspired metaheuristic algorithm that mathematically models the migratory and attacking behaviors of seagulls. Its population-based search mechanism is effective for exploring complex spaces to find global optima.

2.1 Mathematical Model

A. Migration (Exploration): During migration, the algorithm simulates the movement of a seagull flock from one location to another, adhering to three rules.

  1. Collision Avoidance: To prevent collisions between search agents (seagulls), an additional variable \(A\) is used to calculate a new position.
    $$ \vec{C_s}(t) = A \times \vec{X}(t) $$
    Here, \(\vec{C_s}(t)\) is the position avoiding collision, \(\vec{X}(t)\) is the current position of the search agent at iteration \(t\), and \(A\) represents the movement behavior, which decreases linearly over iterations to transition from exploration to exploitation.
    $$ A = f_c – (t \times \frac{f_c}{T_{max}}) $$
    where \(f_c\) is a frequency control parameter (typically set to 2) and \(T_{max}\) is the maximum number of iterations.
  2. Movement towards the Best Neighbor: After avoiding collision, agents move towards the position of the best-performing agent (\(\vec{P}_{best}\)).
    $$ \vec{M_s}(t) = B \times (\vec{P}_{best} – \vec{X}(t)) $$
    The variable \(B\) is responsible for producing random behavior for a balanced search.
    $$ B = 2 \times A^2 \times rand $$
    where \(rand\) is a random number in [0,1].
  3. Approaching the Best Position: The agent updates its position relative to the best agent.
    $$ \vec{D_s}(t) = |\vec{C_s}(t) + \vec{M_s}(t)| $$

B. Attacking (Exploitation): Seagulls attack prey in a spiral motion in the air. This behavior is modeled in three dimensions:
$$ x’ = r \times \cos(\theta) $$
$$ y’ = r \times \sin(\theta) $$
$$ z’ = r \times \theta $$
$$ r = u \times e^{\theta v} $$
Here, \(r\) is the radius of the spiral, \(\theta\) is a random angle in \([0, 2\pi]\), and \(u\) and \(v\) are constants defining the spiral shape. The final updated position \(\vec{X}(t+1)\) is:
$$ \vec{X}(t+1) = (\vec{D_s}(t) \times x’ \times y’ \times z’) + \vec{P}_{best} $$

3. Enhanced Seagull Optimization Algorithm

To bolster the performance of the basic SOA for optimizing the high-dimensional parameter space of a BP network, two key enhancements are introduced.

3.1 Tent Chaotic Mapping for Population Initialization

The standard SOA initializes the population randomly, which can lead to uneven distribution and poor coverage of the search space. Tent chaotic mapping is employed to generate a more uniform and diverse initial population, improving the algorithm’s exploration potential. The Tent map is defined as:
$$ z_{n+1} = F(z_n) = \begin{cases}
z_n / \beta, & \text{if } 0 < z_n < \beta \\
(1 – z_n) / (1 – \beta), & \text{if } \beta \le z_n < 1
\end{cases} $$
where \(z_n \in (0,1)\) and \(\beta\) is a chaotic parameter. When \(\beta = 0.5\), it simplifies to:
$$ z_{n+1} = \begin{cases}
2z_n, & \text{if } 0 < z_n < 0.5 \\
2(1 – z_n), & \text{if } 0.5 \le z_n < 1
\end{cases} $$
The chaotic sequence \(\{z_1, z_2, …, z_N\}\) generated by this map is used to initialize the positions of the seagull population within the defined search bounds.

3.2 Non-linear Decreasing Inertia Weight for Parameter A

In the basic SOA, the control parameter \(A\) decreases linearly from \(f_c\) to 0. A non-linear decreasing strategy is proposed to allow for more aggressive exploration in early iterations and finer exploitation later:
$$ A = 2 – 2 \times \left( \frac{t}{T_{max}} \right)^2 $$
This adjustment provides a faster initial decrease, promoting a quicker shift from global search to local refinement, thereby enhancing convergence speed and final solution quality.

4. The SOA-BP Joint Algorithm Framework

The proposed framework integrates the enhanced SOA with the BP neural network to estimate the SOC of a lithium-ion battery. The core concept is to encode the weights and thresholds of the BP network into the position vector of a seagull in the SOA. The SOA then searches for the position (i.e., the set of network parameters) that minimizes the network’s error on the training data.

Step 1: Problem Encoding. For a BP network with \(n_i\) inputs, \(n_h\) hidden neurons, and \(n_o\) outputs, the total number of parameters \(D\) to optimize is:
$$ D = (n_i \times n_h) + n_h + (n_h \times n_o) + n_o $$
Each seagull’s position \(\vec{X}\) is a \(D\)-dimensional vector representing all weights and biases of the network.

Step 2: Fitness Evaluation. The fitness of each seagull (candidate solution) is the inverse of the MSE (or directly the MSE) of the BP network configured with its encoded parameters, evaluated on the training dataset.
$$ Fitness(\vec{X}) = \frac{1}{E} \quad \text{or} \quad Fitness(\vec{X}) = E $$

Step 3: SOA Optimization Process.

  1. Initialize the seagull population using Tent chaotic mapping. Set parameters \(f_c, u, v, T_{max}\).
  2. Evaluate the fitness of each seagull. Identify the best position \(\vec{P}_{best}\).
  3. For each iteration \(t = 1\) to \(T_{max}\):
    • Update parameter \(A\) using the non-linear decreasing formula.
    • For each seagull, calculate its new position \(\vec{X}(t+1)\) based on the migration and attacking behaviors described in Section 2.1.
    • Evaluate the fitness of the new positions.
    • Update \(\vec{P}_{best}\) if a better solution is found.

Step 4: BP Network Training. After the SOA concludes its search, the optimal position \(\vec{P}_{best}^{*}\) is decoded to obtain the optimized initial weights and thresholds for the BP network. The network is then trained further using the standard backpropagation algorithm on the same training data. This two-stage process (global search by SOA + local refinement by BP) yields a robust and accurate model.

The following table summarizes the key steps of the SOA-BP joint algorithm:

Phase Step Description
Initialization 1 Define BP network architecture (n, m, 1).
2 Encode BP parameters into SOA search space dimension D.
3 Initialize SOA population using Tent chaotic map.
SOA Optimization 4 Calculate fitness (MSE) for each seagull.
5 Identify global best position \(\vec{P}_{best}\).
6 While \(t < T_{max}\), update A, B, and seagull positions via migration and attack models.
7 Re-evaluate fitness and update \(\vec{P}_{best}\).
BP Finalization 8 Decode \(\vec{P}_{best}^{*}\) to initialize BP network weights/thresholds.
9 Perform final BP training and validation.

Experimental Setup and Results

1. Data Preparation and Model Configuration

The experimental data was obtained from a lithium-ion battery subjected to the Federal Urban Driving Schedule (FUDS) dynamic test profile. This profile is representative of real-world urban EV driving conditions, characterized by frequent and varying charge/discharge pulses. The dataset comprised time-synchronized measurements of current (I), voltage (V), and reference SOC values, totaling 60,836 samples.

Input/Output Selection: The model inputs were chosen as the measured current and terminal voltage of the lithium-ion battery. The corresponding SOC value was the target output. A segment of the FUDS data is shown below:

Current (A) Voltage (V) Reference SOC
29.38 47.68 0.7993
16.76 46.76 0.5999
9.52 46.09 0.4579
-10.47 46.83 0.6085
-5.12 46.91 0.5989

From the complete dataset, 1,200 data points were randomly selected. Among them, 1,000 samples were used for training the models, and the remaining 200 samples were reserved as an independent test set for final performance evaluation.

BP Network Structure: The BP network was configured with 2 input neurons (I, V), 1 output neuron (SOC), and a single hidden layer. The number of hidden neurons \(m\) was determined empirically using the common heuristic \(m = \sqrt{n + Y} + \alpha\), where \(n\) is input count, \(Y\) is output count, and \(\alpha\) is a constant between 1 and 10. Through repeated trials, \(m = 9\) was found to yield the best performance for this lithium-ion battery SOC estimation task.

Algorithm Parameters: For the enhanced SOA, the population size was set to 30, and the maximum iteration \(T_{max}\) was 100. The spiral constants were \(u=1, v=1\). The parameters for the compared GA-BP algorithm (population=30, generations=100, crossover rate=0.8, mutation rate=0.05) were set to provide a fair comparison.

2. Results and Performance Analysis

The performance of the proposed Enhanced SOA-BP model was compared against two benchmarks: the standard BP neural network and the GA-BP neural network. The primary metric for comparison was the Mean Absolute Error (MAE) on the independent test set, defined as:
$$ MAE = \frac{1}{N_{test}} \sum_{k=1}^{N_{test}} |y_k – \hat{y}_k| $$
where \(N_{test}=200\).

The SOC estimation results on the test set are visualized in the figure below. The plots clearly show that the prediction curve of the SOA-BP model (marked with ‘+’) adheres much more closely to the true SOC trajectory (solid line) compared to the standard BP model. The GA-BP model shows improvement over standard BP but is consistently outperformed by the SOA-BP model, particularly during periods of rapid SOC change.

A more detailed analysis of the estimation errors is presented in the following table, which summarizes the key performance indicators:

Algorithm Mean Absolute Error (MAE) Max Absolute Error Root Mean Square Error (RMSE)
Standard BP 5.40% 14.2% 6.87%
GA-BP 1.97% 5.8% 2.45%
Enhanced SOA-BP 0.87% 3.1% 1.12%

The results are conclusive. The proposed Enhanced SOA-BP algorithm achieves a remarkable MAE of only 0.87% in estimating the SOC of the lithium-ion battery. This represents a significant performance improvement: a reduction of 4.53 percentage points (or ~84% relative improvement) compared to the standard BP network, and a reduction of 1.10 percentage points (or ~56% relative improvement) compared to the GA-BP network. The RMSE and maximum error metrics follow the same trend, confirming the superior accuracy and robustness of the SOA-BP model. The enhanced SOA successfully provided a superior initialization for the BP network, guiding it away from poor local minima and towards a region in parameter space conducive to high-precision estimation.

Conclusion

Accurate State of Charge estimation remains a critical challenge for advancing lithium-ion battery technology in electric vehicles and energy storage systems. This research has successfully developed and validated a novel hybrid data-driven method that addresses the fundamental limitations of the traditional BP neural network. By integrating an enhanced Seagull Optimization Algorithm, featuring chaotic initialization and a non-linear adaptive inertia weight, we effectively optimized the initial synaptic weights and thresholds of the network. This optimization step is crucial, as it positions the BP network in a favorable region of the error surface, thereby mitigating its susceptibility to local minima and enhancing its convergence properties.

The experimental validation using real-world FUDS cycle data from a lithium-ion battery unequivocally demonstrates the efficacy of the proposed SOA-BP joint algorithm. It significantly outperforms both the standard BP and the commonly used GA-BP approaches in terms of Mean Absolute Error, Root Mean Square Error, and maximum deviation. The achieved estimation accuracy of below 1% MAE meets the stringent requirements for practical BMS applications. This work underscores the potential of combining advanced metaheuristic optimizers with neural networks to solve complex non-linear state estimation problems in electrochemical systems. Future research will focus on extending this framework to include temperature effects, aging phenomena, and multi-state estimation (e.g., simultaneous SOC and SOH) for lithium-ion batteries, further bolstering the intelligence and reliability of next-generation battery management systems.

Scroll to Top