# Machine Learning-Based Lithium Battery State of Health Prediction Research
## 4 Experimentation and Analysis of Results  
### Forecasting Modeling  
To implement the proposed PSO-LSTM, PSO-CNN, and PSO-SVR models for state-of-health (SOH) prediction of lithium-ion batteries, aging datasets from three battery sets, B0005, B0006, and B0007, were employed for experimental validation. Considering that the selection of model parameters is very critical when predicting SOH of lithium batteries based on machine learning, the PSO algorithm is used to systematically optimize the key parameters of each model, minimize the need for manual adjustment, and improve the prediction accuracy and model stability. Based on parameter characteristics and model performance on the NASA dataset, the parameter optimization ranges were determined, as presented in Table 3.  
The model optimization results are evaluated using Root Mean Square Error (RMSE), where an RMSE closer to zero indicates better parameter optimization. Figure 3 illustrates the optimization and prediction process for the three models: PSO-LSTM, PSO-CNN, and PSO-SVR. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Indicator** & **B0005** & **B0006** & **B0007** \\ \hline HI8 & 0.944858 & 0.957171 & 0.890017 \\ HI9 & 0.940103 & 0.955189 & 0.901295 \\ HI10 & \(-\)0.993799 & \(-\)0.99226 & \(-\)0.995370 \\ HI11 & 0.992469 & 0.991659 & 0.9844268 \\ HI12 & \(-\)0.944819 & \(-\)0.865739 & \(-\)0.969182 \\ HI13 & \(-\)0.926612 & \(-\)0.905479 & \(-\)0.921218 \\ HI14 & \(-\)0.990445 & \(-\)0.966795 & \(-\)0.973317 \\ HI15 & 0.321169 & 0.303079 & 0.303079 \\ HI16 & 0.904601 & 0.925035 & 0.860496 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._ \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Parameter** & **Range** \\ \hline \multirow{5}{*}{LSTM} & Number of Hidden & range (10, 100) \\  & Neurons & range (10, 100) \\  & Time Steps & range (1, 10) \\  & Learning Rate & range (0.01, 0.3) \\  & Epochs & range (10, 100) \\  & Batch Size & range (10, 100) \\ \hline \multirow{5}{*}{CNN} & Number of Filters & range (10, 100) \\  & Pooling Size and Strides & range (1, 10) \\ \cline{1-1}  & Filter Size & range (1, 10) \\ \cline{1-1}  & Learning\_Rate & range (0.01, 0.3) \\ \cline{1-1}  & Batch Size & range (10, 100) \\ \hline \multirow{2}{*}{SVR} & C & range (1, 100) \\ \cline{1-1}  & Gamma & range (0.001, 0.1) \\ \cline{1-1}  & Epsilon & range (0.001, 0.1) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Optimization ranges for three model parameters. The detailed steps of PSO are as follows. (1) Dataset division. For each set of aging dataset, the training and testing sets are divided in the ratio of 7:3, and 25% from the training set is divided as the validation set to enhance the generalization ability of the model. (2) Data normalization. Min-max normalization is applied to all data, eliminating scale differences and ensuring uniform magnitude. \[X_{norm}=\frac{X-X_{\text{min}}}{X_{\text{max}}-X_{\text{min}}} \tag{13}\]  
(3) PSO particle swarm parameter initialization. The number of iterations is set to 30, with a population size of 15; individual and social learning factors are both set to 1.7, and inertia weight to 0.6. Each population contains multiple particles, representing different  
Figure 3: Prediction process of SOH of lithium battery by each model optimized based on PSO algorithm. hyperparameter combinations. For PSO-LSTM, the hyperparameters include Learning Rate, Number of Hidden Neurons, Time Step, Batch Size, and Epochs; for PSO-CNN, parameters include number of Filters, Pooling Size and Strides, Filter Size, Batch Size, and Learning Rate; and for PSO-SVR, parameters include Regularization Parameter C, Kernel Function Coefficient Gamma, and Epsilon. (4) Initialize the position and velocity of each particle. Each particle corresponds to an LSTM, CNN, or SVR model. For each particle, the model was trained using the current combination of hyperparameters, and the prediction error RMSE of the test set was used as the fitness value of the particle.