# Research on the Prediction of Insertion Resistance of Wheel Loader Based on PSO-LSTM
## 3 LSTM and PSO
### PSO Optimization Process
The smaller the \(RMSE\) and \(ARE\), the smaller the deviation between the predicted value and the true value, and the higher the prediction accuracy. The closer the value of \(R^{2}\) is to 1, the higher the degree of fit and the better the prediction result. Its calculation formula is as follows:

\[RMSE=\sqrt{\frac{1}{n}\frac{\sum\limits_{i=1}^{n}{(y_{i}^{*}-y_{i})^{2}}}} \tag{17}\]

\[ARE=\frac{1}{n}\sum\limits_{i=1}^{n}{\left|\frac{y_{i}-y_{i}^{*}}{y_{i}}\right|} \tag{18}\]

\[R^{2}=1-\frac{\sum\limits_{i=1}^{n}{(y_{i}-y_{i}^{*})^{2}}}{\sum\limits_{i=1} ^{n}{(y_{i}-\overline{y}_{i})^{2}}} \tag{19}\]

where \(y_{i}\) is the true value, \(y_{i}^{*}\) is the predicted value, \(\overline{y}_{i}\) is the average of the true value, and \(n\) is the number of samples. The prediction results of the LSTM and PSO-LSTM models are shown in Figures 17-19, respectively, for the insertion of gravel samples with depths of 600 mm, 800 mm, and 1000 mm. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Parameters** & **Lower Limit** & **Upper Limit** & \
\begin{tabular}{c} **Minimum** \\ **Speed** \\ \end{tabular} &
\begin{tabular}{c} **Maximum** \\ **Speed** \\ \end{tabular} \\ \hline Initial learning rate & 0.0001 & 0.1 & \(-\)0.001 & 0.001 \\ \hline Number of hidden layer units & 100 & 800 & \(-\)2 & 2 \\ \hline Dropout probability & 0 & 1 & \(-\)0.01 & 0.01 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: PSO-LSTM optimization parameters. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameters** & **LSTM** & **PSO-LSTM** \\ \hline Solver & Adam & Adam \\ \hline Number of iterations & 300 & 300 \\ \hline The number of generations of & 50 & 50 \\ learning-rate attenuation & 0.1 & 0.1 \\ \hline Initial learning rate & 0.01 & Adaptive optimization \\ \hline Number of hidden layer units & 400 & Adaptive optimization \\ \hline Dropout probability & 0.5 & Adaptive optimization \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Parameters of LSTM and PSO-LSTM. The prediction performance indexes of LSTM and PSO-LSTM for gravel sample groups with insertion depths of 600 mm, 800 mm, and 1000 mm are shown in Table 6, and the optimized parameters of PSO-LSTM are shown in Table 7. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Insertion Depth**} & \multirow{2}{*}{
\begin{tabular}{c} **The Proportion** \\ **of Training Set** \\ \end{tabular} } & \multicolumn{2}{c}{**LSTM**} & \multicolumn{2}{c}{**PSO-LSTM**} \\ \cline{3-8}  & & _RMSE_ & _ARE_/\% & _R_\({}^{2}\) & _RMSE_ & _ARE_/\% & _R_\({}^{2}\) \\ \hline \multirow{4}{*}{600 mm} & 50\% & 4.46 & 8.50 & 0.777 & 2.26 & 4.24 & 0.942 \\  & 60\% & 3.46 & 6.75 & 0.846 & 1.69 & 3.12 & 0.963 \\  & 70\% & 5.16 & 7.57 & 0.574 & 1.98 & 3.25 & 0.937 \\  & 80\% & 4.51 & 7.18 & 0.380 & 1.44 & 2.28 & 0.936 \\ \hline \multirow{4}{*}{800 mm} & 50\% & 4.71 & 7.76 & 0.851 & 2.75 & 4.76 & 0.949 \\  & 60\% & 3.26 & 5.62 & 0.894 & 2.47 & 4.25 & 0.939 \\  & 70\% & 3.17 & 5.27 & 0.807 & 2.23 & 3.49 & 0.905 \\  & 80\% & 1.83 & 2.56 & 0.933 & 1.06 & 1.57 & 0.977 \\ \hline \multirow{4}{*}{1000 mm} & 50\% & 9.71 & 7.45 & 0.726 & 4.17 & 4.42 & 0.949 \\  & 60\% & 6.40 & 5.16 & 0.871 & 2.89 & 4.22 & 0.973 \\ \cline{1-1}  & 70\% & 6.98 & 5.77 & 0.833 & 1.88 & 4.42 & 0.987 \\ \cline{1-1}  & 80\% & 5.90 & 5.03 & 0.776 & 1.80 & 1.53 & 0.979 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: LSTM and PSO-LSTM prediction performance of the gravel sample groups. Figure 17: Gravel samples with an insertion depth of 600 mm. (**a**) The training set proportion of 50%; (**b**) The training set proportion of 60%; (**c**) The training set proportion of 70%; (**d**) The training set proportion of 80%.