# Short-Term Passenger Flow Prediction of Urban Rail Transit Based on SDS-SSA-LSTM

Authors: Haijun Li; Yongpeng Zhao; Changxi Ma; Ke Wang; Xiaoting Huang; Wentao Zhang
Journal: Journal of Advanced Transportation
 (2022)

---

## Abstract

Predicting rail transit passenger flow is crucial for modifying the metro schedule. To increase prediction accuracy, a model is proposed that combines long short-term memory (LSTM) with single spectrum analysis (SSA). Firstly, a stepwise decomposition sampling (SDS) strategy based on SSA progressive decomposition is proposed as a solution to the data leaking issue in traditional sequence decomposition. Then, based on this strategy, the passenger flow time series with complex features is decomposed into a relatively single trend and fluctuation component. Finally, the LSTM network is employed to perform short-term predictions on each component separately. The predicted value of each component is accumulated to obtain the original passenger flow’ predicted result. The example shows that, compared with the single LSTM and other hybrid models, the proposed method offers a greater overall prediction accuracy in the experimental days, and the method has specific applicability.


---

## Body

## 1. Introduction

Subway system has the advantages of large capacity, high speed, and high reliability. It has attracted more and more attention both academically and practically [1]. However, while the public is pursuing the high-quality metro, various problems such as congestion and transfer inconvenience must be solved.The metro system’s short-term passenger flow (STPF) prediction is a crucial component in managing public transportation. By releasing the predicted STPF and congestion status of bus routes to the public, passengers can adjust travel mode, route selection, or departure time in advance to better understand travel mode. For the government and operators, the accurate STPF forecast can effectively control and assess the system status and implement response measures when emergencies or special events occur [2]. Hence, the accurate STPF forecast is of great significance.Summing up, in order to predict the STPF more accurately, it is necessary to consider whether the prediction results can reflect the actual online prediction effect and effectively avoid the problem of data leakage. In this research, a prediction model based on SDS-SSA-LSTM is proposed. The SDS strategy can effectively avoid the prediction model from involving future data in the testing phase and solve the data leakage problem of the traditional ODS strategy. Using the SSA method, the trend and fluctuation components in the passenger flow sequence with mixed features can be effectively extracted. Combined with the ability of the LSTM network to transmit long-term dependencies of sequence data, the accurate prediction of STPF can be achieved.


## 2. Literature Review

For unstable traffic flow, at present, wavelet decomposition (WD) [3, 4] and variational mode decomposition (VMD) [5] have been studied for rail transit STPF prediction. However, the above studies all adopt the overall decomposition sampling (ODS) sampling technique to process the data samples; that is, the passenger flow time series is decomposed into subsequences. Nevertheless, the future data is assumed to be known in the decomposition process, and there is a problem of data leakage. Therefore, the model in online prediction has poor practicability and unreliability.The sampling technology based on stepwise decomposition sampling (SDS) [6] can effectively avoid the data leakage problem in traditional ODS technology. EMD cannot be used for SDS because the number of modal decompositions is uncontrollable [7]. EEMD and CEEMD have their algorithm principle [8, 9]. With the update of the edge value of the time series to be decomposed, each decomposed component will change significantly. When they are sampled by SDS, the time sequence of the training samples is uncontrollable. It is difficult to determine the wavelet basis and decomposition level of WD. The trend items directly decomposed by VMD [10] will produce significant errors, which will make prediction difficult. SSA is a nonlinear time sequence analysis method [11], which can effectively extract the trend and volatility in the original sequence. There is no need to select a priori basis function. With the update of the time series to be decomposed, the sequence characteristics of the history of each decomposed component can be almost wholly preserved [12]. Zhou et al. [13] combined SSA with AdaBoost weighted limit learning machine. The original data was divided into three parts for the construction of SSA: trend, periodicity, and residue. Shuai et al. [14] show that the complex characteristics of regularity and randomness of traffic flow can be captured by the decomposed traffic flow prediction hybrid model. Therefore, with the advantage of the SSA decomposition method, this paper decomposes the mixed passenger flow series into trend series and fluctuation series with relatively single characteristics, which is easy for the model to learn.In terms of the STPF prediction, traditional prediction models mainly include the autoregressive integrated moving average model [15], gray model [16], and Kalman filtering model [17]. The traditional time series prediction model has weak generalization ability, its performance and application will be limited, and it is challenging to meet the requirements of processing massive data in practice. In recent years, a large amount of data generated by various city sources has allowed us to understand better the essence of hidden dynamics in the traffic system and significantly changed the way of predicting passenger traffic. Due to higher computing capabilities, there is various computing intelligence and data-driven technology to create opportunities for the use of big data to broaden the practical application of the intelligent transportation system (ITS) [18].Advanced intelligent algorithms have attracted the attention of many scholars due to their superior structure and performance. Li et al. [19] combined the characteristics of segmented passenger flow data with a BP neural network to predict segmented passenger flow. Tsai et al. [20] proposed a new neural network which proves to produce satisfactory results in forecasting STPF. Deep learning can capture complex nonlinear relationships in big data, which significantly improves predictive accuracy. In terms of the STPF prediction, the most commonly employed models are CNN [21–24] and RNN [25], which have shown their excellent ability to extract space-time structure information. LSTM [26–28] as a variant of RNN can automatically learn the dependencies of long-term sequences and capture the connection relationship between the steps. Through experiments, Zhao et al., Guo et al., Du et al., Jiang et al., and Hao et al. [29–33] proved that LSTM has certain advantages in capturing the regularity of STPF.The sampling strategy of SSA stepwise decomposition (SDS) can be applied to avoid the data leakage in the traditional method of sequence decomposition. LSTM neural network is suitable for predicting each component by learning historical data. The SDS-SSA-LSTM hybrid model can provide a new method for the accurate predicting of STPF. In this paper, we attempt to decompose the time series with complex characteristics through the SDS strategy based on SSA, so as to extract the internal characteristics of complex passenger flow data, and build a LSTM memory network model to forecast the short-term metro passenger flow.


## 3. Methodology

### 3.1. Singular Spectrum Analysis (SSA)

SSA is a method of nonlinear time-series analysis. By constructing the trajectory matrix of the time series and decomposing and reconstructing it, the trend and fluctuation components in the original series can be effectively extracted. The specific calculation steps of this algorithm are as follows:(1)
Embedding. According to the set embedding dimensionLL≤n/2, the original time series X=x1,x1,⋯,xn is transformed into trajectory matrix Y. The formula is as follows:(1)YL×K=yiji,j=1L,K=x1x2⋯xn−L+1x2x3⋯xn−L+2⋮⋮⋱⋮xLxL+1⋯xn,where K=n−L+1(2)
Singular value decomposition. Calculate the eigenvaluesλ1,λ2,⋯,λLλ1≥λ2≥⋯≥λL and corresponding eigenvectors U1,U2,⋯,UL of matrix YYT. d is the number of nonzero eigenvalues; define Vi=YTUiλi; the singular value decomposition of the trajectory matrix Y can be written as follows:(2)Y=Y1+Y2+⋯+Yd,where Yi=λiUiViT, 1≤i≤d; Ui is the ith singular value of the trajectory matrix Y corresponding to the left singular vector; and Vi is the ith singular value of the trajectory matrix Y corresponding to the right singular vector. The contribution degree of each matrix Yi to the trajectory matrix Y is related to the eigenvalue λi, and its contribution rate η can be defined as follows:
(3)η=λi∑λ(3)
Diagonal averaging. Each submatrixYi is reduced to a time series with n length. Suppose that Y is a matrix with the same shape as L×K. Let L∗=minL,K and K∗=maxL,K. If L<K, yij∗=yji; otherwise, the restructured series Zc=zc1,zc2,⋯,zcn is defined as follows:(4)zcl=1l+1∑m=1l+1ym,l−m+2∗,1≤l≤L∗,1L∗∑m=1L∗ym,l−m+2∗,L∗≤l≤K∗,1n−1∑m=l−K∗+2l−K∗+1ym,l−m+2∗,K∗≤l≤n(4)
Grouping. The singular vector corresponding to the largest eigenvalue represents the largest change trend of the original sequence, and the singular vector corresponding to the smaller eigenvalue reflects the fluctuation components of the original sequence. By setting the contribution rate thresholdηe (generally taken ηe≥80%) and then gradually reconstructing the subsequence in the order of eigenvalue from large to small, when it appears ∑λi/∑λ≥ηe, the obtained sequence is the trend component of the original sequence, and the remaining subsequence is reconstructed into the fluctuation component


### 3.2. Sampling Strategy Based on Stepwise Decomposition

Let time seriesTS=xtt=1,⋯,T+K, where T+K is the length of time series TS. Use x1 to xT as training data and the rest as test data. The specific stepwise decomposition steps are as follows:
(1)
Decompose the time seriesx1:L into subsequences x1:L+1i2(2)
Decompose the time seriesx1:L+1 with length L+1 into subsequence x1:L+1i2. Then, the input and output of the first sample of the ith subsequence come from x1:Li1 and x1:L+1i2, respectively, as shown in Figure 1(3)
Continue to decompose the next time series of lengthL and L+1 according to step 1 and step 2 until all training datasets are obtained(4)
Establish a prediction model for each subsequence, respectively(5)
In the prediction stage, the time series of historicalL length is decomposed, and each subsequence is predicted according to the trained model(6)
Accumulate the predicted values of each subsequence to obtain the predicted result of the original sequenceFigure 1
The input and output samples.The application of the above SDS strategy completely avoids the data leakage problem in traditional ODS, and the model based on this strategy conforms to the actual online prediction scenario.


### 3.3. Long Short-Term Memory Network (LSTM)

Compared with traditional neural networks, RNN can capture the temporal regularity of sequence data more effectively. LSTM was originally a variant of the traditional recursive neural network. It has strong memory ability when dealing with time-series prediction and is widely used in time-series prediction scenarios with long time interval and delay. The basic structure of the LSTM unit is shown in Figure2.Figure 2
LSTM model structure diagram.LSTM adds more memory modules to the neural network to selectively let information pass through, with each door having a different function.The forget gateft decides which news to discard by integrating the information of the last moment and the news of the present moment. The formula is as follows:
(5)ft=σwfxxt+wfhht−1+wfcCt−1+bf,(6)σz=11+e−z,where σ⋅ is the sigmoid activation function, xt the input at t, ht the output at t, ht−1 the output at t−1, Ct the candidate vectors at time t, wfx,wfh,wfc weight coefficient of the forgetting gate, and bf bias of forgetting gate.An input gateit is the opposite of a forget gate ft. This section decides the news to enter the cell state based on the input threshold. The output of the input gate at t is as follows:
(7)it=σwixxi+wihht−1+wicCt−1+bi,vt=tanhwcxxt+wchht−1+bo,tanhz=ez−e−zez+e−z,where wix,wih,wic are the weight coefficients of input gate, bi is bias of input gate, wcx,wch are the weighting coefficients and bias of candidate vectors, bo is the bias of candidate vectors, tanh⋅ is the hyperbolic tangent activation function, and vt is the updated value of candidate vectors.The output gateot determines what information will be output. No information can pass through the output gate except what is required. So the output at time t is as follows:
(8)ot=σwox+wohht−1+wocCt−1+bo,ht=ot⋅tanhCt,Ct=Ct−1⋅ft+itvt,where ot is the output gate and wox,woh,woc are the weighting coefficients of the output gate.


### 3.4. STPF Prediction Model

Figure3 is the process of the SSA-LSTM model based on the SDS strategy, and here are the modeling steps:Step 1.
Original data processing. The original rail transit passenger flow’s preprocessed time series is divided into a training set and a test set.Step 2.
Decomposition of original passenger flow data. SDS for the training set based on the SSA method until the complete training sample of the trend component and the fluctuation component is obtained. The trend series represents the broader trend of original data. The fluctuation series represents the periodic of original data.Step 3.
Establish prediction model. The LSTM prediction model in view of the deep learning is established for the training set in each subsequence, respectively.Step 4.
Perform SSA stepwise decomposition on the test set, and input it into the LSTM to generate the prediction results of each component.Step 5.
Accumulate the predicted values of each component. Get the STPF forecast results.Figure 3
The process of the STPF prediction based on SDS-SSA-LSTM.


## 3.1. Singular Spectrum Analysis (SSA)

SSA is a method of nonlinear time-series analysis. By constructing the trajectory matrix of the time series and decomposing and reconstructing it, the trend and fluctuation components in the original series can be effectively extracted. The specific calculation steps of this algorithm are as follows:(1)
Embedding. According to the set embedding dimensionLL≤n/2, the original time series X=x1,x1,⋯,xn is transformed into trajectory matrix Y. The formula is as follows:(1)YL×K=yiji,j=1L,K=x1x2⋯xn−L+1x2x3⋯xn−L+2⋮⋮⋱⋮xLxL+1⋯xn,where K=n−L+1(2)
Singular value decomposition. Calculate the eigenvaluesλ1,λ2,⋯,λLλ1≥λ2≥⋯≥λL and corresponding eigenvectors U1,U2,⋯,UL of matrix YYT. d is the number of nonzero eigenvalues; define Vi=YTUiλi; the singular value decomposition of the trajectory matrix Y can be written as follows:(2)Y=Y1+Y2+⋯+Yd,where Yi=λiUiViT, 1≤i≤d; Ui is the ith singular value of the trajectory matrix Y corresponding to the left singular vector; and Vi is the ith singular value of the trajectory matrix Y corresponding to the right singular vector. The contribution degree of each matrix Yi to the trajectory matrix Y is related to the eigenvalue λi, and its contribution rate η can be defined as follows:
(3)η=λi∑λ(3)
Diagonal averaging. Each submatrixYi is reduced to a time series with n length. Suppose that Y is a matrix with the same shape as L×K. Let L∗=minL,K and K∗=maxL,K. If L<K, yij∗=yji; otherwise, the restructured series Zc=zc1,zc2,⋯,zcn is defined as follows:(4)zcl=1l+1∑m=1l+1ym,l−m+2∗,1≤l≤L∗,1L∗∑m=1L∗ym,l−m+2∗,L∗≤l≤K∗,1n−1∑m=l−K∗+2l−K∗+1ym,l−m+2∗,K∗≤l≤n(4)
Grouping. The singular vector corresponding to the largest eigenvalue represents the largest change trend of the original sequence, and the singular vector corresponding to the smaller eigenvalue reflects the fluctuation components of the original sequence. By setting the contribution rate thresholdηe (generally taken ηe≥80%) and then gradually reconstructing the subsequence in the order of eigenvalue from large to small, when it appears ∑λi/∑λ≥ηe, the obtained sequence is the trend component of the original sequence, and the remaining subsequence is reconstructed into the fluctuation component


## 3.2. Sampling Strategy Based on Stepwise Decomposition

Let time seriesTS=xtt=1,⋯,T+K, where T+K is the length of time series TS. Use x1 to xT as training data and the rest as test data. The specific stepwise decomposition steps are as follows:
(1)
Decompose the time seriesx1:L into subsequences x1:L+1i2(2)
Decompose the time seriesx1:L+1 with length L+1 into subsequence x1:L+1i2. Then, the input and output of the first sample of the ith subsequence come from x1:Li1 and x1:L+1i2, respectively, as shown in Figure 1(3)
Continue to decompose the next time series of lengthL and L+1 according to step 1 and step 2 until all training datasets are obtained(4)
Establish a prediction model for each subsequence, respectively(5)
In the prediction stage, the time series of historicalL length is decomposed, and each subsequence is predicted according to the trained model(6)
Accumulate the predicted values of each subsequence to obtain the predicted result of the original sequenceFigure 1
The input and output samples.The application of the above SDS strategy completely avoids the data leakage problem in traditional ODS, and the model based on this strategy conforms to the actual online prediction scenario.


## 3.3. Long Short-Term Memory Network (LSTM)

Compared with traditional neural networks, RNN can capture the temporal regularity of sequence data more effectively. LSTM was originally a variant of the traditional recursive neural network. It has strong memory ability when dealing with time-series prediction and is widely used in time-series prediction scenarios with long time interval and delay. The basic structure of the LSTM unit is shown in Figure2.Figure 2
LSTM model structure diagram.LSTM adds more memory modules to the neural network to selectively let information pass through, with each door having a different function.The forget gateft decides which news to discard by integrating the information of the last moment and the news of the present moment. The formula is as follows:
(5)ft=σwfxxt+wfhht−1+wfcCt−1+bf,(6)σz=11+e−z,where σ⋅ is the sigmoid activation function, xt the input at t, ht the output at t, ht−1 the output at t−1, Ct the candidate vectors at time t, wfx,wfh,wfc weight coefficient of the forgetting gate, and bf bias of forgetting gate.An input gateit is the opposite of a forget gate ft. This section decides the news to enter the cell state based on the input threshold. The output of the input gate at t is as follows:
(7)it=σwixxi+wihht−1+wicCt−1+bi,vt=tanhwcxxt+wchht−1+bo,tanhz=ez−e−zez+e−z,where wix,wih,wic are the weight coefficients of input gate, bi is bias of input gate, wcx,wch are the weighting coefficients and bias of candidate vectors, bo is the bias of candidate vectors, tanh⋅ is the hyperbolic tangent activation function, and vt is the updated value of candidate vectors.The output gateot determines what information will be output. No information can pass through the output gate except what is required. So the output at time t is as follows:
(8)ot=σwox+wohht−1+wocCt−1+bo,ht=ot⋅tanhCt,Ct=Ct−1⋅ft+itvt,where ot is the output gate and wox,woh,woc are the weighting coefficients of the output gate.


## 3.4. STPF Prediction Model

Figure3 is the process of the SSA-LSTM model based on the SDS strategy, and here are the modeling steps:Step 1.
Original data processing. The original rail transit passenger flow’s preprocessed time series is divided into a training set and a test set.Step 2.
Decomposition of original passenger flow data. SDS for the training set based on the SSA method until the complete training sample of the trend component and the fluctuation component is obtained. The trend series represents the broader trend of original data. The fluctuation series represents the periodic of original data.Step 3.
Establish prediction model. The LSTM prediction model in view of the deep learning is established for the training set in each subsequence, respectively.Step 4.
Perform SSA stepwise decomposition on the test set, and input it into the LSTM to generate the prediction results of each component.Step 5.
Accumulate the predicted values of each component. Get the STPF forecast results.Figure 3
The process of the STPF prediction based on SDS-SSA-LSTM.


## 4. Experiments and Results

### 4.1. Data Analysis

The original data is selected from the daily passenger flow data of Xi’an Metro Line 3 from January 1, 2017, to January 24, 2020, to analyze the established model. The sampling interval is one day, and a total of 1119 groups of sample points are obtained.Passenger flow data has a time correlation. The closer the time is , the higher the correlation between the speed. With the increase of time, the correlation weakens. In addition, the passenger flow data has an obvious trend in the short term and periodic in the long term. To analyze the temporal characteristics of passenger flow data, some datasets are selected for visual analysis, as shown in Figure4.Figure 4
Periodic analysis of sampling passenger flow.The weekly trend changes in Figure4 are very similar, which shows the passenger flow data has periodicity of prominence. Therefore, in this study, the passenger flow data is grouped into two samples, from Monday to Thursday (data 1) and from Friday to Sunday (data 2), and the two sets of datasets are, respectively, predicted to verify the model.


### 4.2. Passenger Flow Decomposition

#### 4.2.1. SSA Decomposition

The SSA is applied to the historical time-series for SDS. Figures5 and 6 show the decomposition results of training samples and test samples of the two datasets, respectively.Figure 5
The training samples and test samples of the passenger flow sequence data 1.
(a)
Trend component training samples(b)
Volatility component training samples(c)
Trend component test sample(d)
Volatility component test sampleFigure 6
Training samples and test samples of passenger flow sequence data 2.
(a)
Trend component training samples(b)
Volatility component training samples(c)
Trend component test sample(d)
Volatility component test sample


#### 4.2.2. Data Normalization

To improve the data processing efficiency of the subsequent prediction model, it is necessary to normalize each subsequence. In this paper, MinMax is selected for normalization.


### 4.3. STPF Forecast

#### 4.3.1. Model Parameter Setting

In this paper, given the daily passenger flow data of Xi’an Metro Line 3 from January 1, 2017, to January 24, 2020, the short-term passenger flow in the future period is calculated. After many tests, the parameters of the SDS-SSA-LSTM model are set in the example as shown in Table1.Table 1
SDS-SSA-LSTM model parameters.
Model parametersSDSSSALSTMNumber of neurons——32Learning rate——0.001Look back——3Epochs——50Window length—20—Contribution threshold—80%—Length of decomposition50——Note: “—” indicates that the parameter in this row does not exist in this column model.


#### 4.3.2. Forecast Result

To test the performance of the model in the STPF prediction, ARIMA, LSTM, GRU single model, and DWT-LSTM, EMD-LSTM, VMD-LSTM, SDS-SSA-LSTM, and other hybrid models are used to predict the two datasets. The prediction results are shown in Figures7 and 8.Figure 7
Prediction results of sequence data 1.Figure 8
Prediction results of sequence data 2.


### 4.4. Performance Comparison

In this paper, three single models and four mixed depth models commonly used in the existing literature are selected to compare the prediction accuracy. To evaluate the effectiveness and accuracy of the SDS-SSA-LSTM model, the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) were used to evaluate the model. Table2 shows the error comparison results of the prediction model.Table 2
Comparison of model prediction performance.
DataModelEvaluation indexRMSEMSEMAEData 1ARIMA4.48420.1020.163LSTM4.34018.8382.642GRU4.46919.9702.776DWT-LSTM3.36711.3352.008EMD-LSTM3.69313.6372.335VMD-LSTM4.14217.1602.693SDS-SSA-LSTM2.0404.1611.280Data 2ARIMA8.45071.4030.229LSTM5.95835.4964.872GRU6.05936.7124.960DWT-LSTM5.93935.2744.636EMD-LSTM5.91935.0405.010VMD-LSTM5.90234.8304.823SDS-SSA-LSTM4.32018.6611.838According to the error results in Table2, it can be seen that
(1)
in the classic single-model prediction, the LSTM model shows better prediction effect on both datasets, and RMSE and MSE indicators are the lowest. However, the traditional statistical method has low prediction accuracy for passenger flow data with complex influencing factors(2)
in terms of predicting STPF, the hybrid model with decomposition and fusion strategies performs better than the single model. To some extent, the prediction accuracy has increased(3)
the prediction performance of the DWT-LSTM, EMD-LSTM, and VMD-LSTM models using ODS strategy is lower than that of the SSA-LSTM model based on SDS strategy(4)
ODS strategy assumes that the future data is known from the beginning, but in practical application, the future data needs to be predicted. Therefore, the prediction results obtained by the model based on the ODS strategy cannot reflect the actual online prediction effect. The model based on the SDS strategy completely avoids the leakage of future data, and its prediction results can guide online prediction


## 4.1. Data Analysis

The original data is selected from the daily passenger flow data of Xi’an Metro Line 3 from January 1, 2017, to January 24, 2020, to analyze the established model. The sampling interval is one day, and a total of 1119 groups of sample points are obtained.Passenger flow data has a time correlation. The closer the time is , the higher the correlation between the speed. With the increase of time, the correlation weakens. In addition, the passenger flow data has an obvious trend in the short term and periodic in the long term. To analyze the temporal characteristics of passenger flow data, some datasets are selected for visual analysis, as shown in Figure4.Figure 4
Periodic analysis of sampling passenger flow.The weekly trend changes in Figure4 are very similar, which shows the passenger flow data has periodicity of prominence. Therefore, in this study, the passenger flow data is grouped into two samples, from Monday to Thursday (data 1) and from Friday to Sunday (data 2), and the two sets of datasets are, respectively, predicted to verify the model.


## 4.2. Passenger Flow Decomposition

### 4.2.1. SSA Decomposition

The SSA is applied to the historical time-series for SDS. Figures5 and 6 show the decomposition results of training samples and test samples of the two datasets, respectively.Figure 5
The training samples and test samples of the passenger flow sequence data 1.
(a)
Trend component training samples(b)
Volatility component training samples(c)
Trend component test sample(d)
Volatility component test sampleFigure 6
Training samples and test samples of passenger flow sequence data 2.
(a)
Trend component training samples(b)
Volatility component training samples(c)
Trend component test sample(d)
Volatility component test sample


### 4.2.2. Data Normalization

To improve the data processing efficiency of the subsequent prediction model, it is necessary to normalize each subsequence. In this paper, MinMax is selected for normalization.


## 4.2.1. SSA Decomposition

The SSA is applied to the historical time-series for SDS. Figures5 and 6 show the decomposition results of training samples and test samples of the two datasets, respectively.Figure 5
The training samples and test samples of the passenger flow sequence data 1.
(a)
Trend component training samples(b)
Volatility component training samples(c)
Trend component test sample(d)
Volatility component test sampleFigure 6
Training samples and test samples of passenger flow sequence data 2.
(a)
Trend component training samples(b)
Volatility component training samples(c)
Trend component test sample(d)
Volatility component test sample


## 4.2.2. Data Normalization

To improve the data processing efficiency of the subsequent prediction model, it is necessary to normalize each subsequence. In this paper, MinMax is selected for normalization.


## 4.3. STPF Forecast

### 4.3.1. Model Parameter Setting

In this paper, given the daily passenger flow data of Xi’an Metro Line 3 from January 1, 2017, to January 24, 2020, the short-term passenger flow in the future period is calculated. After many tests, the parameters of the SDS-SSA-LSTM model are set in the example as shown in Table1.Table 1
SDS-SSA-LSTM model parameters.
Model parametersSDSSSALSTMNumber of neurons——32Learning rate——0.001Look back——3Epochs——50Window length—20—Contribution threshold—80%—Length of decomposition50——Note: “—” indicates that the parameter in this row does not exist in this column model.


### 4.3.2. Forecast Result

To test the performance of the model in the STPF prediction, ARIMA, LSTM, GRU single model, and DWT-LSTM, EMD-LSTM, VMD-LSTM, SDS-SSA-LSTM, and other hybrid models are used to predict the two datasets. The prediction results are shown in Figures7 and 8.Figure 7
Prediction results of sequence data 1.Figure 8
Prediction results of sequence data 2.


## 4.3.1. Model Parameter Setting

In this paper, given the daily passenger flow data of Xi’an Metro Line 3 from January 1, 2017, to January 24, 2020, the short-term passenger flow in the future period is calculated. After many tests, the parameters of the SDS-SSA-LSTM model are set in the example as shown in Table1.Table 1
SDS-SSA-LSTM model parameters.
Model parametersSDSSSALSTMNumber of neurons——32Learning rate——0.001Look back——3Epochs——50Window length—20—Contribution threshold—80%—Length of decomposition50——Note: “—” indicates that the parameter in this row does not exist in this column model.


## 4.3.2. Forecast Result

To test the performance of the model in the STPF prediction, ARIMA, LSTM, GRU single model, and DWT-LSTM, EMD-LSTM, VMD-LSTM, SDS-SSA-LSTM, and other hybrid models are used to predict the two datasets. The prediction results are shown in Figures7 and 8.Figure 7
Prediction results of sequence data 1.Figure 8
Prediction results of sequence data 2.


## 4.4. Performance Comparison

In this paper, three single models and four mixed depth models commonly used in the existing literature are selected to compare the prediction accuracy. To evaluate the effectiveness and accuracy of the SDS-SSA-LSTM model, the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) were used to evaluate the model. Table2 shows the error comparison results of the prediction model.Table 2
Comparison of model prediction performance.
DataModelEvaluation indexRMSEMSEMAEData 1ARIMA4.48420.1020.163LSTM4.34018.8382.642GRU4.46919.9702.776DWT-LSTM3.36711.3352.008EMD-LSTM3.69313.6372.335VMD-LSTM4.14217.1602.693SDS-SSA-LSTM2.0404.1611.280Data 2ARIMA8.45071.4030.229LSTM5.95835.4964.872GRU6.05936.7124.960DWT-LSTM5.93935.2744.636EMD-LSTM5.91935.0405.010VMD-LSTM5.90234.8304.823SDS-SSA-LSTM4.32018.6611.838According to the error results in Table2, it can be seen that
(1)
in the classic single-model prediction, the LSTM model shows better prediction effect on both datasets, and RMSE and MSE indicators are the lowest. However, the traditional statistical method has low prediction accuracy for passenger flow data with complex influencing factors(2)
in terms of predicting STPF, the hybrid model with decomposition and fusion strategies performs better than the single model. To some extent, the prediction accuracy has increased(3)
the prediction performance of the DWT-LSTM, EMD-LSTM, and VMD-LSTM models using ODS strategy is lower than that of the SSA-LSTM model based on SDS strategy(4)
ODS strategy assumes that the future data is known from the beginning, but in practical application, the future data needs to be predicted. Therefore, the prediction results obtained by the model based on the ODS strategy cannot reflect the actual online prediction effect. The model based on the SDS strategy completely avoids the leakage of future data, and its prediction results can guide online prediction


## 5. Conclusion

This research suggests a prediction methodology based on SDS-SSA-LSTM to better precisely predict the passenger flow sequence of rail transit. The SDS strategy can effectively avoid the future data involved in the prediction model in the testing phase and solve the data leakage problem of the traditional ODS strategy. Using the SSA method, the passenger flow sequence with mixed features is decomposed into trend sequence and fluctuation sequence with relatively single features, which is easy for model learning. Through example verification, the proposed model established in this paper performs well in the STPF prediction, and this method reveals great application prospects.In the future, developing a visual STPF forecasting platform is the next research focus, and developing a prediction model based on decomposition needs to be combined with SDS strategy. In addition, the cumulative error caused by the increased in modeling quantity is a challenge in achieving the STPF prediction.



---

*Source: 2589681-2022-09-21.xml*