Full-period traffic flow prediction method based on spatial-temporal feature deep fusion
Through a full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features, the challenges of existing models in capturing complex spatiotemporal dependence and multi-periodic trends of traffic flow are solved, and more efficient and accurate traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202411604504.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Existing traffic flow prediction models have challenges in capturing complex spatiotemporal dependencies and multi-periodic trends of traffic flows, and are difficult to meet the needs of real-time prediction and complex traffic environments.
The full-period traffic flow prediction method based on deep fusion of spatiotemporal features is adopted, and the complex space-time dependence of traffic flow is deeply integrated to capture the multi-dimensional, multi-scale and multi-grained traffic flow change laws through technical means such as comprehensive representation of spatiotemporal information, bidirectional gated timing convolution network, time-varying multi-neighborhood graph convolution and context multi-graph perception attention mechanism.
It improves the accuracy and sensitivity of traffic flow prediction, enhances the model's response and prediction capabilities to traffic flow changes, and can more accurately capture the multi-cycle comprehensive changes of traffic flow, improving the performance of traffic flow prediction throughout the cycle.
Smart Images

Figure BDA0005129179100000051 
Figure BDA0005129179100000053 
Figure BDA0005129179100000071
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features. The method starts from the spatiotemporal dimension and faces multiple short, medium and long cycles, combines time series features of different scales and spatial relationships of different granularities, and is used to realize full-cycle digital urban traffic flow prediction that integrates multi-dimensional, multi-scale and multi-granularity comprehensive elements. Background Art
[0002] Driven by autonomous driving, the Internet of Things, cloud computing, and 5G / 6G communication technologies, urban transportation systems are undergoing profound changes. At the same time, global climate change has prompted carbon neutrality and sustainable development to become a global consensus, further increasing the demand for resource optimization and emergency management. In this context, the application of intelligent transportation systems (ITS) has been proven to be an effective solution to urban traffic problems, among which traffic flow prediction plays a vital role. Good traffic flow prediction can provide scientific and effective decision-making support for traffic managers, optimize traffic resource allocation, reduce congestion, and improve urban operation efficiency. With the expansion of cities and the concentration of population, the complexity of traffic demand has increased, and the traffic of commuting, logistics and other travel activities has surged, resulting in an increase in the load on the road network and an increasingly serious problem of urban traffic congestion. Therefore, efficient and accurate traffic flow prediction has become the key to solving these problems. It can not only improve the efficiency and responsiveness of the transportation system, but also provide scientific support for achieving the goals of urban sustainable development, which is of great significance for building a future intelligent and green urban transportation system.
[0003] The field of traffic flow prediction continues to develop and has achieved many research results. Early research mainly relied on human experience and basic statistical models, such as seasonal autoregressive integrated moving average method (SARIMA) and hidden Markov model (HMM). These schemes usually assume that the traffic flow time series is linear and it is difficult to process large-scale data. Therefore, early traffic prediction schemes are difficult to cope with the growing amount of data. With the rapid development of machine learning, nonlinear processing schemes such as support vector regression (SVR) and K nearest neighbor (KNN) have gradually emerged. The technical level has improved, but at the same time, it lacks the ability to model time series information and cannot adapt well to changing traffic scenarios. It relies on features or external algorithms to introduce time series information, which is difficult to meet the needs of real-time traffic flow prediction, limiting the prediction ability for complex traffic environments.
[0004] The emergence of deep learning technology has significantly improved the prediction ability of complex data, especially in processing time series dependencies. For example, recurrent neural networks (RNN), long short-term memory networks (LSTM) and gated recurrent units (GRU) have advantages in temporal feature extraction and can capture the time-dependent dependencies of traffic flow. Since traffic flow has trend and periodicity, temporal features are certainly important, but in traffic flow prediction, it is difficult to fully predict the comprehensive changes of traffic flow by relying solely on time information. Due to its good applicability to non-Euclidean space, graph neural networks (GNN) were introduced to flexibly model the complex relationships between nodes and edges. Nevertheless, as traffic flow patterns become more diverse and unpredictable, and due to the lack of effective spatiotemporal traffic fusion models, existing models still face many challenges in capturing long-distance dependencies of traffic flow and in processing the dynamics of time series and multi-periodic trends of traffic data.
[0005] As the complexity of the model increases, a single model is difficult to fully meet the actual needs. Therefore, scholars have explored comprehensive models to achieve more accurate traffic flow prediction by integrating the advantages of multiple deep learning models. This type of model integrates graph structure modeling, sequence modeling and attention mechanism to form a multi-level spatiotemporal dependency processing framework. However, they still have certain limitations in capturing temporal features, especially in the refined mining of time scales, which may affect the sensitivity of the model to traffic flow changes and limit its accuracy and effectiveness in real-time prediction. In addition, they fail to fully consider dynamically changing environmental factors, and their multi-granularity perception and recognition mining capabilities for spatial information are still insufficient, limiting their application potential in traffic flow prediction. Although these comprehensive solutions gradually strengthen spatiotemporal feature modeling, they only simulate the adjacency matrix representing the connection of spatial nodes and try to integrate it into the traffic flow prediction model. Although the effect has improved, they have failed to fully cope with the complex and changeable airspace communication of traffic flow, and there is still much room for improvement in capturing dynamic and complex traffic flows. Summary of the invention
[0006] Purpose of the invention: The current traffic flow prediction problem faces the characteristics of strong comprehensiveness and high complexity. With the traffic flow pattern becoming diversified and dynamic, more complex spatiotemporal dependencies and time series interactions, as well as the mutual influence of different spatial regions on traffic flow, traffic forecasting research still faces many challenges. Therefore, in response to the above problems, on the basis of fully considering the spatiotemporal relationship pattern, a full-cycle traffic flow prediction method based on the deep fusion of spatiotemporal features is proposed, which fully models the mutual influence of traffic flow between multiple neighborhoods and the fluctuations under complex time series interactions. It can deeply integrate the complex spatiotemporal dependencies of traffic flow, capture the changing laws of traffic flow in multiple dimensions, multiple scales and multiple granularities, and form a composite traffic situation perception, thereby realizing the prediction of comprehensive traffic flow in multiple cycles. It has been confirmed by experiments that the methods proposed in the present invention are superior to similar models.
[0007] To achieve the above object, the technical solution adopted by the present invention is:
[0008] A full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features includes the following steps:
[0009] S1: The traffic network data is comprehensively characterized by spatiotemporal information. First, a method based on distance and local neighborhood density is designed to construct the adjacency matrix of the road network. By comprehensively considering the spatial distance and local density relationship between road nodes, the influence relationship between adjacent nodes can be captured more accurately. At the same time, a multi-dimensional time series cycle fusion method is designed to integrate multiple time scales, which are represented by five feature matrices: the recent feature matrix F based on multi-level time windows, m (t), feature matrix F based on the time period within the week w (t), time-date based interactive feature matrix F td (t), feature matrix F based on the periodic features of the sliding window p (t), feature matrix F based on time resolution res (t), these time series features not only help improve the prediction performance of the model, but also provide a basis for revealing the underlying laws of traffic flow, and then the spatiotemporal information fusion is used as the initial input of the model;
[0010] S2: Design a bidirectional gated temporal convolutional network (Bi-Gated TCN) to capture short-term temporal dependencies, effectively extract short-term potential patterns in historical and future traffic data, and improve the ability to respond to instantaneous traffic changes;
[0011] S3: Design a model based on time-varying multi-neighborhood graph convolution and context-aware multi-graph attention, TVMGCN-CAMGA, to capture short-term multi-attribute neighborhood interactions, aggregate short-term spatial dependencies through multi-layer fusion between multifunctional neighborhoods, and reduce the dimensionality of short-term spatiotemporal features;
[0012] S4: Design TVFormer to deeply explore the long-term trends in historical traffic data, ensure that the model adapts to traffic flow changes at different time scales, and improve the ability to identify the characteristics of long-term fluctuations in traffic flow;
[0013] S5: Design SpaGraphFormer to deeply deconstruct key areas in high-dimensional traffic data, fully explore the topological structure in complex road networks, improve the model's perception of comprehensive changes in regional traffic, and reduce the dimensionality of medium- and long-term spatiotemporal features;
[0014] S6: Reduce the dimension of short-term and medium-term and long-term spatiotemporal features and perform multi-periodic organic fusion to perform multi-period traffic flow prediction;
[0015] S7: Compare and evaluate the prediction analysis results with the original traffic flow data in terms of mean absolute error, mean absolute percentage error and root mean square error.
[0016] Compared with the prior art, the beneficial effects of the present invention are:
[0017] (1) The comprehensive representation strategy of spatiotemporal information designed in the present invention, on the one hand, comprehensively considers the real regional spatial distance and the neighborhood traffic density to construct the adjacency matrix, which can adapt to the perception of different spatial granularities and more comprehensively reflect the structural characteristics of the traffic network, which helps to improve the model's sensitivity and prediction ability to traffic flow changes; on the other hand, starting from a variety of periodic characteristics, a multi-dimensional time series period fusion strategy is designed, so that the model can fully characterize the changing trend of traffic flow on different time scales, providing the model with more robust time dimension information, thereby improving the full-cycle traffic prediction performance.
[0018] (2) The bidirectional gated temporal convolutional network Bi-GatedTCN designed in the present invention for capturing short-term temporal dependencies provides the model with the ability to dynamically control information flow through a bidirectional gating mechanism, ensuring that the model can fully utilize bidirectional temporal dependencies; the bidirectional dilated causal convolution captures long-range temporal dependencies by expanding the receptive field while maintaining causality, thereby enabling the model to better capture the time-varying characteristics of traffic flow.
[0019] (3) The TVMGCN-CAMGA model designed by the present invention to capture short-term multi-attribute neighborhood interactions is based on time-varying multi-neighborhood graph convolution and context-aware multi-graph attention. It can capture the dynamic changes of traffic flow in different spatial neighborhoods through the multi-neighborhood graph, and dynamically adjust the importance of different neighborhood nodes in feature learning through context-aware multi-graph attention, thereby ensuring that the model can still maintain accurate prediction accuracy in a rapidly changing traffic environment.
[0020] (4) The TVFormer model designed by the present invention for in-depth mining of long-term trends in historical traffic flow data can effectively store and update the key features of historical traffic flow data, deeply extract temporal dependencies at different time scales, mine long-term temporal trends, and dynamically adjust the size of the time window according to the state of traffic flow, optimize the timeliness and relevance of input data, and ensure that the model can adapt to changes in traffic flow at complex time scales.
[0021] (5) The SpaGraphFormer model designed by the present invention for deep deconstruction of key areas in high-dimensional traffic data can fully consider key areas and adapt to the real physical characteristics of real-world traffic networks. By mining the topological structure in complex road networks and extracting multi-granularity spatial features, the accuracy of medium- and long-term traffic forecasts can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of the process of the present invention;
[0023] Figure 2 It is a schematic diagram of the comprehensive representation of spatiotemporal information;
[0024] Figure 3 A schematic diagram of a bi-gated temporal convolutional network (Bi-Gated TCN) for capturing short-term temporal dependencies.
[0025] Figure 4 A schematic diagram of the short-term multi-attribute neighborhood interaction capture model based on time-varying multi-neighborhood graph convolution and context-aware multi-graph attention model (TVMGCN-CAMGA);
[0026] Figure 5 It is a schematic diagram of the medium- and long-term temporal dependency capture model (TVFormer);
[0027] Figure 6 Schematic diagram of the medium- and long-term high-dimensional traffic data capture model (SpaGraphFormer);
[0028] Figure 7 A comparison chart of MAE experimental indicators between the present invention and multiple traffic flow prediction algorithms;
[0029] Figure 8 This is a comparison chart of the MPE experimental indicators of the present invention and multiple traffic flow prediction algorithms;
[0030] Fig. 9 This is a comparison chart of the RMSE experimental indicators of the present invention and multiple traffic flow prediction algorithms. DETAILED DESCRIPTION
[0031] The present invention discloses a full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features, such as Figures 1 to 9 To make the purpose, technical solutions and advantages of the present invention more clear, a complete and clear description will be given below in combination with the accompanying drawings and experimental index comparisons.
[0032] Figure 1 The implementation flowchart of the full-cycle traffic flow prediction method based on the deep fusion of spatiotemporal features is presented, and the implementation steps are described in detail based on this flowchart.
[0033] like Figure 2 As shown, in step S1, the present invention comprehensively characterizes the spatiotemporal information of the traffic network data in order to enable the model to accurately capture the spatiotemporal variation characteristics of traffic flow, and better understand and predict the dynamic characteristics of traffic flow. Accurately characterizing the complex spatiotemporal relationship of the traffic network is the key to improving prediction accuracy. Designing a method based on distance and local neighborhood density to construct an adjacency matrix of the road network is to more accurately model the spatial relationship of traffic flow and the local road network structure, because the change of traffic flow is not only affected by time, but also closely related to the spatial position, connectivity and relative distance of the road; designing a multi-dimensional time series cycle fusion method to fuse multiple time scales is to capture the multi-scale time series characteristics of traffic flow more comprehensively and multi-levelly, so as to improve the accuracy and generalization ability of prediction; the technical advantage of doing so is that it can comprehensively consider the changes in traffic flow at different scales, accurately capture the spatiotemporal dependence of traffic flow, enhance the local and global adaptability of the model, and improve the accuracy of the model in predicting full-cycle traffic flow.
[0034] The formula for constructing the adjacency matrix is as follows:
[0035]
[0036] Among them, dist(v i ,v j ) is the node v in the real traffic node i and node v j The distance; σ m is the standard deviation of all road network distances; is node v i The local density of the node v i The quotient of the node distance within a certain range and the standard deviation is calculated by taking the average value through the natural exponential function; κ is the overall threshold.
[0037] The five time series feature matrices constructed are as follows:
[0038] Recent feature matrix F based on multi-level time windows m (t): Focuses on capturing recent changes in traffic flow by using two different time windows (short time window T s and long time window Tl ) to focus on short-term and long-term traffic trends respectively. Specifically, for each time point t, the feature matrix F m (t) includes the time point t and its predecessor T s Hours of traffic flow data, as well as the previous T l This design allows the model to learn both short-term fluctuations and long-term changes, thereby improving the accuracy of predictions. The recent feature matrix formula based on multi-level time windows is as follows:
[0039]
[0040] Where R(t) represents the traffic flow data at time point t; T s is the size of the shorter time window; T l is the size of the larger time window.
[0041] The feature matrix F based on the time period within the week w (t): Traffic flow is usually affected by different time periods within a week. In order to model this influence more accurately, a weekly time period feature matrix is introduced. This matrix takes into account the traffic flow changes at each hour within a week. This method can capture the significant impact of time periods on traffic flow, thereby improving the sensitivity of the prediction model to periodic fluctuations. Based on the weekly time period feature matrix, we focus on capturing traffic flow data at different time periods within a week. For each time point t, the feature matrix F w (t) contains hourly traffic flow data for the past week, reflecting traffic patterns in different time periods, helping the model identify and utilize the impact of time period changes on traffic flow. The feature matrix formula based on time periods within the week is as follows:
[0042] F w (t) = [W i (t),W i (t-1),...,W i (tT w +1)]
[0043] Among them, W i (t) represents the traffic flow data at time point t in the i-th week; T w Indicates the size of the time window.
[0044] The interactive feature matrix F based on time-date td(t): Note that traffic flow is affected by the interaction of date and time. For example, the traffic patterns on weekends and weekdays may be different, and the time of day may also affect the traffic. By considering the interactive features of date and time, these complex patterns can be modeled more comprehensively, thereby improving the accuracy of prediction. The time-date interactive feature matrix captures the interactive effect by combining date features and time features. Specifically, for each time point t, the feature matrix F td (t) contains the product of the date feature D(t) and the time period feature T(t), reflecting the joint impact of date and time, which can help identify and utilize the impact of complex interactions between date and time on traffic flow. The formula of the interaction feature matrix based on time-date is as follows:
[0045] F td (t)=[D(t)·T(t),D(t)·T(t-1),...,D(t)·T(tT t +1)]
[0046] Among them, D(t) represents the date characteristics of time point t (specifically, the week number or day number); T(t) represents the time period characteristics of time point t (that is, the hour number); T(t) represents the size of the time window.
[0047] Feature matrix F based on sliding window periodic features p (t): Traffic flow has significant periodic characteristics, such as daily and weekly cycles. In order to effectively capture these periodic patterns, a sliding window periodic feature matrix is introduced. This matrix can help the model identify and utilize traffic patterns in different cycles, thereby improving the prediction ability of periodic fluctuations. The sliding window periodic feature matrix combines daily periodic features and weekly periodic features to capture these periodic patterns through a sliding window. For each time point t, the feature matrix F p (t) contains the past T p This design can help the model identify and utilize the periodic fluctuations of traffic flow. The feature matrix formula based on the sliding window periodicity feature is as follows:
[0048]
[0049] Among them, P d (t) represents the daily periodicity characteristics at time point t; P w (t) represents the weekly periodicity characteristics at time point t; T p Represents the size of the periodic window.
[0050] The feature matrix F based on the time resolution res(t): Traffic flow data can be recorded at different time resolutions, such as hourly and daily data. In order to further capture the traffic changes at different time resolutions, the time resolution feature matrix is introduced. This matrix can help the model comprehensively consider the traffic flow information at different time resolutions, thereby improving the prediction performance. The time resolution feature matrix combines the hourly and daily traffic flow data, and comprehensively considers these different resolutions through the time window. For each time point t, the feature matrix F res (t) contains the past T r The hourly data and daily data within an hour can help the model understand the changes in traffic flow more comprehensively. The feature matrix formula based on time resolution is as follows:
[0051]
[0052] Among them, R hr (t) represents the hourly traffic flow data at time point t; R d (t) represents the daily traffic flow data at time point t; T r Represents the size of the time window.
[0053] Combining the above five time series-based feature representations, these features will be formalized into time series input x(t), as follows:
[0054]
[0055] in, is the sum of the feature dimensions.
[0056] like Figure 3 As shown, in step S2, the present invention designs a bidirectional gated temporal convolutional network Bi-Gated TCN to capture short-term temporal dependencies. Bi-Gated TCN combines a bidirectional gating mechanism and bidirectional convolution to capture local and short-term temporal dependencies. The advantage is that it can better understand the short-term complex correlation of time series in traffic data. The bidirectional structure fully considers the past and future information in the time series data, enhances the prediction ability of the model, and the gating mechanism helps the model to screen input information, enhance the learning ability of the model, and improve the generalization ability of the model. Bi-Gated TCN consists of a bidirectional gating mechanism, a bidirectional dilated causal convolution, and a residual connection. In the bidirectional gating mechanism, an input gate and a forget gate are designed to dynamically control the flow of information, and the performance of the network on slightly long-range temporal dependencies is improved through bidirectional dilated causal convolution. Subsequently, a residual connection is introduced to ensure that the network will not lose the features of the original input due to the layer-by-layer transmission of information in the deep structure, thereby enhancing the model's short-term temporal dependency modeling capability.
[0057] The bidirectional gating mechanism enhances the network's expressiveness on the basis of temporal convolution by introducing gating units. Specifically, the bidirectional gating mechanism includes two key gating units: input gate and forget gate, which are similar to the mechanism in the long short-term memory network (LSTM), but implemented in the convolutional network. Input Gate: controls the amount of new information input at each time step, and adjusts the input activation value through the gating mechanism; Forget Gate: controls the amount of old information retained at each time step, aiming to dynamically adjust the weight of each temporal convolution layer so that the network can adapt to the characteristics of different time scales. The formulas for the input gate and forget gate are as follows:
[0058] i(t)=σ(W i ·x(t)+U i ·h t-1 +b i )
[0059] f(t)=σ(W f ·x(t)+U f ·h t-1 +b f )
[0060]
[0061]
[0062] Among them, σ is the sigmoid activation function; tanh is the hyperbolic tangent activation function; W i ,W f , and U i ,U f , is the weight matrix; b i ,b f , is the bias term; i(t) and f(t) represent the outputs of the input gate and the forget gate at time step t, respectively; x(t) is the feature of the input sequence at time step t; h t-1 is the hidden state at the previous time step.
[0063] Compared with unidirectional dilated convolution, bidirectional dilated convolution can more comprehensively capture the long-term trend of traffic flow. By setting different dilation rates, it can quickly capture information of different time scales without increasing the computational complexity, thereby enabling the network to effectively capture complex patterns and dependencies in long-term traffic sequences. While capturing long-distance dependencies that increase over time, it can also extract useful features from historical and future information at the same time, which is particularly important for predicting short-term traffic flow fluctuations. The formula for bidirectional dilated causal convolution is as follows:
[0064] DilatedConv fwd (x(t)) = σ(W dilated,fwd * d x(t)+b dilated,fwd )
[0065] DilatedConv bwd (x(t)) = σ(W dilated,bwd * d x(t)+b dilated,bwd )
[0066] in,* d represents a convolution operation with a dilation rate d; W dilated,fwd and W dilated,bwd are the weight matrices of the forward and reverse dilated convolutions, respectively; b dilated,fwd and b dilated,bwd is the corresponding bias term; DilatedConv fwd (x(t)) and DilatedConv bwd (x(t)) are the feature representations of the forward and backward dilated convolutions, respectively.
[0067] The output features of the bidirectional dilated causal convolution are fused as follows:
[0068] H(t)=ReLU(DilatedConv fwd (x(t))+DilatedConv bwd (x(t)))
[0069] Among them, H(t) is the fused short-term time series feature; ReLU() is the activation function.
[0070] like Figure 4 As shown, in step S3, the present invention designs a model TVMGCN-CAMGA based on time-varying multi-neighborhood graph convolution and contextual multi-graph perception attention to capture short-term multi-attribute neighborhood interactions, aggregate short-term spatial dependencies through multi-layer fusion between multi-functional neighborhoods, and reduce the dimension of short-term spatiotemporal features. First, multiple different adjacency graphs are designed, including physical adjacency, functional adjacency, and social adjacency, and then a time-varying multi-graph convolutional network TVMGCN-FMNG is designed to fuse multiple adjacency graphs to comprehensively consider the multi-temporal changes and dependencies between each adjacency graph, and capture spatial dependencies of different granularities.
[0071] The formula for multi-graph convolution is as follows:
[0072]
[0073] Among them, H f(l) A represents the node feature matrix of the lth layer; (k) represents the adjacency matrix of the kth graph; W (l,k) is the convolution weight matrix of the lth layer corresponding to the kth graph; σ(·) is the nonlinear activation function.
[0074] A (k) It can be expressed as three adjacency graphs: physical adjacency graph (A phy ): Based on the physical connection relationship of road sensors, that is, the connection between traffic nodes constitutes a physical adjacency graph; functional adjacency graph (A fun ): A neighborhood graph based on the functional similarity between transportation nodes; a social adjacency graph (A soc ): An adjacency graph constructed based on the relationship between traffic flow and socio-economic activities (such as commercial buildings, residential areas, etc.).
[0075] Since the spatiotemporal characteristics of traffic flow are complex, nonlinear and non-stationary, relying solely on the static adjacency matrix may not accurately reflect the traffic flow pattern that changes over time. In order to further capture the spatiotemporal dynamic changes of traffic flow, a time-varying convolution (TVC) operation is designed and fused with the above-mentioned multi-neighborhood graph convolution to form a time-varying multi-neighborhood multi-graph convolution (TVMGCN-FMNG), so that the convolution weights can be dynamically adjusted over time. This is because traffic data has significant spatiotemporal dynamics. For example, traffic around schools on weekdays is obviously different from traffic on holidays. Specifically, the time-dependent weight matrix W is introduced. (l,k) (t), where t represents the time step, the formula of time-varying convolution is as follows:
[0076]
[0077] Among them, W (l,k) (t) = f(W (l,k) ,t) is a function of time, which is modeled by a parameterized strategy based on the time step t, and position encoding is used to model the time dependency. The formula is as follows:
[0078] W (l,k) (t) = W (l,k) ⊙PE(t)
[0079] Among them, ⊙ represents the Hadamard product; PE(t) is the position encoding of time step t; through this method, not only the characteristics of the current moment are captured, but also the dynamic change trend in the time series is implicitly considered, so as to more accurately extract short-term spatial features.
[0080] In order to further enhance the model's understanding and capture of spatiotemporal relationships and fully tap the potential information in traffic flow data, a context-aware multi-graph attention mechanism (CAMGA) is designed and introduced into the framework of multi-neighborhood graph convolution. This mechanism captures more complex spatial dependencies by dynamically adjusting the attention weights between different nodes. First, the context-aware attention is designed, that is, the attention weight of a node depends not only on the features of adjacent nodes, but also on its global context information. Assume that the attention weight between node i and node j is α ij (t), which is calculated as follows:
[0081]
[0082] Among them, h i (t) and h j (t) are the hidden feature representations of node i and node j respectively; is the linear transformation matrix; is the attention vector; || || represents the vector concatenation operation; C ij (t) is a context-aware feature, which is used to capture the context information between nodes.
[0083] Context-aware features C ij The calculation of (t) is based on the historical interaction information between nodes, and the formula is as follows:
[0084]
[0085] Among them, g φ (·) is a parameterized function used to measure the historical interaction strength between node i and node j.
[0086] Furthermore, the Multi Head Graph Attention strategy is introduced to concatenate the outputs of multiple attention heads to further improve the expressiveness of the model. The Multi Head Graph Attention mechanism calculates multiple attention heads in parallel, concatenates the results and performs nonlinear transformation. The formula is as follows:
[0087]
[0088] Where M represents the number of attention heads; represents the attention weight of the mth attention head at time step t.
[0089] like Figure 5As shown, in step S4, the present invention designs TVFormer to deeply explore the long-term trends in historical traffic data and improve the feature recognition ability of long-periodic fluctuations in traffic flow. Based on the traditional Transformer, TVFormer includes several components such as dynamic memory network (DMN), multi-scale temporal convolution and fusion (MSTC), sparse attention mechanism (SAM), adaptive time window (ATW), etc., which comprehensively improve the model's ability to capture medium- and long-term temporal features.
[0090] First, a dynamic memory network (DMN) is designed to enhance the memory capacity of the time series model to better capture long-term dependencies. DMN maintains a dynamically updated memory library to store historical information and uses the memory library to improve the current time series prediction. The memory update formula used is as follows:
[0091]
[0092] Among them, Gate(·) is a gating mechanism used to control the proportion of memory update. The gate value is normalized by taking its square root to ensure that its value is in the range of 0 to 1; NewMemory(·) is used to generate new memory; through the normalization operation || W n x t +b n || to ensure that the generated memory has an appropriate size.
[0093] Furthermore, a multi-scale temporal convolution (MSTC) is designed to extract features of different time scales, and the long-term dependency features output by the DMN are fused with the multi-scale features output by the MSTC module to achieve comprehensive extraction of traffic flow temporal features. The formula used by the multi-scale temporal convolution is as follows:
[0094]
[0095] Among them, Conv s (·) indicates a multi-scale convolution operation; The scale is adjusted in the form of to ensure the standardization of convolution features.
[0096] Then feature fusion is performed, and the formula used is as follows:
[0097]
[0098] in, It is the standardization coefficient during fusion, which is used to ensure the consistency of the scales of features of different scales after fusion. This process enables the model to achieve more comprehensive integration of temporal information when facing data of different time scales, enriching the feature representation. In addition, MSTC inherits DMN and can continuously adjust the weights of the convolution kernel through the dynamic memory network, thereby further improving its adaptability to changes in traffic flow.
[0099] After obtaining rich time series information, in order to selectively strengthen the focus on key moments (such as traffic peak time periods) and to solve the problem of large computational complexity of the standard attention mechanism, a sparse attention mechanism is designed to focus only on the most relevant parts of the current time step. First, the attention score is calculated using the following formula:
[0100]
[0101] The score ij represents the attention score; then a sparse strategy is applied to retain only the attention weights of the top k largest scores, using the following formula:
[0102]
[0103] in, is the standardization coefficient, which is used to adjust the distribution of scores to make them conform to the normal distribution; only the top k largest scores are retained, which can significantly reduce the computational complexity.
[0104] In order to further adapt the feature weights output by the SAM module, so as to capture more historical information, enhance the model's sensitivity to different time features, and accurately capture medium- and long-term time series dependencies, an adaptive temporal window mechanism (ATW) is designed, which can adjust the time window size according to the dynamic characteristics of the input sequence. Assume that the current time step is t and the size of the time window is w t , can be obtained through learning, the formula is as follows:
[0105] w t =NN window (X multi-scale,t )
[0106] Among them, NN window (·) is used to generate the time window size, and the result is an integer to ensure that the window is an integer; in the adaptive window, the time series features are extracted through weighted operations, and the formula is as follows:
[0107]
[0108] in, It is the normalization coefficient of weighted convolution, which ensures the scale of convolution results is consistent; is a weighting factor that ensures that time steps farther away have lower weights but not no weights; σ is a parameter that controls the window width.
[0109] like Figure 6 As shown, in step S5, the present invention designs SpaGraphFormer to deeply deconstruct the key areas in high-dimensional traffic data, improve the model's perception of the comprehensive changes in traffic volume in the region, and reduce the dimensionality of medium- and long-term spatiotemporal features. Based on the traditional Transformer, SpaGraphFormer designs several components, including spatial feature extraction network (OSFEN), spatial adaptive pooling (OSAP), spatial perception weight distribution network (SPWDN), spatial graph convolution (OSGC), and spatial attention weighting (OSAWF), to improve the model's ability to capture the spatial dependence of complex road network structures and long-distance traffic flows.
[0110] In order to extract preliminary spatial features from the original traffic data, firstly, the optimized spatial feature extraction network (OSFEN) is designed, so that when capturing long-term spatial features, the input spatial features can be dynamically adjusted. The network can adaptively adjust the spatial position of the features, thereby enhancing the modeling ability of long-distance traffic flow relationships. The flexibility of feature extraction is improved by introducing nonlinear operations, which is conducive to capturing local and global spatial features. The spatial features are initially extracted using the following formula:
[0111]
[0112] in, is the feature map output by the lth layer; σ(·) is a nonlinear activation function used to improve the diversity of feature expression; It is the normalization coefficient, which is used to adjust the scale of the convolution output and keep the features stable; is the convolution kernel of the lth layer; k l is the size of the convolution kernel; is the bias term.
[0113] In order to enhance the network depth, by stacking convolution operations layer by layer, skip connections are introduced to further enhance feature extraction. The formula is as follows:
[0114] X L =X l +α·(X l *X l-1 )
[0115] Among them, α is a trainable weight parameter used to control the proportion of skip connections. This skip connection helps alleviate the gradient vanishing problem and promotes the training effect of deep networks.
[0116] In order to further enhance the multi-scale capture of spatial features, the optimized spatial adaptive pooling (OSAP) is designed to introduce adaptability in the multi-scale processing of spatial features. OSAP processes spatial features at different scales by introducing a dynamically adjusted pooling window, so that it can not only adaptively capture local details, but also control the contribution of different spatial regions through dynamic weights, so that the network can still accurately capture long-term dependent features when facing complex spatial structures. The formula is as follows:
[0117]
[0118] Among them, Pool j represents the pooling operation of the jth window; is a normalization term. This weighted summation mechanism is used to allow the model to dynamically adjust the pooling weights according to the input features, so that it can adaptively capture the spatial features of different regions. j is the weight of the pooling window, which is dynamically generated by the network as follows:
[0119]
[0120] Among them, W p is the parameter matrix used to generate the weights.
[0121] Furthermore, in order to capture the interdependence between different regions, a Spatial Perception Weight Distribution Network (SPWDN) is designed to introduce dynamically adjusted spatial perception capabilities in feature similarity calculations to ensure that the network can identify and focus on key areas during the weight distribution process. For a specific location (i, j), the spatial perception weight is generated by the following calculation:
[0122]
[0123] in, represents the weight generation matrix; b a Represents the bias term, which is used to adjust the weight; is a normalization coefficient used to balance the scale of the inner product.
[0124] With weight A ij After that, the features of different key area positions can be weighted according to it, and the formula is as follows:
[0125]
[0126] Among them, X SPWDN,i Features representing the locations of different key areas.
[0127] After obtaining the spatial weight distribution from SPWDN, it is necessary to combine these weights with spatial features to effectively capture the relationship between nodes in the transportation network. In order to solve the dependency problem of graph structure in spatial network, considering the nonlinearity of graph structure, the Optimized Spatial Graph Convolution Network (OSGC) is designed. OSGC builds a graph structure on the feature graph and performs convolution operations to capture the spatial dependency between regions. When constructing the graph convolution, not only direct neighbors but also more distant nodes are considered. Adjacency matrix Dynamically generated in the following way:
[0128]
[0129] Among them, exp() represents the exponential function operation with e as the base.
[0130] The graph convolution operation is performed through matrix multiplication and nonlinear activation, as shown below:
[0131]
[0132] in, is the weight matrix of graph convolution; σ(·) is the nonlinear activation function.
[0133] After OSGC processing, the model has obtained feature expressions that fully consider the spatial structure and the relationship between nodes. The next step is how to further integrate these features and strengthen the role of important features in the final prediction. Therefore, the spatial weighted feature enhancement module (Optimized Spatial Attention Weighted Features, OSAWF) is proposed. In this module, the features after graph convolution are combined with the features generated by the spatial sense weight distribution network, and the features are fused through weighted summation. The final weighted feature map calculation formula is as follows:
[0134] X final,i =γ·X SPWDN,i +(1-γ)·X gc,i
[0135] Among them, γ is a learnable fusion parameter used to control the ratio of graph convolution features and spatial perception weight features; X SPWDN,i is the weighted feature calculated by the spatial perception weight distribution network; X gc,iIt is the feature obtained by spatial graph convolution.
[0136] In step S6, the short-term and medium-term spatiotemporal features are reduced in dimension and multi-period organically integrated to perform multi-period traffic flow prediction. The detailed steps are as follows:
[0137] Space-time fusion coding: Through the dual-stream network structure, the spatial and temporal features are jointly encoded. Let the spatial code be E s,t (t), the time series code is E t,s (t), the formula is as follows:
[0138] E s,t (t)=SpatialEncoder(X(t))+TemporalEncoder(x(t))
[0139] Among them, SpatialEncoder and TemporalEncoder are spatial and temporal encoding modules respectively.
[0140] Hybrid self-attention mechanism: The spatial-temporal hybrid attention weight matrix A is calculated in the following way s,t (t):
[0141]
[0142] Among them, Q s,t (t) = W q,s,t E s,t (t); K s,t (t) = W k,s,t E s,t (t); V s,t (t) = W v,s,t E s,t (t); WhereQ s,t (t) = W q,s,t E s,t (t); K s,t (t) = W k,s,t E s,t (t); V s,t (t) = W v,s,t E s,t (t).
[0143] Spatial-temporal multi-head attention: Use multi-head attention mechanism to learn spatiotemporal joint features:
[0144] H s,t (t) = Concat(Z s,t,1 (t),Z s,t,2 (t),...,Z s,t,H (t))W h,s,t
[0145] Spatiotemporal mixed feature output: Final mixed feature output O s,t (t) is expressed as:
[0146] O s,t (t) = FeedForward(H s,t (t))+E s,t (t)
[0147] Fusion and prediction of spatiotemporal features: After obtaining the spatial feature O s (t), time series feature O t (t) and spatiotemporal mixing characteristics O s,t (t) After that, nonlinear fusion is performed through the feature fusion layer to obtain the final prediction value
[0148]
[0149] in, Represents traffic flow data at predicted future points in time.
[0150] In step S7, the mean absolute error (MAE) represents the average value of the absolute errors between the predicted value and the true value, which is used to measure the average deviation between the predicted value and the true value; the mean absolute percentage error (MAPE) represents the average value of the absolute percentage errors between the predicted value and the true value, which is used to measure the average error of the predicted value relative to the true value, taking into account the ratio of the error to the true value; the root mean square error (RMSE) represents the square root of the average value of the squared errors between the predicted value and the true value, which is used to measure the average deviation between the predicted value and the true value and to penalize large errors. The corresponding formulas are as follows:
[0151]
[0152]
[0153]
[0154] Where n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; these three evaluation indicators can be used to evaluate the accuracy and performance of the traffic flow prediction model. The smaller the MAE and RMSE, the better. The closer the MAPE is to 0, the smaller the prediction error.
[0155] The following further illustrates the prediction effect of the present invention by comparing multiple experimental indicators of multiple models:
[0156] This paper uses four different datasets to evaluate the effectiveness of the proposed method, namely: PEMS03 dataset, PEMS04 dataset, PEMS07 dataset and PEMS08 dataset. As shown in Table 1, Table 1 lists the detailed information of the data collected by the four datasets; Table 1
[0157] The four data sets are all from real traffic data collected by the Performance Measurement System (PEMS) of the California Department of Transportation. They all contain hundreds of sensor sampling nodes and tens of thousands of time steps, and each time span is as long as several months. The data collected by each sensor each time contains three dimensions of features, namely traffic flow, average speed and average occupancy. The main feature used in the present invention is traffic flow. Taking the PEMS04 and PEMS08 data sets as examples, PEMS04 is a traffic flow data generated by 307 sensors collecting data every 5 minutes, and a total of 59 days of data collection; PEMS08 is a traffic data collected by 170 sensors every 5 minutes, and a total of 62 days of data collection. In order to make the research results of the present invention comparable with the previous research results, the present invention uses the same data set division method for these four data sets. Specifically, the proportion of the training set is set to 80%, and the verification set and the test set each account for 10%.
[0158] The present invention adopts the GPU version of the PyTorch1.13.1 framework, and the host adopts NVIDIA GTX 1060 (Intel(R) Core(TM) i7-8750H CPU@2.20GHz 2.21GHz) with 16GB memory; the learning rate of the Adam optimizer is set to 0.001; for a more accurate training model, each batch size is set to 8 or 16; 2 residual connection units are selected and 6 bidirectional temporal dilation causal convolutional layers are stacked to capture short-term temporal dependencies; 4 context-aware attentions and multi-head attentions are selected with two layers of multi-graph convolutional layers to capture short-term spatial dependencies;
[0159] The effectiveness of the traffic flow prediction method proposed in the present invention is evaluated by comparing it with 18 existing methods. The 18 existing methods include:
[0160] (1) HA: The historical average method predicts future values by calculating the average value of a period of time in the past. It is suitable for stationary time series. The method is relatively simple, but it cannot capture complex time dependencies.
[0161] (2) ARIMA: A linear method that combines autoregression, differencing, and moving average, suitable for processing time series with trends and seasonality.
[0162] (3) LSTM: It is a special type of recurrent neural network (RNN) that effectively maintains the memory state and update state by introducing a gating mechanism, solves the gradient vanishing problem in RNN, is good at capturing long-term dependencies, and is suitable for sequence data with long-term dependency features.
[0163] (4) FC-LSTM: Based on the standard LSTM, a fully connected layer is added for higher-level feature extraction. It is suitable for complex time series tasks and further enhances the model's predictive ability.
[0164] (5) GRU: It is a simplified LSTM that uses a gating mechanism to manage information flow and has a relatively low computational cost. Compared with LSTM, GRU can achieve similar results in many applications.
[0165] (6) TCN: It uses a causal convolution structure to process time series, which has the advantage of parallel computing. By extending the convolution kernel, it can effectively capture long-term dependencies and avoid the defects of recursive structures.
[0166] (7) GCN: It processes non-Euclidean data through graph convolution operations and extracts features through the connection relationship between nodes. It can model the dependencies between nodes in traffic flow and effectively capture local and global structural information.
[0167] (8) STGCN: Combining spatiotemporal convolution with graph convolution, it introduces the time dimension to model the spatiotemporal characteristics of traffic flow. It can be used for dynamic traffic flow prediction tasks and can consider both spatial dependency and temporal changes.
[0168] (9) DCRNN: Combining diffuse convolution and recurrent neural network, it predicts traffic flow through graph structure and time series information. The diffusion process enhances the ability of information dissemination and can effectively capture long-term and short-term dependencies.
[0169] (10) Graph WaveNet: It combines graph convolution with temporal convolution and uses graph wave characteristics to model spatiotemporal relationships. It uses a learnable adjacency matrix and attention mechanism to enhance the model’s adaptability to dynamic changes.
[0170] (11)ASTGCN: Based on STGCN, the self-attention mechanism is introduced to improve the ability to focus on important moments and spatial areas, and can more accurately capture key changes in traffic flow.
[0171] (12) STSGCN: Through smooth graph convolution and time series modeling, it reduces the impact of noise on prediction and enhances the ability to capture potential trends in the data. It is suitable for processing high-noise traffic data.
[0172] (13) STFGNN: It integrates multiple features and performs traffic flow prediction through graph convolution and temporal feature extraction. It can handle complex traffic patterns and improve the model's expressiveness and prediction accuracy.
[0173] (14) STTN: By integrating temporal and spatial Transformer modules, it can effectively capture temporal and spatial dependencies respectively.
[0174] (15) STFGCN: It learns the specific traffic pattern of each node through node-specific graph convolution operations, learns the dynamic spatial interdependencies between traffic sequences through an adaptive adjacency matrix, and uses a Transformer-based global temporal correlation learning module to learn the global dependencies of traffic sequences.
[0175] (16) TPGraph: By integrating the three components and effectively utilizing the upstream and downstream road information, it is able to generate accurate predictions of future traffic conditions using only multi-scale historical traffic conditions and spatial factors as input.
[0176] (17) MTDLTFP: Combined with the Transformer model, multiple encoders and decoders are used to extract features from the initial traffic data, reducing the time required for manual feature construction and constructing more effective hidden features.
[0177] (18) RPConvFormer: Based on the Transformer framework, it introduces relative position encoding and 1D convolutional layer improvements to address the limitations of Transformer in handling traffic flow prediction tasks.
[0178] In order to verify the effectiveness of the proposed method for full-cycle traffic flow prediction, a large number of comparative experiments were conducted on four data sets for three indicators with existing methods and the latest methods. Taking the PEMS04 data set as an example, the overall experimental results of the three indicators of MAE, MAPE, and RMSE in multiple different time periods are as follows: Figure 7 , Figure 8 and Fig. 9 shown.
[0179] from Figures 7 to 9It can be seen that the full-cycle traffic flow prediction method proposed by the present invention surpasses the compared methods in the prediction results of each time period in the three experimental indicators. This result fully verifies the effectiveness of the present invention in processing complex dynamic traffic flow prediction tasks. On the one hand, this is due to the fact that the bidirectional gated temporal convolutional network can fully mine the interaction between different time nodes in such a long time series of road network data, so that a large amount of future node information can be used to assist the prediction of the current or next few time steps, instead of wasting this information. On the other hand, the context-aware attention with multiple heads further refines the weights of the nodes. Even if the nodes are far away from the current node, the prediction of the next time step can be taken into account by the present invention, because even if the interaction is negligible, when the time series is very long, there are quite a lot of nodes. No matter how far apart they are, when aggregated, they may also play a "four-two-pound" role in the prediction of the next step. And the use of the spatial-aware weight distribution network further ensures that the nodes with "important influence" in the spatial domain, their information will play their respective roles in the traffic flow prediction at the next moment. Thanks to the use of the above components, the present invention has better performance in overall full-cycle traffic flow prediction.
[0180] The above is a detailed description of the embodiments of the present invention in conjunction with the accompanying drawings, and the specific implementation of the present invention is only used to help understand the method of the present invention. For those of ordinary skill in the art, according to the idea of the present invention, changes and modifications can be made in the specific implementation and application scope, so this specification should not be understood as limiting the present invention.
Claims
1. A full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features, characterized in that: The following steps are involved: S1: The traffic network data is comprehensively characterized by spatiotemporal information. First, a method based on distance and local neighborhood density is designed to construct the adjacency matrix of the road network. By comprehensively considering the spatial distance and local density relationship between road nodes, the influence relationship between adjacent nodes can be captured more accurately. At the same time, a multi-dimensional time series cycle fusion method is designed to integrate multiple time scales, which are represented by five feature matrices: the recent feature matrix F based on multi-level time windows, m (t), feature matrix F based on the time period within the week w (t), time-date based interactive feature matrix F td (t), feature matrix F based on the periodic features of the sliding window p (t), feature matrix F based on time resolution res (t), these time series features not only help improve the prediction performance of the model, but also provide a basis for revealing the underlying laws of traffic flow, and then the spatiotemporal information fusion is used as the initial input of the model; S2: Design a bidirectional gated temporal convolutional network (Bi-Gated TCN) to capture short-term temporal dependencies, effectively extract short-term potential patterns in historical and future traffic data, and improve the ability to respond to instantaneous traffic changes; S3: Design a model based on time-varying multi-neighborhood graph convolution and context-aware multi-graph attention, TVMGCN-CAMGA, to capture short-term multi-attribute neighborhood interactions, aggregate short-term spatial dependencies through multi-layer fusion between multifunctional neighborhoods, and reduce the dimensionality of short-term spatiotemporal features; S4: Design TVFormer to deeply explore the long-term trends in historical traffic data, ensure that the model adapts to traffic flow changes at different time scales, and improve the ability to identify the characteristics of long-term fluctuations in traffic flow; S5: Design SpaGraphFormer to deeply deconstruct key areas in high-dimensional traffic data, fully explore the topological structure in complex road networks, improve the model's perception of comprehensive changes in regional traffic, and reduce the dimensionality of medium- and long-term spatiotemporal features; S6: Reduce the dimension of short-term and medium-term and long-term spatiotemporal features and perform multi-periodic organic fusion to perform multi-period traffic flow prediction; S7: Compare and evaluate the prediction analysis results with the original traffic flow data in terms of mean absolute error, mean absolute percentage error and root mean square error.
2. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S1, the traffic network data is comprehensively characterized in terms of time and space information, including the following steps: Step 1-1: Considering the spatial location, connectivity and relative distance of roads, design a method based on distance and local neighborhood density to construct the adjacency matrix of the road network; Step 1-2: Design a multi-dimensional time series cycle fusion method to fuse multiple time scales, including: recent feature matrix F based on multi-level time windows m (t), feature matrix F based on time periods within a week w (t), time-date based interactive feature matrix F td (t), feature matrix F based on sliding window periodicity features p (t), feature matrix F based on time resolution res (t); Step 1-3: Fusion of spatiotemporal information as initial input to the model.
3. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S2, a bidirectional gated temporal convolutional network Bi-Gated TCN is designed to capture short-term temporal dependencies, including the following steps: Step 2-1: Design a bidirectional gating mechanism, including two key gating units: input gate and forget gate. Input Gate: controls the amount of new information input at each time step, and adjusts the input activation value through the gating mechanism; Forget Gate: controls the amount of old information retained at each time step, aiming to dynamically adjust the weight of each temporal convolutional layer so that the network can adapt to the characteristics of different time scales; Step 2-2: Design a bidirectional dilated causal convolution module so that the network can effectively capture the complex patterns and dependencies in long-term traffic sequences. While capturing the long-distance dependencies that increase over time, it can also extract useful features from both historical and future information, ensuring that the model is more sensitive to short-term traffic flow fluctuations. Step 2-3: Fuse the short-term temporal features output by the bidirectional dilated causal convolution.
4. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S3, a model TVMGCN-CAMGA based on time-varying multi-neighborhood graph convolution and contextual multi-graph-aware attention is designed to capture short-term multi-attribute neighborhood interactions, including the following steps: Step 3-1: Design multiple different adjacency graphs, including the physical adjacency graph (A phy ): Based on the physical connection relationship of road sensors, that is, the connection between traffic nodes constitutes a physical adjacency graph; functional adjacency graph (A fun ): A neighborhood graph based on the functional similarity between transportation nodes; a social adjacency graph (A soc ): An adjacency graph based on the relationship between traffic flow and social and economic activities (such as commercial buildings, residential areas, etc.); Step 3-2: Perform multi-graph convolution operations on the adjacency graph, design a time-varying convolution (TVC) operation, and fuse it with the above multi-neighborhood graph convolution to form a time-varying multi-neighborhood multi-graph convolution (TVMGCN-FMNG), so that the convolution weights can be dynamically adjusted over time; Step 3-3: Design Context-Aware-Attention, that is, the attention weight of a node depends not only on the features of neighboring nodes, but also on its global context information; Step 3-4: Introduce the MultiHead Graph Attention strategy, concatenate the outputs of multiple attention heads to form the Context Aware Multi Graph Attention (CAMGA), and capture more complex spatial dependencies by dynamically adjusting the attention weights between different nodes to further improve the expressiveness of the model.
5. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S4, TVFormer is designed to deeply mine the long-term trends in historical traffic data, including the following steps: Step 4-1: Design a dynamic memory network (DMN) to store historical information by maintaining a dynamically updated memory bank and use the memory bank to improve the current time series prediction, which is used to enhance the memory capacity of the time series model to better capture long-term dependencies; Step 4-2: Design a multi-scale temporal convolution (MSTC) to extract features of different time scales, fuse the long-term dependency features output by the DMN with the multi-scale features output by the MSTC module, and realize the comprehensive extraction of traffic flow temporal features; Step 4-3: Design a sparse attention mechanism (SAM) to focus only on the most relevant parts of the current time step, selectively strengthen attention to key moments (such as traffic peak time periods), and solve the problem of high computational complexity of the standard attention mechanism; Step 4-4: Design an adaptive temporal window mechanism (ATW), adjust the time window size according to the dynamic characteristics of the input sequence, and further adapt the feature weights output by the SAM module to capture more historical information, enhance the model's sensitivity to different time features, and achieve accurate capture of medium- and long-term temporal dependencies.
6. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S5, SpaGraphFormer is designed to deeply deconstruct key areas in high-dimensional traffic data, including the following steps: Step 5-1: Design the Optimized Spatial Feature Extraction Network (OSFEN) to dynamically adjust the input spatial features when capturing long-term spatial features. The network can adaptively adjust the spatial position of the features, thereby enhancing the modeling capability of long-distance traffic flow relationships. The flexibility of feature extraction is improved by introducing nonlinear operations, which is conducive to capturing local and global spatial features. Step 5-2: Design Optimized Spatial Adaptive Pooling (OSAP) to introduce adaptability in the multi-scale processing of spatial features. OSAP introduces a dynamically adjusted pooling window to process spatial features at different scales, so that it can not only adaptively capture local details, but also control the contribution of different spatial regions through dynamic weights, so that the network can still accurately capture long-term dependent features when facing complex spatial structures; Step 5-3: Design a Spatial Perception Weight Distribution Network (SPWDN) to introduce dynamically adjusted spatial perception capabilities into feature similarity calculations to ensure that the network can identify and focus on key areas during the weight distribution process; Step 5-4: Design an Optimized Spatial Graph Convolution Network (OSGC). OSGC builds a graph structure on the feature graph and performs convolution operations to capture the spatial dependencies between regions. When constructing the graph convolution, it considers not only direct neighbors but also more distant nodes. Step 5-5: A spatial weighted feature enhancement module (Optimized SpatialAttention Weighted Features, OSAWF) is further proposed. In this module, the features after graph convolution are combined with the features generated by the spatial sense weight distribution network, and the features are fused through weighted summation.
7. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S6, the short-term and medium-term and long-term spatiotemporal features are dimensionally reduced and multi-periodic organically integrated to perform multi-period traffic flow prediction, including the following steps: Step 6-1: Design space-time fusion coding: Jointly encode spatial and temporal features through a two-stream network structure; Step 6-2: Use the hybrid self-attention mechanism to calculate the spatial-temporal hybrid attention weight matrix; Step 6-3: Design spatial-temporal multi-head attention and use the multi-head attention mechanism to perform spatiotemporal joint feature learning; Step 6-4: Execute spatiotemporal mixed feature output; Step 6-5: Perform fusion and prediction of spatiotemporal features, and perform nonlinear fusion through the feature fusion layer to obtain the final prediction value.
8. The full-cycle traffic flow prediction method based on deep fusion of spatiotemporal features according to claim 1 is characterized by: In step S7, the prediction analysis results are compared and evaluated with the original traffic flow data in terms of mean absolute error, mean absolute percentage error and root mean square error. Mean absolute error (MAE) represents the average value of the absolute error between the predicted value and the true value, and is used to measure the average degree of deviation between the predicted value and the true value; mean absolute percentage error (MAPE) represents the average value of the absolute percentage error between the predicted value and the true value, and is used to measure the average degree of error of the predicted value relative to the true value, taking into account the proportion of the error relative to the true value; root mean square error (RMSE) represents the square root of the average value of the square error between the predicted value and the true value, and is used to measure the average degree of deviation between the predicted value and the true value, and to penalize large errors; these three evaluation indicators can be used to evaluate the accuracy and performance of the traffic flow prediction model, and the smaller the MAE and RMSE, the better, and the closer the MAPE is to 0, the smaller the prediction error.
Citation Information
Patent Citations
Traffic prediction method based on multi-scale space-time fusion graph network
CN115240425A
Traffic flow forecasting method based on multi-mode dynamic residual graph convolution network
US20230334981A1
Short-term traffic flow prediction method based on spatio-temporal correlation
WO2020010717A1
Cited By
Intelligent regulation and control method for three-stage constructed wetland recirculating aquaculture system
CN120406176A
Traffic flow prediction method based on long-period multi-dimensional feature fusion
CN120977121A
Marine diffusible substance concentration field prediction method, system and equipment
CN121113790A
Crop yield prediction method and device and terminal equipment
CN121170585A
Time-varying graph neural network traffic flow prediction method based on dynamic memory bank
CN121171043A