## 4 Model Validation and Result Analysis
### Passenger Flow Forecasting Process Realization  
For passenger flow prediction, this study employs the MHALSTM model, which integrates the advantages of LSTM with the multi-head attention mechanism. The gated structure of the LSTM is adept at capturing dependencies that evolve over time within time-series data, allowing the model to store and utilize historical data characteristics to identify potential periodicities and trends. Simultaneously, the multi-head attention mechanism allows for the parallel processing of information across different subspaces within the model, enabling it to capture more detailed temporal features across various dimensions. This multi-dimensional information processing approach allows the MHALSTM model to identify and utilize complex patterns within the time series, such as traffic peaks, periodic fluctuations, and potential non-linear relationships, thereby enhancing the accuracy and robustness of the predictions. To validate the actual performance of the MHALSTM model in passenger flow prediction, this study compared the MHALSTM with baseline LSTM and Transformer models by calculating the root-mean-square error (RMSE), Mean Absolute Error (MAE), and the coefficient of determination (R\({}^{2}\)). The comparative results, as shown in Table 1, are based on the \"East Station of \(Z\) City\" dataset. Based on Table 1 and Figure 4, it is evident that the LSTM baseline model exhibits significant advantages in handling time-series data. By capturing long-term dependencies between data points, the LSTM baseline model effectively tracks trends in passenger flow changes but tends to underestimate peak predictions. This may be due to the model's insufficient capture of non-linear patterns in the data or the network's inadequate capacity to express such complexities. The Transformer baseline model benefits from its self-attention mechanism, which focuses on different time points, enabling it to roughly capture periodic changes in passenger flow and exhibit a certain level of responsiveness to these changes. However, it performs less effectively than specialized time-series models in terms of capturing local sequence data features. Consequently, it shows notable errors in predicting peaks and troughs, lacks prediction precision, and sometimes exhibits abrupt changes in prediction curves compared to actual values. In contrast, predictions from the MHALSTM model, which integrates the multi-head attention mechanism, demonstrate fluctuations that are very close to actual values. It not only captures trends effectively but also adapts well to short-term changes in passenger flow, demonstrating higher accuracy in predicting peaks and troughs. This indicates its superior overall performance. In terms of prediction metrics, the RMSE of the MHALSTM model is much higher than the MHALSTM model. Figure 4: Line graph for comparison of passenger flow forecast results. (**a**) Comparison chart of the LSTM model; (**b**) comparison chart of the Transformer model; (**c**) comparison chart of the MHALSTM model. model is 18% lower than that of the LSTM baseline model and 55% lower than that of the Transformer baseline model; the MAE is 24% lower than that of the LSTM baseline model and 58% lower than that of the Transformer baseline model. Moreover, the R2 value of the MHALSTM model (0.972) is slightly higher than that of the LSTM model (0.969) and significantly higher than that of the Transformer model (0.894), indicating its ability to explain a higher proportion of variance in the data. This suggests that the MHALSTM model exhibits the highest prediction accuracy amongst those used on this dataset, showing significant performance improvements compared to the other two baseline models. In summary, in this study's time-series prediction task, the MHALSTM model proves to be the most suitable choice due to its ability to capture time-series characteristics, its lower prediction errors, and its strong adaptability to data. The partial passenger flow data obtained using the MHALSTM model is presented in Table 2.