# State-of-Charge Prediction Model for Ni-Cd Batteries Considering Temperature and Noise
## 4 Analysis of SOC Prediction Results of Ni-Cd Battery Using APSO-GRNN
### SOC Prediction Algorithm Results and Discussion  
#### 4.2.1 APSO-GRNN Model Training Results  
The estimation of Ni-Cd battery SOC values is expected to have errors. Therefore, error assessment is an essential aspect of analyzing the accuracy of prediction algorithms [28,29]. Using only one form of error calculation is insufficient to assess the overall accuracy of the model. Thus, multiple forms of error calculation, such as the mean absolute error (\(\delta\)), root mean square error (\(\delta_{RMSE}\)), and Pearson correlation (\(\delta_{p}\)), are commonly used to comprehensively assess the accuracy of a model [30,31]. \[\delta=\frac{1}{N}\sum_{i=1}^{N}\left|\frac{y_{i}-y_{i}^{*}}{y_{i}}\right| \tag{16}\]  
\[\delta_{RMSE}=\sqrt{\frac{1}{N}\sum_{i=1}^{N}(y_{i}-y_{i}^{*})^{2}} \tag{17}\]  
\[\delta_{p}=\frac{\sum_{i=1}^{N}(y_{i}-\bar{y_{i}})(y_{i}^{*}-\bar{y_{i}^{*}})} {\sqrt{\sum_{i=1}^{N}(y_{i}-\bar{y_{i}})}\sqrt{\sum_{i=1}^{N}(y_{i}^{*}-\bar{y _{i}^{*}})}} \tag{18}\]  
To verify the accuracy and advantages of the model proposed in this paper, three common regression prediction models were selected for comparison with the APSO-GRNN: the support vector regression algorithm (SVR), unoptimized generalized neural network (GRNN), and extreme gradient boosting algorithm (XGBoost). The parameters of each model are shown in Table 3:  
The training process for estimating Ni-Cd battery SOC values began with the FUDS data, with a 7:3 ratio used to divide the data into training and verification sets. Cross-validation was used to enhance the efficiency of data utilization. The proposed model was used as the pre-training model, and the training continued based on the pulse-discharge experimental data acquired at 40 \({}^{\circ}\)C. The use of pre-trained models can enhance the robustness of the algorithm. Finally, the model was evaluated using a noisy DST dataset and cyclic pulse dataset at different temperatures. Figure 5: Voltage and current under different conditions: (**a**) DST voltage; (**b**) DST current; (**c**) FUDS voltage; (**d**) FUDS current; (**e**) cyclic pulse voltage; (**f**) cyclic pulse current. The FUDS adopted a discharge strategy that accounted for the actual power change of the battery, resulting in significant differences in voltage and current distribution compared to the pulse-discharge experiments. Using these data to train the model can enhance the robustness of the model. The APSO-GRNN model demonstrated better stability and prediction accuracy than the other three models under the FUDS conditions, with more minor prediction errors and fluctuations, as shown in Figure 6a. The APSO-GRNN model maintained high prediction accuracy even under conditions where there were significant differences in the voltage and current distribution. Moreover, Figure 6b shows that the correlation between the APSO-GRNN model's predicted results and the actual values was more robust than that of the other three models. Combined with Figure 5e, it can be seen that the APSO-GRNN model can reduce the impact of voltage rebound on battery SOC prediction and improve prediction accuracy. The degree of polymerization indicates the degree of particle aggregation and its stabilization indicates algorithm convergence. The degree of polymerization represented the degree of aggregation of the particles, and as the degree of polymerization no longer changed, this indicated the algorithm's \begin{table}
\begin{tabular}{c c} \hline \hline
**Model** & **Parameter** \\ \hline SVR & Kernel function: radial basis; Penalty factor: 2.5 \\ \hline \multirow{2}{*}{XGBoost} & Number of decision trees: 200; Learning rate: 0.05; \\  & Depth of a single tree: 6 \\ \hline GRNN & Smoothing factor: 0.2; Number of neurons: 100 \\ \hline \multirow{2}{*}{APSO-GRNN} & Initial particle position: random numbers ranging from 0.01 to 0.5; \\  & Initial velocity weight: 1; Learning factor: 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Initial parameters of the model.