A Data-Driven Approach to Detect Passenger Flow Anomaly Under Station Closure

During daily subway operation, station closure has large impact on subway system organization and has received increasing attention. This article proposes an anomaly detection method based on ensemble algorithms to determine the range of station closure influence on passenger flow. Firstly, Ensemble Algorithm I is developed to identify the stations with passenger flow volume anomaly and origin-destination (OD) pairs with volume anomaly. Secondly, Ensemble Algorithm II is proposed to identify the OD pairs with travel time anomaly. Then, the spatial variation in passenger flow caused by station closure, i.e. shift of passenger flow to neighboring stations and shift of path flow, is analyzed, and the spatial-temporal influence range of station closure is determined. A case study of the Beijing subway system is performed to illustrate the validity of the proposed method.Compared with sub algorithm of ensemble learning and KNN algorithm, Ensemble Algorithm I and II are more robust and have less misjudgment.


I. INTRODUCTION
Because the pressure of city traffic increases, subway is favored as an advanced urban rapid transit system. Subway plays a vital role in Beijing traffic, and its normal operation provides great convenience to people's life. The total passenger volume per day in the subway system is approximately 12 million per day [1], [2]. However, along with the increase of large-scale activities, relevant stations are closed and a large number of subway passengers are inevitably affected. Therefore, it is crucial for managers to focus on subway operations under station closure conditions to improve the service quality.
In fact, local closure of stations will affect the whole subway system in multiple perspectives. On the one hand, some passengers cannot follow their daily travel routine and the inbound and outbound volumes of the affected stations will change [3], [4]. On the other hand, the closure of transfer The associate editor coordinating the review of this manuscript and approving it for publication was Alberto Cano . stations results in some passengers failing to transfer as usual. Correspondingly, these passengers have to change their travel route, and passenger distribution across the subway network will significantly change, as well as the travel time of these passengers [5], [6]. Therefore, it is critical for managers to understand which passengers are affected and how they are affected for better operations under station closure.
The review of relevant research focuses on the following aspects: (a) changes of passenger behavior under station closure; (b) changes of passenger flow volume under station closure; (c) anomaly detection algorithms based on smart card data; and (d) interaction between travel demand and railway services. Many scholars have widely studied the changes of passenger behavior in anomalous scenarios [5], [7]- [12]. Pnevmatikou et al. [5] developed the joint RP/SP nested logit model to analyze the mode choice during a longterm subway service disruption. Nazem et al. [7] analyzed the changes of travel behavior and the impacts on transit customers' behavior due to public transit service disruptions. Nguyen-Phuoc et al. [8] studied how public transport users adjusted their travel behaviors if public transport was ceased. Sun et al. [10] proposed a novel approach to identify disruptions and evaluate their influence on travel time and delays. Zhang et al. [11] leveraged L-space topology to show that the Shanghai metro had strong robustness in terms of connectivity under random interruptions. Akyol et al. [13] utilized the Eclipse SUMO micro-simulator in conjunction with TraCI and proposed an adaptive traffic control system considering the traffic flows of road vehicles and pedestrians with field data. Akyol et al. [14] adapted Split, Cycle, and Offset Optimization Technique (SCOOT) in order to manage the pedestrian and vehicular traffic. However, none of the above studies focuses on the origin or destination station selection under station closure.
There are a number of studies analyzing passenger flow under unconventional subway scenarios in the field. Sun and Guan [15] proposed a methodology for measuring the vulnerability of a subway network from line operation perspective. Louie et al. [16] developed an empirical model to predict the effect of incident characteristics on the duration of delays in subway operations in Toronto. Malandri et al. [17] studied the evolution of interact relationship between the passenger volume and capacity ratio throughout the network to measure the spatial and temporal extents of the impacts caused by an unplanned service segment disruption. Wang et al. [18] proposed a model called the elastic abnormality detection for outflow model to detect passenger outflow anomalies and to alarm administrators in real time. Wei and Chen [19] proposed a hybrid empirical mode decomposition and back-propagation neural networks(EMD-BPN) approach to predict the short-term passenger flow in metro systems. Liu et al. [20] developed an end-to-end deep learning architecture to predict the metro passenger flow, which achieved a high prediction accuracy. Celikoglu and Cigizoglu [21] used ANN method, generalized regression neural network (GRNN) to forecast daily trip flows. Celikoglu and Cigizoglu [22] used two different ANN algorithms, feed forward back-propagation (FFBP) and radial basis function (RBF) to forecast daily trip flow. However, there are little research on OD and travel time analysis in case of station closure. c) Anomaly detection is a problem of finding outliers in the data. To date, many anomaly detection techniques have been specifically developed for various applications [23]- [29]. Pang et al. [27] adopted statistics of likelihood-ratio test to describe traffic patterns by using global positioning system(GPS) data from taxis to monitor the emergence of unexpected behavior in the metropolitan area of Beijing. Zhang et al. [29] proposed the dictionarybased compression theory for regional traffic flow pattern identification and anomaly detection within a large-scale traffic network. Celikoglu and Silgu [30] used flow dynamics specific to each of the cells to determine the mode of prevailing traffic conditions and then reconstructed by neural methods to obtain classification of flow patterns over the fundamental diagram. Celikoglu [31] proposed a dynamic approach to simulate specify flow pattern variations and incorporate the neural network theory to reconstruct real-time traffic dynamics. Yap et al. [32] developed a new transfer inference algorithm to infer journeys from raw smart card transactions in an accurate way during both disrupted and undisrupted operations. A thorough literature review concluded that despite that much technique was developed in cluster analysis and anomaly detection [24], no existing technique was directly applicable to analyze AFC data, so as to solve the anomaly detection problem for station closure. d) Some studies analyzed the interaction between travel demand and railway services. Xu et al. [33] learned the route choice behavior of passengers from Auto Fare Collection (AFC), timetable, and train loading data using a method combined with Bayesian inference and Metropolis-Hasting sampling. Pineda et al. [34] considered the important expansion of Metro network, compared the information of origin-destination (OD) matrices, transfers, and passenger load levels from two data sources for Metrode Santiago. However, few studies have analyzed the relation between travel demand and railway service in case of station closure, so as advice the subway managers to make targeted practical countermeasures.
Moreover, these above studies hardly involve AFC data mining to investigate the field of station closure, although AFC data are widely used to analyze various behavior characteristics of subway passengers. In fact, AFC data can be used to split travel time [35], predict passenger route choices [33], and identify passenger flow characteristics [2], [36]- [38]. In this study, AFC data are applied to explore the anomalous characteristics of passenger flow under station closure.
The changes in passenger flow under station closure in subway networks are mostly considered, while the changes in passenger behavior under station closure are not. Furthermore, few studies have examined the spatiotemporal change mechanism of the OD volume under station closure from AFC data, although there are many excellent anomaly detection approaches. This article contributes to the current field of study by developing a data-driven approach for detecting passenger flow anomalies to accurately capture passenger travel choice and passenger flow distribution across the network. The main contributions of this article are summarized as follows: (1) A data-driven algorithm based on two ensemble algorithms is proposed to detect anomaly of passenger flow under station closure. The data-driven algorithm can compensate for detection errors caused by a single distribution algorithm of anomaly detection, considering the fact that the data might follow different distributions. Moreover, it effectively overcomes the single-learner disadvantage of being too sensitive or dull to detect anomaly data of passenger flow due to the parallel calculation of the sub-algorithms.The algorithm can process a large amount of data quickly.The result is reasonable and better than the traditional algorithm.
(2) The spatial and temporal impact of station closure on subway passenger flow is analyzed, and a series of phenomena caused by station closure from multiple aspects are examined, such as the inbound and outbound volumes in stations, passenger flow between OD pairs, and passenger travel time. The analysis of inbound and outbound volumes can help to grasp the overcrowding situation of station. Further, the analysis of passenger flow and travel time between OD pairs can help to avoid overcrowding or too long travel time between OD pairs by adjusting the operation of subway. This study is the first attempt to analyze passenger flow under station closure in various perspectives and contributes to understand the change mechanism of passenger flow in stations, OD pairs, and paths under station closure, as well as the change mechanism of travel time.
(3) A case study of the Beijing subway is conducted and two unique phenomena caused by station closure are discussed, including a shift in passenger flow to neighboring stations and a shift in path flow of some OD pairs. These results contribute to accurately managing affected stations, affected passengers, and affected OD under station closure, which can help subway managers to identify abnormal or overcrowded stations and passenger flow and making targeted practical countermeasures.
The remainder of this article is organized as follows: in Section 2, the methodology to identify passenger flow and OD anomalies from a spatiotemporal perspective is proposed. In Section 3 and Section 4, a case study of the Beijing subway network verifies the proposed method. In Section 5, the conclusions are made.

II. METHOD
This section proposes two ensemble algorithms of anomaly detection at the spatial and temporal levels. The test results of these two algorithms are complementary and computed in parallel..

A. ENSEMBLE ALGORITHM I
Ensemble Algorithm I, an anomaly identification method based on passenger flow volume, consists of two steps. The first step is to conduct a Kolmogorov-Smirnov (K-S) test to determine the distributions of the inbound and outbound volumes; and the second step is to apply the anomaly identification algorithms based on the Poisson distribution, local outlier factor algorithm, and Grubbs criterion to identify the passenger flow anomalies and combine them by weighting to obtain the final result.

1) KOLMOGOROV-SMIRNOV TEST
Let N be the total number of stations in a subway network. Let the passenger flow volume in ith station be x i , and let the cumulative distribution function of the passenger flow volume at the first i stations be F (x i ). In this study, the theoretical distributions of the passenger flow volume at station i are assumed to be normal distribution G 1 (x i ) and Poisson distribution G 2 (x i ). The test statistics are then defined as follows: (2) where N 1 represents the sample number of passenger flow data in the K-S normal distribution test, and N 2 represents the sample number of passenger flow data in the K-S Poisson distribution test. The distribution of passenger flow volume can be determined as follows: if D N 1 < d N 1 , the passenger flow is subject to the normal distribution; if D N 2 < d N 2 , the passenger flow is subject to the Poisson distribution. Herein, d N 1 and d N 2 are the test thresholds obtained by the threshold table of K-S test statistics.

2) AN ENSEMBLE ALGORITHM FOR PASSENGER FLOW VOLUME ANOMALY DETECTION
The basic principle of ensemble learning is to train multiple individual learners or base learners, and then combine them to produce better performance using a certain strategy such as Voting.
The hypothesis tests based on the Poisson distribution, LOF algorithm, and Grubbs criterion are regarded as the base learners, and weighted combinations are made according to the results of passenger flow anomaly detection. Among the base learners, the anomaly index of the Poisson distribution hypothesis test is recorded as the Poisson distribution statistic (AI 1 ), the anomaly index of the LOF algorithm is recorded as the local outlier factor (AI 2 ), and the anomaly index of the Grubbs criterion is recorded as the residual of the predicted value (AI 3 ). Note that the coefficient of variation represents the dispersion degree of an anomaly index. If the anomaly dispersion degree of the algorithm is high, the algorithm is sensitive. In contrast, if the degree is low, the algorithm is not sensitive. To reduce the impact of the algorithm sensitivity differences on the ensemble results, the weight of one anomaly index is defined as follows: where cv j is the variation coefficient of anomaly index AI j . Then, the final anomaly index is Briefly, the flow chart is shown below. Next, more details of the algorithm will be discussed.

a: ANOMALY TEST OF PASSENGER FLOW VOLUME BASED ON THE POISSON DISTRIBUTION
Let IX N i and OX N i represent the sets of the inbound volume and outbound volume, respectively, at station i during the normal period. Let x C i and ox C i be the inbound volume and outbound volume, respectively, at station i during the station closure period. Let IX i and OX i be the inbound volume and outbound volume, respectively, at station i during each period, i.e., Let IX C and OX C be the whole sets of inbound volume data and outbound volume data, respectively, of all stations under station closure. Let I and O be the sets of the abnormal inbound volume and outbound volume data, respectively, at all stations.
Assuming that the inbound volume and outbound volume in a station during the station closure period are both normal, they should be subject to the same distribution as that of the volume data in normal period. Therefore, a hypothesis test is performed by establishing the null hypothesis and alternative hypothesis as follows: Null hypothesis H0: The inbound/outbound volume obeys the original Poisson distribution; Alternative hypothesis H1: The inbound/outbound volume does not obey the original Poisson distribution.
The hypothesis test is performed with the significance level of 0.01. The data of the inbound and outbound volumes at all stations during the closure period are checked as follows: Step 1: Estimate the parameters of Poisson distribution based on normal data sets IX N i , OX N i ; Step 2: Input the passenger flow data sets IX C and OX C during station closure and calculate the distribution probability of the inbound/outbound data in all stations AI 1 based on the Poisson distribution during station closure; Step 3: Evaluate whether to accept the original hypothesis to determine whether the data are abnormal. If H1 is accepted for the inbound (or outbound) data at station i, the data are abnormal and Step 4: Output the abnormal stations in the set of I ∪ O .

b: PASSENGER FLOW ANOMALY TEST BASED ON THE LOF ALGORITHM
The LOF algorithm [40] determines the local outlier factor based on density detection. The algorithm calculates an outlier factor LOF for each data point and identifies the outliers by evaluating the closeness of their LOF with 1. It is mainly judged whether the point is anomalous by comparing the density of each point p with that of other points. The lower the density of point p is, the more likely the point is to be identified as anomalous.
Let the first quantile of the passenger flow volume (i.e., the inbound and outbound volumes) be Q 1 and the third quantile of the passenger flow volume be Q 3 . The main steps are as follows: Step 1: Calculate the local outlier factor of the passenger flow volume in all stations during the station closure period and form these factors into a series The local outlier factor of the passenger flow volume (i.e., inbound and outbound volumes) at station i can be calculated as follows: where x (p) represents the passenger flow volume of point p, d K (p) is the distance between p and the K th point closest to p, N K (p) is the p neighborhood with distance d K (p), and Herein, K is a given parameter.
Step 2: Calculate the threshold of anomaly recognition for the local outlier factor as follows: Step 3: Determine whether station i is an abnormal station.
If the local outlier factor of the passenger flow volume at station i is higher than ω, station i is regarded as an anomalous station, i.e., Step 4: Output the abnormal stations in the set of I ∪ O .

c: PASSENGER FLOW ANOMALY DETECTION BASED ON THE GRUBBS CRITERION
The Grubbs criterion is the most efficient in those cases where abnormal values are mixed in the sample data [39], [40]. The Grubbs criterion states that if the residual V i corresponding to a measured value x i (i.e., the inbound volume of station i) satisfies the following equation, then the measured value (i.e., the inbound volume) has a large error, and, as a result, x i should be eliminated as an abnormal datum: wherex i represents the sample mean; σ (x i ) represents the sample standard deviation; and g(|IX i |, a) depends on the number of measurements |IX i | and the significance level.
Herein, 2 for the inbound volume. Note that the level of significance is usually 0.01 or 0.05. Note that |V i | is also the anomaly index AI 3 of the ensemble algorithm.

B. ENSEMBLE ALGORITHM II
Ensemble Algorithm II is based on the distribution detection of the travel time data in the closure period and the normal period. The independent sample t-test, Wilcoxon signed rank test, and Mann-Whitney rank sum test are used as basic learners, and these anomaly detection results are weighted and combined to generate the final result. The weighting method is defined similarly as in the above section. The anomaly indexes of the independent sample t-test, Wilcoxon signed rank test, and Mann-Whitney rank sum test are defined as AI 4 , AI 5 , and AI 6 , respectively. The basic process of Ensemble Algorithm II is as the following Fig. 2. Next, more details of Ensemble Algorithm II will be discussed.

1) TRAVEL TIME ANOMALY DETECTION METHOD BASED ON THE INDEPENDENT SAMPLE T-TEST
The independent t-test is introduced to test the difference in the data obtained from two groups of independent samples to check whether the two samples come from the same population. The steps are detailed as follows: Step 1: Establish the original hypothesis and alternative hypothesis to determine the significance level.
Step 2: Choose the test method and calculate the statistic. The equation of the T statistic is as following: whereX 1 andX 2 represent the mean travel time during the normal period and station closure, respectively; S 2 1 and S 2 2 represent the standard deviations of the travel time during the normal period and station closure, respectively; and n 1 and n 2 represent the corresponding two sample sizes, respectively.
Step 3: Calculate the t statistics, determine the P value according to the t critical value table, and finally obtain the conclusion. The t statistic is also the anomaly index AI 4 .

2) TRAVEL TIME ANOMALY DETECTION METHOD BASED ON THE WILCOXON SIGNED RANK TEST
The Wilcoxon signed rank test [37] is developed on the basis of the symbolic test of paired observation data, which is more effective than the traditional test of the sign alone. It is suitable for pairwise comparisons in the T-test since it does not require that the difference between the paired data obeys the normal distribution. Since the travel time data may be subject to different distributions, the Wilcoxon signed rank test has a wider scope of application than the T-test in travel time anomaly testing applicability.
Let the mean travel time during the normal time period beT . Since passenger volumes during station closure and normal time differ, the data need to be paired first. The matching rules are as follows: first, the passenger flow data are sorted according to the travel time of the passenger flow. Then, the ith data during station closure are matched with the data during the normal time period, round( i·n 2 n 1 ), where round(x) represents the rounding of x. Next, the Wilcoxon signed rank test is performed as follows: Step 1: Calculate the difference between the pairs of observed data and rank the corresponding absolute values in order of size.
Step 2: Calculate the difference between all travel time data and the mean travel time during the normal time period. If the difference is positive, the value will be assigned to aggregate the positive signs T +. If the difference is negative, it will be assigned to aggregate the negative signs T −.
Step 3: The positive and negative signs, T + and T −, respectively, are restored, and the sum of the positive and negative grades, T + and T −, respectively, are calculated. The smaller value between T + and T − is selected as the Wilcoxon test statistic T.
Step 4: A judgment is made according to the Wilcoxon test statistic T. Note that the Wilcoxon test statistic T is the anomaly index AI 5 .

3) TRAVEL TIME ANOMALY DETECTION METHOD BASED ON THE MANN-WHITNEY TEST
The Mann-Whitney rank sum test [38] as a nonparametric test method is often used to test whether the populations of two independent samples have significant differences. Compared with the Wilcoxon signed rank test, the Mann-Whitney test does not make any assumptions about the data distribution. At the same time, there is no requirement for the amount of data of the two samples, and it is not necessary to pair them, and the information in the samples is fully utilized.
The steps of the Mann-Whitney rank sum test are described as follows: Step 1: The travel time data during the normal time period are combined with the travel time data during station closure, and the ranks R i are sorted in ascending order of the data size. The minimum data level is 1, the second lowest data level is 2, and so on.
Step 2: Determine the sum of grades of all samples separately, for example, R 1 , R 2 .
Step 3: Calculate U 1 and U 2 of the travel time data during the normal time period and the travel time data during station closure, respectively, and the calculation equations are as follows: Step 4: Select the smaller value between U 1 and U 2 to compare with the critical value U α in the critical value table. If the selected value is larger than the critical value, the assumption is established, and there is no significant difference in the travel time. Let the smaller value between U 1 and U 2 be the anomaly index AI 6 .   The influence scope of the closure in the Olympic Park Station from 7:00-9:00 (i.e., the morning peak hours) on The second individual algorithm identifies 16 stations with anomalous inbound volumes, as shown in Fig. 3b, and more than half of them coincide with the anomalous points of the LOF algorithm, which indicates that the two algorithms are capable of capturing the anomaly in passenger flow to some extent. Moreover, some stations do not have large variability but are still marked as anomalous based on the Poisson distribution anomaly detection results. One possible explanation is that the variance in the inbound volume in the Poisson distribution is related to the mean value of the inbound volume, and the discriminant index of the anomaly is related to the variance. Sensitivity to fluctuation varies VOLUME 8, 2020 Next, the weights of the three individual algorithms based on the abnormal indices are calculated according to Eq. (3) and the results are calculated. The sensitivity of the LOF algorithm is the highest (i.e., 0.2383), followed by that of Poisson distribution (i.e., 0.3004), and the sensitivity of Grubbs criterion is the lowest (i.e., 0.4613).

III. EXPERIMENT
Then, the anomaly index of Ensemble algorithm I is shown in Figs. 4. Note that in Fig. 4, the anomaly detection result is closer to 0, and the anomaly degree of inbound passenger flow is lower. Most stations have low anomaly degree, that is, only certain stations are influenced, such as the stations near the closure station or near the transfer stations (such as the Olympic Sports Center Station) marked by color yellow shown in Fig. 4.
Finally, the results are obtained shown in Fig. 5, the stations with anomalous inbound volumes are mainly distributed across the following types of stations.  In fact, due to the zero inbound volume of the closed station, the inbound volumes of the stations near the closed station are generally higher. Based on historical data, the reduction in the inbound volume at Olympic Park Station is 10781 while the total number of people entering the stations near Olympic Park Station increased by 7730. The percent reduction in the inbound volumes is 28.3%, indicating that 28.3% of travelers have to abandon their travel routine or change to other travel modes, and the rest of the travel demand allocates to the surrounding stations.
II. The other stations are the interchange stations of Line 8 and Line 15, such as the Lin Cuiqiao Station and Huoying Station. In comparison, the variation of the inbound volume in these stations is less affected by the closed station. For example, the average inbound volume of Lin Cuiqiao Station is 3229, while in the condition of station closure, the value is reduced to 2956. As the transfer station is closed, the passenger flow at the nearby transfer stations increases, and the inbound volumes at the stations increase accordingly for the reason that the passenger flow of the transfer line transfers to other transfer lines.

2) COMPARISON OF ENSEMBLE ALGORITHM I WITH INDIVIDUAL ALGORITHMS BASED ON THE INBOUND VOLUME
The results of the individual algorithms are compared in TABLE 4, and their similarity rates are 0.84,0.73, and 0.78, respectively.The Ensemble Algorithm I is also compared with KNN anomaly detection algorithm. The similarity rates between the anomaly recognition results of Ensemble Algorithm I and the individual algorithms are higher than 70%, which indicates that the results are roughly the same. The consistency between Ensemble Algorithm I and the individual algorithms indicates that the results of each sub-algorithm are reasonable. There are no cases where the results of Ensemble Algorithm I are greatly affected by an unreasonable algorithm. Since the error of each sub-algorithm is small, Ensemble Algorithm I will not produce wrong results. That is why the Ensemble Algorithm I is robust.
Moreover, because the LOF algorithm is sensitive to passenger flow variability, the normal fluctuation error is recognized as an anomaly (e.g., Lin Cuiqiao Station is distinguished as having anomalous data by the LOF algorithm), but Ensemble Algorithm I avoids the aforementioned.
Further, anomaly detection based on the Poisson distribution considers that a station with large passenger flow has a large range of passenger flow variation. However, the algorithm has strict requirements for data distribution. It is sensitive to data volatility, so it is more prone to misjudgment.
In addition, some stations are misjudged as anomalous by the Grubbs criterion, such as the Feibo Station. The normal average inbound volume in Feibo Station is 1044. However, on a normal day the inbound volume in Feibo Station is only 522. Thus, the Grubbs criterion determines the inbound volume of Feibo station to be anomalous because its inbound volume is less than the normal average inbound volume. Ensemble Algorithm I avoids this mistake because the station is evaluated by the weighted discrimination indicator of the three algorithms.
KNN algorithm is easier to recognize the normal fluctuation of data as abnormal,such as Lin Cuiqiao, Fengbo and Wangjing West.For these stations,the difference of inbound volume during station closure and normal time for these stations are 273,136,328 respectively,which can be regarded as normal fluctuation. However,KNN algorithm misjudges them as anomalous.Ensemble Algorithm I avoids this mistake because it is more robust.
Ensemble algorithm I combines the characteristics of the above three algorithms, which not only avoids the shortcoming of the high sensitivity of the LOF algorithm but also considers the changing proportion and density degree of the passenger flow data to avoid misjudging normal passenger flow data.
In short, Ensemble Algorithm I performs better in prediction than individual models alone and KNN algorithm.

3) ANOMALOUS STATION DETECTION BASED ON THE OUTBOUND VOLUME a: ANOMALY DETECTION PROCESS OF THE OUTBOUND VOLUME
Similar to the anomaly detection of inbound volume, the anomaly identification of outbound volume is also based on the proposed Ensemble Algorithm I.
The individual identification results of outbound volume are obtained shown in Figs. 6. Specifically, the LOF algorithm identifies 18 stations whose outbound volume is affected by the closed station. The Poisson distribution anomaly detection algorithm identifies 14 stations with affected outbound volumes. The Grubbs criterion identifies 15 stations whose outbound volume is affected by the closed station. VOLUME 8, 2020   Compared with Fig. 4, Fig. 7 has similar visual effects. That is, the inbound volume and outbound volume in the same station are positively correlated.
The final detection results in Ensemble Algorithm I are obtained shown in Fig. 8. The results are similar to the anomaly identification results of the inbound volume. The stations with anomalous outbound volume are also classified in the following two types.  Fig. 8.
This finding shows that in a bidirectional rail transit system, station closure results in the transfer of both inbound and outbound passengers to the stations near the closed station. The effects on bidirectional passenger flow between the two stations are also similar.

b: COMPARISON OF ENSEMBLE ALGORITHM I WITH INDIVIDUAL ALGORITHMS BASED ON THE OUTBOUND VOLUME
The detection results of Ensemble Algorithm I are compared with the results of the individual algorithms and KNN anomaly detection algorithm shown in TABLE 6, and their similarity rates are 0.85, 0,73, and 0.79, respectively.
The similarity rates between the anomaly recognition results of the ensemble algorithm and the individual algorithms are higher than 70%. Compared with the anomaly detection of inbound traffic, the characteristics of single algorithm and Ensemble Algorithm I remain.
Moreover, the performance of these algorithms is discussed. Firstly, LOF algorithm is sensitive to passenger flow variability, the normal fluctuation error is recognized as anomaly. For example, Anli Road Station is distinguished as having anomalous data by the LOF algorithm (see TABLE 6). Secondly, the anomaly detection based on the Poisson distribution has the highest error rate because it has the strictest requirements for data distribution. For example, Wangjing West Station is distinguished as abnormal by the the algorithm (see TABLE 6). Thirdly, the Grubbs criterion judges the outbound volume of Lin Cuiqiao Station to be anomalous because its outbound volume under station closure is higher than the normal outbound volume, however, its outbound volume under station closure is normal (see TABLE 6). Last,compared with KNN algorithm, the Ensemble Algorithm I is more accurate in judging the normal fluctuation of data.For example,Wangjing East Station and Wangjing West Station are distinguished as abnormal by KNN algorithm (see TABLE 6). In summary, the above Ensemble Algorithm I is applicable to detect anomaly of inbound and outbound volume, and the results of Ensemble Algorithm I are more accurate than single algorithms.

IV. IDENTIFICATION OF OD PAIR AFFECTED BY STATION CLOSURE A. ANOMALY DETECTION OF OD PAIR BASED ON OD VOLUME
To further analyze the spatial influence, the proposed Ensemble Algorithm I based on passenger flow volume is applied to identify anomalous OD pairs. Note that the selected path set contains 22830 transfer OD pairs at the Olympic Park Station.
The detection results of the individual algorithms are shown in Fig. 9. Specifically, a total of 653 anomalous traffic OD pairs are identified according to the LOF algorithm, and 848 anomalous OD pairs are identified based on the Poisson distribution, while 603 anomalous OD pairs are identified based on the Grubbs criterion. The corresponding weights are listed in TABLE 7, and the final anomaly degree of the OD pairs is shown in Fig. 10. Most OD pairs are with normal OD volume, and the station closure has a limited scope of influence on OD pairs. Finally, 553 anomalous OD pairs are obtained by Ensemble Algorithm I shown in Fig. 11. Note that if the color in the grid tends to be white, the volume of the OD pair is abnormal. Among these OD pairs, the anomalous OD pairs are mainly distributed between Line 8 and Line 15. Further, there are 160 anomalous OD pairs that need to transfer at the Olympic Park Station. These anomalous OD pairs should be paid attention to because the shortest paths of these OD pairs pass through the closed station. In addition, the stations with abnormal inbound and outbound volume have significantly more abnormal OD pairs than the other stations. For example, a station with abnormal inbound and outbound volume is  The above Ensemble Algorithm II is applied to detect the OD pairs with anomaly travel time from the whole OD pairs.And it is implemented with the same computer and software.The average running time is as follow: Average running time: 103.66s. The results of detection are shown in Fig.12. Note that if the color in the grid tends to be white, the travel time of the OD pairs is abnormal. It is found out that some stations as an origin station or a destination station are easy to be abnormal, The T-test detects 746 abnormal OD pairs, the Wilcoxon signed rank test detects 665 abnormal OD pairs, the Mann-Whitney rank sum test detects 921 abnormal OD pairs, and Ensemble Algorithm II detects 571 abnormal OD pairs. The origin stations of the OD pairs with anomalous travel time are mainly distributed on Line 8, while the destination stations with abnormal travel time are on Line 14. This is because Line 14 is only connected to Line 15. When the Olympic Park Station is closed, the passengers on Line 8 will transfer to Line 14, which can only be detoured from Line 13, resulting in unusual travel time.
Compared with the OD pairs with abnormal volume, OD pairs with abnormal travel time are significantly different. Only 78 OD pairs are the same in these abnormal detection results, that is, the time and space impact of station closure on subway is different. Among the 78 OD pairs, their origins and destinations are the stations with abnormal inbound and outbound volumes (i.e. North Beach Station and Anli Road Station). That is, the abnormal OD pairs are highly related with the abnormal stations.
In summary, abnormal OD pairs are not only determined by passenger flow volume in stations, AFC data should be mined from more dimensions for managers to understand the shift in passenger flow under station closure.

2) COMPARISON OF ENSEMBLE ALGORITHM II WITH THE INDIVIDUAL ALGORITHMS
The results of Ensemble Algorithm II are compared with the results of the individual algorithms are listed in TABLE 8, and the similarity rates are 0.67, 0.62, and 0.57, respectively.
As shown in TABLE 8, all anomaly detection algorithms have certain misjudgment. Specifically, the independent sample T test requires the travel time data to obey the normal distribution. For example, the OD pair from Beijing South Railway Station to Anli Road Station has multiple paths, the normal distribution may not be satisfied and the corresponding detection result is misjudged. The Wilcoxon signed rank test requires data pairing. However, the number of travel time data during normal station operation is not necessarily equal with that during station closure, resulting in certain degree of information loss and data variation. Thus, the OD pair from ShaoYaoJu Station to West Exit of Tsinghua East Road Station is misjudged. The Mann-Whitney test mixes data and processes the information in the form of ranks, losing some information which may lead to misjudgment (i.e., the OD pair from Xinjiekou Station to Wangjingdong Station). KNN algorithm identifies data fluctuations as anomalies(i.e., the OD pair from Beijing South Station to Anli Road Station).
The similarity rate of the anomaly detection results based on the travel time is significantly lower than that of the station anomaly recognition result, and the average similarity rate is 62.18%. In summary, Ensemble Algorithm II is applicable to detect anomalous OD pair with travel time, and the results of Ensemble Algorithm II are more accurate than single algorithms.

C. DISCUSSION
The following topics should be focused on in further studies: (1) A shift in passenger flow to neighboring stations. Due to station closure, the travel volume originating from or destining to a closed station is reduced to 0, but this part of the travel demand still exists. These passengers may change to another travel mode, and some passengers may choose to enter or leave the stations nearest to the closed station. Therefore, the traffic volume of nearby subway stations will be relatively changed, but how this change occurs needs further research.
(2) A shift in path flow of some OD pairs. If the closed station is a transfer station, the travel volumes along the paths with the closed station as O or D are affected. The travel volume transferring through the closed station is reduced to 0. At the same time, the traffic flow along the other paths between the OD pairs increases. Moreover, the change of path travel time due to the closed station will cause a shift in path flow of given OD pairs. There are two interactive steps to determine the final volume of path flow, so the mechanism of the shift in path flow should be further discussed.

V. CONCLUSION
This article develops an anomaly detection method to determine the range of spatial and temporal influence of a station closure on the passenger flow. First, Ensemble Algorithm I that integrates the Poisson distribution anomaly test, LOF algorithm, and Grubbs criterion is developed to evaluate anomalous passenger flow from the passenger volume perspective during station closure. Then, Ensemble Algorithm II based on independent sample t-test, Wilcoxon signed rank test, and Mann-Whitney rank sum test is proposed to identify the anomalous OD pairs from the anomalous travel time perspective during station closure. Finally, the proposed method is applied to a case study of the Beijing subway network to evaluate the accuracy and applicability of the method. The results show that: compared with existing anomaly recognition algorithms, Ensemble Algorithm I and II are robust and have less misjudgment.
In practice, the proposed method can provide abundant passenger flow information to subway managers: 1) the stations with abnormal inbound or outbound volume contributes to making passenger flow control strategies and train operation adjustment strategies (i.e., short turning) under overcrowding [1], [2]; 2) The OD pairs with abnormal volume contributes to adjusting train operation on certain lines to quickly satisfy the passenger demand; 3) the OD pairs with abnormal travel time contributes to exactly guiding passengers to optimize their travel routes.Besides,appropriate sub classifiers can be selected to solve different anomaly recognition problems.It can obtain more accurate classification results and optimize the performance of the algorithm.
The proposed method only considers the difference of total passenger flow during station closure and normal time.It does not consider the change of passenger flow pattern.In the future, more data such as land use information of stations and passenger individual characteristics can be combined to further quantify the impact of the station closure. In addition, as the detection of inbound, outbound, passenger flow and travel time are independent of each other.
YUHANG WU received the B.S. degree in statistics from the Wuhan University of Technology, Wuhan, China, in 2019. He is currently pursuing the master's degree in applied statistics with Wuhan University, Wuhan. His current research interests include machine learning, data mining, and survival analysis. He was a Visiting Scholar with the University of Wisconsin-Madison, USA, from 2016 to 2017. He is currently an Associate Professor with the State Key Laboratory of Rail Traffic Control and Safety, Beijing Jiaotong University. His current research interests include behavioral modeling, capacity analysis of subway stations, passenger flow control at crowding stations, and intelligent transportation systems. VOLUME 8, 2020