# Concrete Dam Deformation Prediction Model Research Based on SSA-LSTM
## 4 Case Study
### Contrast Analysis  
The LSTM model was retrained, and predictions were made after its optimization using the SSA algorithm to obtain the averaged optimal parameters. For comparison, the default LSTM model was initially set with 100 neurons in the first layer1, 200 neurons in the second layer2, 20 training epochs, a batch size of 10, and a learning rate of 0.005. The non-optimized LSTM model may suffer from issues such as gradient vanishing or exploding, but through multiple tests, basic hyperparameters were determined, allowing for a visual comparison of the optimized and non-optimized model's predictions. Additionally, to provide further comparability, an arbitrary neural network model was selected with 10 neurons in the first layer1, 20 neurons in the second layer2, a maximum iteration of 300, a batch size of 20, and a learning rate of 0.005, and it was compared with the optimized LSTM model and the non-optimized LSTM model. Although the BP model's sensitivity to time series data may not be ideal, it is one of the most common classical neural network models, and comparing it with the optimized model can further demonstrate the performance improvements. The three models were trained and tested on four selected data points, and all three models use the same \"Adam\" optimizer. Table 2 presents a comparative \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameters** & **Range** & **Averaging** \\ \hline Training rate (lr) & 0.001 & 0.001 \\ Number of training epochs (Epoch) & 100–112 & 106 \\ Number of neurons in the first layer (units1) & 104–130 & 169 \\ Number of neurons in the first layer (units2) & 244–256 & 250 \\ batch\_size & 12–18 & 15 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Hyperparameter optimization results. Figure 6: Denoising comparison chart. performance analysis of the models based on various performance metrics. It is evident that the SSA-LSTM model outperforms the LSTM and BP models, as indicated by the decreased EMAE, RMSE, and MAPE values. The MAPE of the SSA-LSTM model ranges from 0.097% to 0.402%, while the MAPE of the BP model ranges from 0.278% to 1.791%. By comparing these values, the error reduction in prediction accuracy ranges from 0.181% to 1.389% when comparing with the BP model and from 0.405% to 1.728% when comparing with the LSTM model. Specifically, for the best overall fitting data point, EX3-4a, the SSA-LSTM model shows an improvement of 0.787% in MAPE compared to the BP model and an improvement of 1.978% compared to the LSTM model, demonstrating a better predictive performance. Furthermore, the MAE of the EX3-4a data point is reduced by 6 \(\times\) 10\({}^{-3}\) mm and 6.8 \(\times\) 10\({}^{-3}\) mm when compared to the other two models, effectively reducing prediction errors. The RMSE of the EX3-4a data point is reduced by 0.206 mm and 0.905 mm when compared to the other two models, indicating significant improvements in prediction accuracy by the proposed SSA-LSTM model, with all performance indicators surpassing the other two models. The comparative analysis of the three metrics shows that the overall model performance is stable without significant deviations. It can be concluded that the SSA-optimized LSTM model enhances the model's global optimization capability, resulting in more reliable prediction results. To further verify the model accuracy, the training and prediction results were demonstrated for four measurement points using three models. Figure 7 shows the fitting results of the training and prediction models, and Figure 8 shows the residuals. The SSA-LSTM model fits better than the other models, the horizontal displacement residuals are significantly smaller than the other models, and the SSA-LSTM model almost completely overlaps with the real curve in the prediction curve of EX3-4a measurement points, effectively predicting the complex nonlinear variation trend between the dam deformation and impact factors in the short term.