A method for predicting short-term passenger flow in rail transit based on BP neural network

Extract characteristic factors through cluster analysis and passenger flow periodic analysis, optimize the initial weights and thresholds of BP neural network, combine genetic algorithm and random forest algorithm to improve BP neural network, and solve the problem of BP neural network in rail transit short-term passenger flow prediction. Local optimal problems improve prediction accuracy and monitoring capabilities.

CN114117903BActive Publication Date: 2024-10-01HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111387081.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2024-10-01
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

BP neural network is prone to fall into local optimality in short-term rail transit passenger flow prediction, resulting in a decrease in the accuracy of prediction results.

Method used

Extract characteristic factors through cluster analysis and passenger flow periodic analysis, optimize the initial weights and thresholds of the BP neural network, and combine the genetic algorithm and random forest algorithm to improve the parameters and training algorithm of the BP neural network to avoid local optimal problems.

Benefits of technology

It improves rail transit passenger flow monitoring capabilities, provides more accurate short-term predictions and pre-evaluations, and enhances the effect of passenger flow control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114117903B_ABST
    Figure CN114117903B_ABST
Patent Text Reader

Abstract

The invention discloses a method for predicting short-term passenger flow of rail transit based on a BP neural network, which specifically comprises the following steps: preprocessing original data; calculating the dissimilarity of preprocessed data by calculating the distance between different date types; clustering according to the calculated dissimilarity, merging the two types of segmentation with the smallest distance until all the segmentation are merged into one segmentation; drawing a clustering pedigree diagram and performing clustering analysis; passenger flow periodicity analysis, passenger flow time characteristic periodicity analysis; passenger flow space characteristic periodicity analysis; passenger flow space-time characteristic periodicity analysis; characteristic factor extraction according to the results of clustering analysis and passenger flow periodicity analysis; selecting BP neural network parameters and related functions, and determining the initial weight and threshold of the BP neural network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data statistics, and in particular to a method for predicting short-term passenger flow of rail transit based on a BP neural network. Background Art

[0002] BP neural network improved based on genetic algorithm. The BP neural network model is a multi-layer feedforward neural network model based on the error back propagation algorithm. The input signal passes through the input layer, hidden layer and output layer of the BP neural network structure in turn, is processed in the hidden layer, and finally output by the output layer. This process is the forward transmission of the signal. When the actual output of the output layer does not match the expected output, the error is reversely transmitted. In the process of reverse transmission of the error, a certain method is adopted to amortize the total error between the actual output and the expected output to each layer of neurons. The neurons accept the amortized error, and based on this, the weights and thresholds are corrected to reduce the error of the next signal transmission result. After multiple iterations, the error finally converges, the model training is completed, and the obtained weights and thresholds can be used for data prediction.

[0003] When using the BP network model, the model often falls into a local optimum, and the accuracy of the model prediction results will be greatly reduced. Summary of the invention

[0004] The purpose of the present invention is to remedy the defects of the prior art and provide a method for predicting short-term passenger flow in rail transit based on BP neural network.

[0005] The present invention is achieved through the following technical solutions:

[0006] A method for predicting short-term passenger flow of rail transit based on BP neural network specifically comprises the following steps:

[0007] (1) Cluster analysis

[0008] (1.1) Preprocess the raw data;

[0009] (1.2) Calculate the dissimilarity of the preprocessed data by calculating the distance between different date types;

[0010] (1.3) Clustering is performed based on the calculated dissimilarity, and the two segments with the smallest distance are merged until all the segments are merged into one segment;

[0011] (1.4) Draw a cluster pedigree diagram and conduct cluster analysis;

[0012] (2) Analysis of passenger flow periodicity

[0013] (2.1) Periodic analysis of passenger flow time characteristics;

[0014] (2.2) Periodic analysis of passenger flow spatial characteristics;

[0015] (2.3) Periodic analysis of temporal and spatial characteristics of passenger flow;

[0016] (3) Extract characteristic factors based on the results of cluster analysis and passenger flow periodicity analysis;

[0017] (4) Select BP neural network parameters and related functions, and determine the initial weights and thresholds of the BP neural network.

[0018] Cluster analysis is defined as follows: In data space A, data set X consists of many data points, data point x i =(x i1 ,x i2 ,······,x id )∈A,x i Each feature (or dimension) x ij It can be an enumeration type or a numeric type. ij Represents the short-term passenger flow every 5 minutes during the full-day operation period of different date types. If there are N objects x in the dataset X i , then the data set is equivalent to an N*d matrix. The purpose of clustering is to split the data set X into k partitions C m (m=1,······,k), there may be some objects that do not belong to any segmentation, which constitutes the noise segmentation C k+1 .

[0019] X=C1∪C2∪···∪Ck+1

[0020]

[0021] These partitions constitute the results of cluster analysis.

[0022] The raw data described in step (1.1) is preprocessed, specifically, the raw data passenger flow on different working days is standardized:

[0023]

[0024]

[0025]

[0026] In the formula, S j is the sample standard deviation, and x is the characteristic point of the data set.

[0027] The dissimilarity calculation of the preprocessed data described in step (1.2) is as follows:

[0028] The Euclidean distance is used as the quantitative indicator of dissimilarity:

[0029] The dissimilarity between objects is usually expressed as the distance between vectors, i.e., d(x i ,x j ), x is the feature point of the data set.

[0030] The passenger flow periodicity analysis described in step (2) is specifically as follows:

[0031] (2.1) Analysis of the periodicity of passenger flow time characteristics

[0032] A one-dimensional time series is used to describe the inbound / outbound passenger flow of a station, and the distribution of inbound / outbound passenger flow of each station in a day is divided into five types: single peak type, double peak type, full peak type, convex peak type and no peak type;

[0033] Single-peak distribution means that a station has one entry peak and one exit peak during the operation time of a day;

[0034] The bimodal distribution refers to the morning peak of urban rail transit passenger flow between 7:00 and 9:00 in the morning due to commuting and going to school, and the evening peak of urban rail transit passenger flow between 17:00 and 19:00 in the evening due to getting off work and school. The passenger flow in other periods does not change much, which is a flat peak.

[0035] The full peak distribution has no distinct passenger flow trough, and the passenger flow is large in every period of the day;

[0036] The passenger flow distribution of the non-peak distribution has no obvious peak. As the surrounding environment is not attractive enough to the passenger flow, the passenger flow in and out of the station is relatively small throughout the day.

[0037] The convex peak distribution appears near the venues where large-scale events are held;

[0038] (2.2) Periodic analysis of passenger flow spatial characteristics

[0039] Analyze the passenger flow of urban rail transit from a spatial dimension, and analyze the passenger flow of different stations or sections in the same time period; station passenger flow refers to the sum of passenger flow of getting on and off and transfer passengers at a station within a unit time; use an n-dimensional sequence to describe the passenger flow of n stations in a certain period of time;

[0040] Sectional passenger flow refers to the passenger flow of each section of the urban rail transit line in a unit time. According to the running direction of the train, it is divided into upward section passenger flow and downward section passenger flow.

[0041] (2.3) Periodic analysis of temporal and spatial characteristics of passenger flow

[0042] Passenger flow data changes simultaneously in both time and space dimensions and presents certain regularity. The temporal and spatial characteristics of passenger flow are demonstrated by constructing an independent urban rail transit line with n stations. The short-term passenger flow prediction is based on the collected passenger flow data, analyzing the changing rules and the connections within the passenger flow data, and calculating the inbound and outbound passenger flows of each station in the next one or more time periods, that is, predicting the passenger flow data of the (m+Δt)th column based on the data of the first m columns of the matrix F, where 1≤m≤h, and h is the number of columns of the matrix.

[0043] Due to the completely closed nature of urban rail transit, the AFC system can collect complete travel data. Each passenger has a pair of travel origin and destination, commonly known as an OD (Origin-Destination) pair. Under normal circumstances, passengers leaving a station must have entered the rail transit system from other stations before that. That is, from S to S within the tth time period, n The passenger flow out of the station must be composed of part of the passenger flow in other stations in the previous period, and this period is mainly determined by the running time of the train between the two stations. This conclusion can be simplified as n The passenger flow out of the station will be the same as that of the T i During the time period S j The station is related to the passenger flow entering the station, where 1≤j≤n-1. j The expression of is shown below.

[0044]

[0045] Obviously, later than T j S j The passenger flow entering the station cannot enter from S in the tth time period. n By combining the historical entry / exit passenger flow data of each station, we can obtain a [S j ×(h+1)], as shown in the following formula.

[0046]

[0047] Each row of the matrix F reflects the passenger flow characteristics of each station in the time dimension. Each column of the matrix F represents the passenger flow characteristics of different stations at the same time in the spatial dimension. It can be seen that the above formula can simultaneously reflect the temporal and spatial characteristics of urban rail transit passenger flow.

[0048] Short-term passenger flow forecasting for urban rail transit refers to studying the changing patterns and internal connections of the collected passenger flow data to estimate the inbound and outbound passenger flow of each station in the next one or more time periods. That is, based on the partial data of the first m columns of the matrix F, the passenger flow data of the (m+Δt)th column is predicted, where 1≤m≤h, and Δt is the time interval, usually 1, 2, or 3.

[0049] The characteristic factor extraction according to the results of cluster analysis and passenger flow periodicity analysis in step (3) is as follows:

[0050] By clustering the stations, the stations are divided into 5 categories. The passenger flow of a station in each period is selected as the sample set of BP neural network in each category, and the data sets of the 5 categories are used as the input data of the BP network model.

[0051] First, according to the time proximity feature, the passenger flow of the three time periods before the current moment is selected as the influencing factors. Through the periodic analysis of passenger flow, it is concluded that there is periodicity between days and weeks, so the passenger flow of the same time period of the day before the current time period and the passenger flow of the same time period of the week before the current time period are selected as influencing factors; considering that the passenger flow of the same time period of the previous day is also affected by the passenger flow of the previous time period, this passenger flow is also included in the influencing factor set, and the passenger flow of the previous time period of the same time period of the previous week is also included in the influencing factor set; in addition, holidays often have more passenger flow than non-holidays, and the passenger flow size and passenger flow time distribution characteristics between weekdays and weekends are different, so which of the current day is a weekday, weekend, or holiday is added as an influencing factor;

[0052] After selecting the influencing factors, the importance of the influencing factors to the results is ranked by the random forest algorithm, the factors with small importance are removed, and the factors with large importance are selected as the final influencing factor set of the BP network model.

[0053] The BP neural network parameters and related functions are selected, including: determining the number of hidden layers, the number of hidden nodes, the transfer function, the learning rate, the number of iterations and the selection of the gradient descent algorithm.

[0054] The number of hidden layers is one; the number of hidden nodes is 24; the transfer function is a Sigmoid function; the learning rate is 0.01; the number of iterations is 60,000; and the gradient descent algorithm is the Adma algorithm.

[0055] The advantages of the present invention are:

[0056] The present invention uses the BP neural network model and the OD matrix to achieve short-term prediction of rail transit passenger flow data; based on the performance of the traditional BP neural network, the present invention improves the transfer function and training algorithm of the network. The present invention uses a genetic algorithm to optimize the initial weights and thresholds of the neural network to avoid the model falling into a local optimum, in which case the accuracy of the model prediction results will be greatly reduced. The present invention improves the ability to monitor rail transit passenger flow, provides early evaluation and prediction, and measures for precise control of passenger flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 This is the clustering pedigree diagram of the present invention.

[0058] Figure 2 This is an independent urban rail transit line with n stations according to the present invention. DETAILED DESCRIPTION

[0059] Basic steps of bp neural network algorithm:

[0060] (1) The weight W in the BP neural network ij Assign a random small non-zero real number, set the initial learning rate μ and momentum factor α;

[0061] (2) inputting the first set of sample pairs among the N sets of input and output sample pairs;

[0062] (3) According to formula (1), the actual output value O of each layer element in the BP neural network is calculated, k is the kth layer neural network, m is the mth layer neural network, i is the i-th element of a certain layer, and j is the j-th element of a certain layer;

[0063]

[0064] in, is the output of the i-th element of the k-th layer; is the input sum of the i-th element in the k-th layer; is the connection weight of the i element in the k-1th layer to the j element in the kth layer;

[0065] (4) Adjust the connection weights of each layer according to formula (2)

[0066]

[0067] When k = m,

[0068] When k<m,

[0069] In the formula is the result of the output layer k, y i is the output of the i-th neuron, and t is time t.

[0070] (5) Go to step (2), input the second pair of samples, and cycle through N groups of sample pairs until W ij Stop when it becomes stable or reaches the target prediction error.

[0071] A method for predicting short-term passenger flow of rail transit based on BP neural network specifically comprises the following steps:

[0072] 1. Cluster analysis

[0073] Cluster analysis is defined as follows: In data space A, data set X consists of many data points, data point x i =(x i1 ,x i2 ,······,x id )∈A,x i Each feature (or dimension) x ij It can be an enumeration type or a numeric type. ij Represents the short-term passenger flow every 5 minutes during the full-day operation period of different date types. If there are N objects x in the dataset X i , then the data set is equivalent to an N*d matrix. The purpose of clustering is to split the data set X into k partitions C m (m=1,······,k), there may be some objects that do not belong to any segmentation, which constitutes the noise segmentation C k+1 .

[0074] 2.X=C1∪C2∪···∪Ck+1

[0075] 3.

[0076] These partitions constitute the results of cluster analysis.

[0077] The existing training data is: the passenger flow data of rail transit 1, 2, 3, 4, 5, 10, 11, and 12 in 2019-2020, and the daily summary of the inbound and outbound passenger flow data at each station of the 8 lines. Before making a short-term passenger flow forecast, it is necessary to divide the date type, and then make a short-term passenger flow forecast according to the divided date type. The present invention uses a cluster analysis method to perform cluster analysis on the rail transit passenger flow of different date types at each moment.

[0078] Clustering is to divide data samples into different clusters or classes according to a specific standard (usually a distance criterion). The result of clustering is that the similarities between samples within a class are as large as possible, and the differences between samples between classes are as large as possible. That is, after clustering analysis, data of different categories are completely separated, and data of the same category are clustered together.

[0079] Cluster analysis is defined as follows: In data space A, data set X consists of many data points, data point x i =(x i1 ,x i2 ,······,x id )∈A,x i Each feature (or dimension) x ij It can be an enumeration type or a numerical type. ij Represents the short-term passenger flow every 5 minutes during the full-day operation period of different date types. If there are N objects x in the dataset X i , then the data set is equivalent to an N*d matrix. The purpose of clustering is to split the data set X into k partitions C m (m=1,······,k), there may be some objects that do not belong to any segmentation, which constitutes the noise segmentation C k+1 The cluster analysis satisfies the following formula:

[0080] X=C 1 ∪C 2 ∪···∪C k+1 (5)

[0081]

[0082] These partitions constitute the results of cluster analysis.

[0083] There are many methods for cluster analysis. The method selected in this invention is based on the distance between the defined segments. The specific method is to first divide the data of each working day into its own segment, then merge the two segments with the smallest distance, and then repeat the above process until all the segments are merged into one segment. The process can be made into a cluster pedigree diagram. The specific steps are as follows:

[0084] (1) Clustering data preprocessing

[0085] Before cluster analysis, the existing raw data is preprocessed. This is mainly because when extracting samples to measure data, different variables have different dimensions and may have different units of magnitude. In order to compare and segment the data together, it is necessary to preprocess the raw data. The standardization transformation method is a commonly used data preprocessing method. Standardize the raw (6-digit) data passenger flow on different working days:

[0086]

[0087]

[0088]

[0089] (2) Calculation of dissimilarity

[0090] In order to measure the similarity or difference between passenger flow on different types of dates, that is, dissimilarity, it is necessary to define a cluster statistic as a quantitative indicator of cluster analysis, and then complete quantitative cluster analysis based on this quantitative indicator. The method for solving dissimilarity is usually to calculate the distance between different date types. This paper uses Euclidean distance as the quantitative indicator of dissimilarity:

[0091]

[0092] (3) Clustering

[0093] Merge the two types of segmentation with the smallest distance, and repeat the above process after merging until all segmentation are merged into one segmentation.

[0094] (4) Draw a cluster pedigree diagram

[0095] According to the steps of the clustering process, a passenger flow distribution is selected as an example for clustering analysis. Figure 1 shown.

[0096] 4. Passenger flow periodicity analysis

[0097] The passenger flow in and out of each station changes dynamically. Analyzing the temporal and spatial characteristics and periodic change patterns of the actual passenger flow of urban rail transit will help the management department to adjust the departure intervals and route plans, arrange platform personnel to organize passenger flow, and thus maximize the passenger capacity of the urban rail transit network.

[0098] ⑴ Periodic analysis of passenger flow time characteristics

[0099] With the widespread application of the AFC system, the urban rail transit operation department can collect passenger flow data from each independent AFC device terminal every 15 minutes. From the time dimension, the present invention uses a one-dimensional time series to describe the inbound / outbound passenger flow of a station.

[0100] Affected by the geographical location and type of the station, the distribution of passenger flow in and out of each station in a day can be mainly divided into five types: single peak, double peak, full peak, convex peak and no peak. Single peak distribution means that the station has one entry peak and one exit peak during the operation time of a day. Double peak means that the urban rail transit passenger flow forms a morning peak from 7 to 9 in the morning due to commuting and going to school, and forms an evening peak from 17 to 19 in the evening due to getting off work and school. The passenger flow does not change much in other time periods, which belongs to the passenger flow flat peak.

[0101] The passenger flow distribution of the full-peak type of station is characterized by no distinct passenger flow troughs, and the passenger flow is large in every period of the day. Such stations are generally located in highly developed areas or areas with a high concentration of public facilities; the non-peak type of passenger flow distribution has no obvious peaks, mostly due to the lack of attraction of the surrounding environment to passenger flow, resulting in a small passenger flow in and out of the station throughout the day, but with the continuous prosperity of the city, the passenger flow of these stations will gradually increase. The convex peak type usually appears when large-scale events are held, such as sports events, concerts, etc., or when the weather changes suddenly. When a large-scale event is closed, the station closer to the event location will have a sharp increase in inbound passenger flow. After a certain period of time, the outbound passenger flow of other hub stations may have a sharp increase.

[0102] ⑵ Periodic analysis of passenger flow spatial characteristics

[0103] The passenger flow of urban rail transit is analyzed from the spatial dimension to study the passenger flow of different stations or sections in the same time period. Station passenger flow refers to the sum of the passenger flow of getting on and off and the passenger flow of transfer passengers at the station within a unit time (usually peak hour or day as the unit time). The present invention uses an n-dimensional sequence to describe the passenger flow of n stations within a certain period of time.

[0104] Cross-sectional passenger flow refers to the passenger flow through each section of an urban rail transit line within a unit time (usually peak hours are used as the study period). According to the different running directions of the trains, it can be divided into upward cross-sectional passenger flow and downward cross-sectional passenger flow.

[0105] (3) Periodic analysis of temporal and spatial characteristics of passenger flow

[0106] Urban rail transit travel data is a typical spatiotemporal data. Passenger flow data changes simultaneously in both time and space dimensions and shows certain regularity. The outbound passenger flow of a station is closely related to the inbound and outbound passenger flow of its related stations. Therefore, it is difficult to accurately describe its regularity using only the historical passenger flow data of one station. In order to more clearly display the spatiotemporal characteristics of passenger flow, the present invention constructs an independent urban rail transit line with n stations, such as Figure 2 shown.

[0107] Due to the completely closed nature of urban rail transit, the AFC system can collect complete travel data. Each passenger has a pair of travel origin and destination, commonly known as an OD (Origin-Destination) pair. Under normal circumstances, passengers leaving a station must have entered the rail transit system from other stations before that. That is, from S to S within the tth time period, n The passenger flow out of the station must be composed of part of the passenger flow in other stations in the previous period, and this period is mainly determined by the running time of the train between the two stations. This conclusion can be simplified as nThe passenger flow out of the station will be the same as that of the T i During the time period S j The station is related to the passenger flow entering the station, where 1≤j≤n-1. j The expression of is shown below.

[0108]

[0109] Obviously, later than T j S j The passenger flow entering the station cannot enter from S in the tth time period. n By combining the historical entry / exit passenger flow data of each station, we can obtain a [S j ×(h+1)], as shown in the following formula.

[0110]

[0111] Each row of the matrix F reflects the passenger flow characteristics of each station in the time dimension. Each column of the matrix F represents the passenger flow characteristics of different stations at the same time in the spatial dimension. It can be seen that the above formula can simultaneously reflect the temporal and spatial characteristics of urban rail transit passenger flow.

[0112] Short-term passenger flow forecasting for urban rail transit refers to studying the changing patterns and internal connections of the collected passenger flow data to estimate the inbound and outbound passenger flow of each station in the next one or more time periods. That is, based on the partial data of the first m columns of the matrix F, the passenger flow data of the (m+△t)th column is predicted, where 1≤m≤h, △t is the time interval, usually 1, 2, 3.

[0113] 5. Feature factor extraction

[0114] By clustering the stations, the stations are divided into 5 categories. The passenger flow of each station in each period is selected as the sample set of the BP neural network in each category, and the data sets of the 5 categories are used as the input data of the BP network model. This step is to make the trained model more universal and to have more accurate prediction results for different data types.

[0115] This prediction model mainly considers the influence of time characteristic factors. First, according to the time proximity feature, that is, the passenger flow to be predicted has a strong connection with the passenger flow in the adjacent time periods, we select the passenger flow in the three time periods before the current moment as the influencing factors. By analyzing the periodic characteristics of passenger flow, it is concluded that there is periodicity between days and weeks, so the passenger flow in the same time period of the day before the current time period and the passenger flow in the same time period of the week before the current time period are selected as influencing factors. Considering that the passenger flow in the same time period of the previous day is also affected by the passenger flow in the previous time period, this passenger flow is also included in the influencing factor set. Similarly, the previous time period of the same time period of the previous week is treated in the same way. In the process of analyzing the data, it is found that holidays often have more passenger flow than non-holidays, and the passenger flow size and passenger flow time distribution characteristics between weekdays and weekends are different. Therefore, we add which of the current day is a weekday, weekend, or holiday as an influencing factor.

[0116] Table 1 Selection of impact factors

[0117]

[0118]

[0119] After selecting factors through experience and data analysis, the RF (random forest) algorithm is used to sort the importance of factors to the results, remove factors with low importance, and select factors with high importance as the final influencing factor set of the BP network model. Finally, the influencing factor set we selected is {X i-1 , X i-2 , X i-3 , X i -1,X i -7, X_}

[0120] 6. Neural network parameters and related function selection

[0121] The parameters of the BP neural network model affect the accuracy of the prediction model, and the selection of parameters needs to be carefully considered.

[0122] 1) Determination of the number of hidden layers: A three-layer BP neural network can complete the data prediction. As the number of hidden layers increases, the prediction accuracy will be improved, but the corresponding BP neural network training time will also increase greatly. After comprehensive consideration, the number of hidden layers of the prediction model of the present invention is selected as one layer.

[0123] 2) Determination of the number of hidden nodes: In previous studies, the number of hidden nodes is generally considered to be related to the dimension of the input vector and the dimension of the output vector. Different experts have proposed different methods for determining the number of hidden nodes. The prediction model of the present invention selects the 2n+1 method to roughly determine the number of hidden layer nodes. In subsequent multiple experiments, the number of nodes is continuously changed, and finally it is concluded that 24 hidden nodes can effectively improve the model accuracy.

[0124] 3) Determination of transfer function: The prediction model of the present invention uses a Sigmoid function as the transfer function of the BP network model. The Sigmoid function is smooth and easy to derive. Since the error is transferred in reverse, the distribution of the total error on each weight and threshold is obtained by derivation.

[0125] 4) Determination of learning rate: The learning rate determines the amount of change in weights and thresholds during training. If it is too large or too small, it will have a negative impact on the prediction results. If it is too large, the training will be oscillating, and if it is too small, the convergence speed will be slow. Previous studies generally selected 0.01-0.8. Through continuous adjustment of the learning rate and comparison of results, it is proposed to select 0.01 as the learning rate of the BP network model.

[0126] 5) Determination of the number of iterations: First, based on the experience of previous experiments and similar comparisons between other excellent prediction models and the prediction model of the present invention, the number of iterations was roughly determined to range from 10,000 to 100,000. In multiple experiments, the number of iterations was continuously adjusted, and finally 60,000 was obtained as the optimal number of iterations for this prediction model.

[0127] 6) Gradient descent algorithm selection: After consulting multiple sources and comparing the pros and cons of various gradient descent functions, this prediction model selects the Adam algorithm as the gradient descent algorithm. The Adam algorithm has the advantages of efficient computing power, less memory required, suitable for solving optimization problems involving large-scale data and parameters, suitable for non-stationary targets, and basically only requires a very small amount of parameter adjustment. Since the present invention is aimed at the prediction of subway passenger flow, the amount of data is large, so the algorithm suitable for processing large-scale data is suitable for this prediction model, so Adam becomes the best choice for this prediction model.

Claims

1. A method for predicting short-term passenger flow in rail transit based on BP neural network, characterized in that: The specific steps include: (1) Cluster analysis (1.1) Preprocess the raw data; (1.2) Calculate the dissimilarity of the preprocessed data by calculating the distance between different date types; (1.3) Clustering is performed based on the calculated dissimilarity, and the two segments with the smallest distance are merged until all the segments are merged into one segment; (1.4) Draw a cluster pedigree diagram and conduct cluster analysis; (2) Analysis of passenger flow periodicity (2.1) Periodic analysis of passenger flow time characteristics; (2.2) Periodic analysis of passenger flow spatial characteristics; (2.3) Periodic analysis of temporal and spatial characteristics of passenger flow; (3) Extract characteristic factors based on the results of cluster analysis and passenger flow periodicity analysis; (4) Selecting BP neural network parameters and related functions, and determining the initial weights and thresholds of the BP neural network; The passenger flow periodicity analysis described in step (2) is specifically as follows: (2.1) Analysis of the periodicity of passenger flow time characteristics A one-dimensional time series is used to describe the inbound / outbound passenger flow of a station, and the distribution of inbound / outbound passenger flow of each station in a day is divided into five types: single peak type, double peak type, full peak type, convex peak type and no peak type; Single-peak distribution means that a station has one entry peak and one exit peak during the operation time of a day; The bimodal distribution refers to the morning peak of urban rail transit passenger flow between 7:00 and 9:00 in the morning due to commuting and going to school, and the evening peak of urban rail transit passenger flow between 17:00 and 19:00 in the evening due to getting off work and school. The passenger flow in other periods does not change much, which is a flat peak. The full peak distribution has no distinct passenger flow trough, and the passenger flow is large in every period of the day; The passenger flow distribution of the non-peak distribution has no obvious peak. As the surrounding environment is not attractive enough to the passenger flow, the passenger flow in and out of the station is relatively small throughout the day. The convex peak distribution appears near the venues where large-scale events are held; (2.2) Periodic analysis of passenger flow spatial characteristics Analyze the passenger flow of urban rail transit from a spatial dimension, and analyze the passenger flow of different stations or sections in the same time period; station passenger flow refers to the sum of passenger flow of getting on and off and transfer passengers at a station within a unit time; use an n-dimensional sequence to describe the passenger flow of n stations in a certain period of time; Sectional passenger flow refers to the passenger flow of each section of the urban rail transit line in a unit time. According to the running direction of the train, it is divided into upward section passenger flow and downward section passenger flow. (2.3) Periodic analysis of temporal and spatial characteristics of passenger flow Passenger flow data changes simultaneously in both time and space dimensions and presents certain regularity. The temporal and spatial characteristics of passenger flow are demonstrated by constructing an independent urban rail transit line with n stations. The short-term passenger flow prediction is based on the collected passenger flow data, analyzing the changing rules and the connections within the passenger flow data, and calculating the inbound and outbound passenger flows of each station in the next one or more time periods, that is, predicting the passenger flow data of the (m+△t)th column based on the data of the first m columns of the matrix F, where 1≤m≤h, △t is the time period interval, and the matrix F is a multidimensional passenger flow matrix obtained by combining the historical inbound / outbound passenger flow data of each station, and h is the number of columns of the matrix.

2. According to claim 1, a method for predicting short-term passenger flow of rail transit based on BP neural network is characterized in that: The raw data described in step (1.1) is preprocessed, specifically, the raw data passenger flow on different working days is standardized: Where S j is the sample standard deviation, and x is the characteristic point of the data set.

3. According to claim 2, a method for predicting short-term passenger flow of rail transit based on BP neural network is characterized in that: The dissimilarity calculation of the preprocessed data described in step (1.2) is as follows: The Euclidean distance is used as the quantitative indicator of dissimilarity: Where d(x i ,x j ) is the dissimilarity between objects, usually the distance between vectors.

4. According to claim 1, a method for predicting short-term passenger flow of rail transit based on BP neural network is characterized in that: Each passenger has a pair of travel origin and destination, namely OD pair; in the tth time period, from S n The passenger flow out of the station must be composed of part of the passenger flow in other stations in the previous period, and this period is determined by the running time of the train between the two stations, that is, the passenger flow from S to S in the tth time period. n The passenger flow out of the station will be the same as that of the T i During the time period S j The station is related to the passenger flow entering the station, where 1≤j≤n-1, T j The expression of is as follows: Later than T j S j The passenger flow entering the station cannot enter from S in the tth time period. n Station exits the rail transit system, and by combining the historical entry / exit passenger flow data of each station, a [S j ×(h+1)], as shown below: Each row of the matrix F reflects the passenger flow characteristics of each station in the time dimension, and each column of the matrix F represents the passenger flow characteristics of different stations at the same time from the spatial dimension. It can be seen that the above formula reflects the temporal and spatial characteristics of urban rail transit passenger flow at the same time.

5. According to claim 4, a method for predicting short-term passenger flow of rail transit based on BP neural network is characterized in that: The characteristic factor extraction according to the results of cluster analysis and passenger flow periodicity analysis in step (3) is as follows: By clustering the stations, the stations are divided into 5 categories. The passenger flow of a station in each period is selected as the sample set of BP neural network in each category, and the data sets of the 5 categories are used as the input data of the BP network model. First, according to the time proximity feature, the passenger flow of the three time periods before the current moment is selected as the influencing factors. Through the periodic analysis of passenger flow, it is found that there is periodicity between days and weeks, so the passenger flow of the same time period of the day before the current time period and the passenger flow of the same time period of the week before the current time period are selected as influencing factors; considering that the passenger flow of the same time period of the previous day is also affected by the passenger flow of the previous time period, this passenger flow is also included in the influencing factor set, and the passenger flow of the previous time period of the same time period of the previous week is also included in the influencing factor set; in addition, holidays often have more passenger flow than non-holidays, and the passenger flow size and passenger flow time distribution characteristics between weekdays and weekends are different, so which of the current day is a weekday, weekend, or holiday is added as an influencing factor; After selecting the influencing factors, the importance of the influencing factors to the results is ranked by the random forest algorithm, the factors with small importance are removed, and the factors with large importance are selected as the final influencing factor set of the BP network model.

6. A method for predicting short-term passenger flow of rail transit based on BP neural network according to claim 5, characterized in that: The BP neural network parameters and related functions are selected, including: determining the number of hidden layers, the number of hidden nodes, the transfer function, the learning rate, the number of iterations and the selection of the gradient descent algorithm.

7. The short-term passenger flow prediction method based on BP neural network according to claim 6 is characterized by: The number of hidden layers is one; the number of hidden nodes is 24; the transfer function is a Sigmoid function; the learning rate is 0.01; the number of iterations is 60,000; and the gradient descent algorithm is the Adma algorithm.