Urban Rail Transit Passenger Flow Forecasting Method Based on the Coupling of Artificial Fish Swarm and Improved Particle Swarm Optimization Algorithms

Urban rail transit passenger flow forecasting is an important basis for station design, passenger flow organization, and train operation plan optimization. In this work, we combined the artificial fish swarm and improved particle swarm optimization (AFSA-PSO) algorithms. Taking the Window of the World station of the Shenzhen Metro Line 1 as an example, subway passenger flow prediction research was carried out. The AFSA-PSO algorithm successfully preserved the fast convergence and strong traceability of the original algorithm through particle self-adjustment and dynamic weights, and it effectively overcame its shortcomings, such as the tendency to fall into local optimum and lower convergence speed. In addition to accurately predicting normal passenger flow, the algorithm can also effectively identify and predict the large-scale tourist attractions passenger flow as it has strong applicability and robustness. Compared with single PSO or AFSA algorithms, the new algorithm has better prediction effects, such as faster convergence, lower average absolute percentage error, and a higher correlation coefficient with real values.


Introduction
Urban rail transit has the characteristics of large traffic volume, high speed, and high security. It has become the main travel mode of transport for residents of large cities. For urban rail transit networks, considering the difference and complexity of passenger flow distribution in peak and low periods, how to precisely predict the passenger flow of urban rail transit in a real-time manner has been an active study field for our research team [1][2][3][4] and public transport operation management departments.
Studies have been carried out on passenger flow prediction models and algorithms for urban rail transit, which mainly fall into two categories: mathematical model methods and model-free algorithms.
The determined model methods and their corresponding optimization algorithms include the ARIMA time series prediction algorithm [5], the nearest-neighbor nonparametric regression algorithm for short-term inbound passenger flow prediction [6], and the nearest-neighbor passenger flow prediction algorithm based on the fuzzy value time series relationship [7]. Yao Enjian et al. put forward a way to determine real-time inbound and outbound passenger flow of new stations at the initial stage of opening based on improved k-near nonparametric regression [8]. There are also prediction methods, Bayesian networks [9], a tracking orthogonal least-squares algorithm [10], and traffic flow prediction based on a Kalman filtering model [11].
Regarding model-free algorithms and their optimization algorithms, such as wavelet support vector machine [12], Feng et al. proposed a short-term inbound passenger flow prediction model of urban rail transit based on the grey wolf optimizer and a wavelet neural network [13]. Huang and Han proposed a short-term bus stop based on improved limit learning machine time based on a passenger flow prediction method and a bionic algorithm based on biological group intelligence [14], such as using a dynamic change energy aware adaptive particle swarm optimization algorithm (DCW-APSO) to optimize an LS-SVM to predict high-speed railway passenger flow using grey support vector machine calibrated by particle swarm optimization (PSO) [15,16].
The above studies provide an important research basis for designing and optimizing algorithms of urban rail transit passenger flow prediction models. Existing algorithms have the following characteristics: (1) Due to the limitations of the models themselves, methods based on mathematical analytical models have difficulties dealing with the impact of random interference factors on subway passenger flow. Thus, they cannot reflect the high uncertainty and nonlinearity of the traffic flow system itself, and the prediction accuracy is not high for intelligent model prediction methods based on knowledge. However, model-free algorithms obtain prediction "experience" and "knowledge" through the structure mechanism of the method itself, so as to predict the traffic in the next period, which has a certain adaptive ability [11].
(2) Due to the high demand for sample data of subway passenger flow and the large amount of algorithm calculations but the low efficiency of mathematical analytical models, it is difficult to adapt to calculations of large-scale data [11].
(3) In recent years, China has constructed an increasing number of large theme parks and hosted large-scale international events. The theme park tourists leave at night and large-scale events cause thousands of people to travel together, which puts an enormous amount of pressure on already tense urban transportation systems, thus necessitating higher requirements for traffic planning, traffic impact analysis, and traffic management [9]. At present, most research mainly focuses on the prediction of subway passenger flow in the normal morning and evening peaks, while there is less research on the prediction of passenger flow before and after the departure of large theme parks or large-scale activities.
(4) The bionic algorithm is a general term for a kind of random search method that simulates the evolution of natural organisms or the social behavior of groups. Compared with neural network models, these algorithms do not rely on gradient information when solving, so they are widely used, especially for large-scale complex optimization problems that are difficult to be solved by traditional methods [12]. Current bionic algorithms are usually used to optimize other algorithms [15,16], and their advantages as the main body of a prediction algorithm are less frequently considered.
However, the existing methods, such as the particle swarm algorithm, the artificial ant colony algorithm, and the artificial bee colony algorithm have the disadvantage of premature convergence. A feasible solution is difficult to guarantee global optimization [12].
The artificial fish swarm algorithm (AFSA) has a good ability to overcome local extremum and obtain global extremum. Moreover, the algorithm only uses the function value of the objective function and does not need special information such as the gradient value of the objective function, so it has a certain adaptive ability to the search space. The algorithm has no requirement for initial values and is not sensitive to the selection of parameters [17].
AFSA-PSO algorithm's advantages compared with the traditional estimation models are as follows: (1) It can adapt to calculations of large-scale data and has high efficiency, which can also reflect the high uncertainty and nonlinearity of the traffic flow system itself compared with methods based on mathematical analytical models [11]; (2) Compared with neural network models, AFSA-PSO algorithm only uses the function value of the objective function and does not rely on gradient information, so it has a certain adaptive ability to the search space. Moreover, they are widely used, especially for large-scale complex optimization problems [12]; (3) Comparing the traditional machine-learning algorithms such as SVM and SVR, AFSA-PSO algorithm has no requirement for initial values and is not sensitive to the selection of parameters [17]; (4) AFSA-PSO algorithm has a good ability to overcome local extremum and obtain global extremum compared with single PSO algorithm and other bionic algorithms [12,17].
Therefore, in this study, we took the advantages of the PSO bionic algorithm and used the artificial fish swarm algorithm (AFSA) to make up for its deficiencies, resulting in the AFSA-PSO algorithm.
The rest of this paper is organized as follows: for the principle of the algorithm, the PSO and AFSA algorithms are separately introduced in Section 2. In Section 3, the proposed coupling of the AFSA and improved PSO algorithms (AFSA-PSO) is elaborated, which improves the efficiency of the solution by self-regulation of particles and dynamic weight distribution. It also avoids premature convergence of particles and has the characteristics of fast convergence near the optimal solution. In Section 4, we describe how the new algorithm was used to predict the normal rail transit passenger flow and the rail transit passenger flow during the period of tourists leaving large-scale attractions, taking into account the average absolute percentage error, iteration speed, and correlation coefficient index between the prediction results and the real values to evaluate the effectiveness of the algorithm. Finally, in Section 5, the results are discussed and future research is considered.

PSO Algorithm
Generally, the traditional PSO algorithm needs to abstract the potential solution of the objective function into particles with specific speed and motion direction in the dimension space and to search in the solution space [18]. The specific steps are as follows: Step 1: Set the parameters required for algorithm iteration-(1) inertia weight, that is, the coefficient that the particle keeps its original speed; (2) cognition coefficient, that is, the weight coefficient of the historical optimal value of the particle tracking itself; (3) social knowledge coefficient, that is, the weight coefficient of the optimal value of the particle tracking group; (4) random number evenly distributed in the interval; (5) constraint factor; (6) satisfaction error; and (7) maximum number of iterations.
Step 2: Initialize the particle swarm. Calculate the initial value of all particles.
Step 3: Update. According to formulas (1) and (2), calculate the speed and position of each particle and recalculate the better solution of the particles according to the updated state: where v k is the speed of the particle after k iterations, x k is the position of the particle after k iterations, p k is the historical optimal value searched by the particle, and q k is the optimal value searched by all particles.
Step 4: Convergence discrimination. If the current solution is within the range of satisfactory error or reaches the maximum number of iterations, the algorithm ends; otherwise, return to step 3 and repeat.

AFSA Algorithm
The artificial fish swarm algorithm is a kind of bionic algorithm. Fish can swim and search for food quickly and nimbly in the water. It depends on the ability of information sharing between fish swarms and information analysis of fish swarms to external stimulation so as to search for food as much as possible and avoid being swallowed [19].
The AFSA algorithm optimization process is based on the artificial fish model design, and the individual state of the fish is X = (x 1 , x 2 · · · , x n ), among which x i , i = 1, 2 · · · , n is the variable to be optimized; the food concentration of the artificial fish is Y = f (X), among which Y is the objective function value; the artificial fish spacing is d = X i , X j ; and the artificial fish's perceived distance is V. The maximum step size for artificial fish movement is S, and the congestion factor is c, as shown in Figure 1. The artificial fish swarm algorithm is a kind of bionic algorithm. Fish can swim and search for food quickly and nimbly in the water. It depends on the ability of information sharing between fish swarms and information analysis of fish swarms to external stimulation so as to search for food as much as possible and avoid being swallowed [19].
The AFSA algorithm optimization process is based on the artificial fish model design, and the individual state of the fish is  , , ; and the artificial fish's perceived distance is V . The maximum step size for artificial fish movement is S , and the congestion factor is c , as shown in Figure 1. indicates that the surrounding area of the optimal partner is not too crowded, then artificial fish group i x moves one step towards the function optimal partner j x . Otherwise, foraging behavior is performed.
The specific steps of the algorithm are as follows [20]: Step 1: Determine the population size fishnum and randomly generate n individuals n x in the variable feasible region. The number of iterations is gen . Then, set the visual domain V of artificial fish. The distance between fish is ij d , the step length is S, the crowding factor is c, and the number of attempts is try_number .
Step 2: Calculate the individual fitness value of each artificial fish in the initial fish school and give the best artificial fish status and fitness value to the bulletin board.
Step 3: Simulate the behavior of artificial fish groups, such as foraging, gathering, tailgating, and random behavior. Generate new fish groups by iteration.
Step 4: Evaluate the status and fitness of all individuals. If an individual's status and fitness are better than the bulletin board, the bulletin board will be updated. Otherwise, the bulletin board will remain unchanged.
Step 5: Convergence discrimination. If the current solution is within the range of satisfactory error or reaches the maximum number of iterations, the algorithm ends. Otherwise, return to step 2 and repeat.

Algorithm Design
In this study, the AFSO-PSO algorithm was designed according to the characteristics of the two algorithms described above, and they are coupled by the dynamic weight.
Scholars in the study of prediction model to confirm the weight of each index. There are different methods summed up into two categories: fixed weight method and dynamic weight method. The For example, the rear end behavior of a school of fish refers to the behavior of a fish moving in the optimal direction within its visible area. Artificial fish group x i searches for the function optimal partner x j among all partners in its field of vision. If x j /n > cx i indicates that the surrounding area of the optimal partner is not too crowded, then artificial fish group x i moves one step towards the function optimal partner x j . Otherwise, foraging behavior is performed.
The specific steps of the algorithm are as follows [20]: Step 1: Determine the population size f ishnum and randomly generate n individuals x n in the variable feasible region. The number of iterations is gen. Then, set the visual domain V of artificial fish. The distance between fish is d ij , the step length is S, the crowding factor is c, and the number of attempts is try_number.
Step 2: Calculate the individual fitness value of each artificial fish in the initial fish school and give the best artificial fish status and fitness value to the bulletin board.
Step 3: Simulate the behavior of artificial fish groups, such as foraging, gathering, tailgating, and random behavior. Generate new fish groups by iteration.
Step 4: Evaluate the status and fitness of all individuals. If an individual's status and fitness are better than the bulletin board, the bulletin board will be updated. Otherwise, the bulletin board will remain unchanged.
Step 5: Convergence discrimination. If the current solution is within the range of satisfactory error or reaches the maximum number of iterations, the algorithm ends. Otherwise, return to step 2 and repeat.

Algorithm Design
In this study, the AFSO-PSO algorithm was designed according to the characteristics of the two algorithms described above, and they are coupled by the dynamic weight.
Scholars in the study of prediction model to confirm the weight of each index. There are different methods summed up into two categories: fixed weight method and dynamic weight method. The fixed weight method includes questionnaire survey method [21], analytic hierarchy process [22] and entropy weight method [23], etc. These methods calculate the weight in advance, and the weight is fixed in the prediction process. However, the actual situation is very complex. It is impossible for each index to maintain the same weight with the change of index value [24], so there is a dynamic weight method. By comparing the error between the simulation value and the measured value, the current weight value is adjusted dynamically, and the weight correction table [25] is established. In bionic algorithm, dynamic weight method is often used to balance the global search and local search ability of population [26,27]. Therefore, the new algorithm uses the concept of dynamic weight in the above paper for reference, coupling particle swarm and fish swarm algorithm to find optima mutation population examples. At the beginning of the algorithm iteration, the accuracy of particle optimization direction is required to be higher, so the weight of artificial fish swarm algorithm is larger. At the end of the algorithm iteration, the global optimal solution domain of particles is rapidly reduced, and the convergence of the optimization process is required to be higher, so the weight of particle swarm algorithm is larger. This algorithm successfully retains the advantages of PSO rapidity, convergence and AFSA globality, and traceability through particle self-regulation and dynamic weight. At the same time, it effectively avoids the shortcomings of "premature" in the process of particle optimization, obvious reduction of convergence speed in the later stage, and balances the global and local search capabilities of the population.
The specific steps of the algorithm are as follows: Step 1: Initialization. Set the parameters and models of the PSO and AFSA algorithms as shown in Section 2.
Step 2: Independently carry out the PSO and AFSA algorithms and obtain the new particle swarm, new fish swarm, and initial value after iterative updating. Judge whether the new particles and fish need self-regulation. If so, turn to step 3; if not, turn to step 4. Among them, the judgment basis for new particles and new schools to enter into self-regulation is as follows: The PSO algorithm judges according to the difference between the local optimal value and the global optimal value. If the difference is too small, it means that the particles are too concentrated and need self-regulation.
where a is the average aggregation degree of particles, K is the particle swarm size, m is the particle dimension, q j is the global optimal value, and p ij is the local optimal value. The AFSA algorithm is based on the number of times that the numerical change rate in the bulletin board is less than the specified change rate ρ. If the number of times is too much, it means that the change of optimal fitness is not obvious and self-regulation is needed.
Step 3: Adjust the state of the particle and fish swarms: (1) Recalculate the positions of the particles and artificial fish by using update rules P t+1 (i) and A t+1 (i): where r is the m dimension vector composed of random numbers between [−1, 1], u is the transposition of m dimension vector u generated randomly and only composed of 0 and 1, P t (i) is the P t (i) arithmetic mean value after taking the absolute number for each dimension value, and A t (i) is the A t (i) arithmetic mean value after taking the absolute number for each dimension value.
(2) According to P t+1 (i) and A t+1 (i), update the global optimal value q j , the local optimal value p ij , and the bulletin board.
(3) Judge whether the particle and fish swarms still need self-regulation. If yes, go to step 3 (1); if no, go to step 4.
Step 4: Use the mutation rule to generate the mutation population: where B t+1 is the mutation population particle after (t + 1) searches, P t+1 is the particle after (t + 1) searches, A t+1 is the fish population particle after (t + 1) searches, α t+1 and (1 − α t+1 ) are the weight coefficients of the PSO and AFSA algorithms, respectively. The weight coefficient α t+1 and (1 − α t+1 ) are related to the number of iterations. In the early stage of algorithm iteration, the search process requires higher direction, so the weight of the AFSA algorithm is larger. In the late stage of algorithm iteration, the global optimal solution domain is rapidly reduced, and the search process requires higher convergence, so the weight of the PSO algorithm is larger.
where T is the maximum number of iterations, and t is the current number of iterations.
Step 5: Convergence discrimination. If the current solution meets the convergence criteria or reaches the maximum number of iterations, the iteration is ended. Otherwise, step 2 is revisited and the iteration is repeated. The procedure of the algorithm is shown in detail in Figure 2.
(3) Judge whether the particle and fish swarms still need self-regulation. If yes, go to step 3 (1); if no, go to step 4.
Step 4: Use the mutation rule to generate the mutation population: where 1 t B  is the mutation population particle after  are related to the number of iterations. In the early stage of algorithm iteration, the search process requires higher direction, so the weight of the AFSA algorithm is larger. In the late stage of algorithm iteration, the global optimal solution domain is rapidly reduced, and the search process requires higher convergence, so the weight of the PSO algorithm is larger.
where T is the maximum number of iterations, and t is the current number of iterations.
Step 5: Convergence discrimination. If the current solution meets the convergence criteria or reaches the maximum number of iterations, the iteration is ended. Otherwise, step 2 is revisited and the iteration is repeated. The procedure of the algorithm is shown in detail in Figure 2.

Normal Passenger Flow Forecast
Normal passenger flow forecasting was performed in three steps: (1) Passenger flow data of four working days were used as the training set, the algorithm was trained, and the passenger flow of the fifth working day was predicted, so that the algorithm could reach a stable forecast state. (2) The passenger flow data of four working days were selected as the test set again, and the passenger flow of the fifth working day was predicted. In order to effectively control the influence of system error on the prediction results, the arithmetic mean value of the first 10 prediction results was selected as the final result. (3) The passenger flow of 10 different working days was predicted to verify the robustness of the algorithm, and the algorithm was verified by comparing and analyzing the mean

Normal Passenger Flow Forecast
Normal passenger flow forecasting was performed in three steps: (1) Passenger flow data of four working days were used as the training set, the algorithm was trained, and the passenger flow of the fifth working day was predicted, so that the algorithm could reach a stable forecast state. (2) The passenger flow data of four working days were selected as the test set again, and the passenger flow of the fifth working day was predicted. In order to effectively control the influence of system error on the prediction results, the arithmetic mean value of the first 10 prediction results was selected as the final result. (3) The passenger flow of 10 different working days was predicted to verify the robustness of the algorithm, and the algorithm was verified by comparing and analyzing the mean average absolute percentage error (MAPE), iteration speed, correlation coefficient, and other indicators of accuracy for the prediction results.
Considering the greater fluctuation and mobility of the passenger flow in the peak hours of working days, which is not conducive to the management and control of rail stations, we carried out normal passenger flow prediction for the early peak (7:00-9:00 a.m.) and the late peak (5:00-7:00 p.m.) for the Window of the World station. The prediction results showed the following: (1) The trend of the normal passenger flow prediction curve of the three algorithms was basically consistent with the real value curve, and the coincidence degree was relatively high. Among them, the predicted value curve of AFSA-PSO was the closest to the real value curve, as shown in Figures 3 and 4. (2) The MAPE and iteration speed of the three algorithms were compared. (a) After the PSO algorithm iterated for about 25 times, the particles gradually lost diversity, and the MAPE tended to be stable. (b) The convergence speed of AFSA algorithm was faster in the early stage and slowed down obviously in the later stage. After iterating for about five times, the MAPE tended to be stable and was the highest among the three algorithms. (c) The AFSA-PSO algorithm had the fastest convergence speed and the highest operation efficiency. After iterating for about 45 times, the MAPE tended to be stable and the lowest of the three algorithms, as shown in Figures 5 and 6.

and 4.
(2) The MAPE and iteration speed of the three algorithms were compared. (a) After the PSO algorithm iterated for about 25 times, the particles gradually lost diversity, and the MAPE tended to be stable. (b) The convergence speed of AFSA algorithm was faster in the early stage and slowed down obviously in the later stage. After iterating for about five times, the MAPE tended to be stable and was the highest among the three algorithms. (c) The AFSA-PSO algorithm had the fastest convergence speed and the highest operation efficiency. After iterating for about 45 times, the MAPE tended to be stable and the lowest of the three algorithms, as shown in Figures 5 and 6.
The MAPEs of 10 working day forecast data were compared. (a) Among 10 groups of forecast data, the MAPE of AFSA-PSO was the smallest and the forecast accuracy was the highest. (b) Compared with PSO and AFSA, the average MAPE of early peak decreased by 0.77% and 1.21%, respectively, and the average MAPE of the late peak decreased by 2.78% and 2.90%, respectively, with a relatively obvious decrease, and the forecast accuracy of the early peak was higher, as shown in Tables 1 and 2.    (2) The MAPE and iteration speed of the three algorithms were compared. (a) After the PSO algorithm iterated for about 25 times, the particles gradually lost diversity, and the MAPE tended to be stable. (b) The convergence speed of AFSA algorithm was faster in the early stage and slowed down obviously in the later stage. After iterating for about five times, the MAPE tended to be stable and was the highest among the three algorithms. (c) The AFSA-PSO algorithm had the fastest convergence speed and the highest operation efficiency. After iterating for about 45 times, the MAPE tended to be stable and the lowest of the three algorithms, as shown in Figures 5 and 6.
The MAPEs of 10 working day forecast data were compared. (a) Among 10 groups of forecast data, the MAPE of AFSA-PSO was the smallest and the forecast accuracy was the highest. (b) Compared with PSO and AFSA, the average MAPE of early peak decreased by 0.77% and 1.21%, respectively, and the average MAPE of the late peak decreased by 2.78% and 2.90%, respectively, with a relatively obvious decrease, and the forecast accuracy of the early peak was higher, as shown in Tables 1 and 2.      3.65% 5.59% 5.93% The MAPEs of 10 working day forecast data were compared. (a) Among 10 groups of forecast data, the MAPE of AFSA-PSO was the smallest and the forecast accuracy was the highest. (b) Compared with PSO and AFSA, the average MAPE of early peak decreased by 0.77% and 1.21%, respectively, and the average MAPE of the late peak decreased by 2.78% and 2.90%, respectively, with a relatively obvious decrease, and the forecast accuracy of the early peak was higher, as shown in Tables 1 and 2. The MAPE was calculated as follows: where δ is the average absolute percentage error, x i and L i are the predicted value and the real value of the i th group data, respectively, and n are the number of prediction groups. (4) The correlation coefficients p between the predicted value and the real value of the three algorithms were compared. (a) The Pearson correlation coefficients of the three algorithms were all high, the significance level p was approximately 0, and there was a strong linear relationship between the predicted value and the real value. (b) Among the 10 groups of data, the average value of the Pearson correlation coefficient of AFSA-PSO was the highest, reaching 0.998 and 0.990 at morning and evening peaks, respectively, which was significantly better than PSO and AFSA. The detailed comparison is presented in Tables 3 and 4. In conclusion, compared with the PSO and AFSA algorithms, the AFSA-PSO algorithm had the highest prediction accuracy and the best effect. The prediction effect of the early peak was better than that of the late peak.

Prediction of Large-Scale Tourist Attraction Passenger Flow
Traffic demand prediction is an important part of traffic organization and management of large-scale tourist spots. It provides a decision-making basis for the safe and fast evacuation of tourist spots by predicting the passenger flow of the transport network of large-scale tourist spots in a certain period and carrying out traffic distribution [28].
The passenger flow forecast of large-scale tourist attractions is consistent with that of normal passenger flow. As the opening time of the Window of the World night market is 7:30 p.m., the tourists of the day market leave before 7:00 p.m. on holidays. The railway station shows obvious passenger flow fluctuations from 5:00 to 7:00 p.m. as shown in Figure 7.

Prediction of Large-scale Tourist Attraction Passenger Flow
Traffic demand prediction is an important part of traffic organization and management of largescale tourist spots. It provides a decision-making basis for the safe and fast evacuation of tourist spots by predicting the passenger flow of the transport network of large-scale tourist spots in a certain period and carrying out traffic distribution [28].
The passenger flow forecast of large-scale tourist attractions is consistent with that of normal passenger flow. As the opening time of the Window of the World night market is 7:30 p.m., the tourists of the day market leave before 7:00 p.m. on holidays. The railway station shows obvious passenger flow fluctuations from 5:00 to 7:00 p.m. as shown in Figure 7. Therefore, for the Window of the World on holidays from 5:00 to 7:00 p.m., after carrying out passenger flow prediction of large-scale tourist spots, the prediction results showed the following: (1) The trend of the predicted value curve of the three algorithms was basically the same as the real value curve. The algorithm could effectively identify and predict the passenger flow when a large number of tourists left the large-scale tourist attractions. Among them, the predicted value curve of AFSA-PSO was the closest to the real value curve, as shown in Figure 8. (2) The MAPEs and iteration speeds of the three prediction algorithms were compared. (a) After about 10 iterations of the PSO algorithm, the particles gradually lost diversity, and the MAPE tended to be stable and was the highest among the three algorithms. (b) The convergence speed of the AFSA algorithm was faster in the early stages of iteration, and the speed was significantly reduced after about five iterations. (c) The convergence speed and operation efficiency of the AFSA-PSO algorithm were the best, and the MAPE tended to be higher after about 20 iterations. It was stable and was the lowest of the three algorithms, as shown in Figure 9 and Table 5. Therefore, for the Window of the World on holidays from 5:00 to 7:00 p.m., after carrying out passenger flow prediction of large-scale tourist spots, the prediction results showed the following: (1) The trend of the predicted value curve of the three algorithms was basically the same as the real value curve. The algorithm could effectively identify and predict the passenger flow when a large number of tourists left the large-scale tourist attractions. Among them, the predicted value curve of AFSA-PSO was the closest to the real value curve, as shown in Figure 8.

Prediction of Large-scale Tourist Attraction Passenger Flow
Traffic demand prediction is an important part of traffic organization and management of largescale tourist spots. It provides a decision-making basis for the safe and fast evacuation of tourist spots by predicting the passenger flow of the transport network of large-scale tourist spots in a certain period and carrying out traffic distribution [28].
The passenger flow forecast of large-scale tourist attractions is consistent with that of normal passenger flow. As the opening time of the Window of the World night market is 7:30 p.m., the tourists of the day market leave before 7:00 p.m. on holidays. The railway station shows obvious passenger flow fluctuations from 5:00 to 7:00 p.m. as shown in Figure 7. Therefore, for the Window of the World on holidays from 5:00 to 7:00 p.m., after carrying out passenger flow prediction of large-scale tourist spots, the prediction results showed the following: (1) The trend of the predicted value curve of the three algorithms was basically the same as the real value curve. The algorithm could effectively identify and predict the passenger flow when a large number of tourists left the large-scale tourist attractions. Among them, the predicted value curve of AFSA-PSO was the closest to the real value curve, as shown in Figure 8. (2) The MAPEs and iteration speeds of the three prediction algorithms were compared. (a) After about 10 iterations of the PSO algorithm, the particles gradually lost diversity, and the MAPE tended to be stable and was the highest among the three algorithms. (b) The convergence speed of the AFSA algorithm was faster in the early stages of iteration, and the speed was significantly reduced after about five iterations. (c) The convergence speed and operation efficiency of the AFSA-PSO algorithm were the best, and the MAPE tended to be higher after about 20 iterations. It was stable and was the lowest of the three algorithms, as shown in Figure 9 and Table 5. (2) The MAPEs and iteration speeds of the three prediction algorithms were compared. (a) After about 10 iterations of the PSO algorithm, the particles gradually lost diversity, and the MAPE tended to be stable and was the highest among the three algorithms. (b) The convergence speed of the AFSA algorithm was faster in the early stages of iteration, and the speed was significantly reduced after about five iterations. (c) The convergence speed and operation efficiency of the AFSA-PSO algorithm were the best, and the MAPE tended to be higher after about 20 iterations. It was stable and was the lowest of the three algorithms, as shown in Figure 9 and Table 5.
The correlation coefficient between the predicted value and the real value of the three algorithms was compared. There was a strong linear relationship between the predicted value and the real value of AFSA-PSO, PSO, and AFSA, among which the correlation coefficient of AFSA-PSO was the largest and the linear relationship was the strongest, as shown in Table 6.  The correlation coefficient between the predicted value and the real value of the three algorithms was compared. There was a strong linear relationship between the predicted value and the real value of AFSA-PSO, PSO, and AFSA, among which the correlation coefficient of AFSA-PSO was the largest and the linear relationship was the strongest, as shown in Table 6.

Conclusion
Based on the historical passenger flow data of the Window of the World station of the Shenzhen Metro Line 1, we used the PSO, AFSA, and AFSA-PSO algorithms to predict the normal and largescale tourist attraction subway passenger flow. The results revealed the following: (1) In view of the shortcomings of the basic particle swarm optimization (PSO) algorithm in solving function optimization problems, such as easy to fall into "precocity" and obvious reduction of convergence speed in the later stage, this paper proposes an improved method: by introducing fish swarm algorithm and dynamic weight to improve the mutation population. In the early stages of the algorithm iteration, the optimization process requires higher direction, so the weight of AFSA algorithm is larger. In the late stages of the algorithm iteration, the global optimization solution domain is rapidly reduced, and the convergence of the solution is higher in the optimization process, so the weight of PSO is larger. It is found that the improved algorithm can effectively balance the relationship between local search ability and global search ability by controlling the exploration ability and development ability of the population with dynamic weight. The simulation results show that AFSA-PSO algorithm can significantly reduce the number of iterations and running time compared with the basic particle swarm optimization algorithm.
(2) The current basic bionic algorithm is usually used to optimize other algorithms [15,16], while the advantages of being the main body of prediction algorithm are rarely considered. This research improves the theory of bionic algorithm, takes the optimized bionic algorithm AFSA-PSO as the main body of the prediction algorithm, and achieves good results.

Conclusions
Based on the historical passenger flow data of the Window of the World station of the Shenzhen Metro Line 1, we used the PSO, AFSA, and AFSA-PSO algorithms to predict the normal and large-scale tourist attraction subway passenger flow. The results revealed the following: (1) In view of the shortcomings of the basic particle swarm optimization (PSO) algorithm in solving function optimization problems, such as easy to fall into "precocity" and obvious reduction of convergence speed in the later stage, this paper proposes an improved method: by introducing fish swarm algorithm and dynamic weight to improve the mutation population. In the early stages of the algorithm iteration, the optimization process requires higher direction, so the weight of AFSA algorithm is larger. In the late stages of the algorithm iteration, the global optimization solution domain is rapidly reduced, and the convergence of the solution is higher in the optimization process, so the weight of PSO is larger. It is found that the improved algorithm can effectively balance the relationship between local search ability and global search ability by controlling the exploration ability and development ability of the population with dynamic weight. The simulation results show that AFSA-PSO algorithm can significantly reduce the number of iterations and running time compared with the basic particle swarm optimization algorithm.
(2) The current basic bionic algorithm is usually used to optimize other algorithms [15,16], while the advantages of being the main body of prediction algorithm are rarely considered. This research improves the theory of bionic algorithm, takes the optimized bionic algorithm AFSA-PSO as the main body of the prediction algorithm, and achieves good results.
(3) Most of the existing literature focuses on the prediction of the regular passenger flow demand of the general subway station, while the research on the prediction of the passenger flow of the subway station near the large-scale tourist attractions is very limited, especially when the tourists leave. AFSA-PSO algorithm can effectively predict the subway passenger flow of large-scale tourist spots in a certain period, with strong robustness, high correlation coefficient and small error between the prediction results and the real value. This provides decision-making basis for traffic safety control and safe and rapid evacuation of large-scale tourist spots.
(4) AFSA-PSO algorithm has been successfully applied to urban rail transit passenger flow prediction and early warning, which can provide decision support for listing operation scheduling and orderly organization of station passenger flow. To some extent, it has practical guiding significance for improving operation management level and improving emergency decision-making ability.
In the future, we will continue to forecast the passenger flow of all lines of the station together with other lines, so as to facilitate the passenger flow management and evacuation of all lines of the station. Based on this algorithm, the principle of entropy will be added to the dynamic weight to further improve the accuracy.