An Adaptive Sinusoidal-Disturbance-Strategy Sparrow Search Algorithm and Its Application

In light of the problems of slow convergence speed, insufficient optimization accuracy and easy falling into local optima in the sparrow search algorithm, this paper proposes an adaptive sinusoidal-disturbance-strategy sparrow search algorithm (ASDSSA) and its mathematical equation. Firstly, the initial population quality of the algorithm is improved by fusing cubic chaos mapping and perturbation compensation factors; secondly, the sinusoidal-disturbance-strategy is introduced to update the mathematical equation of the discoverer’s position to improve the information exchange ability of the population and the global search performance of the algorithm; finally, the adaptive Cauchy mutation strategy is used to improve the ability of the algorithm to jump out of the local optimal solutions. Through the optimization experiments on eight benchmark functions and CEC2017 test functions, as well as the Wilcoxon rank-sum test and time complexity analysis, the results show that the improved algorithm has better optimization performance and convergence efficiency. Further, the improved algorithm was applied to optimize the parameters of the long short term memory network (LSTM) model for passenger flow prediction on selected metro passenger flow datasets. The effectiveness and feasibility of the improved algorithm were verified by experiments.

The swarm intelligence optimization algorithm is a stochastic search algorithm developed inspired by the social behavior patterns, evolutionary mechanisms and physical phenomena of natural biological groups. It solves the problems of traditional optimization algorithms to optimize complex problems with high computation, high complexity, low efficiency, etc. In 2011, Krishnanand K N et al. [12] proposed a firefly algorithm (FA) inspired by fireflies' information exchange when searching for food and mating through flickering. In 2012, Pan W T et al. [13] proposed the fruit fly optimization algorithm (FOA) inspired by fruit flies' foraging. Liu C et al. [14] proposed the wolf pack algorithm (WPA) that mimics the behaviors of bionic wolves, such as wandering, tracking, rounding up and remembering. In 2013 and 2014, Tang R et al. [15], Fong S et al. [16] and Mirjalili S et al. [17] proposed a wolf pack search algorithm (WPSA) and a gray wolf algorithm (GWO). In 2014, Meng X et al. [18] proposed chicken swarm optimization (CSO) that simulates the chicken flock hierarchy and foraging behavior. In 2015, Uymaz S A et al. [19] proposed the artificial algae algorithm (AAA) based on the living behavior of photosynthetic species of microalgae. Mirjalili S et al. [20] proposed the ant lion optimizer algorithm (ALO) based on ants, antlions and elite antlions representing different roles and constantly searching around the local optimal solution in the iterative process. In 2016, Mirjalili et al. [21] proposed the whale algorithm (WOA) stemming from the simulation of hunting behavior of humpback whale populations in nature. Mashwani W K et al. [22] introduced the latest decomposition and indicator function-based evolutionary algorithms for multi-objective optimization processing that can be used as an adaptation evaluation technique for metaheuristic algorithms. In 2017, Mirjalili S et al. [23] proposed a salp swarm algorithm (SSA) inspired by salp aggregation predation behavior. In 2018, Arora S et al. [24] proposed the butterfly optimization algorithm (BOA) inspired by butterfly positioning food predation. In 2020, Xue and Shen proposed the sparrow search algorithm (SSA) [25] based on a study of the predation and anti-predation behavior of the sparrow population. In 2021, Mashwani W K et al. [26] proposed a multiswarm-intelligence-based algorithm (MSIA) based on the single optimization problem with bounded constraints. Mashwani W K et al. [27] proposed a hybrid TLBO (HTLBO) based on a set of optimization solutions provided in a single simulation, aiming to further improve the exploration and development capabilities of the baseline TLBO algorithm [28]. Mashwani W K et al. [29] proposed an improved evolutionary algorithm integrating strategies based on large-scale global optimization problems. Currently, swarm intelligence optimization algorithms such as sparrow intelligence are widely used for engineering problems. Adrián Rodríguez-Ramos et al. [30] used a difference algorithm and particle swarm optimization to adjust the kernel parameters in the fuzzy C-means (KFCM) algorithm for fault detection, and Yang et al. [31] used the bat algorithm (BA) to solve engineering optimization tasks. However, SSA has the advantages of strong optimization, less adjustment parameters and strong robustness, which is widely used in image analysis [32], track planning [33] and power [34].
However, when SSA calculates the initial value of fitness, the population members are randomly generated within the specified search range, which results in low distribution uniformity of the initial population within the search range. It is easy to fall into a local optimal solution in the iterative process, which greatly affects the optimization performance of the algorithm. In response to this shortcoming, many scholars have carried out research to improve the situation. Tang et al. [35] cross-integrated the bird swarm algorithm and genetic algorithm into the sparrow search algorithm, avoiding the disadvantage of easily falling into local optima in the late iterations. Chen et al. [36] initialized the sparrow population's location by Tent chaotic mapping and combined levy flight and random wandering strategies to enhance the convergence speed and exploration ability of the algorithm. Ouyang et al. [37] used K-means clustering method to cluster and differentiate the individual locations of sparrows, thereby improving the initial quality of the population. Zhang et al. [38] used logistic mapping to initialize the population and used the Cauchy mutation operator to perturb the optimal sparrow individuals to improve the global search capability of the algorithm. Yuan et al. [39] used the centroid adversarial learning method to initialize the population of the sparrow search algorithm and introduced a mutation operator to change the position of discoverer to improve the global search efficiency of the algorithm. Zhu et al. [40] proposed an adaptive sparrow search algorithm to improve the convergence speed of SSA by introducing an adaptive learning factor. Zhang et al. [41] introduced the positive cosine algorithm into the sparrow search algorithm and proposed a new labor collaboration structure to improve the ability of the algorithm to jump out of the local optima and increase the robustness of the algorithm. Mao et al. [42] increased the ability of the algorithm to escape easy-to-fall-into local optimal solutions by introducing a Cauchy mutation and reverse learning strategy. Fu et al. [43] introduced the elite chaotic reverse learning mechanism to improve the quality of the initial population and used the chicken swarm algorithm to optimize the followers, to enhance the global search ability of the algorithm; finally, the Cauchy-Gaussian mutation strategy is used to ensure the antistagnation ability of the population and avoid premature convergence of the algorithm.
Although the above improvement strategies have improved the optimization ability of SSA to a certain extent, the problems of insufficient search ability and easy premature convergence still exist in the later period of optimization. To address the limitations of SSA, this paper proposes an adaptive sinusoidal-disturbance-strategy sparrow search algorithm (ASDSSA). Our contributions in this article are mainly as follows: (1) We integrated the cubic chaos mapping and perturbation compensation factor to initialize the population, which improves the quality and traversal of the initial sparrow population. (2) A sinusoidal disturbance strategy is proposed to update the position of the discoverers, which improves the information exchange ability between populations and improves the global search ability of the algorithm. (3) The adaptive Cauchy mutation strategy is used to locally disturb the optimal solution, which improves the convergence speed of the algorithm and its ability to solve the problem of easily falling into the local optimal solutions. (4) The effectiveness of the improved algorithm was demonstrated by simulating eight benchmark test functions and CEC2017 test functions, along with a comparison with other algorithms in terms of Wilcoxon rank sum tests and time complexity analysis. We applied ASDSSA to the parameter selection of the LSTM model and further verified the effectiveness and feasibility of the improved algorithm for practical engineering on the subway passenger flow dataset.

Sparrow Search Algorithm
The sparrow search algorithm is a swarm intelligence optimization algorithm proposed to simulate the behavior of sparrows foraging and avoiding predators. In the process of foraging, sparrows are divided into discoverers and followers, and a certain proportion of sparrows will be selected in the population. When reconnaissance and early warning work, the food is abandoned in time when danger is found, and the process of the sparrow constantly searching for better food is the process to optimize.
During each iteration, the positions of discoverers are updated as follows: In Equation (1): t is the current number of iterations; T max is the maximum number of iterations; X t i,j is the positional information of the i-th sparrow in the j-th dimension; α ∈ (0, 1] is a random number; R 2 and ST denote the warning value and safety value, respectively; Q is a random number obeying the normal distribution; L is a unit vector. When R 2 < ST, it means that there is no predator around the foraging environment and the finder conducts a wide area search; when R 2 ≥ ST it means that some sparrows find a predator. They need to fly to other safe areas to feed.
The positions of the followers are updated as follows: In Equation (2): X worst is the current global worst position, X t+1 P is the optimal position occupied by the discovers, A is 1 × d matrix whose value is randomly assigned to 1 or −1, and A + = A T AA T −1 . When i > n/2, the i-th followers with a low fitness value do not have enough food and need to fly elsewhere to search for food. When i ≤ n/2 the positions of the followers will be constant.
When aware of danger, sparrow populations will take anti-predation actions. It is usually assumed that the sparrows aware of danger account for 10% to 20% of the total population, and the initial positions of these sparrows are randomly generated in the population.
The positions of the vigilantes are updated as follows: In Equation (3), X t best is the current global optimum; β is a step control parameter; K is random number, and K ∈ [−1, 1]; f i represents the current fitness value of the individual sparrow; f g represents the current global optimum; ε is defined as small constant to avoid the denominator being zero.
When f i = f g , it indicates that the positions of the sparrows at the edge of the group change; when f i = f g , it indicates that the sparrows in the middle of the group are aware of the danger and need to get close to other sparrows to minimize their risk of predation.

Improved Sparrow Search Algorithm
As the initial population is generated in a random way in the standard sparrow search algorithm, it will make the initial population division uneven, and the discoverers converge quickly to zero and converge to the position of the global optimum at the early stage of the search. It is difficult to obtain better population diversity by searching for the characteristics of individuals, so the search accuracy is not hard. In the iterative process of the algorithm, the problem of falling into local optimal solutions is common. Aiming at the above problems, this paper makes the following improvements.

Chaotic Disturbance Strategy
Chaotic sequence mappings are widely used in optimization search solution problems because of their randomness and ergodic nature [44,45]. By introducing chaotic sequence mappings to initialize the population, the initial population can be more evenly distributed, which helps the algorithm to perform global searching and improves the convergence speed and accuracy of the algorithm. Among the many chaotic mappings, cubic chaotic mappings have better uniform distribution performance in the range of [0,1], and their mathematical model is: where y i is a cubic sequence. If X i ∈ [lb, ub], lb and ub are the upper and lower bounds of the solution space, respectively. The cubic sequence is mapped onto individual sparrows according to Equation (5).
In order to further improve the performance of the sparrow search algorithm, we add a perturbation compensation factor to the initialized position of the sparrow population position, which can better evaluate the feasible solution, thereby enabling the algorithm to improve population diversity and enhance the global search capability. The position update formula with the introduction of the perturbation compensation factor is: The population fitness value is first calculated with the introduction of the cubic chaos mapping only, and then the perturbation compensation factor is introduced and the population fitness value is recalculated. According to the fitness value, the top N sparrows with better fitness values are selected as the initial population.

Sinusoidal Disturbance Strategy
At the beginning of the SSA iteration, the discoverers perform a large search in the solution space region, but as shown by Equation (1), when R 2 < ST, each dimension of the discoverers decreases exponentially, leading to a decline in population diversity and easily to falling into a local optimum, causing the problem of poor search accuracy. To address this problem, this paper introduces the sinusoidal disturbance strategy. The sinusoidal disturbance strategy was introduced to the sparrow search algorithm to update the positions of the discoverers, thereby increasing the global search ability of the discoverers, which allows individuals with good fitness in the original population to be perturbed between localities at their original positions and improves the information exchange between sparrow populations. Here we propose a sinusoidal disturbance weight as follows: where w min and w max are the minimum and maximum values of the weight variation range, respectively. The discoverers' equation improved by the sinusoidal disturbance strategy is as follows: With the incorporation of the sinusoidal disturbance strategy, the large weight factor in the early stage of the algorithm search improves the discoverer's ability to explore unknown regions, thereby enabling the algorithm to have a wide range of global search capabilities. In the later stage of algorithm optimization, the weight factor decreases and the local development ability of the algorithm is strong, which increases the possibility of the algorithm jumping out of the local optima and effectively improves the convergence speed of the algorithm.

Adaptive Cauchy Mutation Strategy
In the iterative process of SSA, the rapid assimilation of sparrow individuals easily leads to the problem of falling into the local optimal solutions. In order to solve this problem, this paper adopts the adaptive Cauchy mutation strategy, which selects the individual with the best fitness to mutate. The specific equation is as follows: In Equation (9), U t best is the position of the individual at the optimal position after the mutation, N t is the mutation step, Cauchy(0, 1) is the random number generated by the Cauchy distribution function, and X t best is the individual with the current optimal fitness. From Equation (10), we can see that the mutation step N t adaptively decreases as the iteration number, t, increases. In the early iterations, the mutation step is larger, allowing the algorithm to jump out of the local optima, and in the late iterations, the mutation step is smaller, speeding up the convergence of the algorithm. It serves to balance the exploration and development of the optimal position of the sparrow, enabling the algorithm to jump out of the local optima.
As the position of the mutated individual sparrow is not necessarily better than the initial position, the fitness values before and after the mutation are compared. If the fitness value of the current individual is lower than the fitness value of the mutated individual, the current individual is retained. If the fitness value of the current individual is higher than the fitness value of the mutated individual, the current individual is replaced with the mutated individual. The specific equation is as follows: The corresponding ASDSSA pseudo-code is shown in Algorithm 1, and the flowchart is shown in Figure 2. The optimal solution, F best ; The best fitness value, f g ; 1: Initialize the position of N sparrows using Equation (5), and calculating the individual sparrow fitness value f i ; 2: Initialize the position of r i sparrows using Equation (6), and recalculating the individual sparrow fitness value; 3: According to the fitness value, the top N sparrows with better fitness value are selected as the initial population; 4: Get the optimal position and its corresponding optimal fitness value, the worst position and its corresponding worst fitness value; 5: while (t < T max ) 6: for j = 1: ND 7: Update the positions of the discoverers using Equation (8)

Time Complexity Analysis
Assume that the time complexity of SSA is O(N × T max × d), where N is the population size, T max is the maximum number of iterations, and d is the dimensions of the problem to be optimized. Firstly, the ASDSSA is improved on the basis of the SSA, and its time complexity is divided into three parts: the time complexity of the chaotic mapping population initialization strategy with the introduction of a perturbation disturbance factor, the time complexity of the SSA with the introduction of a sinusoidal disturbance strategy and the time complexity of the SSA with the introduction of adaptive Cauchy mutation strategy. Secondly, the chaotic initialization population strategy after introducing the disturbance factor replaces the original method of randomly initializing the population, but the time complexity does not increase. The sinusoidal disturbance strategy only changes the positions of the discoverers, which can make the search range larger and more likely to include areas closer to the optimal solution, and this does not increase the time complexity. The complexity of adopting the adaptive Cauchy mutation strategy in the iterative process It can be seen that the time complexity of ASDSSA is consistent with the time complexity of SSA. ASDSSA is more stable, and its optimization performance is much higher than that of SSA.

Selection of Benchmark Test Functions
In order to verify the improvement effectiveness of the adaptive sinusoidal disturbance strategy on SSA, we adopted eight benchmark test functions with different characteristics for testing and compared our algorithm with other swarm intelligence optimization algorithms, such as WOA, GWO, PSO, GA and SSA. The parameters for each algorithm were set as shown in Table 1. The eight benchmark test functions and their specific information are given in Table 2 Table 3 shows the experimental results obtained after 30 independent runs of multiple standard test functions, including the optimal solution, average value and standard deviation of each algorithm when solving each test function. Table 1. Parameter settings.

Algorithm
Parameter Setting  Table 2. Benchmark test function information.

Test Function
Dim Scope Best

Experimental Results and Analysis
As can be seen in Table 3, in the experiments with the eight benchmark test functions, ASDSSA was significantly better than the other five algorithms. For the unimodal functions f 1 (x) and f 2 (x), both SSA and ASDSSA could find their theoretical optimal solutions, but the average value and standard deviation of ASDSSA were zero, indicating that ASDSSA is more stable than SSA. For the unimodal functions f 3 (x) and f 4 (x), AS-DSSA found its theoretical optimal solution, and the optimal solutions of the other five algorithms were infinitely close to zero. Among them, SSA performed better, at least five orders of magnitude better than the other four algorithms. For the unimodal function f 5 (x), although the ASDSSA optimization solution did not reach the optimal value, ASDSSA had the highest optimization accuracy and the strongest stability compared with other algorithms. For the multimodal function f 6 (x), both SSA and ASDSSA could find the theoretical optimal solution, but the mean value and standard deviation of SSA were not as stable as those of ASDSSA. For multimodal functions f 7 (x) and f 8 (x), ASDSSA outperformed other algorithms in optimal value, average value and standard deviation. Comprehensive analysis showed that the average values and standard deviations of ASDSSA are better than those of other algorithms in the optimization process, indicating that the introduction of the adaptive sinusoidal disturbance strategy has improved the solution performance of SSA and provides a strong global search capability and local exploration capability.
In order to illustrate that ASDSSA has better optimization ability and convergence speed, simulation experiments were carried out on eight benchmark test functions. Figure 3 shows the convergence curves of different algorithms on the benchmark functions. The convergence curves of all the algorithms mentioned in this paper are presented in Figure 3 for 200 iterations, where the horizontal axis represents the number of iterations and the vertical axis represents the fitness value. For all test functions, ASDSSA requires the least number of iterations to reach the peak accuracy of the others, indicating that the introduction of the adaptive sinusoidal disturbance strategy increases the proportion of high-quality individuals in the population and improves the convergence speed of the algorithm. As the number of iterations increases, the convergence curves of the GWO, PSO and GA algorithms tend to flatten out; they display varying degrees of stagnation and relatively low optimization accuracy. The step-wise decline of the ASDSSA convergence curve shows that the adaptive Cauchy mutation strategy can help the algorithm to get out of stagnation effectively and search for a better solution in the global scope. At the same number of iterations, the solution accuracy of ASDSSA is much higher than those of other algorithms. In summary, it can be proved that ASDSSA has faster convergence speed and stronger robustness than the other algorithms. Figure 4 shows the comparison of the effects of the three strategies proposed in this paper. The initial population number was set to 30, the number of iterations was set to 300, and we chose f 1 (x) as the objective function; (a) is 10-dimensional, (b) is 30-dimensional, (c) is 50-dimensional and (d) is 100-dimensional. SSA is the original algorithm; ASDSSA-1, ASDSSA-2 and ASDSSA-3 are improved SSAs that include the chaotic disturbance strategy, sinusoidal disturbance strategy and adaptive Cauchy mutation strategy, respectively. As can be seen in Figure 4, the addition of any these three strategies can improve the performance of the SSA to a certain extent. In 10 dimensions, ASDSSA-1 showed no obvious improvement, but ASDSSA-2 and ASDSSA-3 were obviously superior; in 30 dimensions, ASDSSA-1 performed better than ASDSSA-2 and ASDSSA-3; in 50 dimensions, ASDSSA-2 and ASDSSA-3 performed better; in 100 dimensions, ASDSSA-1 and ASDSSA-2 performed averagely, and ASDSSA-3 performed better. In summary, ASDSSA outperformed the baseline strategy in terms of convergence speed and optimization accuracy, indicating that the population chaotic disturbance strategy, the sinusoidal disturbance strategy and the adaptive Cauchy mutation strategy all have good improvement effects on the original algorithm. To further validate the outperformance of the ASDSSA on benchmark functions, the benchmark functions used were the sphere function, the Schwefel 2.22 function, the Ackley function, the Griewank function, the rotated hyper-ellipsoid function and the hyper-ellipsoid function. More detailed descriptions of all benchmark functions can be found in the literature [46,47]. We compared the performance of ASDSSA with that of the HSO+ algorithm [48] in 30D, 60D and 90D, which also performed well on benchmark functions. We used the same population size of 50, the same number of iterations of 50 and 100 independent runs. Table 4 gives the results of the mean and standard deviation of the ASDSSA and HSO+ algorithms on 30D, 60D and 90D dimensions. As we can see in Table 4, the optimization performance of the ASDSSA is significantly better than that of the HSO+ algorithm.

CEC2017 Test and Wilcoxon Rank-Sum Test
To further validate the performance of the ASDSSA and its ability to solve for composite type functions, we tested the ASDSSA on the CEC2017 test functions [49]. CEC2017 contains thirty test functions, of which F1-F3 are single-peaked functions, F4-F10 are simple multipeaked functions, F11-F20 are mixed functions, F21-F30 are composite functions and the F2 was not used due to its defects. To demonstrate the superiority of the improvements in the ASDSSA, the ASDSSA is compared with other heuristic algorithms, such as WOA, GWO, PSO, SSA and the multiple-strategies sparrow search algorithm (MSSA) [42] in a CEC2017 test function optimization experiment. We set dimensions to 30, the initial population number to 100 and the maximum number of target functions to 300,000, and we performed 51 independent runs for each test function, calculating the mean and standard deviation for each algorithm based on the results, and the comparison of the data from the test function search experiments is shown in Table 5. The results in Table 5 show that the ASDSSA produced the best mean value in F1 ,  F3, F4, F5, F7, F8, F10, F11, F13, F17, F18, F19, F20, F21, F22, F23, F24, F27, F29 and F30, which indicates that the ASDSSA has good optimization. However, the original swarm intelligence optimization algorithms WOA, GWO, PSO and SSA performed poorly in the more complex CEC2017 test functions, indicating that the optimization ability declined in more complex optimization problems. ASDSSA outperformed the improved algorithm MSSA in mean and standard deviation, indicating that the strategy of ASDSSA is better and more suitable for complex optimization problems.
Similarly, the results of ASDSSA for Dim = 10, Dim = 50 and Dim = 100 are shown in Table 6. We compared the performance of ASDSSA with the gaining sharing knowledgebased algorithm (GSK) [2] using better (+), worse (−) or the statistically insignificant (≈). The statistical tests are summarized in Table 7. ASDSSA outperformed the GSK algorithm with 10, 30 and 50 dimensions, but only slightly outperformed the GSK algorithm with 100 dimensions, and overall, the ASDSSA's performance was superior to that of the GSK algorithm. The specific convergence plots are shown below. Figure 5 shows the convergence plots for F1 to F7 solved by the proposed algorithm, the GSK algorithm and MSSA with 10, 30 and 50 dimensions. Figure 6 shows the convergence plots for F8 to F13 solved by the proposed algorithm, the GSK algorithm and MSSA for 10, 30 and 50 dimensions. Figure 7 shows the convergence plots for F14 to F19 solved by the proposed algorithm, the GSK algorithm and the MSSA with 10, 30 and 50 dimensions. Figure 8 shows the convergence plots for F20 to F25 solved by the proposed algorithm, the GSK algorithm and the MSSA with 10, 30 and 50 dimensions. Figure 9 shows the convergence plots for F26 to F30 for the benchmark functions solved by the proposed algorithm, the GSK algorithm and the MSSA with 10, 30 and 50 dimensions. According to the values and convergence plots shown, the ASDSSA possesses good properties for solving large-scale global optimization problems.      We also show a set of comparisons with the winner of the 2014 competition, LSHADE [50], for Dim = 10, Dim = 30, Dim = 50 and Dim = 100 with CEC2017. As can be seen in Table 8, the performances of the two algorithms are comparable for 10 dimensions and in 30 dimensions, but the superiority of the ASDSSA over the LSHADE algorithm increased significantly as the number of dimensions increased from 30 to 100 dimensions. Using the results of 51 independent experiments with 30 dimensions, we used the Wilcoxon rank-sum nonparametric statistical test method [51] to test the statistically significant differences between ASDSSA and the other five algorithms to judge the reliability. The original hypothesis, H0, was that there was no significant difference between the two algorithms; hypothesis H1 was that the overall difference between the two algorithms was significant. The p-values of the test results were used to compare the differences between the two algorithms, and when p < 0.05, the two algorithms could be considered significantly different. The experimental results are indicated by "+, = and −", where "+" indicates that by the rank-sum test, the ASDSSA is better than the comparison algorithm, "=" indicates that by the rank-sum test, the ASDSSA is comparable to the comparison algorithm and "−" indicates that by the rank-sum test, the ASDSSA is inferior to the comparison algorithm. The results of the Wilcoxon rank-sum test are shown in Table 9, which shows that the statistical results of the rank-sum tests of ASDSSA and the other algorithms are almost always less than 0.05, indicating that ASDSSA is significantly different from the other algorithms.

Application of the the Improved Sparrow Search Algorithm in Subway Passenger Flow Prediction
To further validate the optimization performance of ASDSSA and verify its ability to be applied in practical engineering, it was used to optimize the parameters of an LSTM model and applied to the short-term passenger flow forecast of a metro [52][53][54]. The LSTM model is a machine learning algorithm with a simple structure, few parameter settings, a strong generalization ability and fast learning speed. Short-term passenger flow forecasting is a basic task for the formulation of operation management and dynamic adjustment of rail transit. Accurately predicted passenger flow is very important for the operation of urban subway systems and ensures the operational safety of rail transit. As the urban rail transit data are non-linear and non-cyclical, the LSTM prediction model has been widely used, which can timely grasp the regular characteristics of short term passenger flow and always performs well.
The performance of LSTM models is closely related to the selection of parameters, and inappropriate parameter selection can reduce the learning ability and generalization performance of the algorithm. To improve the model's performance, we used ASDSSA to optimize the learning rate, number of neurons and other parameters in the LSTM.
In this study, the automatic fare collection (AFC) data of Fuzhou urban rail transit system in December 2020 were selected as the research object, which mainly include AFC code, transaction time (exit time), entry time, entry station, exit station, card number, card type and transaction status. The passenger flow data of the first three weeks of December were used as training data, and the passenger flow data of the last week of December were used as test data for short-time passenger flow prediction. By analyzing the passenger flow data to predict the peaks and trend of passenger flow, we could formulate a suitable subway operation scheme for the short-term fluctuations of passenger flow, so as to improve economic benefits and reduce unnecessary operation losses.
In the experiment, the original data were preprocessed.The dataset was first normalized by using Equation (12) and divided into a training set and a test set; then, ASDSSA was used to optimize the parameters of the LSTM model to obtain the optimized model ASDSSA-LSTM; and finally, the prediction results were obtained through the optimized model. X * = X − X min X max − X min (12) In order to verify the accuracy and generalization effect of the optimized model, we constructed BP, LSTM, WOA-LSTM, GWO-LSTM, PSO-LSTM, SSA-LSTM, MSSA-LSTM and ASDSSA-LSTM-eight models for comparison. Mean absolute percent error (MAPE), root mean-square error (RMSE), mean absolute error (MAE) and coefficient of determination (R-squared, R 2 ) were used as evaluation metrics to validate the effectiveness of the prediction model. They were calculated as follows: whereŷ i is the predicted value, y i is the true value andȳ i is the average value of the true value, and m is the number of predicted samples. Figure 10 shows the experimental results of the eight algorithms on the metro passenger flow dataset, and Table 10 gives the error evaluation results of the eight algorithms. As can be seen in Figure 10, the ASDSSA-LSTM model produced a better fit and better prediction accuracy. As can be seen in Table 10, the basic BP model and the LSTM model have poor prediction results and larger errors. Among the LSTM models improved by the basic swarm optimization algorithm, GWO outperformed the other three algorithms in terms of MAPE metrics, but SSA outperformed the other algorithms in terms of RMSE, MAE and R 2 metrics, indicating that the SSA-optimized LSTM model is a better fit. The ASDSSA-LSTM model proposed in this paper is superior to other algorithms according to four evaluation indexes. The prediction error measured by MAPE, RMSE and MAE was reduced by at least 20% compared with other optimization algorithms. This shows that the ASDSSA-LSTM model significantly improved the generalization performance and robustness under the same conditions. The superiority of ASDSSA and the effectiveness and feasibility of its application in practice are demonstrated.

Conclusions
For the shortcomings of insufficient SSA population diversity, slow convergence speed and easy-to-fall-into local optimal solutions, this paper proposes an adaptive sinusoidaldisturbance-strategy sparrow search algorithm. The main research contributions are as follows: (1) The quality of the initial population of SSA was improved by the cubic chaotic mapping and perturbation compensation factors. The sinusoidal disturbance strategy was introduced to increases the global search capability of the algorithm. The adaptive Cauchy mutation strategy is used to improve the ability to solve the problem of the algorithm easily falling into a local optimal solution in the process of SSA iteration, thereby improving the optimization accuracy and convergence efficiency of the algorithm. (2) Through the experimental simulation test and the comparison of various algorithms on eight benchmark functions and CEC2017 test functions, it can be found that the improved sparrow algorithm, ASDSSA, greatly improves the search accuracy and convergence speed compared with SSA, and also has obvious advantages compared with other intelligent optimization algorithms, which verifies the improvements brought about by ASDSSA. (3) ASDSSA was used to optimize the selection of parameters such as learning rate and number of neurons in an LSTM model, and then the ASDSSA-LSTM prediction model was constructed. In the prediction analysis of the Metro passenger flow dataset, the results showed that the improved model has better prediction accuracy, which further verifies the effectiveness and application feasibility of the improved algorithm. In future research, ASDSSA can be used to solve more complex practical problems.