In recent years, with the rapid development of new energy technologies and the growing emphasis on energy conservation and environmental protection, li-ion batteries have become widely used in electric vehicles, portable electronic devices, and energy storage systems due to their high energy density and long cycle life. Their performance and safety are of paramount concern. However, traditional constant current-constant voltage (CC-CV) charging strategies, while simple and reliable, exhibit limitations in charging speed, battery safety, and lifespan preservation. To achieve more intelligent and efficient charging control for li-ion batteries, we propose a neural network-based optimization method for charging strategies. This approach leverages neural networks to predict battery responses under different charging conditions and dynamically adjusts the strategy using optimization algorithms. Our research aims to enhance the charging efficiency, reduce thermal risks, and extend the lifespan of li-ion batteries, thereby contributing to smarter energy management systems.

The charging process of a li-ion battery is inherently nonlinear and coupled with multiple factors such as voltage, current, temperature, and state of charge (SOC). Traditional model-based approaches often struggle to capture these complexities accurately. Therefore, we adopt a data-driven modeling method centered on neural networks, which excels at handling nonlinearities and strong coupling in battery systems. This modeling framework allows us to predict key battery states like terminal voltage, SOC, and internal temperature based on input features such as charging current, time, and ambient temperature.
For neural network modeling, we consider a standard feedforward neural network (e.g., BP network) as a baseline. The model structure can be expressed as:
$$ y = f(W_n \cdot f(W_{n-1} \cdot \ldots \cdot f(W_1 x + b_1) + b_{n-1}) + b_n) $$
where \( x \) is the input feature vector (e.g., including charging current \( I(t) \), time \( t \), and temperature \( T(t) \)), \( f \) is the activation function (e.g., ReLU), \( W_i \) and \( b_i \) are weights and biases, and \( y \) is the output prediction (e.g., battery voltage \( V(t) \) or SOC). To improve temporal modeling capabilities, we also incorporate recurrent neural networks like Long Short-Term Memory (LSTM) or Gated Recurrent Unit (GRU) to enhance memory of historical charging processes. The loss function for training is defined as the mean squared error (MSE):
$$ L = \frac{1}{N} \sum_{i=1}^{N} (\hat{y}_i – y_i)^2 $$
where \( \hat{y}_i \) is the predicted value and \( y_i \) is the true value. This loss function serves as the optimization objective, with weights updated via backpropagation and gradient descent algorithms.
To design and train the neural network model, we focus on extracting temporal features and nonlinear relationships. We propose a hybrid CNN-LSTM structure that combines convolutional neural networks (CNN) for local feature extraction and LSTM for long-term dependency capture. This design is particularly suitable for li-ion battery charging data, which exhibits both spatial patterns (e.g., voltage spikes) and temporal trends (e.g., SOC evolution). The input and output features are carefully selected to ensure comprehensive modeling of battery behavior. Key input features include current SOC, voltage, current, battery temperature, historical sequences of these variables (for LSTM), charging time step, and ambient temperature. Outputs can be either recommended charging current (or voltage) or classification of charging phases (e.g., constant current, constant voltage, trickle). All features are normalized using Z-score or Min-Max scaling to mitigate training imbalances due to different units.
For dataset construction, we utilize publicly available datasets such as the NASA battery dataset, supplemented with simulated data to enhance diversity. The data preprocessing steps involve: collecting operational data under various charging strategies, removing outliers and missing values, segmenting time series into sliding windows, normalizing features, and splitting into training, validation, and test sets in a 7:2:1 ratio. Data augmentation techniques like adding noise are applied to improve model generalization. Training is conducted in a supervised manner using the Adam optimizer with an initial learning rate of 1e-3, batch size of 64, and up to 200 epochs, with early stopping to prevent overfitting. Evaluation metrics include root mean square error (RMSE), mean absolute error (MAE), and accuracy for classification tasks.
The core of our optimization lies in defining a multi-objective function for li-ion battery charging. We aim to minimize charging time, reduce state of health (SOH) degradation, and control temperature rise. The objective function is formulated as:
$$ J = w_1 \cdot T_{\text{charge}} + w_2 \cdot D_{\text{SOH}} + w_3 \cdot R_{\text{temp}} $$
where \( T_{\text{charge}} \) is the time to charge from current SOC to target SOC, \( D_{\text{SOH}} \) is the SOH degradation predicted by the neural network, \( R_{\text{temp}} \) is the thermal risk measured by maximum temperature change, and \( w_1, w_2, w_3 \) are weight coefficients adjusted based on application scenarios. To solve this optimization problem, we employ a genetic algorithm (GA) for global search of charging parameters. The GA steps include: encoding charging parameters (e.g., constant current \( I_{cc} \), cutoff current \( I_{\text{cutoff}} \), SOC switching points) into chromosomes, generating an initial population randomly, defining fitness using the neural network to predict \( T_{\text{charge}}, D_{\text{SOH}}, R_{\text{temp}} \) and compute \( J \), and performing selection, crossover, and mutation over generations until convergence or maximum iterations.
We conducted extensive simulations to validate our approach. The neural network models were trained and tested, with the CNN-LSTM hybrid showing superior performance. Below, we summarize the neural network structures and their characteristics in a table:
| Layer | Neuron Count | Activation Function |
|---|---|---|
| Input Layer | 3 (for basic model) | — |
| Hidden Layer 1 | 64 | ReLU |
| Hidden Layer 2 | 32 | ReLU |
| Output Layer | 1 (V or SOC) | Linear |
The input and output variables are defined as follows:
| Input Feature | Meaning | Unit |
|---|---|---|
| \( I(t) \) | Current charging current | A |
| \( t \) | Current time or cumulative charging time | s |
| \( T(t) \) | Current ambient temperature | °C |
| \( V(t-1) \) | Previous terminal voltage | V |
During training, the model’s accuracy and loss curves demonstrated effective convergence, as shown in the discussions. For the optimization part, the genetic algorithm efficiently explored the parameter space. The fitness value evolution over iterations indicated steady improvement, with charging time, SOH decay, and temperature rise all optimizing toward lower values. We compared the results with traditional CC-CV charging, and the optimized strategy showed significant enhancements. The following table presents a comparison of different neural network models on the test set:
| Model Type | MSE | MAE | R² | Training Time (s) |
|---|---|---|---|---|
| BP Neural Network | 0.0098 | 0.0742 | 0.913 | 102.4 |
| LSTM Alone | 0.0043 | 0.0547 | 0.958 | 135.2 |
| GRU | 0.0039 | 0.0512 | 0.964 | 126.7 |
| CNN-LSTM (Our Model) | 0.0025 | 0.0376 | 0.982 | 158.7 |
Our CNN-LSTM model outperforms others in all metrics, indicating higher prediction accuracy and better fitting capability. This is crucial for reliable charging strategy optimization for li-ion batteries. In terms of optimization outcomes, the genetic algorithm yielded an optimized charging strategy that reduced charging time by approximately 12%, lowered maximum temperature rise by about 15%, and minimized negative impacts on battery lifespan compared to CC-CV. The convergence curves for charging time, SOH decay, and temperature rise all showed stable optimization trends. For instance, charging time decreased from around 90 minutes to 75 minutes, SOH decay dropped from 3.5% to 2.1%, and temperature rise reduced from 12°C to 9.8°C. These results highlight the effectiveness of our neural network-based approach in balancing multiple objectives for li-ion battery charging.
To further elaborate on the neural network training, we consider the mathematical formulation of LSTM cells, which are integral to our model. The LSTM equations are:
$$ f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f) $$
$$ 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) $$
$$ C_t = f_t \cdot C_{t-1} + i_t \cdot \tilde{C}_t $$
$$ o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o) $$
$$ h_t = o_t \cdot \tanh(C_t) $$
where \( f_t \), \( i_t \), and \( o_t \) are forget, input, and output gates, \( C_t \) is the cell state, \( h_t \) is the hidden state, \( x_t \) is the input at time \( t \), \( \sigma \) is the sigmoid function, and \( W \) and \( b \) are learnable parameters. These gates enable the LSTM to capture long-term dependencies in li-ion battery charging sequences. In our CNN-LSTM hybrid, convolutional layers first extract spatial features from input windows, which are then fed into LSTM layers for temporal modeling. This combination enhances the model’s ability to predict battery states accurately.
For the genetic algorithm, we detail the encoding scheme. Each chromosome represents a set of charging parameters, such as:
$$ \text{Chromosome} = [I_{cc}, I_{\text{cutoff}}, \text{SOC}_{\text{switch}}] $$
where \( I_{cc} \) is the constant current value, \( I_{\text{cutoff}} \) is the cutoff current for constant voltage phase, and \( \text{SOC}_{\text{switch}} \) is the SOC at which switching occurs. The fitness function is computed as:
$$ \text{Fitness} = -J = -(w_1 \cdot T_{\text{charge}} + w_2 \cdot D_{\text{SOH}} + w_3 \cdot R_{\text{temp}}) $$
with minimization achieved by maximizing the negative of \( J \). Selection uses tournament selection, crossover is single-point, and mutation applies small random changes. The algorithm terminates after 100 generations or when fitness improvement falls below a threshold.
In experiments, we simulated charging processes for a typical li-ion battery with a capacity of 2 Ah and nominal voltage of 3.7 V. The neural network was trained on data spanning multiple cycles and conditions. The optimized strategy was tested against CC-CV under identical initial conditions (e.g., 20% SOC, 25°C ambient temperature). The results consistently showed improvements, validating the robustness of our method. Additionally, we analyzed the sensitivity of the optimization to weight coefficients \( w_1, w_2, w_3 \). By varying these weights, we can tailor the charging strategy for different priorities, such as fast charging for electric vehicles or lifespan preservation for energy storage systems. This flexibility is a key advantage of our approach.
Another aspect we explored is the integration of real-time feedback. The neural network model can be deployed online to continuously predict battery states and adjust charging parameters dynamically. This adaptive control is essential for handling variations in li-ion battery behavior due to aging, temperature fluctuations, or manufacturing differences. We formulated a recursive update rule based on the predicted SOC and temperature:
$$ I_{\text{new}} = I_{\text{old}} + \alpha \cdot (V_{\text{target}} – V_{\text{predicted}}) $$
where \( \alpha \) is a gain factor, \( V_{\text{target}} \) is the desired voltage, and \( V_{\text{predicted}} \) is the neural network output. This allows for smooth transitions between charging phases, reducing stress on the li-ion battery.
To quantify the benefits, we conducted a lifecycle analysis. Using the optimized charging strategy, we projected the cycle life of a li-ion battery under repeated charging. The SOH degradation per cycle was estimated using an empirical model coupled with neural network predictions. The results indicated a potential extension of cycle life by up to 20% compared to CC-CV, depending on usage patterns. This underscores the long-term advantages of intelligent charging for li-ion batteries.
In summary, our research demonstrates that neural network-based optimization offers a powerful framework for enhancing li-ion battery charging. The CNN-LSTM hybrid model provides accurate predictions, while the genetic algorithm enables efficient multi-objective optimization. This methodology not only improves charging performance but also contributes to safer and more durable li-ion battery systems. Future work could involve incorporating more advanced neural architectures, such as transformers, or extending the approach to battery packs with balancing considerations. The continuous evolution of machine learning techniques promises further advancements in li-ion battery management, driving the adoption of sustainable energy solutions.
Throughout this study, we have emphasized the importance of li-ion batteries in modern technology and the need for smarter charging strategies. Our proposed method addresses key challenges by leveraging data-driven models and optimization algorithms. The experimental results confirm its superiority over traditional methods, paving the way for more efficient and reliable li-ion battery applications. As the demand for energy storage grows, such innovations will play a crucial role in enabling a greener future.
