High-speed traffic flow prediction method based on long-short period Transform fusion trend and seasonal characteristics

By using a long and short-term Transformer fusion trend and seasonal characteristics in highway traffic flow prediction, the problem of failure to fully combine the correlation between near-term and forward data in the prior art is solved, and higher prediction accuracy and robustness are achieved.

CN119540887APending Publication Date: 2025-02-28HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411604505.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Existing deep learning methods fail to fully combine the correlation between recent and long-term data in highway traffic flow prediction, resulting in insufficient prediction accuracy and robustness.

Method used

A high-speed traffic flow prediction method based on the fusion trend and seasonal characteristics of long and short period Transformer is designed. By combining Transformer and diffusion convolution, the spatiotemporal characteristics of short period data are captured, and the improved Transformer model is used to analyze long period data.

Benefits of technology

It significantly improves the accuracy and robustness of highway traffic flow prediction, and can more effectively capture the periodic changes and spatiotemporal characteristics of traffic flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540887A_ABST
    Figure CN119540887A_ABST
Patent Text Reader

Abstract

The invention provides a high-speed traffic flow prediction method based on long and short period Transform fusion trend and seasonal characteristics, and belongs to the field of data unsupervised prediction. The invention provides a high-speed traffic flow prediction method based on long and short period Transform fusion trend and seasonal characteristics, aiming at the problems that time-space relevance exists among variables in traffic flow data and short-term and long-term information cannot be fully combined when a traditional method is used for processing the data, and the invention provides the high-speed traffic flow prediction method based on the long and short period Transform fusion trend and seasonal characteristics. According to the method, a Transform attention mechanism is innovatively combined with diffusion convolution, the spatial-temporal correlation of short-period data is deeply mined, meanwhile, the trend of Transform is fused with seasonal characteristics, and the long-term dependency relationship in different periods is effectively captured. And finally, fusing the prediction results of different period data by using three weight moments, and fully considering the characteristics of short-term data and long-term data. When the network model is applied to high-speed traffic flow prediction, the prediction accuracy can be improved, and the effectiveness of the method is verified by experimental results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The present invention relates to the field of unsupervised data prediction, and in particular to a high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trends and seasonal characteristics. Background technology:

[0002] With the vigorous development of emerging technologies such as big data, cloud computing, and the Internet of Things, the digital transformation process of various industries has been significantly accelerated, and the implementation of intelligent and precise management has also been promoted. As an important link connecting cities, the increasingly severe congestion problem of highways has affected people's travel. If congestion can be predicted in advance, corresponding measures can be taken to resolve the congestion. Therefore, accurately predicting traffic flow data in future time periods plays a vital role in alleviating road congestion.

[0003] Traffic flow data mainly includes information such as flow, density and speed, and belongs to the time series data type. Time series data is a series of measurements recorded at a specific time point. They are arranged in chronological order and can clearly reveal the changing trend of the data over time. Early warning of highway congestion mainly depends on the accurate prediction of traffic flow data. However, time series data is easily affected by special conditions such as bad weather or traffic accidents, which makes the accuracy of prediction a difficult problem in this field.

[0004] At present, many deep learning methods have been proposed for traffic flow prediction. For example, convolutional neural networks (CNN) and long short-term memory networks (LSTM) are used to capture and extract temporal feature information from traffic data, attention mechanisms are used to enhance the ability to extract temporal features, and graph neural networks (GNN) are used to extract spatial feature information. These methods do not fully combine the correlation between recent data and long-term data. In fact, both recent data and long-term data have an important impact on prediction: recent data can reflect the spatiotemporal correlation of traffic flow data, while long-term data can reflect the periodic changes of traffic flow. Therefore, how to design a suitable deep learning model to effectively combine different periodic information to improve the accuracy and robustness of prediction is a problem worthy of in-depth study.

[0005] To solve the above problems, we designed a high-speed traffic flow prediction method based on the long-short cycle Transformer fusion trend and seasonal characteristics. This method combines diffusion convolution on the basis of Transformer, thereby mining the correlation information of short-cycle data in time and space dimensions, and at the same time uses the Transformer fusion of trend and seasonal features to deeply analyze the long-cycle data to capture long-term dependencies. This long-short cycle fusion network model significantly improves the prediction performance.

[0006] The traffic status of highways can be observed through surveillance videos. Using technologies such as target detection, we can extract valuable traffic flow parameters such as flow, density and speed from video data. There is a certain correlation between these parameters, but most current traffic flow prediction methods do not make full use of data information of different periods and ignore their potential relationships. To this end, we divide the data into "hourly cycle data", "day cycle data" and "weekly cycle data". For hourly cycle data, we combine Transformer and diffuse convolution to capture the temporal relationship and the spatial relationship between nodes of each section. For daily cycle data and weekly cycle data, we improve the original Transformer model, integrate trend features with seasonal features, and further improve the quality of long-term data feature representation to better capture the periodic changes of traffic flow, so that the accuracy and generalization ability of prediction are greatly improved.

[0007] In summary, our overall model consists of three periodic parts, using Transformer and diffusion convolution and Transformer combined with trend and seasonal features to model the relationship between short-term and long-term traffic flow data, and achieve efficient prediction of time series data. This method not only opens up new ideas in theory, but also provides solid technical support for the actual safety of highway scenarios. Summary of the invention:

[0008] The purpose of the present invention is to solve the problem that different cycles are connected and the problem that the traditional Transformer model fails to fully integrate trends and seasonal characteristics, and proposes a high-speed traffic flow prediction method based on long- and short-cycle Transformer integrating trends and seasonal characteristics.

[0009] (I) Technical solution

[0010] A high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics includes the following steps:

[0011] Step 1: Process video data. This step mainly extracts traffic flow parameters from video data. Before determining the importance of each dimension, the input data needs to be standardized and the data set needs to be divided.

[0012] Step 1-1 uses the ViBe algorithm to separate the vehicle and background from the video frame.

[0013] When the algorithm is initialized, the eight neighborhoods of each pixel point x in the first frame image are randomly sampled N times, and the sampled N pixels are saved in the background space. The formula is as follows:

[0014] M(x)={v1,v2,v3,...,v N} (1)

[0015] Then define a sphere S with radius R centered at V(x) R (V(x) is used to calculate the Euclidean distance between each pixel in the current frame and the corresponding background sample pixel. If the calculated distance is greater than the threshold min, the pixel is a background point. The formula is as follows:

[0016] {S R (V(x))∩{ν1,ν2,...,ν N}}≥min (2)

[0017] Finally, the background model is updated. When a pixel is judged as a background point, a pixel in the corresponding background sample is randomly replaced. If a pixel in the image is continuously judged as a foreground, the pixel is updated to the background.

[0018] Step 1-2 uses the YOLOv8 model for training to detect the target vehicle. We use the cross entropy loss function to determine whether the target vehicle exists and the accuracy of target classification, and the mean square error loss function to locate the position of the target vehicle. By minimizing the loss function, the accuracy of target detection is improved.

[0019] Steps 1-3 are combined with the virtual coil algorithm to extract traffic flow parameters (traffic volume, speed, and density) and generate corresponding data set files. We count the total number of vehicles passing through the virtual coil within a specific time to calculate the traffic flow. The formula is as follows:

[0020]

[0021] Among them, N represents the number of frames in the time period, car i Represents the vehicle count.

[0022] We use the time interval between two adjacent virtual coils to calculate the vehicle speed v (m / s). The formula is as follows:

[0023]

[0024] Where d is the distance between the two virtual coils, and Δt is the time difference between the vehicle passing the first and second coils.

[0025] We use the lane width and the length of the area covered by the video frame to calculate the vehicle density Den (vehicles / km) in the area. The formula is as follows:

[0026]

[0027] Among them, M is the total number of vehicles passing through the virtual coil during the time period, L is the length of the area covered by the video frame, w is the lane width, and num is the number of lanes.

[0028] Steps 1-4 construct a data set based on the flow, speed, and density values ​​obtained by each node at each moment, and normalize these data using the z-score standardization method. The z-score is standardized based on the mean and standard deviation of the original data, and the formula is as follows:

[0029]

[0030] Among them, x i represents the i-th value of the time series data, represents the mean of the time series data, and s represents the variance of the time series data.

[0031] Steps 1-5 divide the input data into three different time periods, among which "hourly cycle data" is short-term data, while "daily cycle data" and "weekly cycle data" are long-term data.

[0032] Steps 1-6 divide the data set into training set, validation set, and test set, with the ratio of 6:2:2. The training set is used for the model training process, the validation set is used to adjust and optimize the model parameters, and the test set is used to evaluate the final performance of the model.

[0033] Step 2: Training hourly cycle data is mainly completed by Transformer attention mechanism and diffusion convolution. The purpose of inputting data into Transformer for training is to extract time series features, and then using diffusion convolution for training is to extract the spatial features of each road node, so that the model can fully extract the spatiotemporal features of short-term data.

[0034] Step 2-1 uses position encoding to provide position information for sequence elements. The formula is as follows:

[0035]

[0036] Among them, PE f,t Represents the positional encoding value corresponding to the f-th feature at time t, where F is the number of features in the input sequence.

[0037] Step 2-2 uses the Transformer attention mechanism to obtain the matrix composed of the vectors of all nodes at time t, denoted as G t The attention calculation formula is as follows:

[0038]

[0039] in, and They represent the query vector, key vector, and value vector of the i-th node at time t, respectively. k is the dimension of the key vector.

[0040] Step 2-3 builds the graph relationship based on the vector output from the previous layer. First, two linear mappings are performed on each node vector. The formula is as follows:

[0041]

[0042] Among them, R t1 and R t2 They represent the matrices composed of the source vector and target vector of the node at time t respectively. W1 and W2 are trainable matrices.

[0043] Then construct the spatial relationship between N road network nodes at time t, the formula is as follows:

[0044] M t =ReLU(R t1 )ReLU(R t2 ) T (10)

[0045] Among them, M t Represents the weighted adjacency matrix of the graph at time t.

[0046] Steps 2-4 use diffuse convolution to extract the spatial relationship between nodes. The formula is as follows:

[0047]

[0048] Among them, X t is the input feature matrix at time t, and are two trainable parameter matrices in the diffusion of step l, [diag(M t λ)] -1 and They are the forward transfer matrix and backward transfer matrix at time t respectively, and finally the feature Z1 of the daily cycle data is obtained.

[0049] Step 3: Training daily and weekly cycle data is done by Transformer that integrates trend and seasonal features. This model can extract cycle features well.

[0050] Step 3-1 performs STL decomposition on the traffic flow, speed and density data to obtain three parts: residual, trend and seasonality. Among them, the residual captures unpredictable traffic changes, the trend represents the long-term upward or downward trend of traffic flow, and the seasonality reflects the fluctuation of traffic flow with the day and week.

[0051] Step 3-2 inputs the trend and seasonal characteristics of the data into two attention mechanism modules for calculation to obtain their respective attention scores. The calculation process of the attention mechanism is dynamic and can adaptively adjust the weights according to the different characteristics of the input data. The formula is as follows:

[0052]

[0053] Among them, Q t and Q s is the query vector of trend and seasonality, K t and K s is the key vector of trend and seasonality, V t and V s is the value vector of trend and seasonality. In this way, the model can effectively capture the relationship between trend and seasonality, thus helping to mine the deep information of the data.

[0054] Step 3-3 effectively fuses the outputs of the two attentions to obtain the feature Z2 of the daily cycle data and the data feature Z3 of the weekly cycle data. The formula is as follows:

[0055] W1Attention t (Q t ,K t ,V t )+W2Attention s (Q s ,K s ,V s ) (12)

[0056] Among them, W1 and W2 are learnable parameters, which are used to effectively regulate the fusion results. By fusing trend and seasonal features, more representative final data features can be generated.

[0057] Step 4: Use three weight coefficients to perform weighted fusion on the outputs of the three different period modules to finally obtain the prediction result.

[0058] Step 4-1: Apply the weight coefficients to the corresponding three modules and perform weighted fusion. The formula is as follows:

[0059] Z=W1′Z1+W2′Z2+W3′Z3 (13)

[0060] Among them, W1′, W2′ and W3′ are trainable weight coefficients, and Z is the fused data feature.

[0061] Step 4-2 is input to the fully connected layer to ensure that the output has the same size as the predicted target. The fully connected layer uses ReLU as the activation function, and the final output prediction result is

[0062] Step 4-3 compares the output prediction results with the actual results and uses the mean square error loss function to train the model. Back propagates according to the error and calculates the gradient layer by layer to update the parameters. Through continuous iterative training, the optimized network model is finally obtained.

[0063] Step 5: Use the trained model to test the validation set and test set data in turn to adjust the model's hyperparameters and verify the model's effectiveness.

[0064] Step 5-1 Load the validation set and test set data.

[0065] Step 5-2 uses the validation set data to make predictions using the test model.

[0066] Step 5-3 uses mean absolute percentage error (MAPE), root mean square error (RMSE) and mean absolute error (MAE) to adjust the model, and finally uses the test set data to make the final prediction through the optimized network model. The formula is as follows:

[0067]

[0068] (II) Beneficial effects

[0069] 1. This paper combines the Transformer attention mechanism with diffuse convolution, deeply explores the complex spatial correlations between highway sections, and accurately captures the temporal correlations within a short period, thus showing excellent performance in extracting spatiotemporal features.

[0070] 2. The present invention solves the problem that traditional methods are difficult to effectively capture the periodic changes in traffic flow. The present invention uses a Transformer model that integrates trend and seasonal characteristics for daily and weekly cycle data. The model can effectively capture long-term dependencies within different cycles and flexibly respond to fluctuations and uncertainties in the data.

[0071] 3. The present invention solves the problem that traditional methods are difficult to capture time correlation, spatial correlation and periodic correlation at the same time. The present invention trains hourly, daily and weekly cycle data respectively, and fuses the prediction results of different cycle data through three weight coefficients. The method fully considers the characteristics of short-term data and long-term data, and significantly improves the accuracy of highway traffic flow prediction. Description of the drawings:

[0072] Figure 1It is the main program flow chart of the present invention.

[0073] Figure 2 This is a flow chart of video data processing according to the present invention.

[0074] Figure 3 This is a diagram of the multi-cycle network structure described in the present invention. Specific implementation method:

[0075] In order to explain the technical solution of the present invention more clearly and completely, the present invention is further explained below in conjunction with the accompanying drawings and examples.

[0076] The following is a video of surveillance video information obtained from the Changshen Expressway. Through video image processing and other technologies, a data set containing vehicle flow, speed and density is obtained. The video of 150 road network nodes is used as an example to explain. Figure 1 As shown, the present invention provides a high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics, comprising the following steps:

[0077] Step 1 Figure 2 As shown in the method flow chart, the first step of the method is to process the video data to obtain a self-built data set and pre-process the input data. The specific steps are as follows:

[0078] Step 1-1 uses the ViBe algorithm to separate the vehicle and background from the video frame. The eight neighborhoods of each pixel point in the first frame image are randomly sampled 20 times, and the Euclidean distance is calculated using a sphere with a radius of 25. If it is greater than a threshold of 6, the pixel point is a background point.

[0079] Step 1-2 uses the YOLOv8 model for training. When the number of iterations reaches 200, the loss value drops to the minimum, and the training ends.

[0080] Steps 1-3 are combined with the virtual coil algorithm to extract traffic flow parameters, which are substituted into the formulas for calculating vehicle flow, speed, and density to further generate the corresponding data set file. The data set shape is (103680, 150, 3), where 103680 is the number of time nodes, 150 is the number of spatial nodes, and 3 is the number of features.

[0081] Steps 1-4 use the z-score standardization method to normalize each data. For example, the speed x in the three features is (25, 27, 22, 22, 20, ...), with a mean of 23 and a standard deviation of 2.7. Substitute each value of the x sequence into the formula The new sequence X=(0.74, 1.48, -0.37, -0.37, -1.1, ...) is obtained.

[0082] Steps 1-5 divide the input data into "hourly cycle data", "daily cycle data" and "weekly cycle data". The sampling data is 12 months, and the data are 103,680 items, all of which are 5 minutes per step. The daily cycle data is the value at this moment of the previous day, and the weekly cycle data is the value at this moment of the previous week.

[0083] Steps 1-6 divide the data set into training set, validation set, and test set. The training set data is 62,208, the validation set data is 20,736, and the test set data is 20,736.

[0084] Step 2: Short-term data model training phase, training model such as Figure 3 As shown, the time series data is input into the model training. At this stage, position encoding, Transformer attention mechanism and diffusion convolution are needed. The specific steps are as follows:

[0085] Step 2-1 uses position coding to provide position information for sequence elements. For example, sin10 represents the position coding value corresponding to the first feature at the 10th time node.

[0086] Step 2-2 uses the Transformer attention mechanism to obtain data of 150 nodes at 103,860 time nodes.

[0087] Step 2-3 constructs the spatial relationship of 150 road network nodes at all times based on the output data of step 2-2, thereby obtaining a weighted adjacency matrix of 103,860 time nodes.

[0088] Steps 2-4 use diffusion convolution to extract the spatial relationship between nodes, input the feature matrix, weighted adjacency matrix, forward transfer matrix and backward transfer matrix of 103,860 time nodes into the diffusion convolution formula, and output the final feature Z1 of the hourly periodic data.

[0089] Step 3: Long-term data model training phase. The training model is as follows: Figure 3 As shown, the time series data is input into the model training. At this stage, the Transformer that integrates trend and season needs to be used. The specific steps are as follows:

[0090] Step 3-1 performs STL decomposition on the traffic flow, speed and density data.

[0091] Step 3-2 calculates the two attentions after the trend and seasonal features are fused. t and Q s , and the key vector K for trend and seasonality t and K s ,use and The form is effectively integrated and then substituted into the attention mechanism calculation formula to obtain the attention output Attention t (Q t ,K t ,V t ) and Attention s (Q s ,K s ,V s ).

[0092] Step 3-3 Attention t (Q t ,K t ,V t ) and Attention s (Q s ,K s ,V s ) to effectively fuse the daily cycle data and the weekly cycle data to output the final feature information Z2 and Z3.

[0093] Step 4 uses three weight coefficients to perform weighted fusion on the output features of each cycle module to obtain the final prediction result.

[0094] In step 4-1, the weight coefficients W1′, W2′ and W3′ are applied to the output features of the corresponding three cycles respectively, and weighted fusion is performed to obtain Z.

[0095] Step 4-2 Input Z into the fully connected layer to get the final prediction result

[0096] Step 4-3 will The model is trained by comparing with the actual results using the mean square error loss function. Back propagation is performed based on the loss value, and multiple rounds of iterations are used for effective training. The number of iterations is set to 200.

[0097] Step 5: In the model testing phase, the trained model is used to test the validation set and test set data in turn, and then the accuracy is calculated. The specific steps are as follows:

[0098] Step 5-1 loads 20,736 sets of validation set data and 20,736 sets of test set data.

[0099] Step 5-2 uses the validation set data to make predictions using the test model.

[0100] Step 5-3 compares the predicted label with the true label, and uses MAPE, RMSE, and MAE as indicators to measure the model effect. If the accuracy is improved, use the same operation to evaluate the test set effect and obtain the final prediction accuracy.

[0101] The data used in this example comes from the surveillance video of the Changshen Expressway. After preprocessing the video data, we obtained a data set containing traffic flow, speed and density. In order to evaluate the prediction performance of the algorithm, we selected MAPE, RMSE, and MAE as evaluation indicators. Compared with the traditional time series prediction method, the accuracy of the present invention has been improved. The effect comparison is shown in Table 1, where MLSCT represents the high-speed traffic flow prediction method proposed by the present invention based on the long-short cycle Transformer fusion trend and seasonal characteristics.

[0102] Table 1

[0103] Models MAPE RMSE MAE LSTM 10.43 30.12 18.75 TCN 9.17 27.39 17.62 Transformer 8.81 23.42 15.14 T-GCN 8.67 22.43 14.26 MLSCT 7.32 21.56 13.47

[0104] The above is a detailed description of the embodiments of the present invention in conjunction with the accompanying drawings, and the specific implementation methods herein are 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 methods and application scopes, so the present invention should not be understood as limiting the present invention.

Claims

1. A high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics, characterized by The method comprises the following steps: Step 1: Process the video data, including building a dataset, standardizing the data, and dividing the dataset. Step 2: Train on hourly periodic data using Transformer attention mechanism and dilated convolution. Step 3: Train the daily and weekly cycle data using a Transformer that integrates trend and seasonal features. Step 4: Use three weight coefficients to perform weighted fusion on the outputs of three different periodic modules. Step 5: In the model testing phase, the trained model is used to test the validation set and test set data.

2. According to claim 1, a high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics is characterized by: The video data processing module in step 1 includes the following specific steps: Step 1_1 Use the ViBe algorithm to separate the vehicle and background from the video frame. Step 1_2 uses the YOLOv8 model to detect the target vehicle. Step 1_3 combines the virtual coil algorithm to extract vehicle flow, speed and density. The vehicle flow calculation formula is as follows: Among them, N represents the number of frames in the time period, car i Represents the vehicle count. The formula for calculating vehicle speed is as follows: Where d is the distance between the two virtual coils, and Δt is the time difference between the vehicle passing the first and second coils. The vehicle density calculation formula is as follows: Among them, M is the total number of vehicles passing through the virtual coil during the time period, L is the length of the area covered by the video frame, w is the lane width, and num is the number of lanes. Step 1_4 Data normalization. Use the z-score normalization method to normalize the traffic flow data. The z-score is normalized based on the mean and standard deviation of the original data, and the calculation formula is as follows: Step 1_5 divides the input data into three different time periods. "Hourly cycle data" is short-term data, while "Daily cycle data" and "Weekly cycle data" are long-term data. Step 1_6 divides the data set into training set, validation set, and test set in a ratio of 6:2:

2.

3. The high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics according to claim 1 is characterized in that: The hourly periodic data training module in step 2 includes the following specific steps: Step 2_1 uses position encoding to provide position information for sequence elements. The calculation formula is as follows: Among them, PE f,t Represents the positional encoding value corresponding to the f-th feature at time t, where F is the number of features in the input sequence. Step 2_2 uses the Transformer attention mechanism to obtain the matrix composed of the vectors of all nodes at time t. Step 2_3 constructs the spatial relationship between N road network nodes at time t based on the vector output by the previous layer. The calculation formula is as follows: M t =ReLU(R t1 )ReLU(R t2 ) T Among them, M t Represents the weighted adjacency matrix of the graph at time t. Step 2_4 uses diffuse convolution to extract the spatial relationship between nodes, and finally obtains the feature Z1 of the daily cycle data. The diffuse convolution calculation formula is as follows: Among them, X t is the input feature matrix at time t, and are two trainable parameter matrices in the diffusion of step l, [diag(M t λ)] -1 and are the forward transfer matrix and backward transfer matrix at time t respectively.

4. The high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics according to claim 1 is characterized in that: The daily cycle and weekly cycle data training module in step 3 specifically comprises the following steps: Step 3_1 performs STL decomposition on the traffic flow, speed and density data to obtain three parts: residual, trend and seasonality. Step 3_2 inputs the trend and seasonal characteristics of the data into the two attention mechanism modules for calculation to obtain their respective attention scores. The calculation formula is as follows: Among them, Q t and Q s is the query vector of trend and seasonality, K t and K s is the key vector of trend and seasonality, V t and V s is a vector of trend and seasonality values. Step 3_3 effectively fuses the outputs of the two attentions, and finally obtains the feature Z2 of the daily cycle data and the data feature Z3 of the weekly cycle data. The attention fusion calculation formula is as follows: W1Attention t (Q t ,K t ,V t )+W2Attention s (Q s ,K s ,V s ) Among them, W1 and W2 are learnable parameters, which are used to effectively regulate the fusion results.

5. The high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics according to claim 1 is characterized in that: The weighted fusion module in step 4 has the following specific steps: Step 4_1: Apply the weight coefficients to the corresponding three modules respectively and perform weighted fusion. The calculation formula is as follows: Z=W1′Z1+W2′Z2+W3′Z3 Among them, W1′, W2′ and W3′ are trainable weight coefficients, and Z is the fused data feature. Step 4_2 is input into the fully connected layer to obtain the final prediction result. Step 4_3 compares the output prediction results with the actual results and uses the mean square error loss function to train the model.

6. The high-speed traffic flow prediction method based on long- and short-cycle Transformer fusion trend and seasonal characteristics according to claim 1 is characterized in that: The model testing module in step 5 includes the following specific steps: Step 5_1 Load the validation set and test set data. Step 5_2 uses the validation data to make predictions using the test model. Step 5_3 uses mean absolute percentage error (MAPE), root mean square error (RMSE) and mean absolute error (MAE) to adjust the model, and finally uses the test set data to make the final prediction through the optimized network model. The formula is as follows: 。

Citation Information

Cited By

  • Trend and seasonal traffic flow prediction method

    CN119811095A

  • Traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transform

    CN121034085A

  • A traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time transformer

    CN121034085B