## 4 Comparative Analysis of the Prediction Results
The \(R^{2}\) of the GA-BP and the PSO-BP models is relatively close under the conditions of free flow with gate control and the combined flow patterns. The \(R^{2}\) of the PSO-BP model is higher than that of the GA-BP model under the conditions of submerged outflow with gate control and weir flow. From the perspective of prediction accuracy, overall, the MAPE and maximum relative error of the PSO-BP model are lower than those of the GA-BP model, and the BP model has the largest MAPE and maximum relative error. In summary, the particle swarm algorithm is slightly better than the genetic algorithm in optimizing the BP neural network for gate flow prediction. However, since the prediction results of the GA-BP and PSO-BP models are affected by their respective parameter settings, which are quite different, it is impossible to accurately evaluate the optimization effects of the particle swarm optimization and genetic algorithm on the BP neural network. From the evaluation indicators of the prediction results, the GA-BP and PSO-BP models significantly improve the prediction accuracy of the BP model and enhance the generalization ability of the BP model, which can be used for the flow prediction of dry and branch canals in the irrigation areas. From Table 2, it can be seen that the relevant statistical indicators of traditional methods are significantly inferior to those of neural network models, which reflects the superiority of the model proposed in this paper. The optimization effect of particle swarm optimization is better than that of the genetic algorithm. The main reason is that the two algorithms have different principles: (1) the crossover probability and mutation probability in the GA-BP model are fixed. The genetic algorithm requires different search capabilities in the early global search stage and the later local search stage. Fixed parameter settings cannot self-adaptively meet the search capability requirements of genetic algorithms at different times; (2) the crossover and mutation operations of genetic algorithms in the population evolution process will randomly introduce new individuals. The quality of new individuals will directly affect the convergence speed of the algorithm, and this process is blind. Excellent individuals will accelerate the population's movement towards the optimal position during the evolutionary process, while undesirable individuals will slow down their movement speed; and (3) the particle swarm of the particle swarm algorithm will follow the optimal particle movement under global conditions. The entire population of the genetic algorithm moves towards the optimal position during the evolution process. Therefore, the PSO algorithm has a faster convergence speed than the GA algorithm. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{2}{c}{**Computational Models**} & \(R^{2}\) & **MAPE (\%)** & \multicolumn{2}{c}{**Maximum**} & \multicolumn{1}{c}{**Run Time (s)**} \\ \hline \multirow{4}{*}{FOG} & BP & 0.974 & 8.241 & 18.222 & 25 \\  & GA-BP & 0.997 & 2.858 & 7.682 & 36 \\  & PSO-BP & 0.996 & 2.827 & 6.444 & 18 \\  & Traditional method & 0.203 & 37.83 & 111.36 & / \\ \hline \multirow{4}{*}{SOG} & BP & 0.987 & 8.162 & \(-\)25.03 & 28 \\  & GA-BP & 0.982 & 4.667 & 16.575 & 34 \\  & PSO-BP & 0.996 & 4.723 & \(-\)12.423 & 22 \\  & Traditional method & 0.021 & 677.10 & 1492.74 & / \\ \hline \multirow{4}{*}{WF} & BP & 0.663 & 7.04 & 12.119 & 17 \\  & GA-BP & 0.835 & 4.984 & 11.098 & 26 \\  & PSO-BP & 0.883 & 4.573 & 11.204 & 13 \\  & Traditional method & 0.317 & 28.70 & 39.43 & / \\ \hline \multirow{4}{*}{Combined flow patterns} & BP & 0.981 & 7.721 & 21.397 & 52 \\  & GA-BP & 0.989 & 5.364 & 15.694 & 64 \\ \cline{1-1}  & PSO-BP & 0.989 & 5.056 & 12.171 & 41 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Evaluation of prediction results of the BP model, GA-BP model, and PSO-BP model.