Bus passenger flow prediction method combining frequency domain and spatial domain characteristics
Through the combination of STL decomposition, frequency domain attention mechanism and multi-graph convolutional neural network, multi-scale features are extracted, and the problem of unutilized frequency domain information and spatial relationships in the existing technology is solved, and more accurate and flexible bus passenger flow forecast.
Patent Information
- Application Number
- CN202411119308.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
AI Technical Summary
The existing bus passenger flow prediction methods fail to make full use of the frequency domain information in the bus travel time domain signal sequence and the dynamic and static spatial relationship between stations, resulting in insufficient prediction performance and lack of flexibility and accuracy.
The seasonal trend decomposition algorithm (STL) of local weighted regression is used to decompose the time domain signal sequence into seasonal and trend components. Combined with the frequency domain attention mechanism and multi-graph convolutional neural network, multi-scale spatio-temporal frequency characteristics are extracted to carry out bus passenger flow predictions.
Through decomposition and feature extraction, the accuracy and flexibility of bus passenger flow prediction are improved, the time domain, frequency domain and airspace information are fully utilized, the identification ability of key stations in the bus network is enhanced, and the prediction performance is improved.
Smart Images

Figure CN119026951A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of public transport passenger flow prediction, and in particular to a public transport passenger flow prediction method combining frequency domain and space domain features. Background Art
[0002] Accurate prediction of bus travel time domain signal sequence is crucial for the planning, operation and management of bus systems. Through accurate prediction, bus companies, planning agencies and regulatory agencies can deeply analyze the dynamic changes of passenger flow and provide key data support for the layout of bus networks, the arrangement of timetables, the dispatch of vehicles and personnel. This prediction not only ensures the quality of bus services, but also has a far-reaching impact on alleviating traffic congestion and improving urban operation efficiency. Bus travel time domain signal sequence data has complex trends, seasonal characteristics, etc., and these data contain rich information. By effectively extracting and analyzing these data, the temporal and spatial frequency distribution of passenger flow can be revealed, and then its development trend can be scientifically predicted. This analysis is crucial for optimizing the bus system, meeting the travel needs of passengers, and improving the attractiveness and efficiency of bus services. When predicting bus passenger flow, it is necessary to comprehensively consider a variety of factors, including but not limited to the influence of land use types around bus stops and bus line network layout. By applying advanced data analysis techniques and models, the pattern of passenger flow changes can be captured more accurately, providing decision support for the continuous improvement of the bus system and the optimization of passenger services.
[0003] At present, in the field of bus travel time domain signal sequence prediction, the bus travel time domain signal sequence prediction method based on deep learning has failed to decompose the signal sequence according to the trend, season and other characteristics of the bus travel time domain sequence, and has failed to further extract signal features according to the characteristics of different components. Moreover, most of the existing prediction methods only use their time domain characteristics for analysis and prediction, and fail to fully explore and utilize the important frequency domain information contained in the time domain signal sequence and the hidden dynamic and static spatial relationships between stations. In reality, time series contain rich information in the time domain, frequency domain and spatial domain. Therefore, fully extracting the spatiotemporal frequency characteristics in the time series and automatically learning the spatiotemporal frequency characteristics of the time series through deep learning technology to improve the prediction performance are the key points and difficulties of current research.
[0004] At present, the existing bus passenger flow prediction methods are mostly based on the analysis of bus travel time domain signal series, which only extracts time domain features and fails to fully utilize the frequency characteristics of time series, which easily leads to overfitting or underfitting problems.
[0005] The bus travel time domain signal sequence has complex characteristics, such as trend, seasonality, periodicity and irregularity, etc. At present, the bus passenger flow prediction method in the prior art fails to decompose the bus travel time domain signal sequence into components based on the above characteristics, fails to capture the time-space frequency domain characteristics of different components respectively, and lacks prediction flexibility.
[0006] There are complex dynamic and static spatial correlations between stations in urban bus networks. At present, the existing bus passenger flow prediction methods fail to fully explore the various hidden dynamic and static spatial correlation characteristics between stations and fail to perfectly model the spatial correlation between stations. Summary of the invention
[0007] The embodiment of the present invention provides a method for predicting public transport passenger flow by combining frequency domain and spatial domain features, so as to achieve effective prediction of public transport passenger flow.
[0008] In order to achieve the above object, the present invention adopts the following technical scheme.
[0009] A bus passenger flow prediction method combining frequency domain and spatial domain features, comprising:
[0010] The bus travel time domain signal sequence is obtained based on the bus IC card swiping data, and the local weighted regression seasonal trend decomposition algorithm STL method is used to decompose the bus travel time domain signal sequence into seasonal component, trend component and residual component.
[0011] The frequency domain attention mechanism is used to process the seasonal component to obtain the seasonal component based on frequency domain attention, and the weight of each station in the bus travel time series is obtained, and the station to be used is selected according to the weight of each station;
[0012] The spatial features are obtained using a multi-graph convolutional neural network based on the trend component, the distance graph between sites, the site POI similarity graph, and the site passenger flow similarity graph;
[0013] Multi-scale seasonal features are obtained through dilated causal convolution processing based on the frequency-domain attention seasonal component, multi-scale trend features are obtained through dilated causal convolution processing based on the spatial features, and future passenger flow of each station is predicted based on the multi-scale seasonal features and the multi-scale trend features.
[0014] Preferably, the method of obtaining a bus travel time domain signal sequence according to bus IC card swiping data includes:
[0015] Collect bus IC card swiping data, pre-process the bus IC card swiping data, the pre-processing includes filling missing values, processing errors and removing duplicate data, dividing the pre-processed bus IC card swiping data into a certain time granularity, counting the passenger flow of each station in each continuous period, and obtaining the bus travel time domain signal sequence Xt ∈R L×d , where L is the total number of time steps of the sample, and d is the number of bus stops;
[0016] Using STL method to transform the bus travel time domain signal sequence X t ∈R L×d Decomposed into seasonal components S t , trend component T t and the residual component R t .
[0017] Preferably, the seasonal trend decomposition algorithm STL method using local weighted regression decomposes the bus travel time domain signal sequence into: seasonal component, trend component and residual component, including:
[0018] Bus travel time domain signal sequence X t The decomposition process includes two processes: inner loop and outer loop. The inner loop is nested in the outer loop. The inner loop uses seasonal smoothing and trend smoothing to update the seasonal component and trend component respectively. After each iteration of the inner loop, the outer loop starts to calculate the residual component. The decomposition formula of the STL method is:
[0019] X t =S t +T t +R t ,t=1,...,n
[0020] Among them, the input bus travel time domain signal sequence X t ∈R L×d , L is the total number of time steps of the sample, d is the number of bus stops, S t is the seasonal component, T t is the trend component, R t is the residual component;
[0021] The specific steps of the inner loop are: Assume and are the seasonal and trend components of the kth iteration of the inner loop, and The initial value of is 0, then and The calculation process of the k+1th step is as follows:
[0022] The original bus travel time domain signal sequence X t Subtract the trend component T t k , and obtain a new detrended sequence X t -T t k :
[0023] For the detrended series X t -Tt k Perform local weighted regression Loess smoothing to obtain a preliminary seasonal series
[0024] Use filter pairs Perform low-pass filtering and Loess processing on the low-pass filtering results to obtain the remaining trend sequence Detrending the smoothed cyclic subseries to obtain the seasonal component
[0025]
[0026] in, is the seasonal component obtained in the k+1th iteration, is the preliminary seasonal sequence in the k+1th iteration, is the residual trend sequence obtained after Loess processing in the k+1th iteration;
[0027] Remove the original sequence X t The seasonal component of the deseasonal series is calculated by Loess. Smooth and get the trend component
[0028] Deseasonalizing the series by Loess Smooth and get the trend component
[0029] 3) When one iteration of the inner loop ends, the outer loop starts, and the residual component is calculated using the seasonal component and trend component obtained in the inner loop
[0030]
[0031] Among them, is the residual component obtained in the k+1th iteration, X t is the original sequence, is the seasonal component obtained in the k+1th iteration, is the trend component obtained in the k+1th iteration.
[0032] Preferably, the seasonal component is processed by the frequency domain attention mechanism to obtain the seasonal component based on the frequency domain attention, and the weight of each station in the bus travel time series is obtained, and the station to be adopted is selected according to the weight of each station, including:
[0033] The seasonal component S t ∈R L×d After being mapped into a set of vectors Q,K,V∈R by the fully connected layer L×d , Q,K∈RL×d The vector is fast Fourier transformed in the variable direction to obtain the corresponding frequency domain sequence Q k ,K k ∈R L×(d / 2) ;
[0034] Q k ,K k =FFT(Q,K)
[0035]
[0036] x n It represents the value of the nth variable in each time step of the time series, N is the total length of the time series variable, k is the frequency index, and its value range is [0, N / 2];
[0037] Find K k The conjugate matrix of
[0038]
[0039] Q k and The energy term of the seasonal term is obtained by multiplication, and the autocorrelation function of the seasonal term variable direction is obtained by inverse Fourier transform of the energy term of the seasonal term, as shown in the following formula:
[0040]
[0041] Where F -1 represents inverse Fourier transform;
[0042] The autocorrelation function of the seasonal variable direction is passed through the softmax function to obtain the weight ω of each seasonal variable R ∈R L×d , the seasonal term variables represent each site, with weight ω R The size of reflects the importance of each site of the seasonal term. R Multiplying with the V vector obtains the seasonal component representation based on frequency domain attention
[0043] ω R =softmax(R Q,K )
[0044]
[0045] Among them, ω R is the weight of each variable of the seasonal term, i.e., the site, R Q,K is the autocorrelation function of the seasonal variable direction,
[0046] is the seasonal component representation based on frequency domain attention, V is the seasonal component S t The vector mapped by the fully connected layer.
[0047] Preferably, the spatial features are obtained by using a multi-graph convolutional neural network according to the trend component, the inter-station distance graph, the station POI similarity graph and the station passenger flow similarity graph, including:
[0048] The traffic network is represented as a weighted graph G = (V, E, A), where V and E represent nodes and edges between nodes, respectively. i represents a site, edge e ij Indicates site v i and v j The correlation between them, A∈R |V|×|V| Representing the adjacency matrix, constructing the inter-station distance graph, station point of interest POI similarity graph and station passenger flow similarity graph according to the multiple correlations of the stations;
[0049] The construction process of the site POI similarity graph includes:
[0050] The weight of the edge between two vertices in the site POI similarity graph is defined as the functional similarity, and the similarity of the vector POIs composed of the number of POIs of different categories at each site is calculated using the adjusted cosine similarity, P h,i and P h,j Respectively represent site v i and v j POIs vector, where H represents the number of POIs categories, Represents the average value of all sites in this type of POI, Th p To adjust A p The sparsity of
[0051]
[0052] Represents the site POI similarity graph A p Middle Site v i and v j The strength of the correlation
[0053] The process of constructing the inter-site distance map includes:
[0054] The adjacency matrix is constructed using the threshold Gaussian kernel to calculate the distance between sites i and j. The sites closer to the target site have a larger weight, dist(V i ,V j ) represents the distance between site i and site j, σ represents the standard deviation of the distance, Th d is the distance threshold set to control A d The sparsity of
[0055]
[0056] A represents the distance between sites d Middle Site v i and v j The process of constructing the site passenger flow similarity graph includes:
[0057] The similarity of passenger flow of N stations in k time slots is calculated based on the Pearson correlation coefficient:
[0058]
[0059]
[0060] A s represents the site passenger flow similarity graph, ω ij Indicates site v i and v j The strength of the correlation between
[0061] The adjacency matrix A of the station distance graph, station POI similarity graph and station passenger flow similarity graph is normalized to obtain The formula is as follows:
[0062]
[0063] Among them, I N is the identity matrix, To add the normalized adjacency matrix with self-loops, a softmax operation is added to the weighted matrix, and the multi-graph fusion process is expressed as:
[0064] W p ',W d ',W s '=softmax(W p ,W d ,W s )
[0065]
[0066] represents Hadamard multiplication, A F The result of multi-image fusion, the distance map between sites A d , Site POI similarity graph A p 、Site adjacency graph A s The results of normalization are W d ,W p ,W sCorresponding to each graph is the learnable weight matrix that adjusts the weight of each graph, W' p ,W' d ,W' s is the result of the weighted matrix after the softmax operation;
[0067] The graph convolution expression is:
[0068]
[0069] where σ is the activation function, is the feature matrix of each node, W l is the weight matrix of the lth layer;
[0070] The multi-graph convolution module combines the bus passenger flow trend component and the station distance graph A d , Site POI similarity graph A p 、Site adjacency graph A s The fusion results of these three different types of images are F As the input of the graph convolutional neural network, the multi-graph convolution module uses a single-layer graph convolutional network GCN to perform convolution operations to capture the relationship between each site. The expression of graph convolution is shown above to generate spatial features
[0071] Preferably, the method of obtaining a multi-scale seasonal feature by dilated causal convolution according to the seasonal component based on frequency domain attention, obtaining a multi-scale trend feature by dilated causal convolution according to the spatial feature, and predicting the future passenger flow of each station according to the multi-scale seasonal feature and the multi-scale trend feature includes:
[0072] Adopt dilated causal convolution as the seasonal component based on frequency domain attention and spatial characteristics We design multiple convolution kernels of different sizes, and set the convolution kernel size to be represented by k. The dilated causal convolution function for the input x is defined as:
[0073]
[0074] Among them, the input x is the seasonal component based on frequency domain attention in the multi-scale frequency domain module and the multi-scale spatial domain module. and spatial characteristics s represents the input feature information; d is the hole parameter, that is, the hole interval size; sd·i represents the positioning of historical position information;
[0075] Respectively and After dilated causal convolution, the multi-scale trend features χ t and seasonal characteristics χs
[0076] Combined with the above, the bus passenger flow is predicted. T =σ(W p (x s +χ t )+b p )
[0077] Among them, Y T ∈R T×d is the passenger flow of each station in the next T consecutive periods, W p is the learnable weight matrix, b p is the bias term, and σ is the activation function.
[0078] It can be seen from the technical solutions provided by the above-mentioned embodiments of the present invention that the present invention decomposes the bus travel time domain signal sequence based on the STL method, processes the seasonal term component based on the frequency domain attention, and screens the stations that have an important impact on the prediction; processes the trend term component based on the multi-graph convolutional neural network, fully explores the hidden dynamic and static spatial correlations between stations, and improves the prediction performance. Finally, multiple convolution kernels of different sizes are designed for the trend component and the seasonal component respectively, and the obtained multi-scale trend features and seasonal features are combined to perform multi-scale passenger flow prediction. The present invention processes the bus travel time domain signal sequence in the frequency domain, and uses the frequency domain attention mechanism to assign different weights to different bus stations, reflecting the importance of each station in the bus travel time domain signal sequence, so that the model can focus more on the key stations in the bus network.
[0079] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0081] Figure 1 A processing flow chart of a method for predicting public transport passenger flow by combining frequency domain and spatial domain features provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0082] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0083] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or coupling. The term "and / or" used herein includes any unit and all combinations of one or more associated listed items.
[0084] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0085] To facilitate understanding of the embodiments of the present invention, several specific embodiments will be further explained below with reference to the accompanying drawings, and each embodiment does not constitute a limitation on the embodiments of the present invention.
[0086] The embodiment of the present invention provides a bus passenger flow prediction method that combines frequency domain and spatial domain features, which solves the problems that the existing passenger flow prediction methods fail to capture the frequency domain characteristics of bus passenger flow and fail to fully utilize the dynamic and static spatial relationship of stations. At the same time, the bus passenger flow time domain signal sequence is decomposed and processed with seasonal trends, and multiple convolution kernels of different sizes are designed. Features are extracted for the two components respectively, and finally the multi-scale trend characteristics and seasonal characteristics are combined to realize the prediction of bus passenger flow.
[0087] The processing flow of a method for predicting public transportation passenger flow by combining frequency domain and spatial domain features provided by an embodiment of the present invention is as follows: Figure 1 As shown, the following steps are included:
[0088] Step S1: Decomposition of bus travel time domain signal sequence based on STL (Seasonal-Trend decomposition procedure based on Loess, seasonal trend decomposition algorithm of local weighted regression) method.
[0089] Collect bus IC card swiping data, pre-process the bus IC card swiping data, including filling missing values, processing errors and deleting duplicate data, etc., divide the data into a certain time granularity, count the passenger flow of each station in each continuous period, and obtain the bus travel time domain signal sequence X t ∈R L×d , where L is the total number of time steps of the sample and d is the number of bus stops.
[0090] Using STL method to transform the bus travel time domain signal sequence X t ∈R L×d Decomposed into three additive components, namely the seasonal component S t , trend component T t and the residual component R t .
[0091] Step S2: Use the frequency domain attention mechanism to process the seasonal component and obtain the weight of each station in the bus travel time series.
[0092] The frequency domain attention mechanism is used to process the seasonal component time series. The correlation function between the variables is calculated and the weights of the variables, that is, the weights of different bus stops, are obtained through the activation function. The weights are used to reflect the importance of each stop in the bus travel time series, and the stops that have an important impact on the model prediction are selected.
[0093] Step S3: According to the trend component, the distance graph between sites, the site POI similarity graph and the site passenger flow similarity graph, a multi-graph convolutional neural network is used to obtain spatial features.
[0094] Different correlations between stations have different effects on station passenger flow prediction. We construct a distance map between stations, a station POI similarity map, and a station passenger flow similarity map. We perform multi-graph weighted fusion on the three maps and then perform graph convolution to extract graph information containing additional spatial information. We use the bus passenger flow trend component and three different types of maps as inputs to the multi-graph convolutional neural network to generate spatial features.
[0095] Step S4: Extract multi-scale trend features and multi-scale seasonal features to perform multi-scale prediction of bus passenger flow.
[0096] Among them, in step S1, the specific implementation method of bus travel time domain signal sequence decomposition based on STL is:
[0097] 1) Bus travel time domain signal sequence X t The specific decomposition process of is mainly composed of two processes: inner loop and outer loop. The inner loop is nested in the outer loop. The inner loop uses seasonal smoothing and trend smoothing to update the seasonal component and trend component respectively. After each iteration of the inner loop, the outer loop starts to calculate the residual component. The decomposition formula of STL is:
[0098] X t =S t +T t +R t ,t=1,...,n
[0099] Among them, the input bus travel time domain signal sequence X t ∈R L×d , L is the total number of time steps of the sample, d is the number of bus stops, S t is the seasonal component, T t is the trend component, R t is the residual component.
[0100] 2) The specific steps of the inner loop are: Assume and are the seasonal and trend components of the kth iteration of the inner loop, and T t k The initial value of is 0. Then and The calculation process of the k+1th step is as follows:
[0101] First, remove the trend. t Subtract the trend component T t k , and obtain a new detrended sequence X t -T t k :
[0102] For the detrended series X t -T t k Perform Loess (locally weighted regression) smoothing to obtain the smoothed result, which is the preliminary seasonal series.
[0103] Use a filter pair consisting of three moving average methods Perform low-pass filtering. Then, perform Loess processing on the low-pass filtering result to obtain the remaining trend sequence Detrending the smoothed cyclic subseries to obtain the seasonal component
[0104]
[0105] in, is the seasonal component obtained in the k+1th iteration, is the preliminary seasonal sequence in the k+1th iteration, is the residual trend sequence obtained after Loess processing in the k+1th iteration.
[0106] Second, eliminate seasonality. Remove the original sequence X t Seasonal ingredients:
[0107]
[0108] Similarly, trend smoothing is performed. t Smooth and get the trend component
[0109] 3) When one iteration of the inner loop ends, the outer loop begins. Using the seasonal component and trend component obtained in the inner loop, the residual component can be calculated
[0110]
[0111] Among them, is the residual component obtained in the k+1th iteration, X t is the original sequence, is the seasonal component obtained in the k+1th iteration, is the trend component obtained in the k+1th iteration.
[0112] Among them, in step S2, the seasonal term component representation based on frequency domain attention is specifically as follows:
[0113] First, the seasonal component S t ∈R L×d After being mapped into a set of vectors Q,K,V∈R by the fully connected layer L×d ,
[0114] Q,K∈R L×d The vector is fast Fourier transformed in the variable direction to obtain the corresponding frequency domain sequence Q k ,K k ∈R L ×(d / 2) .
[0115] Q k ,K k =FFT(Q,K)
[0116]
[0117] x nIt represents the value of the nth variable of the time series at each time step, N is the total length of the time series variable, and k is the frequency index, which ranges from [0, N / 2].
[0118] Then find K k The conjugate matrix of
[0119]
[0120] Then, Q k and The energy term of the seasonal term is obtained by multiplication, and the autocorrelation function of the seasonal term variable direction is obtained by inverse Fourier transform of the energy term of the seasonal term, as shown in the following formula:
[0121]
[0122] Where F -1 represents the inverse Fourier transform.
[0123] Finally, the autocorrelation function of the seasonal term variable direction is passed through the softmax function to obtain the weights ω of each seasonal term variable, i.e., the site R ∈R L×d , with weight ω R The size of reflects the importance of each site of the seasonal term, and then ω R Multiplying with the V vector obtains the seasonal component representation based on frequency domain attention As shown below.
[0124] ω R =softmax(R Q,K )
[0125]
[0126] Among them, ω R is the weight of each variable of the seasonal term, i.e., the site, R Q,K is the autocorrelation function of the seasonal variable direction,
[0127] is the seasonal component representation based on frequency domain attention, V is the seasonal component S t The vector mapped by the fully connected layer.
[0128] The specific construction of the graph of the three association relationships between the stations in step S3 is as follows: the traffic network is represented as a weighted graph G = (V, E, A), where V and E represent nodes and edges between nodes respectively. i represents a site, edge e ij Indicates site v i and v j The correlation betweenij The weight represents v i With v j The greater the weight, the higher the correlation between the two sites. |V|×|V| Represents the adjacency matrix. Three related graphs are constructed for the multiple correlations of the sites, including the inter-site distance graph, the site POI (Point of Interest) similarity graph, and the site passenger flow similarity graph.
[0129] 1) Among them, the construction of the site POI similarity graph is as follows:
[0130] The weight of the edge between two vertices in the site POI similarity graph is defined as the functional similarity, and the similarity of the vector POIs composed of the number of POIs of different categories at each site is calculated using the adjusted cosine similarity. h,i and P h,j Respectively represent site v i and v j POIs vector, where H represents the number of POIs categories, Represents the average value of all sites in this type of POI, Th p To adjust A p The sparsity of .
[0131]
[0132]
[0133] 2) The construction of the distance map between sites is as follows:
[0134] The adjacency matrix is constructed using a threshold Gaussian kernel to calculate the distance between sites i and j. Sites closer to the target site have a larger weight. dist(V i ,V j ) represents the distance between site i and site j, σ represents the standard deviation of the distance, Th d The distance threshold is set to control A d The sparsity of .
[0135]
[0136] 3) Among them, the construction of the site passenger flow similarity graph is as follows:
[0137] The similarity of passenger flow of N stations in k time slots is calculated based on the Pearson correlation coefficient:
[0138]
[0139] The specific steps of performing weighted summation on the adjacency matrix of the site distance graph, the site POI similarity graph, and the site adjacency graph in step S3 to achieve multi-graph fusion are:
[0140] Since the value range of the adjacency matrix of the constructed graph may vary greatly, we first normalize the adjacency matrix A of each graph to obtain The formula is as follows:
[0141]
[0142] Among them, I N is the identity matrix. is a normalized adjacency matrix with self-loops added. In order to ensure that the fusion result after the weighted sum operation of each adjacency matrix remains normalized, a softmax operation is added to the weighted matrix, and the multi-graph fusion process can be expressed as:
[0143] W p ',W d ',W s '=softmax(W p ,W d ,W s )
[0144]
[0145] represents Hadamard multiplication, A F The result of multi-image fusion, the distance map between sites A d , Site POI similarity graph A p 、Site adjacency graph A s The results of normalization are W d ,W p ,W s Corresponding to each graph is the learnable weight matrix that adjusts the weight of each graph, W' p ,W' d ,W' s is the result of the weighted matrix after the softmax operation.
[0146] Among them, in step S3, based on the multi-graph fusion result, the graph convolution expression is:
[0147]
[0148] where σ is the activation function, is the feature matrix of each node, W l is the weight matrix of the lth layer. The multi-graph convolution module takes the bus passenger flow trend component and three different types of graphs as input to generate spatial features
[0149] The multi-scale trend feature and multi-scale seasonal feature extraction in step S4 are specifically as follows: using dilated causal convolution as the seasonal component based on frequency domain attention and spatial characteristics We design multiple convolution kernels of different sizes, and set the convolution kernel size to be represented by k. The dilated causal convolution function for the input x is defined as:
[0150]
[0151] Among them, the input x is the frequency domain feature in the multi-scale frequency domain module and the multi-scale spatial domain module respectively. and spatial characteristics s represents the input feature information; d is the hole parameter, that is, the hole interval size; sd·i represents the positioning of historical position information.
[0152] Respectively and After dilated causal convolution, the multi-scale trend features χ t and seasonal characteristics χ s
[0153] Combined with the above, the bus passenger flow is predicted. T =σ(W p (x s +χ t )+b p )
[0154] Among them, Y T ∈R T×d is the passenger flow of each station in the next T consecutive periods, W p is the learnable weight matrix, b p is the bias term, and σ is the activation function.
[0155] In summary, the present invention decomposes the bus travel time domain signal sequence based on the STL method, better captures the change pattern and trend of the bus travel time domain signal sequence, and improves the accuracy of predicting future sequences; based on the frequency domain attention to process the seasonal term component, make full use of the frequency domain characteristics of the bus travel time domain signal sequence, assign different weights to different bus stations, so that the model can focus more on the key stations in the bus network; for the trend term component, construct the station distance map, station POI similarity map, station passenger flow similarity map, perform multi-graph fusion convolution operation, fully explore the hidden dynamic and static spatial correlations between stations, and improve the prediction performance; design a plurality of convolution kernels of different sizes for the trend component and the seasonal component respectively, and combine the obtained multi-scale trend features and seasonal features to obtain the multi-scale bus passenger flow prediction result.
[0156] The present invention can make full use of the frequency domain characteristics in the bus travel time domain signal sequence, fully explore the hidden dynamic and static spatial correlations between bus stops, and realize the scientific prediction of bus travel time domain data.
[0157] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0158] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0159] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0160] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A bus passenger flow prediction method combining frequency domain and spatial domain features, characterized in that: include: The bus travel time domain signal sequence is obtained based on the bus IC card swiping data, and the local weighted regression seasonal trend decomposition algorithm STL method is used to decompose the bus travel time domain signal sequence into seasonal component, trend component and residual component. The frequency domain attention mechanism is used to process the seasonal component to obtain the seasonal component based on frequency domain attention, and the weight of each station in the bus travel time series is obtained, and the station to be used is selected according to the weight of each station; The spatial features are obtained using a multi-graph convolutional neural network based on the trend component, the distance graph between sites, the site POI similarity graph, and the site passenger flow similarity graph; Multi-scale seasonal features are obtained through dilated causal convolution processing based on the seasonal component based on frequency domain attention, multi-scale trend features are obtained through dilated causal convolution processing based on the spatial features, and the future passenger flow of each station is predicted based on the multi-scale seasonal features and the multi-scale trend features.
2. The method according to claim 1, characterized in that The method of obtaining a bus travel time domain signal sequence according to bus IC card swiping data includes: Collect bus IC card swiping data, pre-process the bus IC card swiping data, the pre-processing includes filling missing values, processing errors and removing duplicate data, dividing the pre-processed bus IC card swiping data into a certain time granularity, counting the passenger flow of each station in each continuous period, and obtaining the bus travel time domain signal sequence X t ∈R L×d , where L is the total number of time steps of the sample, and d is the number of bus stops; Using STL method to transform the bus travel time domain signal sequence X t ∈R L×d Decomposed into seasonal components S t , trend component T t and the residual component R t .
3. The method according to claim 2, characterized in that The seasonal trend decomposition algorithm STL method using local weighted regression decomposes the bus travel time domain signal sequence into: seasonal component, trend component and residual component, including: Bus travel time domain signal sequence X t The decomposition process includes two processes: inner loop and outer loop. The inner loop is nested in the outer loop. The inner loop uses seasonal smoothing and trend smoothing to update the seasonal component and trend component respectively. After each iteration of the inner loop, the outer loop starts to calculate the residual component. The decomposition formula of the STL method is: X t =S t +T t +R t ,t=1,...,n Among them, the input bus travel time domain signal sequence X t ∈R L×d , L is the total number of time steps of the sample, d is the number of bus stops, S t is the seasonal component, T t is the trend component, R t is the residual component; The specific steps of the inner loop are: Assume and T t k are the seasonal and trend components of the kth iteration of the inner loop, and T t k The initial value of is 0, then and The calculation process of the k+1th step is as follows: The original bus travel time domain signal sequence X t Subtract the trend component T t k , and obtain a new detrended sequence X t -T t k : For the detrended series X t -T t k Perform local weighted regression Loess smoothing to obtain a preliminary seasonal series Use filter pairs Perform low-pass filtering and Loess processing on the low-pass filtering results to obtain the remaining trend sequence Detrending the smoothed cyclic subseries to obtain the seasonal component in, is the seasonal component obtained in the k+1th iteration, is the preliminary seasonal sequence in the k+1th iteration, is the residual trend sequence obtained after Loess processing in the k+1th iteration; Remove the original sequence X t The seasonal component of the deseasonal series is calculated by Loess. Smooth and get the trend component Deseasonalizing the series by Loess Smooth and get the trend component 3) When one iteration of the inner loop ends, the outer loop starts, and the residual component is calculated using the seasonal component and trend component obtained in the inner loop Among them, is the residual component obtained in the k+1th iteration, X t is the original sequence, is the seasonal component obtained in the k+1th iteration, is the trend component obtained in the k+1th iteration.
4. The method according to claim 3, characterized in that The frequency domain attention mechanism is used to process the seasonal component to obtain the seasonal component based on the frequency domain attention, and the weight of each station in the bus travel time series is obtained, and the station to be used is selected according to the weight of each station, including: The seasonal component S t ∈R L×d After being mapped into a set of vectors Q,K,V∈R by the fully connected layer L×d , Q,K∈R L×d The vector is fast Fourier transformed in the variable direction to obtain the corresponding frequency domain sequence Q k ,K k ∈R L×(d / 2) ; Q k ,K k =FFT(Q,K) x n It represents the value of the nth variable of the time series at each time step, N is the total length of the time series variable, k is the frequency index, and the value range is [0, N / 2]; Find K k The conjugate matrix of Q k and The energy term of the seasonal term is obtained by multiplication, and the autocorrelation function of the seasonal term variable direction is obtained by inverse Fourier transform of the energy term of the seasonal term, as shown in the following formula: Where F -1 represents inverse Fourier transform; The autocorrelation function of the seasonal variable direction is passed through the softmax function to obtain the weight ω of each seasonal variable R ∈R L ×d , the seasonal term variables represent each site, with weight ω R The size of reflects the importance of the seasonal term at each site. R Multiplying with the V vector obtains the seasonal component representation based on frequency domain attention ω R =softmax(R Q,K ) Among them, ω R is the weight of each variable of the seasonal term, i.e., the site, R Q,K is the autocorrelation function of the seasonal variable direction, is the seasonal component representation based on frequency domain attention, V is the seasonal component S t The vector mapped by the fully connected layer.
5. The method according to claim 4, characterized in that The spatial features are obtained by using a multi-graph convolutional neural network based on the trend component, the inter-station distance graph, the station POI similarity graph, and the station passenger flow similarity graph, including: The traffic network is represented as a weighted graph G = (V, E, A), where V and E represent nodes and edges between nodes, respectively. i represents a site, edge e ij Indicates site v i and v j The correlation between them, A∈R |V|×|V| Representing the adjacency matrix, constructing the inter-station distance graph, station point of interest POI similarity graph and station passenger flow similarity graph according to the multiple correlations of the stations; The construction process of the site POI similarity graph includes: The weight of the edge between two vertices in the site POI similarity graph is defined as the functional similarity, and the similarity of the vector POIs composed of the number of POIs of different categories at each site is calculated using the adjusted cosine similarity, P h,i and P h,j Respectively represent site v i and v j POIs vector, where H represents the number of POIs categories, Represents the average value of all sites in this type of POI, Th p To adjust A p The sparsity of Represents the site POI similarity graph A p Middle Site v i and v j The strength of the correlation The process of constructing the inter-site distance map includes: The adjacency matrix is constructed using the threshold Gaussian kernel to calculate the distance between sites i and j. The sites closer to the target site have a larger weight, dist(V i ,V j ) represents the distance between site i and site j, σ represents the standard deviation of the distance, Th d is the distance threshold set to control A d The sparsity of A represents the distance between sites d Middle Site v i and v j The process of constructing the site passenger flow similarity graph includes: The similarity of passenger flow of N stations in k time slots is calculated based on the Pearson correlation coefficient: A s represents the site passenger flow similarity graph, ω ij Indicates site v i and v j The strength of the correlation between The adjacency matrix A of the station distance graph, station POI similarity graph and station passenger flow similarity graph is normalized to obtain The formula is as follows: Among them, I N is the identity matrix, To add the normalized adjacency matrix with self-loops, a softmax operation is added to the weighted matrix, and the multi-graph fusion process is expressed as: W p ',W d ',W s '=softmax(W p ,W d ,W s ) represents Hadamard multiplication, A F The result of multi-image fusion, the distance map between sites A d , Site POI similarity graph A p 、Site adjacency graph A s The results of normalization are W d ,W p ,W s Corresponding to each graph is the learnable weight matrix that adjusts the weight of each graph, W' p ,W' d ,W' s is the result of the weighted matrix after the softmax operation; The graph convolution expression is: where σ is the activation function, is the feature matrix of each node, W l is the weight matrix of the lth layer; The multi-graph convolution module combines the bus passenger flow trend component and the station distance graph A d , Site POI similarity graph A p 、Site adjacency graph A s The fusion results of these three different types of images are F As the input of the graph convolutional neural network, the multi-graph convolution module uses a single-layer graph convolutional network GCN to perform convolution operations to capture the relationship between each site. The expression of graph convolution is shown above to generate spatial features 6. The method according to claim 5, characterized in that The method of obtaining multi-scale seasonal features by dilated causal convolution according to the seasonal component based on frequency domain attention, obtaining multi-scale trend features by dilated causal convolution according to the spatial features, and predicting the future passenger flow of each station according to the multi-scale seasonal features and the multi-scale trend features includes: Adopt dilated causal convolution as the seasonal component based on frequency domain attention and spatial characteristics We design multiple convolution kernels of different sizes, and set the convolution kernel size to be represented by k. The dilated causal convolution function for the input x is defined as: Among them, the input x is the seasonal component based on frequency domain attention in the multi-scale frequency domain module and the multi-scale spatial domain module. and spatial characteristics s represents the input feature information; d is the hole parameter, that is, the hole interval size; sd·i represents the positioning of historical position information; Respectively and After dilated causal convolution, the multi-scale trend features χ t and seasonal characteristics χ s Combined with the above, the bus passenger flow is predicted. T =σ(W p (x s +χ t )+b p ) Among them, Y T ∈R T×d is the passenger flow of each station in the next T consecutive periods, W p is the learnable weight matrix, b p is the bias term, and σ is the activation function.
Citation Information
Cited By
Satellite clock error prediction method and system
CN120370355A
A satellite clock error prediction method and system
CN120370355B
Multi-source data fusion-based business flow site selection optimization method
CN121235218A
