Urban traffic flow prediction method, system and product under complex road network condition
By combining the mixed layer of the TSMixer model with the Mamba block method, the problems of dynamic information processing and noise filtering in traffic flow prediction under complex road network conditions are solved, and more efficient long-sequence modeling and stronger prediction accuracy are achieved.
Patent Information
- Application Number
- CN202510412626.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-03
AI Technical Summary
The prior art is difficult to effectively deal with real-time changing traffic networks under complex road network conditions, especially when non-periodic events such as sudden traffic congestion and abnormal weather occur. The model lacks a dynamic information screening mechanism, making it difficult to distinguish between effective signals and noise, resulting in a degradation of prediction performance.
Using a method combining the mixed layer of the TSMixer model with the Mamba block, the cross information between the time dependence and features in the time series is captured through the mixed layer, the dynamic selection ability of the Mamba block is used to filter noise, enhance the focus of key information, and capture the global dependence in the long sequence through selective state space modeling.
It realizes dynamic processing of data based on real-time traffic conditions in urban traffic flow prediction under complex road network conditions, effectively utilizes multivariate information and performs efficient long-sequence modeling, has stronger expression ability and higher prediction accuracy, reduces the risk of overfitting and improves the generalization ability of the model.
Smart Images

Figure CN119939167A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of traffic flow prediction, and in particular relates to a method, system and product for predicting urban traffic flow under complex road network conditions. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] For the typical time series prediction scenario of urban traffic flow prediction, existing technologies face challenges in practical applications. The urban traffic system has complex dynamic characteristics, including multivariate time series data such as intersection flow, vehicle type, and driving speed. Its flow changes are affected by multiple factors such as the periodicity of morning and evening peaks, interference from emergencies, and holiday mode switching, showing high volatility, non-periodicity, and non-stationarity. Traditional time series prediction models based on statistics, such as ARIMA, face the challenge of processing complex multivariate data. With the rapid development of deep learning, models based on CNN, RNN, and Transformer have been widely used in time series prediction tasks, achieving better prediction performance than traditional methods. The Transformer-based model uses the self-attention mechanism to capture long-term dependencies in the sequence and achieves excellent performance, but its quadratic complexity problem leads to high computational cost when processing long sequence data generated by massive sensors in urban road networks. Recently, the Mamba model based on the state space model SSM has shown comparable performance to the Transformer in sequence data modeling. It combines the sequential reasoning ability of RNN and the parallel training ability of CNN, successfully solving the problem of low computational efficiency of Transformer when processing long sequence data. Mamba introduces a selection mechanism based on the SSM framework, which can effectively focus on or ignore information in a way that depends on the input data. At the same time, it uses a hardware-aware scanning algorithm to efficiently parallelize data processing and maintain linear complexity when modeling long sequences. Today, Mamba has demonstrated superior performance in language modeling, computer vision, genomics and other fields. It is a strong competitor to the Transformer architecture and has inspired researchers to explore the application of Mamba in time series prediction tasks.
[0004] It is currently found that simple linear models, such as DLinear, outperform most complex Transformer-based models in terms of performance and efficiency in time series forecasting tasks. The TSMixer model is a recently proposed multivariate time series forecasting architecture based on full MLP. It retains the ability of linear models to capture temporal dependencies, while being able to effectively utilize cross-variable information to improve forecasting performance, making it highly competitive. However, in urban traffic flow forecasting, when non-periodic events such as sudden traffic congestion and abnormal weather occur, the model uses MLP with static parameter weights to capture the dependencies between variables, lacks a dynamic information screening mechanism, and is difficult to distinguish between effective signals and noise. It cannot effectively handle real-time changing traffic networks, limiting the forecasting performance under complex road network conditions. In addition, MLP-based models only rely on local time patterns observed in historical windows for prediction, and may ignore global temporal dependencies when processing long sequences generated by traffic flow sensors, resulting in reduced prediction accuracy. Summary of the invention
[0005] In order to solve at least one technical problem existing in the above-mentioned background technology, the present invention provides a method and system for predicting urban traffic flow under complex road network conditions, which can dynamically process data according to real-time traffic conditions in urban traffic flow prediction, effectively utilize multivariate information and perform efficient long sequence modeling, and has stronger expression ability and higher prediction accuracy.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: A first aspect of the present invention provides a method for predicting urban traffic flow under complex road network conditions, comprising the following steps: Obtain urban road network traffic flow time series data; Based on the time series data of urban road network traffic flow, time mixing features are extracted to capture the cross information between different traffic features, and the time mixing features and the cross information between different traffic features are integrated to obtain the mixed feature representation; Based on hybrid feature representation, the global dependencies in long sequences are captured through selective state space modeling, and dynamic temporal features are output; After enhancing the dynamic time series features, they are projected along the time dimension to obtain the predicted values of each characteristic variable of the traffic time series data.
[0007] Furthermore, the time mixing features extracted based on the urban road network traffic flow time series data include: Perform two-dimensional batch normalization on time series data in both time and feature dimensions; Transpose the normalized time series data, apply the time mixture MLP along the time dimension and share between features to capture local time dependencies and obtain the time mixture features; The time mixing features are transposed again, the dimensional order of the original data is restored, and residual connections are performed to retain the fluctuation characteristics of the original traffic to obtain the final time mixing features.
[0008] Furthermore, the time-based mixed feature captures cross-information between different traffic features, including: Perform two-dimensional batch normalization on the time-mixed feature sequence; The normalized data are processed along the feature domain using feature mixing MLP and shared between time steps to capture the cross information between features and obtain the cross information between different traffic characteristics.
[0009] Furthermore, the hybrid feature representation captures global dependencies in long sequences through selective state space modeling and outputs dynamic time series features, including: The hybrid feature representation is transformed through a fully connected linear layer to map the original feature dimension to the hidden layer dimension of the Mamba block, encoding the high-dimensional semantics of the traffic feature. The high-dimensional semantics of the linearly transformed traffic features are input into the Mamba block, mapped to the hidden state space, capturing global dependencies, modeling long sequence dependencies, and outputting dynamic temporal features.
[0010] Furthermore, after obtaining the dynamic time series features, the dynamic time series features are mapped back to the original dimension through a fully connected linear layer, decoding the high-dimensional features into physically meaningful variables.
[0011] Furthermore, the dynamic time series feature enhancement includes performing a Dropout regularization operation on the dynamic time series feature, performing a residual connection between the obtained result and the mixed feature representation, retaining the original feature and skipping unnecessary transformations to obtain an enhanced feature representation.
[0012] Furthermore, when projecting along the time dimension after enhancing the dynamic time series features, the historical window is transformed into Mapping to predicted length , get the future The predicted value of each characteristic variable of the traffic time series data at each time step.
[0013] Furthermore, the method further comprises preprocessing the urban road network traffic flow time series data, and the preprocessed data is expressed as: , represents the traffic flow time series data continuously sampled by different sensors in the urban road network after preprocessing, where Indicates that the time series is The observed value at time, Indicates the length of the input time series data, Represents the number of traffic multivariate features contained in each time step.
[0014] A second aspect of the present invention provides a system for predicting urban traffic flow under complex road network conditions, comprising: A data acquisition module, which is used to obtain time series data of urban road network traffic flow; A hybrid feature extraction module is used to extract time hybrid features based on the time series data of urban road network traffic flow, capture the cross information between different traffic features based on the time hybrid features, and fuse the time hybrid features and the cross information between different traffic features to obtain hybrid feature representation; The traffic flow prediction module is used to capture the global dependencies in long sequences based on hybrid feature representation through selective state space modeling and output dynamic time series features; after enhancing the dynamic time series features, they are projected along the time dimension to obtain the predicted values of each feature variable of the traffic time series data.
[0015] A third aspect of the present invention provides a program product.
[0016] The program product is a computer program product, including a computer program, which, when executed by a processor, implements the steps in the method for predicting urban traffic flow under complex road network conditions as described above.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention can simultaneously capture the time dependency in time series, the cross-information between features, and the global dependency in long sequences. In the urban traffic flow prediction under complex road network conditions, it can dynamically process data according to real-time traffic conditions, effectively utilize multivariate information, and perform efficient long sequence modeling, with stronger expression ability and higher prediction accuracy.
[0018] 2. The present invention effectively captures the time dependency and cross-information between features in time series data by using a mixed layer, and fuses the time mixed features and the cross-information between different traffic features to obtain a mixed feature representation; based on the mixed feature representation, the global dependency in a long sequence is captured by selective state space modeling, and dynamic time series features are output to reduce the risk of overfitting and improve the generalization ability of the model. The use of residual connections can effectively alleviate the gradient vanishing problem and avoid information degradation in deep networks. In complex multivariate scenarios, the present invention achieves higher prediction accuracy than the traditional TSMixer model.
[0019] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0021] Figure 1 is a flow chart of a method for predicting urban traffic flow under complex road network conditions provided by an embodiment of the present invention; Figure 2 It is a structural diagram of the time series prediction model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0024] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0025] As mentioned in the background technology, when non-periodic events such as sudden traffic congestion and abnormal weather occur in urban traffic flow prediction, the model uses a multilayer perceptron (MLP) with static parameter weights to capture the dependencies between variables. It lacks a dynamic information screening mechanism and is difficult to distinguish between valid signals and noise. It cannot effectively handle real-time changing traffic networks, which limits the prediction performance under complex road network conditions. In addition, the MLP-based model only relies on the local time patterns observed in the historical window for prediction. When processing long sequences generated by traffic flow sensors, it may ignore the global temporal dependencies, resulting in a decrease in prediction accuracy.
[0026] The present invention combines the mixing layer of the TSMixer model with the Mamba block sequence, uses the mixing layer to effectively capture the time dependency and cross information between features in the time series data, uses the dynamic selection ability of the Mamba block to filter noise, enhances the focus on key information, and further captures the global dependency in the long sequence. The training stability and generalization ability of the model are improved through Dropout and residual connection, and the prediction results are finally generated by the time projection layer mapping. By combining the advantages of TSMixer and Mamba, the present invention can dynamically process data according to real-time traffic conditions in urban traffic flow prediction, effectively utilize multivariate information and perform efficient long sequence modeling, and has stronger expression ability and higher prediction accuracy.
[0027] Embodiment 1 See also Figure 1 and Figure 2 This embodiment provides a method for predicting urban traffic flow under complex road network conditions, including the following steps: S101: Obtaining urban road network traffic flow time series data and preprocessing it; In this embodiment, the urban road network traffic flow time series data is obtained and preprocessed to obtain , represents the traffic flow time series data continuously sampled by different sensors in the urban road network after preprocessing, where Indicates that the time series is The observed value at time, Indicates the length of the input time series data, Represents the number of traffic multivariate features contained in each time step.
[0028] S102: Based on the preprocessed urban road network traffic flow time series data, extract the time pattern and the cross information between different features to generate a mixed feature representation; In this embodiment, the time series data is input into the mixing layer in the TSMixer model to extract the time pattern and the cross information between different features to generate a mixed feature representation; For the mixing layer that feeds time series data into the TSMixer model, the input data for the model is ,in Indicates that the time series is The observed value at time, Indicates the length of the input time series data, Represents the number of feature variables, and passes the data through the time mixing layer and feature mixing layer in the mixing layer in sequence to capture local time dependencies and enhance feature interactions to generate a mixed representation , in the form of ,in Indicates time mixing in the time dimension. Indicates feature mixing on the feature dimension.
[0029] The specific steps include: S201, time series data applies two-dimensional batch normalization in both time and feature dimensions, , ensuring the consistency of data in two dimensions and eliminating the dimensional differences between different sensors.
[0030] S202, transpose the normalized input, apply the time-mixed MLP along the time dimension and share between features, capture local time dependencies, and obtain time-mixed features, such as traffic periodicity during peak hours, ;in, , , is an activation function, Yes Perform a transpose operation; S203, transpose the result of time mixing again, restore the dimensional order of the original data, and then perform residual connection to retain the fluctuation characteristics of the original traffic. , and obtain the temporal mixing feature representation of the output of the temporal mixing layer ;in, Represents the Dropout operation; S204, sequence Perform two-dimensional batch normalization again to obtain The normalized data is applied with feature mixing MLP along the feature domain and shared between time steps to capture cross-information between features, such as the dynamic correlation between vehicle speed and traffic flow. , ;in, is the first layer output of the feature mixing MLP, which represents the intermediate result after nonlinear transformation of the normalized input. is the second layer output of the feature mixture MLP, which represents the final result of the feature mixture MLP obtained by linearly transforming the intermediate result of the first layer. , , , , is the dimension of the hidden layer in the feature mixing MLP; S205, fusing the temporal pattern and cross-variable information through residual connection, , and get the output of the mixed layer .
[0031] S103: Based on hybrid feature representation, it captures global dependencies in long sequences through selective state space modeling and outputs dynamic temporal features; In this embodiment, the output data of the hybrid layer is input into the Mamba block, and the global dependencies in the long sequence are captured by selective state space modeling, and the dynamic time series features are output; The specific steps include: S301, data The feature dimension is transformed through the fully connected linear layer, from the original feature dimension Mapped to the hidden layer dimensions of the Mamba block , encoding the high-dimensional semantics of traffic characteristics and enhancing the model's expressiveness, expressed as: , where the weight matrix , bias term , the data after linear transformation .
[0032] S302, time series after linear transformation Enter the Mamba block, , mapping it to the hidden state space, ignoring unnecessary mixing operations through the selective state space, extracting relevant patterns that are crucial to prediction, and capturing global dependencies that may be ignored by the mixing layer, modeling long sequence dependencies, and outputting dynamic timing features, which are formally expressed as , .
[0033] In this embodiment, the Mamba block dynamically processes data according to real-time traffic conditions through a selective state space, ignoring unnecessary mixing operations and extracting relevant patterns that are critical for prediction.
[0034] When faced with unexpected events such as abnormal weather, the historical periodicity weight is reduced, and short-term fluctuations affected by weather are fitted first. At the same time, global dependencies that may be ignored by the mixed layer are captured, and dependencies between long sequences such as historical data across weeks are modeled, and dynamic time series features are finally output. .
[0035] S303, the output data obtained by Mamba block processing Through the fully connected linear layer, the high-dimensional features are mapped back to the original dimension and decoded into physical meaning variables, which is specifically expressed as , where the weight matrix , bias term , the output of this layer after linear transformation is .
[0036] S104: enhancing the dynamic time series feature to obtain an enhanced dynamic time series feature representation; Specifically, the output of the Mamba block is subjected to a Dropout regularization operation, and the result is residually connected with the hybrid feature representation, retaining the original features and skipping unnecessary transformations to obtain an enhanced feature representation; In this embodiment, when the output of the Mamba block is subjected to the Dropout regularization operation, some neurons are randomly discarded with a probability of 0.1 to 0.9. , By reducing the interdependence between variables, the model is prevented from overfitting to fixed road patterns. The probability value is dynamically adjusted according to the training stage to adapt to different data distributions, improving the generalization ability of the model.
[0037] S105: mapping the enhanced dynamic time series feature representation to obtain a final traffic flow prediction result; In this embodiment, the result after residual connection is input into the time projection layer of the TSMixer model and mapped into the final prediction result.
[0038] Specifically, when the result after residual connection is input into the time projection layer of TSMixer model, the residual output is first Transpose, apply a fully connected linear layer along the time dimension for linear projection and share between features. This layer learns temporal patterns and transforms the time series from the historical window Mapping to predicted length Specific expression is , where the weight matrix , bias term , and get the final prediction result , including the future The predicted value of each characteristic variable of the traffic time series data at each time step.
[0039] Effect verification The prediction performance of the present invention is evaluated by mean square error (MSE) and mean absolute error (MAE), and the smaller the error, the better the performance. The model constructed by the embodiment of the present invention is experimented on a public real traffic data set, with the input historical data length of 512 and the prediction length of 96, 192, 336 and 720. Table 1 shows the error comparison experimental results of the method of the present invention and the TSMixer model on the public data set; Table 1 Experimental results of prediction model error comparison
[0040] It can be seen from Table 1 that the present invention performs well in different length prediction tasks, and the values of mean square error (MSE) and mean absolute error (MAE) are smaller than those of the TSMixer model, which proves the effectiveness of the model proposed in the present invention in predicting urban traffic flow under complex road network conditions.
[0041] Embodiment 2 This embodiment provides a system for predicting urban traffic flow under complex road network conditions, including: A data acquisition module, which is used to obtain time series data of urban road network traffic flow; A hybrid feature extraction module is used to extract time hybrid features based on the time series data of urban road network traffic flow, capture the cross information between different traffic features based on the time hybrid features, and fuse the time hybrid features and the cross information between different traffic features to obtain hybrid feature representation; The traffic flow prediction module is used to capture the global dependencies in long sequences based on hybrid feature representation through selective state space modeling and output dynamic time series features; after enhancing the dynamic time series features, they are projected along the time dimension to obtain the predicted values of each feature variable of the traffic time series data.
[0042] It should be noted that the specific implementation method of the urban traffic flow prediction system under complex road network conditions of the embodiment of the present invention is similar to the specific implementation method of the urban traffic flow prediction method under complex road network conditions of the embodiment of the present invention. Please refer to the description of the method part for details. In order to reduce redundancy, it will not be repeated here.
[0043] Embodiment 3 This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the method for predicting urban traffic flow under complex road network conditions as described above are implemented.
[0044] Embodiment 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the method for predicting urban traffic flow under complex road network conditions as described above are implemented.
[0045] Embodiment 5 This embodiment provides a program product, which is a computer program product, including a computer program. When the computer program is executed by a processor, the steps in the method for predicting urban traffic flow under complex road network conditions as described above are implemented.
[0046] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting urban traffic flow under complex road network conditions, characterized in that: The steps include: Obtain urban road network traffic flow time series data; Based on the time series data of urban road network traffic flow, time mixing features are extracted to capture the cross information between different traffic features, and the time mixing features and the cross information between different traffic features are integrated to obtain the mixed feature representation; Based on hybrid feature representation, the global dependencies in long sequences are captured through selective state space modeling, and dynamic temporal features are output; After enhancing the dynamic time series features, they are projected along the time dimension to obtain the predicted values of each characteristic variable of the traffic time series data.
2. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: The time mixing features extracted based on the urban road network traffic flow time series data include: Perform two-dimensional batch normalization on time series data in both time and feature dimensions; Transpose the normalized time series data, apply the time mixture MLP along the time dimension and share between features to capture local time dependencies and obtain the time mixture features; The time mixing features are transposed again, the dimensional order of the original data is restored, and residual connections are performed to retain the fluctuation characteristics of the original traffic to obtain the final time mixing features.
3. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: The time-based mixed feature captures the cross-information between different traffic features, including: Perform two-dimensional batch normalization on the time-mixed feature sequence; The normalized data are processed along the feature domain using feature mixing MLP and shared between time steps to capture the cross information between features and obtain the cross information between different traffic characteristics.
4. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: The hybrid feature representation captures global dependencies in long sequences through selective state space modeling and outputs dynamic time series features, including: The hybrid feature representation is transformed through a fully connected linear layer to map the original feature dimension to the hidden layer dimension of the Mamba block, encoding the high-dimensional semantics of the traffic feature. The high-dimensional semantics of the linearly transformed traffic features are input into the Mamba block, mapped to the hidden state space, capturing global dependencies, modeling long sequence dependencies, and outputting dynamic temporal features.
5. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: After obtaining the dynamic time series features, the dynamic time series features are mapped back to the original dimension through a fully connected linear layer, decoding the high-dimensional features into physically meaningful variables.
6. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: The enhancement of dynamic time series features includes performing a Dropout regularization operation on the dynamic time series features, performing a residual connection between the obtained results and the mixed feature representation, retaining the original features and skipping unnecessary transformations to obtain an enhanced feature representation.
7. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: When the dynamic time series features are enhanced and projected along the time dimension, the historical window is transformed into Mapping to predicted length , get the future The predicted value of each characteristic variable of the traffic time series data at each time step.
8. The method for predicting urban traffic flow under complex road network conditions as claimed in claim 1, characterized in that: The method further includes preprocessing the urban road network traffic flow time series data, and the preprocessed data is expressed as: , represents the traffic flow time series data continuously sampled by different sensors in the urban road network after preprocessing, where Indicates that the time series is The observed value at time, Indicates the length of the input time series data, Represents the number of traffic multivariate features contained in each time step.
9. Urban traffic flow prediction system under complex road network conditions, characterized by: include: A data acquisition module, which is used to obtain time series data of urban road network traffic flow; A hybrid feature extraction module is used to extract time hybrid features based on the time series data of urban road network traffic flow, capture the cross information between different traffic features based on the time hybrid features, and fuse the time hybrid features and the cross information between different traffic features to obtain hybrid feature representation; The traffic flow prediction module is used to capture the global dependencies in long sequences based on hybrid feature representation through selective state space modeling and output dynamic time series features; after enhancing the dynamic time series features, they are projected along the time dimension to obtain the predicted values of each feature variable of the traffic time series data.
10. A program product, the program product being a computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for predicting urban traffic flow under complex road network conditions as described in any one of claims 1-8 are implemented.
Citation Information
Patent Citations
Multi-view fusion space-time dynamic graph convolutional network urban traffic flow prediction method
CN116935649A
Time sequence prediction method and device, computer equipment and storage medium
CN118520269A
Charging pile charging charge prediction method, system and device based on Internet of Things
CN118572699A
Deep hash image retrieval method based on frequency domain decoupling and visual Mamba
CN118820508A
Aviation trajectory prediction method based on multi-flight training and transposition input, medium, device and program product
CN119479384A
Cited By
Induction signal phase duration prediction method based on TSpixel
CN120726830A
Electrolytic bath health state online prediction method and system based on state space model
CN121167243A