1. 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.
2. Algorithm Principle
2.1. 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
is the speed of the particle after
k iterations,
is the position of the particle after
iterations,
is the historical optimal value searched by the particle, and
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.
2.2. 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
, among which
is the variable to be optimized; the food concentration of the artificial fish is
, among which
is the objective function value; the artificial fish spacing is
; and the artificial fish’s perceived distance is
. The maximum step size for artificial fish movement is
, and the congestion factor is
, as shown in
Figure 1.
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 searches for the function optimal partner among all partners in its field of vision. If indicates that the surrounding area of the optimal partner is not too crowded, then artificial fish group moves one step towards the function optimal partner . Otherwise, foraging behavior is performed.
The specific steps of the algorithm are as follows [
20]:
Step 1: Determine the population size and randomly generate individuals in the variable feasible region. The number of iterations is . Then, set the visual domain of artificial fish. The distance between fish is , the step length is S, the crowding factor is c, and the number of attempts is .
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.
3. 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
is the average aggregation degree of particles,
is the particle swarm size,
is the particle dimension,
qj is the global optimal value, and
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
and
:
where
is the
dimension vector composed of random numbers between
,
is the transposition of
dimension vector
generated randomly and only composed of 0 and 1,
is the
arithmetic mean value after taking the absolute number for each dimension value, and
is the
arithmetic mean value after taking the absolute number for each dimension value.
(2) According to and , update the global optimal value , the local optimal value , 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
is the mutation population particle after
searches,
is the particle after
searches,
is the fish population particle after
searches,
and
are the weight coefficients of the PSO and AFSA algorithms, respectively.
The weight coefficient
and
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
is the maximum number of iterations, and
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.
5. 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.