Road network level traffic prediction method fusing transfer learning and macroscopic fundamental diagram
Through the method of integrating migration and learning and macro basic maps, the problem of high training costs of traffic flow forecasting models in existing technologies and insufficient data for data, realizing high -precision traffic flow and possession forecasting, improving the practicality of the model And applicability.
Patent Information
- Application Number
- CN202411388981.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-08
AI Technical Summary
In the prior art, the traffic flow prediction model requires a lot of training, resulting in high computational cost; and requires sufficient representativeness of regional traffic data, but in reality, most regions do not meet this requirement, resulting in relatively practical and applicability of the prediction model. Low; in the absence or lack of data, the prediction effect is poor and cannot provide effective traffic flow prediction data for intelligent transportation systems.
A road network-level traffic prediction method that integrates transfer learning and macroscopic basic graphs is used to divide the regional road network through semantic segmentation algorithm, obtain the macroscopic basic graph and critical occupancy of each sub-region, determine the target domain and source domain, and establish the target domain and source domain. The traffic time matrix of the domain, uses Pearson correlation coefficient and unbiased estimator to calculate the data modeling goodness, generates a training sample set, trains a multi-convolutional neural network coupled traffic prediction model, and conducts adaptive training through transfer learning.
Reduce the dependence and training costs of the target domain data, and improve the predictive effect of the target domain, especially when the data volume is small or lacks the data, it can get high -precision traffic flow and share prediction values, which has improved, which has improved. The practicality and application of the model predict the model.
Smart Images

Figure CN119358730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a road network-level traffic prediction method integrating transfer learning with a macro basic graph. Background Art
[0002] With the increase of motor vehicles, various urban traffic problems are becoming increasingly serious. Congestion, traffic accidents, exhaust emissions, etc. have become common problems in daily life. In existing research, it has been proved in practice in different cities that intelligent transportation system (ITS) is an effective way to solve urban traffic problems. In order to better use intelligent transportation system (ITS) to solve urban traffic problems, it is necessary to predict urban traffic flow.
[0003] At present, there are a lot of studies on traffic flow prediction in the existing technology, a large part of which is based on data-driven methods, for example, using machine learning and deep learning to predict traffic flow, and such methods have shown good prediction performance. However, the existing data-driven methods need to train the traffic prediction model sufficiently when establishing the prediction model, resulting in a high computational cost for establishing the prediction model; in addition, a large amount of traffic data is required during the model training process, and these data usually need to meet the conditions of being representative enough to cover all traffic modes in the area, but in fact few areas can meet the above traffic data conditions, resulting in low practicality and applicability of the prediction model; in addition, the traffic data obtained in most areas have the problem of missing data and missing data, which will lead to low accuracy of the prediction model results when predicting traffic flow in most areas, resulting in the inability to provide effective traffic flow prediction data for the intelligent transportation system, and ultimately unable to effectively solve urban traffic problems. Summary of the invention
[0004] To this end, the technical problem to be solved by the present invention is to overcome the problem that the prediction model in the prior art requires a lot of training, resulting in high model training costs; the prediction model requires that the regional traffic data is sufficiently representative and can represent all traffic modes in the region, but in reality most regions do not meet this requirement, resulting in poor practicality and applicability of the prediction model; when regional traffic data is missing or lacking, the prediction effect of the prediction model is relatively poor, resulting in the inability to provide effective traffic flow prediction data for the intelligent transportation system.
[0005] In order to solve the above technical problems, the present invention provides a road network-level traffic prediction method integrating transfer learning and macro basic graph, comprising:
[0006] According to the historical traffic data of the regional road network and the number of preset regional divisions, the regional road network is divided based on the semantic segmentation algorithm to obtain the sub-regions of the regional road network;
[0007] Based on the macro basic graph of each sub-region, the critical occupancy rate of each sub-region is obtained; any sub-region is selected as the target domain, and other sub-regions whose critical occupancy rates are within the critical interval of the target domain are taken as the critical related sub-regions of the target domain; within the critical interval of the target domain, the curve area enclosed by the macro basic graph of the target domain and the macro basic graphs of its critical related sub-regions are calculated respectively, and the critical related sub-region corresponding to the calculated minimum curve area is taken as the source domain; if there is no critical occupancy rate of other sub-regions within the critical interval of the target domain, the regional road network is re-divided;
[0008] Taking each detector in the target domain as the center, the flow value of each modeled road in the target domain at each time is obtained, and the flow time matrix of each detector in the target domain is established; taking each detector in the source domain as the center, the flow value of each modeled road in the source domain at each time is obtained, and the flow time matrix of each detector in the source domain is established;
[0009] Based on the Pearson correlation coefficient and unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, the data modeling goodness between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain is obtained;
[0010] The target domain detector and source domain detector corresponding to the obtained maximum data modeling goodness are respectively taken as the center to obtain the flow value and occupancy value of each modeling road in the target domain and the source domain at each time, and the sliding window method is used to set the sliding window size to l and the sliding step to 1. For a modeling road, the flow value or occupancy value at every l time in the sliding window is used as a training sample, and the flow value or occupancy at the (l+1)th time is used as the true value corresponding to the training sample, thereby generating the target domain training sample set and its corresponding true value set, and the source domain training sample set and its corresponding true value set;
[0011] Using the source domain training sample set and its corresponding true value set, the traffic prediction model is trained to obtain the source domain traffic prediction model;
[0012] The source domain traffic prediction model is adaptively trained using the filtered target domain training sample set and its corresponding true value set to obtain the target domain traffic prediction model.
[0013] Preferably, the traffic prediction model is a multi-convolutional neural network coupled traffic prediction model;
[0014] The multi-convolutional neural network coupled traffic prediction model includes three convolutional neural networks and two neural networks;
[0015] The source domain training set includes a flow training sample set and an occupancy training sample set;
[0016] Input each traffic training sample in the source domain training sample set into the first convolutional neural network, and output the traffic prediction value corresponding to each traffic training sample;
[0017] Input each occupancy training sample in the source domain training sample set into the second convolutional neural network, and output the occupancy prediction value corresponding to each occupancy training sample;
[0018] After integrating each normalized flow training sample and each occupancy training sample in the source domain training sample set, each obtained joint flow-occupancy sample is input into the third convolutional neural network, and the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample is output;
[0019] After standardizing the individual prediction values of each flow divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the flow prediction values corresponding to each flow training sample, and then input into the first neural network to output the final prediction values of the flow corresponding to each flow training sample;
[0020] The individual prediction values of each occupancy divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample are standardized, integrated with the occupancy prediction value corresponding to each occupancy training sample, and then input into the second neural network to output the final prediction value of the occupancy corresponding to each occupancy training sample.
[0021] Preferably, the method of training the traffic prediction model using the source domain training sample set and its corresponding true value set to obtain the source domain traffic prediction model includes:
[0022] Based on the first convolutional neural network, the spatiotemporal characteristics of the flow values at each time in each flow training sample in the source domain training sample set are extracted to obtain the flow prediction value corresponding to each flow training sample;
[0023] Based on the second convolutional neural network, the spatiotemporal characteristics of the occupancy values at each moment in each occupancy training sample in the source domain training sample set are extracted to obtain the occupancy prediction value corresponding to each occupancy training sample;
[0024] Integrate each normalized flow training sample and each occupancy training sample in the source domain training sample set to obtain each joint flow-occupancy sample; input each joint flow-occupancy sample into the third convolutional neural network, and output the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample;
[0025] After standardizing the individual prediction values of each flow divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the flow prediction values corresponding to each flow training sample, and then input into the first neural network to output the final prediction values of the flow corresponding to each flow training sample;
[0026] After standardizing the individual prediction values of each occupancy divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the occupancy prediction values corresponding to each occupancy training sample, and then input into the second neural network to output the final prediction values of the occupancy corresponding to each occupancy training sample;
[0027] The loss function is calculated according to the final predicted value of the traffic flow corresponding to each traffic training sample, the final predicted value of the occupancy corresponding to each occupancy training sample, and the true value set corresponding to the source domain training sample set; by minimizing the loss function, the various parameters of the multi-convolutional neural network coupled traffic prediction model are obtained, and the training of the multi-convolutional neural network coupled traffic prediction model is completed; the trained multi-convolutional neural network coupled traffic prediction model is used as the source domain traffic prediction model.
[0028] Preferably, the curve area enclosed by the macro basic graph of the target domain and the macro basic graph of its ath critically related sub-region is:
[0029]
[0030] Among them, MFD T A macroscopic fundamental graph representing the target domain; MFD a represents the ath critically relevant sub-region of the target domain; represents the critical occupancy of the target domain; represents the critical interval range of the target domain; ∈ represents the interval threshold.
[0031] Preferably, calculating the Pearson correlation coefficient between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain comprises:
[0032] For any detector X in the target domain and any detector Y in the source domain, calculate the Pearson correlation coefficient r between the flow-time matrix of detector X in the target domain and the flow-time matrix of detector Y in the source domain XY , whose expression is:
[0033]
[0034] Among them, Q X represents the traffic time matrix of the target domain detector X; Q Y represents the flow time matrix of the source domain detector Y; Cov(Q X,Q Y ) represents the covariance between the flow-time matrix of the target domain detector X and the flow-time matrix of the source domain detector Y; Represents the flow time matrix of the target domain detector X when the number of samples is n X The standard deviation in the sample; represents the flow time matrix of the target domain detector X at the i-th moment; represents the mean of the flow time matrix of the target domain detector X; Represents the flow time matrix of the source domain detector Y when the number of samples is n Y The standard deviation in the sample; represents the flow-time matrix of the source domain detector Y at the jth moment; Represents the mean of the flow time matrix of the source domain detector Y.
[0035] Preferably, calculating an unbiased estimator between a flow time matrix of each detector in the target domain and a flow time matrix of each detector in the source domain comprises:
[0036] For any detector X in the target domain and any detector Y in the source domain, the maximum mean difference MMD(X,Y) between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain is calculated, and its expression is:
[0037]
[0038] in, represents the traffic time matrix of the target domain detector X at the i-th moment; n X represents the number of samples in the flow time matrix of the target domain detector X; represents the flow time matrix of the source domain detector Y at the jth moment; n Y represents the number of samples in the flow time matrix of the source domain detector Y;
[0039] Through the mapping function F(*), the flow time matrix of the target domain detector X and the source domain detector Y is projected into the kernel Hilbert space to obtain the kernel function between the target domain detector X and the source domain detector Y, which is expressed as:
[0040]
[0041] in, Represents the mapping function corresponding to the traffic time matrix of the target domain detector X at the i-th moment; represents the mapping function corresponding to the flow-time matrix of the source domain detector Y at the jth moment;
[0042] Based on the kernel function expression, the unbiased estimator MMD between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain is calculated 2 (Q X ,Q Y ), whose expression is:
[0043]
[0044] The kernel operation is performed through the Gaussian kernel function to obtain the value of the kernel function between the target domain detector X and the source domain detector Y, thereby obtaining the value of the unbiased estimator between the flow time matrix of the detector X in the target domain and the flow time matrix of the detector Y in the source domain; wherein the Gaussian kernel function expression is:
[0045]
[0046] Where σ represents the width parameter of the Gaussian kernel function.
[0047] Preferably, the data modeling goodness between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain is obtained based on the Pearson correlation coefficient and the unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, including:
[0048] For any detector X in the target domain and any detector Y in the source domain, the Pearson correlation coefficient r between the flow-time matrix of the target domain detector X and the flow-time matrix of the source domain detector Y is XY And the unbiased estimator MMD between them 2 (Q X ,Q Y ), and obtain the data modeling goodness G between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain XY , whose expression is:
[0049] G XY =λ1|r XY |-λ2MMD 2 (Q X ,Q Y )
[0050] Wherein, λ1 represents the first weighting coefficient; λ2 represents the second weighting coefficient.
[0051] Preferably, the target domain detector corresponding to the obtained maximum data modeling goodness is taken as the center, the flow value and occupancy value of each modeling road in the target domain at each time are obtained, and the sliding window method is used, the sliding window size is set to l, the sliding step is 1, and for a modeling road, the flow value or occupancy value at every l time in the sliding window is used as a training sample, and the flow value or occupancy at the (l+1)th time is used as the true value corresponding to the training sample, thereby generating a target domain training sample set and its corresponding true value set, including:
[0052] Taking the target domain detector corresponding to the maximum data modeling goodness as the center, the flow value and occupancy value of each modeled road in the target domain at each time are obtained to obtain the target domain flow time matrix and the target domain occupancy time matrix;
[0053] Based on the target domain traffic time matrix, the target domain traffic training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0054]
[0055] in, They represent the target domain traffic training sample set and the true value set corresponding to the target domain traffic training sample set respectively; represents the k-th target domain traffic training sample matrix, which contains the traffic values of each modeled road in the target domain at l moments corresponding to the k-th sliding step; represents the true value vector corresponding to the k-th target domain traffic training sample matrix, which contains the true value of the traffic at the (l+1)th moment of each modeling road in the target domain corresponding to the k-th sliding step; m T represents the number of modeled roads in the target domain; n represents the total number of moments; l represents the sliding window size; p represents the prediction window size, p = 1; k represents the number of sliding times;
[0056] Based on the target domain occupancy time matrix, the target domain occupancy training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0057]
[0058]
[0059] in, They represent the target domain occupancy training sample set and the true value set corresponding to the target domain occupancy training sample set respectively; represents the k-th target domain occupancy training sample matrix, which contains the occupancy values of each modeled road in the target domain corresponding to the k-th sliding step at l moments; represents the true value vector corresponding to the k-th occupancy training sample matrix, which contains the true value of the occupancy of each modeled road in the target domain at the (l+1)th moment corresponding to the k-th sliding step;
[0060] Based on the target domain traffic training sample set and its corresponding true value set, the target domain occupancy training sample set and its corresponding true value set, a target domain training sample set and its corresponding true value set are constructed.
[0061] Preferably, the source domain detector corresponding to the obtained maximum data modeling goodness is taken as the center, the flow value and occupancy value of each modeling road in the source domain at each time are obtained, and the sliding window method is used, the sliding window size is set to l, the sliding step is 1, and for a modeling road, the flow value or occupancy value at every l time in the sliding window is used as a training sample, and the flow value or occupancy at the (l+1)th time is used as the true value corresponding to the training sample, thereby generating a source domain training sample set and its corresponding true value set, including:
[0062] Taking the source domain detector corresponding to the maximum data modeling goodness as the center, the flow value and occupancy value of each modeling road in the source domain at each time are obtained to obtain the source domain flow time matrix and source domain occupancy time matrix;
[0063] Based on the source domain traffic time matrix, the source domain traffic training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0064]
[0065]
[0066] in, They represent the source domain traffic training sample set and the true value set corresponding to the source domain traffic training sample set respectively; represents the k-th source domain traffic training sample matrix, which contains the traffic values of each modeled road in the source domain at time I corresponding to the k-th sliding step; represents the true value vector corresponding to the k-th source domain traffic training sample matrix, which contains the true value of the traffic at the (l+1)th moment of each modeling road in the source domain corresponding to the k-th sliding step; m S represents the number of modeled roads in the source domain; n represents the total number of moments; l represents the sliding window size; p represents the prediction window size, p = 1; k represents the number of sliding times;
[0067] Based on the source domain occupancy time matrix, the source domain occupancy training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0068]
[0069] in, They represent the source domain occupancy training sample set and the true value set corresponding to the source domain occupancy respectively; represents the k-th source domain occupancy training sample matrix, which contains the occupancy values of each source domain modeling road in the source domain corresponding to the k-th sliding step at l moments; represents the true value vector corresponding to the k-th source domain occupancy training sample matrix, which contains the true value of the occupancy of each modeled road in the source domain at the (l+1)th moment corresponding to the k-th sliding step;
[0070] Based on the source domain traffic training sample set and its corresponding true value set, the source domain occupancy training sample set and its corresponding true value set, a source domain training sample set and its corresponding true value set are constructed.
[0071] Preferably, filtering the target domain training sample set and its corresponding true value set includes:
[0072] Through the maximum weighted flow value ratio and critical occupancy ratio between the source domain and the target domain, the flow data and occupancy data in the target domain training sample set and its corresponding true value set are filtered respectively to obtain the filtered target domain training sample set and its corresponding true value set;
[0073] The maximum weighted flow value ratio between the source domain and the target domain is used as the flow filtering coefficient Its expression is:
[0074]
[0075] in, Indicates the maximum weighted flow value of the target domain; Indicates the maximum weighted flow value of the source domain;
[0076] The critical occupancy ratio between the source domain and the target domain is used as the occupancy filtering coefficient Its expression is:
[0077]
[0078] in, represents the critical occupancy of the target domain; Represents the critical occupancy of the source domain.
[0079] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0080] (1) The method for road network-level traffic prediction integrating transfer learning and macro basic graph described in the present invention divides the current area into various sub-areas and draws macro basic graphs of each sub-area; determines the target domain, and based on the macro basic graphs of each sub-area, finds the sub-area with the most similar traffic mode to the target domain as the source domain; the source domain found based on the macro basic graph has a very high similarity with the target domain in the changes of flow data and occupancy data, which lays a foundation for subsequent transfer learning; uses the flow data and occupancy data of the source domain to train the traffic prediction model to obtain the source domain traffic prediction model, and then based on the principle of transfer learning, freezes the source domain traffic prediction model that is closer to the input layer. After the parameters of multiple computing layers are adjusted, the traffic prediction model of the source domain is adaptively trained using the traffic data and occupancy data of the target domain to obtain the traffic prediction model of the target domain; this prediction process that integrates transfer learning can reduce the dependence on the target domain data and the cost of training, and can also improve the prediction effect on the target domain, that is, when the target domain data is small or lacks data, the method designed by the present invention can obtain high-precision prediction values of the traffic and occupancy of the target domain; in addition, the method designed by the present invention enriches the practicality and applicability of the prediction model, can predict the traffic conditions of any area in advance, and solve the traffic congestion problems that may occur in various areas in a targeted manner;
[0081] (2) The present invention discloses a road network-level traffic prediction method that integrates transfer learning and macro basic graph. In the process of data construction, the two detectors with the most similar traffic modes in the target domain and the source domain are found through the Pearson correlation coefficient and the maximum mean difference. Based on the target domain detector and the source domain detector, data modeling is performed on the target domain and the source domain, respectively, to obtain a flow time matrix sorted by the actual distance and time of the target domain detector and a flow time matrix sorted by the actual distance and time of the source domain detector. These two flow time matrices fully consider the temporal and spatial correlations between various links in the region, and provide a data set for subsequent training prediction models, thereby ensuring the rationality of transfer learning between the target domain and the source domain.
[0082] (3) The present invention discloses a road network-level traffic prediction method that integrates transfer learning and a macro basic graph, and also designs a traffic prediction model that couples multiple convolutional neural networks. The prediction model includes three convolutional neural networks. The first convolutional neural network is used to predict the flow value; the second convolutional neural network is used to predict the occupancy value; and the third convolutional neural network is used to predict the combined flow-occupancy value. Compared with using only a single convolutional neural network to predict the flow and occupancy, the prediction model designed by the present invention can improve the prediction accuracy of the flow and occupancy in the source domain and the target domain. At the same time, after integrating transfer learning, the prediction accuracy of the flow and occupancy in the target domain can be further improved, and the traffic conditions in any area can be better predicted, so that effective traffic flow prediction data can be provided for the intelligent transportation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:
[0084] Figure 1 It is a schematic diagram of a road network-level traffic prediction method integrating transfer learning and macro basic graph provided by the present invention;
[0085] Figure 2 It is a schematic diagram of the curve area enclosed by the macro basic graph of each sub-region and the macro basic graph of the target domain;
[0086] Figure 3 It is a structural diagram of the multi-convolutional neural network coupled traffic prediction model;
[0087] Figure 4 This is the structural diagram of the third convolutional neural network;
[0088] Figure 5 This is the specific framework diagram of the third convolutional neural network;
[0089] Figure 6 It is a schematic diagram of the model migration process;
[0090] Figure 7 is a schematic diagram of the study area; Figure 7 (a) shows the satellite schematic diagram of the study area; Figure 7 (b) shows the schematic diagram of the detector distribution in the study area;
[0091] Figure 8 It is a schematic diagram of the partition results of the study area and the MFD of each sub-area;
[0092] Fig. 9 It is a comparison diagram of MFD and weighted traffic in the source domain and target domain; Fig. 9(a) shows the MFD comparison diagram of the source domain and the target domain; Fig. 9 (b) in the figure shows the weighted traffic comparison diagram of the source domain and the target domain;
[0093] Fig.10 It is a comparison chart of MAE and MSE of traffic prediction value and occupancy prediction value of different prediction models based on source domain prediction data set; Fig.10 (a) shows the comparison of MAE and MSE of traffic prediction values of different prediction models; Fig.10 (b) shows the comparison of MAE and MSE of occupancy prediction values of different prediction models;
[0094] Fig.11 It is a trend comparison chart of the predicted flow and predicted occupancy of the multi-convolutional neural network coupled traffic prediction model and the actual weighted flow and occupancy;
[0095] Fig.12 is a comparison chart of the prediction performance of the target domain model; Fig.12 (a) shows the comparison of MAE and MSE indicators of various prediction models when predicting the traffic volume of each road in the target domain; Fig.12 (b) shows the comparison of NRMSE and SMAPE indicators of various prediction models when predicting the traffic volume of each road in the target domain; Fig.12 (c) shows the comparison of MAE and MSE indicators of various prediction models when predicting the occupancy rate of each road in the target domain; Fig.12 (d) shows the comparison of NRMSE and SMAPE indicators of various prediction models when predicting the occupancy rate of each road in the target domain;
[0096] Fig.13 This is a comparison chart of the MFD-MATL predicted value and the measured value;
[0097] Fig.14 is the target domain traffic classification map;
[0098] Fig.15 is the MFD-MATL category prediction result in the target domain;
[0099] Fig.16 It is a schematic diagram of the macro basic diagram;
[0100] Fig.17 This is an overview diagram of transfer learning. DETAILED DESCRIPTION
[0101] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0102] Embodiment 1
[0103] Reference Figure 1 As shown, Figure 1 A flow chart of a road network-level traffic prediction method integrating transfer learning and macro basic graph provided by the present invention; specifically comprising:
[0104] S1: Regional road network partitioning and selection of target domain and source domain, including:
[0105] S11: According to the historical traffic data of the regional road network and the preset number of regional divisions, the regional road network is divided based on the semantic segmentation (N-Cut) algorithm to obtain various sub-regions of the regional road network;
[0106] S12: based on the macro basic map of each sub-region, obtaining the critical occupancy rate and the maximum weighted flow value of each sub-region of the current region;
[0107] S13: Select any sub-region as the target domain, and use other sub-regions whose critical occupancy rates are within the critical interval of the target domain as the critical related sub-regions of the target domain. Within the critical interval of the target domain, calculate the curve area enclosed by the macro basic graph of the target domain and the macro basic graphs of its respective critical related sub-regions, and use the critical related sub-region corresponding to the calculated minimum curve area as the source domain; if there is no critical occupancy rate of other sub-regions within the critical interval of the target domain, re-divide the regional road network;
[0108] Among them, the curve area enclosed by the macro basic graph of the target domain and the macro basic graph of its a-th critical related sub-region is:
[0109]
[0110] Among them, MFD T A macroscopic fundamental graph representing the target domain; MFD a represents the i-th critically relevant sub-region of the target domain; represents the critical occupancy of the target domain; represents the critical interval range of the target domain; ∈ represents the interval threshold;
[0111] by Figure 2 Taking the MFD of each sub-region in as an example, sub-region 2 is taken as the target domain, and the curve area S enclosed by sub-region 2 and sub-region 4 2,4 The expression is:
[0112]
[0113] Wherein, MFD4 represents the macro basic map of sub-region 4; MFD2 represents the macro basic map of sub-region 2;
[0114] By calculating and screening the critical occupancy difference and area difference of each sub-region, the sub-region with the smallest MFD difference with the target domain is obtained as the source domain for research to ensure that the source domain and the target domain have similar traffic conditions.
[0115] S2: Data modeling, including:
[0116] When constructing model data, the temporal and spatial correlations between various links in the region should be fully considered. To this end, the present invention takes the two detectors with the most similar traffic modes in the target domain and the source domain as the center, and relies on these two detectors to establish a flow time matrix sorted by the actual distance and time of the detectors in their respective regions. Therefore, the present invention finds the two detectors with the most similar traffic modes in the target domain and the source domain through the Pearson correlation coefficient and the maximum mean difference;
[0117] S21: taking each detector in the target domain as the center, obtaining the flow value of each modeled road in the target domain at each time, and establishing the flow time matrix of each detector in the target domain; taking each detector in the source domain as the center, obtaining the flow value of each modeled road in the source domain at each time, and establishing the flow time matrix of each detector in the source domain;
[0118] S22: Calculate the Pearson correlation coefficient between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, including:
[0119] For any detector X in the target domain and any detector Y in the source domain, calculate the Pearson correlation coefficient r between the flow-time matrix of detector X in the target domain and the flow-time matrix of detector Y in the source domain XY , whose expression is:
[0120]
[0121] Among them, Q X represents the traffic time matrix of the target domain detector X; Q Y represents the flow time matrix of the source domain detector Y; Cov(Q X ,Q Y ) represents the covariance between the flow-time matrix of the target domain detector X and the flow-time matrix of the source domain detector Y; Represents the flow time matrix of the target domain detector X when the number of samples is n X The standard deviation in the sample; represents the flow time matrix of the target domain detector X at the i-th moment; represents the mean of the flow time matrix of the target domain detector X; Represents the flow time matrix of the source domain detector Y when the number of samples is n YThe standard deviation in the sample; represents the flow time matrix of the source domain detector Y at the jth moment; represents the mean of the flow time matrix of the source domain detector Y;
[0122] S23: Calculate the unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, including:
[0123] For any detector X in the target domain and any detector Y in the source domain, the maximum mean difference MMD(X,Y) between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain is calculated, and its expression is:
[0124]
[0125] in, represents the traffic time matrix of the target domain detector X at the i-th moment; n X represents the number of samples in the flow time matrix of the target domain detector X; represents the flow time matrix of the source domain detector Y at the jth moment; n Y represents the number of samples in the flow time matrix of the source domain detector Y;
[0126] Through the mapping function F(*), the flow time matrix of the target domain detector X and the source domain detector Y is projected into the kernel Hilbert space In the above equation, we get the kernel function between the target domain detector X and the source domain detector Y, which is expressed as:
[0127]
[0128] in, Represents the mapping function corresponding to the traffic time matrix of the target domain detector X at the i-th moment; represents the mapping function corresponding to the flow-time matrix of the source domain detector Y at the jth moment; K(*,*) corresponds to the inner product of the two domain features after projection in the Hilbert space; by projecting the data into the kernel Hilbert space, the numerical difference between the two regions can be better measured;
[0129] By applying the kernel trick, the MMD can be directly calculated from the kernel function 2 , then based on the kernel function expression, the unbiased estimator MMD between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain is calculated 2 (Q X ,Q Y ), whose expression is:
[0130]
[0131] The kernel operation is performed through the Gaussian kernel function to obtain the value of the kernel function between the target domain detector X and the source domain detector Y, thereby obtaining the value of the unbiased estimator between the flow time matrix of the detector X in the target domain and the flow time matrix of the detector Y in the source domain; wherein the Gaussian kernel function expression is:
[0132]
[0133] Among them, σ represents the width parameter of the Gaussian kernel function;
[0134] Based on S23, in order to prevent the difference between the regional modeling traffic data determined only by the Pearson correlation coefficient from being too large, the present invention selects the maximum mean difference (MMD) to measure the difference between the two regional data after modeling;
[0135] S24: Based on the Pearson correlation coefficient and the unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, the data modeling goodness between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain is obtained, including:
[0136] For any detector X in the target domain and any detector Y in the source domain, the Pearson correlation coefficient r between the flow-time matrix of the target domain detector X and the flow-time matrix of the source domain detector Y is XY And the unbiased estimator MMD between them 2 (Q X ,Q Y ), and obtain the data modeling goodness G between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain XY , whose expression is:
[0137] G XY =λ1|r XY |-λ2MMD 2 (Q X ,Q Y )
[0138] Wherein, λ1 represents the first weighting coefficient; λ2 represents the second weighting coefficient;
[0139] The Pearson correlation coefficient r was calculated by comprehensively considering the regression prediction results of a single road and the difference between the modeling data of the two regions. XY The MMD calculated after modeling its corresponding data 2 Perform weighted calculation to obtain the data modeling goodness G;
[0140] Based on S21-S23, when distinguishing the similarity of two area detectors, the similarity of two road detectors is calculated by kernel space distance and Pearson correlation coefficient;
[0141] S25: respectively taking the target domain detector and the source domain detector corresponding to the obtained maximum data modeling goodness as the center, obtaining the flow value and occupancy value of each modeling road in the target domain and the source domain at each time, and using the sliding window method, setting the sliding window size to l, the sliding step to 1, for a modeling road, taking the flow value or occupancy value at every l time in the sliding window as a training sample, and taking the flow value or occupancy at the (l+1)th time as the true value corresponding to the training sample, thereby generating a target domain training sample set and its corresponding true value set, a source domain training sample set and its corresponding true value set, including:
[0142] (1) Generate a target domain training sample set and its corresponding true value set, including:
[0143] Taking the target domain detector corresponding to the maximum data modeling goodness obtained as the center, the flow value and occupancy value of each modeling road in the target domain at each time are obtained to obtain the target domain flow time matrix and the target domain occupancy time matrix; wherein, each row in the target domain flow time matrix represents the time series composed of the flow of a modeling road at each time, that is, each row represents the flow time series of a modeling road in the target domain; each row in the target domain occupancy time matrix represents the time series composed of the occupancy values of a modeling road at each time, that is, each row represents the occupancy time series of a modeling road in the target domain;
[0144] Based on the target domain traffic time matrix, the target domain traffic training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0145]
[0146] in, They represent the target domain traffic training sample set and the true value set corresponding to the target domain traffic training sample set respectively; represents the k-th target domain traffic training sample matrix, which contains the traffic values of each modeled road in the target domain corresponding to the k-th sliding step at l moments, that is, each row represents the traffic value from the k-th moment to the (k+l-1)-th moment in the traffic time series of a modeled road in the target domain; represents the true value vector corresponding to the k-th target domain traffic training sample matrix, which contains the true value of the traffic at the (l+1)th moment of each modeling road in the target domain corresponding to the k-th sliding step, that is, each row represents the traffic value at the (k+l+p-1)th moment in the traffic time series of a modeling road in the target domain; m T represents time; l represents the sliding window size; p represents the prediction window size, that is, the number of real values contained in each row of each real value vector. The present invention sets p=1; k represents the number of sliding times;
[0147] Based on the target domain occupancy time matrix, the target domain occupancy training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0148]
[0149] in, They represent the target domain occupancy training sample set and the true value set corresponding to the target domain occupancy training sample set respectively; represents the k-th target domain occupancy training sample matrix, which contains the occupancy values of each modeled road in the target domain corresponding to the k-th sliding step at l moments, where each row represents the occupancy value from the k-th moment to the (p+l-1)-th moment in the occupancy time series of a modeled road in the target domain; represents the true value vector corresponding to the k-th target domain occupancy training sample matrix, which contains the true value of the occupancy of each modeled road in the target domain at the (l+1)th moment corresponding to the k-th sliding step, where each row represents the occupancy value of a modeled road in the target domain at the (k+l+p-1)th moment in the occupancy time series;
[0150] Based on the target domain traffic training sample set and its corresponding true value set, the target domain occupancy training sample set and its corresponding true value set, construct a target domain training sample set and its corresponding true value set;
[0151] (2) Generate a source domain training sample set and its corresponding true value set, including:
[0152] Taking the source domain detector corresponding to the maximum data modeling goodness obtained as the center, the flow value and occupancy value of each modeling road in the source domain at each time are obtained to obtain the source domain flow time matrix and the source domain occupancy time matrix; wherein, each row in the source domain flow time matrix represents the time series composed of the flow values of a modeling road at each time, that is, each row represents the flow time series of each modeling road in the source domain; each row in the source domain occupancy time matrix represents the time series composed of the occupancy values of a modeling road at each time, that is, each row represents the occupancy time series of each modeling road in the source domain;
[0153] Based on the source domain traffic time matrix, the source domain traffic training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are:
[0154]
[0155] in, They represent the source domain traffic training sample set and the true value set corresponding to the source domain traffic training sample set respectively; represents the k-th source domain traffic training sample matrix, which contains the traffic values of each modeled road in the source domain at l moments corresponding to the k-th sliding step, that is, each row represents the traffic value from the k-th moment to the (k+l-1)-th moment in the traffic time series of a modeled road in the source domain; represents the true value vector corresponding to the k-th source domain traffic training sample matrix, which contains the true value of the traffic at the (l+1)th moment of each modeling road in the source domain corresponding to the k-th sliding step, that is, each row represents the traffic value at the (k+l+p-1)th moment in the traffic time series of a modeling road in the source domain; m S represents the number of modeled roads in the source domain; n represents the total number of moments; l represents the sliding window size; p represents the prediction window size, p = 1; k represents the number of sliding times;
[0156] Based on the source domain occupancy time matrix, the source domain occupancy input set and the source domain occupancy output set are generated according to the preset input window size, prediction window size, and sliding step size. The expressions are:
[0157]
[0158] in, They represent the source domain occupancy training sample set and the true value set corresponding to the source domain occupancy respectively; represents the k-th source domain occupancy training sample matrix, which contains the occupancy values of each source domain modeling road in the source domain corresponding to the k-th sliding step at l moments, that is, each row represents the occupancy value of a modeling road in the source domain from the k-th moment to the (k+l-1)-th moment in the occupancy time series; represents the true value vector corresponding to the k-th source domain occupancy training sample matrix, which contains the true value of the occupancy of each modeled road in the source domain at the (l+1)th moment corresponding to the k-th sliding step, that is, each row represents the occupancy value of a modeled road in the source domain at the (k+l+p-1)th moment in the occupancy time series;
[0159] Based on the source domain traffic training sample set and its corresponding true value set, the source domain occupancy training sample set and its corresponding true value set, a source domain training sample set and its corresponding true value set are constructed.
[0160] S3: Establish a multi-convolutional neural network coupled traffic prediction model. The structure diagram of the multi-convolutional neural network coupled traffic prediction model is as follows: Figure 3 As shown; specifically including:
[0161] The multi-convolutional neural network coupled traffic prediction model includes three convolutional neural networks and two neural networks;
[0162] The source domain training set includes a flow training sample set and an occupancy training sample set;
[0163] Input each traffic training sample in the source domain training sample set into the first convolutional neural network, and output the traffic prediction value corresponding to each traffic training sample;
[0164] Input each occupancy training sample in the source domain training sample set into the second convolutional neural network, and output the occupancy prediction value corresponding to each occupancy training sample;
[0165] After integrating each normalized flow training sample and each occupancy training sample in the source domain training sample set, each obtained joint flow-occupancy sample is input into the third convolutional neural network, and the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample is output;
[0166] After standardizing the individual prediction values of each flow divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the flow prediction values corresponding to each flow training sample, and then input into the first neural network to output the final prediction values of the flow corresponding to each flow training sample;
[0167] After standardizing the individual prediction values of each occupancy divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the occupancy prediction values corresponding to each occupancy training sample, and then input into the second neural network to output the final prediction values of the occupancy corresponding to each occupancy training sample;
[0168] In summary, the multi-convolutional neural network coupled traffic prediction model (M-CNN-FPM) contains three convolutional neural networks, which are used for different feature extraction respectively; the first convolutional neural network is used to extract the spatiotemporal characteristics of traffic flow; the second convolutional neural network is used to extract the spatiotemporal characteristics of occupancy; the first convolutional neural network and the second convolutional neural network only consider the trend and characteristics of one variable, and do not consider the direct real-time relationship between traffic flow and occupancy, so the third convolutional neural network is introduced to extract the relationship between the two; unlike the first two CNNs, the input of the third convolutional neural network is the integrated value of traffic flow and occupancy, so the spatial dimension of the third convolutional neural network is twice that of the first two CNN inputs;
[0169] The structure diagram of the third convolutional neural network is as follows Figure 4 As shown, the flow and occupancy data are normalized and then integrated, and then the obtained joint flow-occupancy sample is input into the third convolutional neural network to obtain the joint flow-occupancy prediction value corresponding to the joint flow-occupancy sample; finally, the flow data and occupancy data in the obtained joint flow-occupancy prediction value are standardized respectively, so that the data is restored to the original magnitude;
[0170] After CNN prediction of flow and occupancy respectively, a set of predicted values of flow and occupancy can be obtained; in addition, in the third convolutional neural network, a set of flow and occupancy predictions can be obtained; in order to integrate the two sets of predicted data, it is necessary to add two neural networks after the three CNNs to integrate the predicted values of flow and occupancy; the individual features and shared features and connections of flow and occupancy extracted by the first three CNNs are combined through the neural network to further improve the accuracy of the prediction; the model framework of the third convolutional neural network is as follows Figure 5 shown.
[0171] S4: Using the source domain training sample set and its corresponding true value set, the traffic prediction model is trained to obtain the source domain traffic prediction model, including:
[0172] Based on the first convolutional neural network, the spatiotemporal characteristics of the flow values at each time in each flow training sample in the source domain training sample set are extracted to obtain the flow prediction value corresponding to each flow training sample;
[0173] Based on the second convolutional neural network, the spatiotemporal characteristics of the occupancy values at each moment in each occupancy training sample in the source domain training sample set are extracted to obtain the occupancy prediction value corresponding to each occupancy training sample;
[0174] Integrate each normalized flow training sample and each occupancy training sample in the source domain training sample set to obtain each joint flow-occupancy sample; input each joint flow-occupancy sample into the third convolutional neural network, and output the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample;
[0175] After standardizing the individual prediction values of each flow divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the flow prediction values corresponding to each flow training sample, and then input into the first neural network to output the final prediction values of the flow corresponding to each flow training sample;
[0176] After standardizing the individual prediction values of each occupancy divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the occupancy prediction values corresponding to each occupancy training sample, and then input into the second neural network to output the final prediction values of the occupancy corresponding to each occupancy training sample;
[0177] The loss function is calculated according to the final predicted value of the traffic flow corresponding to each traffic training sample, the final predicted value of the occupancy corresponding to each occupancy training sample, and the true value set corresponding to the source domain training sample set; by minimizing the loss function, the various parameters of the multi-convolutional neural network coupled traffic prediction model are obtained, and the training of the multi-convolutional neural network coupled traffic prediction model is completed; the trained multi-convolutional neural network coupled traffic prediction model is used as the source domain traffic prediction model.
[0178] S5: Adaptively train the source domain traffic prediction model using the filtered target domain training sample set and its corresponding true value set to obtain the target domain traffic prediction model;
[0179] Due to the variability between networks in different traffic areas, after filtering out similar traffic areas, the data in the source domain or target domain needs to be filtered and processed to adapt to the data changes between different research areas; in the present invention, the target domain data is filtered and processed by the proportional relationship between the critical occupancy rate and the maximum weighted flow of the target domain and the source domain to fit the prediction model trained from the source domain data set;
[0180] The filtering of the target domain training sample set and its corresponding true value set includes:
[0181] Through the maximum weighted flow value ratio and critical occupancy ratio between the source domain and the target domain, the flow data and occupancy data in the target domain training sample set and its corresponding true value set are filtered respectively to obtain the filtered target domain training sample set and its corresponding true value set;
[0182] The maximum weighted flow value ratio between the source domain and the target domain is used as the flow filtering coefficient Its expression is:
[0183]
[0184] in, Indicates the maximum weighted flow value of the target domain; Indicates the maximum weighted flow value of the source domain;
[0185] The critical occupancy ratio between the source domain and the target domain is used as the occupancy filtering coefficient Its expression is:
[0186]
[0187] in, represents the critical occupancy of the target domain; represents the critical occupancy of the source domain;
[0188] In summary, the source domain that is most similar to the traffic conditions in the target domain is screened out through the macro fundamental diagram (MFD), and model migration is carried out between the two cells; however, due to the difference in traffic between different areas, even the two cells that have been screened out have differences in order of magnitude; for this reason, the present invention filters the target domain traffic volume data by the ratio of the maximum traffic volume values between the source domain and the target domain, and performs the same operation on the occupancy data.
[0189] By filtering the target domain traffic data, the data between the two areas are made to be on the same order of magnitude; the M-CNN-FPM traffic prediction model is trained using the source domain training set data to obtain the source domain traffic prediction model; then, several computing layer parameters of the source domain traffic prediction model are frozen, and a small part of the target domain data (training set data) is input into the frozen source domain model for model adaptive training; the model trained in this way can not only capture the common features between the two traffic areas at the same time, but also improve the prediction performance of the traffic prediction model in the target domain prediction.
[0190] Specifically, in the strategy of integrating transfer learning with macro basic graph (MFD-MATL), the three CNNs are regarded as one module, and the following two neural networks are also regarded as one module; during the model migration process, the CNN module close to the input is frozen in the calculation layer, and other layers and neural network modules are not frozen; the specific model transfer is as follows Figure 8 As shown in the figure, the transfer method is used to realize the migration of common features of the two domains and adaptation in the target domain, so as to obtain better prediction results in the target domain.
[0191] Embodiment 2
[0192] In order to verify the performance of the proposed M-CNN-FPM prediction model, the present invention uses data obtained from UTD19 in central London, UK. The satellite view of the area is as follows: Figure 7 As shown in Figure 2; the traffic area in the city center is selected for research because the city center, as a compact area, has more similar road adjacencies and is suitable for the transfer of the proposed model; after adjusting the remaining detectors and filtering the detectors with abnormal data, some detectors are selected for research, such as Figure 7 As shown, Figure 7 The red dots in the figure represent the selected partial detectors.
[0193] The research data is generated based on a sliding window, with a preset sliding window size of 12, a prediction window size of 1, and a sliding step of 1 (using the data from the previous hour to predict the traffic data for the next 5 minutes); in order to verify the model, the data generated by the sliding window will be divided into two groups: a training set and a test set, in which the proportions of the source domain and the target domain are different; in the source domain, the first 90% of the traffic data is used for training, and the last 10% is used for prediction and evaluation; in the target domain, the first 10% of the traffic data in the source domain is used to obtain adaptive training of the model, and the last 90% of the traffic data is used to predict and evaluate the predictive effectiveness of the model; the traffic data includes flow data and occupancy data.
[0194] Based on the N-cut clustering algorithm, this paper divides the study area into five homogeneous sub-areas, taking into account a series of factors such as model feature extraction, internal homogeneity, model generalization and computational cost. Figure 8 As shown; Table 1 records the MFD and parameters of each sub-region; by analyzing the critical occupancy of each sub-region, the two sub-regions with the highest similarity are Region3 and Region4.
[0195] Table 1 Partition results and MFD and parameters of each sub-area
[0196]
[0197] In the MFD parameters shown in Table 1, Num_detector is the number of detectors in the region, MFD_a and MFD_b are the coefficients of the fitted quadratic function, and the expression of the maximum weighted flow in any sub-region is:
[0198] q w* =MFD_a*O 2 +MFD_b*O
[0199] Among them, O * Indicates the critical occupancy rate corresponding to the current sub-region; q w* Indicates the maximum weighted flow value corresponding to the current sub-area; R 2 It indicates the goodness of fit of the MFD curve fitted by the current sub-region to the overall model. The larger the value, the more accurate the fit, and the more the MFD can represent the regional traffic pattern.
[0200] Region 3 is selected as the source region of the study, i.e., the source domain, and Region 4 is selected as the target region of the study, i.e., the target domain; the average occupancy weighted flow scatter plot of the two regions and MFD is shown in Fig. 9 (a); it is clear that the two regions and their respective MFD shapes are more similar, but they are not of the same order of magnitude; Fig. 9(b) shows the dynamic relationship between the weighted traffic data of the 643-step sequence of the target domain training set and the corresponding source domain data. It can also clearly see the similar traffic scenarios and their numerical differences between the two; Fig. 9 The traffic conditions in the two areas are similar, which also proves that the migration of the prediction model based on the minimum value of the present invention is reasonable.
[0201] The multi-convolutional neural network coupled traffic prediction model represented by the M-CNN-FPM traffic prediction model is a model trained in the source domain; two source domain individual CNNs (one predicts traffic flow and the other predicts occupancy) are selected for prediction and fused with transfer learning, and it is named Source-CNN-MATL traffic prediction model, that is, the Source-CNN-MATL traffic prediction model is composed of two convolutional neural networks and fused with transfer learning; at the same time, in order to further explore the advantages and disadvantages of direct model migration based on feature space, the source domain data is filtered and trained, and the FSATL traffic prediction model corresponds to the model trained on the filtered source domain dataset also based on a single CNN; MAE and MSE are selected to evaluate the prediction effectiveness of the two models.
[0202] Fig.10 The figure shows the results of three traffic prediction models predicting flow and occupancy on the source domain test dataset; the prediction results of the Source-CNN-MATL traffic prediction model and the M-CNN-FPM traffic prediction model are better than the FSATL traffic prediction model, proving that filtering the source domain data does affect the prediction results of the source domain model; at the same time, it is proved that the proposed M-CNN-FPM traffic prediction model has better prediction effect.
[0203] Fig.11 The trend comparison between the proposed M-CNN-FPM traffic prediction model and the actual weighted flow and occupancy is shown in; Fig.11 The size and color of each point in the graph represent the difference between the occupancy predicted by the present invention and the true value; the results show that the traffic prediction model proposed by the present invention can provide good predictions in the source domain.
[0204] After obtaining the source domain traffic prediction model, it is also necessary to perform domain adaptation on the source domain traffic prediction model in the target domain so that the prediction model can extract traffic knowledge and features from less traffic data in the target domain.
[0205] In order to verify the advantages of the MFD-MATL algorithm proposed in this paper in transfer learning, other modeling methods are added and compared; in addition to FSATL, the knowledge transfer method of direct transfer learning (DTL) is also added, and the traffic prediction model trained in the source domain is directly applied to the data prediction in the target domain after adaptation in the target domain; a single CNN network (Target-CNN) trained with target domain data is also added for comparison; among the various prediction methods studied, the layer and parameter structure of CNN are the same. In order to further evaluate the superiority of the model, in addition to the previous MAE and MSE, evaluation indicators such as NRMSE and SMAPE are also introduced.
[0206] Fig.12 The comparison of MAE, MSE, NRMSE and SMAPE indicators of various prediction models in predicting the traffic flow of each road in the target domain is demonstrated when the training data of the target domain is insufficient; by comparing the evaluation indicators under various models, the proposed MFD-MATL algorithm has a prediction advantage and can provide more accurate traffic flow occupancy prediction for each link in the target domain.
[0207] Fig.13 Comparison between the actual values in the target domain test set and the predicted values by MFD-MATL; it can be observed that the difference between the two is very small, which indicates that accurate predictions of most traffic conditions can be achieved and the predicted data points can reflect most traffic conditions in the target domain.
[0208] In order to further compare the accuracy of the model proposed in this invention in predicting traffic conditions, the traffic conditions in the target domain are divided into three categories based on the K-means algorithm: free flow, stable flow and unstable flow; the partition results and the prediction results of the model proposed in this invention are shown in Figure 2. Fig.14 and Fig.15 As shown; the results show that the model proposed in the present invention can provide more accurate traffic condition prediction when the target domain data is insufficient.
[0209] Table 2 gives a comparison of the prediction performance of various models in the target domain with insufficient data; the first row is the flow prediction, and the second row is the occupancy prediction; Source-CNN-MATL is two independent CNNs in the source domain, predicting flow and occupancy respectively, and its prediction framework in the target domain is the same as MFD-MATL, that is, only the target domain data is filtered. For further comparison, the present invention also uses support vector machine (SVM), random forest (RF) and long short-term memory (LSTM) to perform flow prediction in the target domain. Among them, Accuracy represents the prediction result after classifying the traffic conditions of the target domain cell. The comparison of various indicators shows that the MFD-MATL proposed in this paper has good prediction performance in cells with insufficient data.
[0210] Table 2 Comparison of evaluation indicators
[0211]
[0212] Based on Example 1 and Example 2, the road network-level traffic prediction method integrating transfer learning and macro basic graph provided by the present invention is generally divided into two parts.
[0213] In the first part, the present invention divides the network into several areas based on the N-cut algorithm, draws the MFD scatter plot of each area, and then regresses to obtain the MFD curve and its key parameters of each area; in order to filter the traffic area most suitable for transfer learning, the present invention proposes a two-step traffic area similarity discrimination method based on MFD critical occupancy and area between curves, and finds the sub-area most similar to the macro basic map of the target domain as the source domain; the traffic data from the source domain is trained in the multi-convolutional neural network coupled traffic prediction model M-CNN-FPM (Muti-CNNs-Fusion Prediction Model) proposed in the present invention, and some layers of the obtained prediction model are frozen to prepare for subsequent transfer learning; wherein, the frozen layers of the obtained prediction model are several continuous calculation layers close to the input.
[0214] In the second part, the traffic flow occupancy data of the target domain are filtered according to the ratio of the critical occupancy-maximum weighted flow value points obtained by the MFD of the two areas; a small amount of target domain data is input to adapt the source domain model to the target domain, so that the model can obtain better prediction results in the regression task of the target domain; finally, the adjusted prediction model is used to predict the test data of the target domain and perform rationality analysis.
[0215] The present invention uses macro basic graph, transfer learning and deep learning, and the specific principles are as follows:
[0216] (1) The Macroscopic Fundamental Diagram (MFD) was first proposed by Godfrey in 1969, reflecting the unimodal relationship between network weighted flow and average density (occupancy rate). Since MFD is independent of the traffic network and does not change with the change of road network traffic flow, it can measure the traffic status of the road network and is an intrinsic property of the network; according to MFD, the unimodal relationship between network weighted flow and average density (occupancy rate) can be described as a quadratic or cubic function relationship.
[0217] Taking the quadratic function relationship as an example, the basic curve of MFD is as follows: Figure 1 shown in Figure 1 In the equation, O represents the average occupancy rate of the road network; and q w Represents the weighted flow value of the road network; * Indicates the critical occupancy of the road network. At this time, the corresponding weighted flow value of the road network is the maximum weighted flow value q w* , corresponding to the maximum traffic efficiency of the regional road network; when the average occupancy rate of the road network is less than O * When the average occupancy rate of the road network is greater than O, the weighted flow rate is greater; when the average occupancy rate of the road network is greater than O * When the average occupancy rate of the road network is larger, the weighted flow rate is smaller; by controlling the number of vehicles in the road network to control the average occupancy rate at O * Nearby, the traffic efficiency of the road network can be maintained at a high value, thereby alleviating regional congestion. Among them, the weighted flow value q of the road network w , and the expressions of average occupancy are:
[0218]
[0219] Among them, q b , O b , l b They respectively represent the weighted flow, occupancy rate and road length of road b in the road network.
[0220] (2) Transfer learning is a powerful machine learning method. Its core idea is to transfer the knowledge or model learned on one task (source task) to another related task (target task) to improve the performance of the new task. This method makes full use of existing data and model resources, reduces the target task's dependence on a large amount of new data, speeds up model training, and improves the model's generalization ability. The overview of transfer learning is shown in the figure below. Figure 2 As shown;
[0221] Transfer learning can be divided into three main categories:
[0222] Model-based transfer: Directly use the pre-trained model of the source task as the starting point of the target task, and fine-tune the model parameters to adapt to the new task; when there is less traffic data in the target domain, using the pre-trained model can significantly improve model performance.
[0223] Feature-based transfer: extract feature representations from the source task, and then train the model of the target task based on these features; specifically, transfer features to each other through feature transformation to reduce the gap between the source domain and the target domain; or transform the data features of the source domain and the target domain into a unified feature space, and then use traditional machine learning methods for classification and recognition.
[0224] Relationship-based transfer: learn the relationship between data from the source task and apply this relationship to the target task; in the present invention, by learning the traffic data in the source domain and its relationship, and then applying it to the target domain where data is scarce, the dependence on the target domain data is low.
[0225] (3) Deep learning is a machine learning algorithm based on artificial neural networks. Its core is to achieve automatic learning and feature extraction of complex data by building a multi-level neural network model. This algorithm imitates the interaction between neurons in the human brain and recognizes patterns, classifies and predicts through training with large amounts of data.
[0226] In deep learning, Convolutional Neural Network (CNN) is a feedforward neural network widely used in computer vision and image recognition tasks. The design of CNN is inspired by the study of biological visual cognition mechanisms, especially the layout of local connections of neurons in the visual cortex. It automatically extracts features by performing a series of convolution operations on the input image, which can be used as the basis for a variety of tasks such as image classification, object detection, and facial recognition.
[0227] CNN mainly consists of the following layers:
[0228] Convolutional Layer: This is the core component of CNN. In the convolutional layer, one or more convolution kernels (also called filters) slide on the input image and produce an output feature map through dot product operations.
[0229] Activation Layer: The activation layer usually follows the convolutional layer to increase the nonlinearity of the network.
[0230] Pooling Layer: Pooling layer (also called downsampling layer) is used to reduce the spatial size of the data, thereby reducing the number of parameters and computation in the network, and also helps reduce overfitting.
[0231] Fully Connected Layer: After several convolutional layers and pooling layers, there are usually one or more fully connected layers. Each neuron in the fully connected layer is connected to all neurons in the previous layer. Its function is to combine the features extracted by the convolutional layer and the pooling layer for the final classification or regression task.
[0232] Output Layer: The output layer is usually a special case of the fully connected layer and is used to output the final result.
[0233] The advantage of CNN is that it can automatically extract useful features from raw images without manually designing complex feature extractors. This makes CNN have good application prospects in image recognition, video analysis, autonomous driving and other fields.
[0234] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. A road network-level traffic prediction method integrating transfer learning and macro basic graph, characterized in that: include: According to the historical traffic data of the regional road network and the number of preset regional divisions, the regional road network is divided based on the semantic segmentation algorithm to obtain the sub-regions of the regional road network; Based on the macro basic graph of each sub-region, the critical occupancy rate of each sub-region is obtained; any sub-region is selected as the target domain, and other sub-regions whose critical occupancy rates are within the critical interval of the target domain are taken as the critical related sub-regions of the target domain; within the critical interval of the target domain, the curve area enclosed by the macro basic graph of the target domain and the macro basic graphs of its critical related sub-regions are calculated respectively, and the critical related sub-region corresponding to the calculated minimum curve area is taken as the source domain; if there is no critical occupancy rate of other sub-regions within the critical interval of the target domain, the regional road network is re-divided; Taking each detector in the target domain as the center, the flow value of each modeled road in the target domain at each time is obtained, and the flow time matrix of each detector in the target domain is established; taking each detector in the source domain as the center, the flow value of each modeled road in the source domain at each time is obtained, and the flow time matrix of each detector in the source domain is established; Based on the Pearson correlation coefficient and unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, the data modeling goodness between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain is obtained; The target domain detector and source domain detector corresponding to the obtained maximum data modeling goodness are respectively taken as the center to obtain the flow value and occupancy value of each modeling road in the target domain and the source domain at each time, and the sliding window method is used to set the sliding window size to l and the sliding step to 1. For a modeling road, the flow value or occupancy value at every k moments in the sliding window is used as a training sample, and the flow value or occupancy at the (k+1)th moment is used as the true value corresponding to the training sample, thereby generating the target domain training sample set and its corresponding true value set, and the source domain training sample set and its corresponding true value set; Using the source domain training sample set and its corresponding true value set, the traffic prediction model is trained to obtain the source domain traffic prediction model; The source domain traffic prediction model is adaptively trained using the filtered target domain training sample set and its corresponding true value set to obtain the target domain traffic prediction model.
2. A road network-level traffic prediction method integrating transfer learning and macro basic graph according to claim 1, characterized in that: The traffic prediction model is a multi-convolutional neural network coupled traffic prediction model; The multi-convolutional neural network coupled traffic prediction model includes three convolutional neural networks and two neural networks; The source domain training set includes a flow training sample set and an occupancy training sample set; Input each traffic training sample in the source domain training sample set into the first convolutional neural network, and output the traffic prediction value corresponding to each traffic training sample; Input each occupancy training sample in the source domain training sample set into the second convolutional neural network, and output the occupancy prediction value corresponding to each occupancy training sample; After integrating each normalized flow training sample and each occupancy training sample in the source domain training sample set, each obtained joint flow-occupancy sample is input into the third convolutional neural network, and the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample is output; After standardizing the individual prediction values of each flow divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the flow prediction values corresponding to each flow training sample, and then input into the first neural network to output the final prediction values of the flow corresponding to each flow training sample; The individual prediction values of each occupancy divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample are standardized, integrated with the occupancy prediction value corresponding to each occupancy training sample, and then input into the second neural network to output the final prediction value of the occupancy corresponding to each occupancy training sample.
3. A road network-level traffic prediction method integrating transfer learning and macro basic graph according to claim 2, characterized in that: The traffic prediction model is trained by using the source domain training sample set and its corresponding true value set to obtain the source domain traffic prediction model, including: Based on the first convolutional neural network, the spatiotemporal characteristics of the flow values at each time in each flow training sample in the source domain training sample set are extracted to obtain the flow prediction value corresponding to each flow training sample; Based on the second convolutional neural network, the spatiotemporal characteristics of the occupancy values at each moment in each occupancy training sample in the source domain training sample set are extracted to obtain the occupancy prediction value corresponding to each occupancy training sample; Integrate each normalized flow training sample and each occupancy training sample in the source domain training sample set to obtain each joint flow-occupancy sample; input each joint flow-occupancy sample into the third convolutional neural network, and output the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample; After standardizing the individual prediction values of each flow divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the flow prediction values corresponding to each flow training sample, and then input into the first neural network to output the final prediction values of the flow corresponding to each flow training sample; After standardizing the individual prediction values of each occupancy divided from the joint flow-occupancy prediction value corresponding to each joint flow-occupancy sample, the individual prediction values are integrated with the occupancy prediction values corresponding to each occupancy training sample, and then input into the second neural network to output the final prediction values of the occupancy corresponding to each occupancy training sample; The loss function is calculated according to the final predicted value of the traffic flow corresponding to each traffic training sample, the final predicted value of the occupancy corresponding to each occupancy training sample, and the true value set corresponding to the source domain training sample set; by minimizing the loss function, the various parameters of the multi-convolutional neural network coupled traffic prediction model are obtained, and the training of the multi-convolutional neural network coupled traffic prediction model is completed; the trained multi-convolutional neural network coupled traffic prediction model is used as the source domain traffic prediction model.
4. A road network-level traffic prediction method integrating transfer learning and macro basic graph according to claim 1, characterized in that: The curve area enclosed by the macro basic graph of the target domain and the macro basic graph of its ath critically related sub-region is: Among them, MFD T A macroscopic fundamental graph representing the target domain; MFD a represents the ath critically relevant sub-region of the target domain; represents the critical occupancy of the target domain; represents the critical interval range of the target domain; ∈ represents the interval threshold.
5. The method for road network-level traffic prediction integrating transfer learning and macro basic graph according to claim 1, characterized in that: Calculating the Pearson correlation coefficient between the flow-time matrix of each detector in the target domain and the flow-time matrix of each detector in the source domain includes: For any detector X in the target domain and any detector Y in the source domain, calculate the Pearson correlation coefficient r between the flow-time matrix of detector X in the target domain and the flow-time matrix of detector Y in the source domain XY , whose expression is: Among them, Q X represents the traffic time matrix of the target domain detector X; Q Y represents the flow time matrix of the source domain detector Y; Cov(Q X ,Q Y ) represents the covariance between the flow-time matrix of the target domain detector X and the flow-time matrix of the source domain detector Y; Represents the flow time matrix of the target domain detector X when the number of samples is n X The standard deviation in the sample; represents the flow time matrix of the target domain detector X at the i-th moment; represents the mean of the flow time matrix of the target domain detector X; Represents the flow time matrix of the source domain detector Y when the number of samples is n Y The standard deviation in the sample; represents the flow-time matrix of the source domain detector Y at the jth moment; Represents the mean of the flow time matrix of the source domain detector Y.
6. A road network-level traffic prediction method integrating transfer learning and macro basic graph according to claim 1, characterized in that: Calculating the unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain includes: For any detector X in the target domain and any detector Y in the source domain, the maximum mean difference MMD(X,Y) between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain is calculated, and its expression is: in, represents the traffic time matrix of the target domain detector X at the i-th moment; n X represents the number of samples in the flow time matrix of the target domain detector X; represents the flow time matrix of the source domain detector Y at the jth moment; n Y represents the number of samples in the flow time matrix of the source domain detector Y; Through the mapping function F(*), the flow time matrix of the target domain detector X and the source domain detector Y is projected into the kernel Hilbert space In the above equation, we get the kernel function between the target domain detector X and the source domain detector Y, which is expressed as: in, Represents the mapping function corresponding to the traffic time matrix of the target domain detector X at the i-th moment; represents the mapping function corresponding to the flow-time matrix of the source domain detector Y at the jth moment; Based on the kernel function expression, the unbiased estimator MMD between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain is calculated 2 (Q X ,Q Y ), whose expression is: The kernel operation is performed through the Gaussian kernel function to obtain the value of the kernel function between the target domain detector X and the source domain detector Y, thereby obtaining the value of the unbiased estimator between the flow time matrix of the detector X in the target domain and the flow time matrix of the detector Y in the source domain; wherein the Gaussian kernel function expression is: Where σ represents the width parameter of the Gaussian kernel function.
7. A road network-level traffic prediction method integrating transfer learning and macro basic graph according to claim 1, characterized in that: The data modeling goodness between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain is obtained based on the Pearson correlation coefficient and the unbiased estimator between the flow time matrix of each detector in the target domain and the flow time matrix of each detector in the source domain, including: For any detector X in the target domain and any detector Y in the source domain, the Pearson correlation coefficient r between the flow-time matrix of the target domain detector X and the flow-time matrix of the source domain detector Y is XY And the unbiased estimator MMD between them 2 (Q X ,Q Y ), and obtain the data modeling goodness G between the flow time matrix of detector X in the target domain and the flow time matrix of detector Y in the source domain XY , whose expression is: G XY =λ1|r XY |-λ2MMD 2 (Q X ,Q Y ) Wherein, λ1 represents the first weighting coefficient; λ2 represents the second weighting coefficient.
8. The method for road network-level traffic prediction integrating transfer learning and macro basic graph according to claim 1, characterized in that: Taking the target domain detector corresponding to the maximum data modeling goodness as the center, the flow value and occupancy value of each modeling road in the target domain at each time are obtained, and the sliding window method is used to set the sliding window size to l and the sliding step to 1. For a modeling road, the flow value or occupancy value at every l time in the sliding window is used as a training sample, and the flow value or occupancy at the (l+1)th time is used as the true value corresponding to the training sample, thereby generating a target domain training sample set and its corresponding true value set, including: Taking the target domain detector corresponding to the maximum data modeling goodness as the center, the flow value and occupancy value of each modeled road in the target domain at each time are obtained to obtain the target domain flow time matrix and the target domain occupancy time matrix; Based on the target domain traffic time matrix, the target domain traffic training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are: in, They represent the target domain traffic training sample set and the true value set corresponding to the target domain traffic training sample set respectively; represents the k-th target domain traffic training sample matrix, which contains the traffic values of each modeled road in the target domain at l moments corresponding to the k-th sliding step; represents the true value vector corresponding to the k-th target domain traffic training sample matrix, which contains the true value of the traffic at the (l+1)th moment of each modeling road in the target domain corresponding to the k-th sliding step; m T represents the number of modeled roads in the target domain; n represents the total number of moments; l represents the sliding window size; p represents the prediction window size, p = 1; k represents the number of sliding times; Based on the target domain occupancy time matrix, the target domain occupancy training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are: in, They represent the target domain occupancy training sample set and the true value set corresponding to the target domain occupancy training sample set respectively; represents the k-th target domain occupancy training sample matrix, which contains the occupancy values of each modeled road in the target domain corresponding to the k-th sliding step at l moments; represents the true value vector corresponding to the k-th occupancy training sample matrix, which contains the true value of the occupancy of each modeled road in the target domain at the (l+1)th moment corresponding to the k-th sliding step; Based on the target domain traffic training sample set and its corresponding true value set, the target domain occupancy training sample set and its corresponding true value set, a target domain training sample set and its corresponding true value set are constructed.
9. The method for road network-level traffic prediction integrating transfer learning and macro basic graph according to claim 1, characterized in that: Taking the source domain detector corresponding to the maximum data modeling goodness as the center, the flow value and occupancy value of each modeling road in the source domain at each time are obtained, and the sliding window method is used to set the sliding window size to l and the sliding step to 1. For a modeling road, the flow value or occupancy value at every l time in the sliding window is used as a training sample, and the flow value or occupancy at the (l+1)th time is used as the true value corresponding to the training sample, thereby generating a source domain training sample set and its corresponding true value set, including: Taking the source domain detector corresponding to the maximum data modeling goodness as the center, the flow value and occupancy value of each modeling road in the source domain at each time are obtained to obtain the source domain flow time matrix and source domain occupancy time matrix; Based on the source domain traffic time matrix, the source domain traffic training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are: in, They represent the source domain traffic training sample set and the true value set corresponding to the source domain traffic training sample set respectively; represents the k-th source domain traffic training sample matrix, which contains the traffic values of each modeled road in the source domain at l moments corresponding to the k-th sliding step; represents the true value vector corresponding to the k-th source domain traffic training sample matrix, which contains the true value of the traffic at the (l+1)th moment of each modeling road in the source domain corresponding to the k-th sliding step; m S represents the number of modeled roads in the source domain; n represents the total number of moments; l represents the sliding window size; p represents the prediction window size, p = 1; k represents the number of sliding times; Based on the source domain occupancy time matrix, the source domain occupancy training sample set and its corresponding true value set are generated according to the sliding window size, prediction window size, and sliding step size. The expressions are: in, They represent the source domain occupancy training sample set and the true value set corresponding to the source domain occupancy respectively; represents the k-th source domain occupancy training sample matrix, which contains the occupancy values of each source domain modeling road in the source domain corresponding to the k-th sliding step at l moments; represents the true value vector corresponding to the k-th source domain occupancy training sample matrix, which contains the true value of the occupancy of each modeled road in the source domain at the (l+1)th moment corresponding to the k-th sliding step; Based on the source domain traffic training sample set and its corresponding true value set, the source domain occupancy training sample set and its corresponding true value set, a source domain training sample set and its corresponding true value set are constructed.
10. The method for road network-level traffic prediction integrating transfer learning and macro basic graph according to claim 1, characterized in that: Filtering the target domain training sample set and its corresponding true value set includes: Through the maximum weighted flow value ratio and critical occupancy ratio between the source domain and the target domain, the flow data and occupancy data in the target domain training sample set and its corresponding true value set are filtered respectively to obtain the filtered target domain training sample set and its corresponding true value set; The maximum weighted flow value ratio between the source domain and the target domain is used as the flow filtering coefficient Its expression is: in, Indicates the maximum weighted flow value of the target domain; Indicates the maximum weighted flow value of the source domain; The critical occupancy ratio between the source domain and the target domain is used as the occupancy filtering coefficient Its expression is: in, represents the critical occupancy of the target domain; Represents the critical occupancy of the source domain.
Citation Information
Patent Citations
MFD estimation method based on data fusion of BP neural network
CN109272746A
Road network traffic state judgment method based on MFD + spectral clustering + SVM
CN110210509A
Road traffic congestion propagation prediction method based on SAE (Stacked Auto-Encoder)-LSTM (Long Short Term Memory)-SAD (Sum of Absolute Differences)
CN110599766A
Traffic information processing method and device
CN110969857A
Traffic prediction method based on graph transfer learning
CN113128783A