Traffic volume prediction method of prophet-deepar model

By combining the Prophet and DeepAR models, the trends, seasonality, and impact of sudden events in traffic volume are extracted, solving the problems of accuracy and adaptability in traffic volume prediction under sudden events, and achieving efficient and accurate traffic volume prediction.

CN116564102BActive Publication Date: 2025-12-05HARBIN INST OF TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310533910.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-12
Publication Date
2025-12-05
Estimated Expiration
2043-05-12

AI Technical Summary

Technical Problem

Existing traffic volume prediction technologies struggle to generate accurate and stable predictions under sudden events, cannot effectively incorporate the influencing factors of such events, and have strict data requirements, necessitating extensive experience to adjust model parameters.

Method used

By combining the Prophet and DeepAR models, the Prophet model extracts trends, seasonal fluctuations, and the impact of holidays, while the DeepAR model introduces external variables related to emergencies, thus constructing the Prophet-DeepAR model for traffic volume prediction.

Benefits of technology

It improves the accuracy and flexibility of traffic volume forecasting during emergencies, adapts to changes in road traffic conditions, reduces the requirement for professional knowledge, and overcomes data gaps and anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116564102B_ABST
    Figure CN116564102B_ABST
Patent Text Reader

Abstract

The application relates to a traffic volume prediction method of a Prophet-DeepAR model, and the method comprises the following steps: acquiring a traffic volume dataset and a covariant dataset; constructing a Prophet model, inputting the traffic volume dataset into the Prophet model, decomposing the traffic volume dataset, and outputting a first prediction result; constructing a DeepAR model, training the DeepAR model based on the decomposed traffic volume dataset and the covariant dataset, generating a second prediction result based on the trained DeepAR model; and combining the first prediction result and the second prediction result to obtain a traffic volume prediction result. Compared with an existing traffic volume prediction model, the application has better prediction performance under the condition of a sudden event through model combination.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of traffic engineering, and in particular to a traffic volume prediction method based on a Prophet-DeepAR model. BACKGROUND

[0002] In recent years, the intensity and frequency of emergencies (such as natural disasters, catastrophic accidents, public health emergencies, and public safety incidents) worldwide have been increasing year by year. Emergencies and the subsequent response measures have a significant impact on traffic volume. For example, during the pandemic, traffic demand was greatly and sharply changed due to traffic lockdown. Predicting the changes in traffic volume during emergencies in advance not only provides decision-making basis for traffic management departments to implement control strategies and achieves the goal of normal operation of the traffic system under extreme adverse conditions, but also facilitates the implementation of disaster prevention and protection measures to ensure the safety of travelers. Therefore, traffic volume prediction during emergencies is a common concern of government management departments and travelers.

[0003] Many traffic flow prediction technologies have achieved good performance. The prior art proposes a subway station passenger traffic flow prediction method based on the Prophet model, and the prior art also constructs a traffic flow prediction method based on adaptive generalized PageRank. However, the existing traffic volume prediction technologies are often based on conventional road traffic conditions and only consider historical traffic volume data, without considering emergencies as influencing factors. If an emergency occurs, the existing traffic volume prediction model still faces the following challenges to generate accurate and stable prediction results: (1) Most models assume that future traffic conditions are homogeneous with the past, and when an emergency occurs, useful assumptions cannot be made according to actual conditions. (2) The historical data of traffic volume under emergencies is not complete, and for both statistical methods and intelligent algorithms, the data cannot meet the model requirements. (3) Time-varying traffic volume has complex characteristics such as nonlinearity, autocorrelation, and periodicity. When a large-scale traffic network experiences an emergency, different road segments have different traffic conditions, and the predictor needs to manually adjust the model parameters to adapt to the complex background of traffic volume, which requires the predictor to have a lot of experience in the field of traffic.

[0004] In summary, it is of great research and practical significance to propose an efficient and high-precision prediction method for traffic volume under emergencies SUMMARY

[0005] The purpose of this invention is to provide a traffic volume prediction method based on the Prophet-DeepAR model. To apply existing prediction techniques to traffic volume during emergencies and improve the accuracy of traffic volume prediction during such events, this invention combines the Prophet model framework with the DeepAR algorithm. The Prophet model is used as the main framework of the method, extracting and predicting trend, seasonal fluctuations, and holiday impact components from traffic volume time series data. The DeepAR model introduces external variables related to the emergencies, using these to model and predict the impact information of the emergencies hidden in the residuals extracted by the Prophet model. Ultimately, this achieves accurate traffic volume prediction during emergencies.

[0006] To achieve the above objectives, the present invention provides the following solution:

[0007] The traffic volume prediction method of the Prophet-DeepAR model includes:

[0008] Obtain the traffic volume dataset and covariate dataset;

[0009] Construct a Prophet model, input the traffic volume dataset into the Prophet model, decompose the traffic volume dataset, and output the first prediction result;

[0010] Construct a DeepAR model, train the DeepAR model based on the decomposed traffic volume dataset and the covariate dataset, and generate a second prediction result based on the trained DeepAR model;

[0011] By combining the first prediction result and the second prediction result, a traffic volume prediction result is obtained.

[0012] Optionally, the traffic volume dataset includes timestamps and traffic volume;

[0013] The covariate dataset includes rainfall, wind speed, temperature, road capacity, whether an emergency occurred, and whether traffic closures were implemented.

[0014] Optionally, the Prophet model is:

[0015] y(t) = g(t) + s(t) + h(t) + r(t)

[0016] Where g(t) represents the trend term obtained from the decomposition of traffic volume time series, s(t) is the periodic term obtained by modeling the periodic changes of traffic volume time series, and the modeling method of this term is the same as that used in the exponential smoothing method; h(t) represents the random impact of holidays on traffic volume time series, and r(t) is the error term.

[0017] Optionally, the traffic volume dataset is input into the Prophet model to decompose the traffic volume dataset and output a first prediction result, including:

[0018] The traffic volume dataset is divided into a traffic volume training set and a traffic volume test set. The traffic volume training set is input into the Prophet model. The traffic volume time series in the traffic volume training set is decomposed into trend terms, periodic terms, holiday terms and residual terms. The prediction results of the trend terms, periodic terms and holiday terms are generated based on the timestamps of the traffic volume test set, and the first prediction result is output.

[0019] Optionally, the method for obtaining the trend item is as follows:

[0020] To determine whether road capacity has reached saturation, different modeling methods are used. When the road capacity is nearing or has already reached saturation, a logistic growth model is used to fit the trend term.

[0021]

[0022] Where C(t) is the time-varying road capacity, k is the initial traffic volume growth rate, and m is the offset parameter. Let be the rate of change in traffic volume growth, t be the timestamp corresponding to the model training and prediction periods, and exp() be an exponential function with the natural constant e as its base. This represents the change in offset.

[0023] When the road capacity is not saturated, a piecewise linear growth model is used to fit the trend term:

[0024]

[0025] Where k is the initial traffic volume growth rate, and m is the offset parameter. This represents the change in the rate of increase of traffic volume. This represents the change in the offset parameter;

[0026] The method for obtaining the periodic term is as follows:

[0027]

[0028] Where P is the number of periods, a n and b n Let be the vector of Fourier coefficients, N be the number of sine and cosine components in the Fourier series, π be pi, n be a positive integer from 1 to N, t be the timestamps for the model training and prediction periods, and a be the time stamp. n Here, b represents the Fourier coefficients, indicating the amplitude of the cosine component in the Fourier series. nFor Fourier coefficients, representing the amplitude of the sinusoidal component in the Fourier series;

[0029] The method for obtaining the holiday item is as follows:

[0030]

[0031] Where κ represents the parameter vector, D i k represents the period of influence of the i-th holiday. i Let κ be the i-th component in the parameter vector, representing the degree of influence of the i-th holiday, and t be the timestamp of the model training period and the prediction period.

[0032] Optionally, constructing the DeepAR model includes:

[0033] The DeepAR model is constructed using a long short-term memory neural network.

[0034] Optionally, the conditional probability distribution of the DeepAR model is:

[0035]

[0036] Where t0 is the dividing point between the past training period and the future prediction period, 1: t0-1 is the training period, and t0: T is the prediction period. This is a predicted value for traffic volume. x represents the actual historical traffic volume. 1:T For covariates z, where both the training and prediction time periods are known. t Let h be the traffic volume at time t. t Let θ be the output of the Long Short-Term Memory Neural Network at time t, Θ be the model parameters, θ(·) be the transfer function of the Long Short-Term Memory Neural Network, and P(·|·) be the probability likelihood function specified by the predictor. The product sign indicates the product of consecutive terms from t0 to T, z 1:t-1 Let t be the traffic volume from time 1 to time t-1.

[0037] Optionally, training the DeepAR model based on the decomposed traffic volume dataset and the covariate dataset includes: training the DeepAR model based on the residual terms and the covariate dataset.

[0038] Optionally, the method further includes:

[0039] The parameters are adjusted based on the fitting results of the trend term, the periodic term, the holiday term, and the residual term, as well as the statistical information of the traffic volume prediction results.

[0040] Optionally, the statistical indicators of the traffic volume prediction results include: mean absolute error, root mean square error, and decision coefficient.

[0041] The beneficial effects of this invention are as follows:

[0042] (1) This invention, through model combination, exhibits better predictive performance under emergency conditions compared to existing traffic volume prediction models. (2) This invention is highly flexible and can adapt to changes in road traffic conditions by adjusting input covariates and parameters, making it more suitable for emergency situations. (3) This invention overcomes the problems of missing and anomalies in data. Due to objective factors, it is difficult to obtain long-term stable and accurate traffic volume data under emergency conditions. However, both the Prophet model and the DeepAR model are robust to data. (4) Traffic volume forecasters can adjust parameters based on the statistical information of different components of this invention without needing to understand the road network change mechanism caused by the emergency, thus reducing the professional knowledge requirements for prediction work. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart of the traffic volume prediction method using the Prophet-DeepAR model according to an embodiment of the present invention.

[0045] Figure 2 This is a schematic diagram of the basic architecture of the DeepAR model according to an embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram of the traffic volume prediction results of the Prophet-DeepAR algorithm in an embodiment of the present invention. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0049] This invention discloses a traffic volume prediction method using the Prophet-DeepAR model.

[0050] Step 1: Read traffic volume and related covariate data, and summarize them into a traffic volume dataset and a covariate dataset. Based on prediction needs, divide the traffic volume dataset into a traffic volume training set and a traffic volume test set.

[0051] Step 2: Construct the Prophet model, decompose the traffic volume time series in the traffic volume training set into trend terms, periodic terms, holiday terms and residuals, and generate prediction results for trend terms, periodic terms and holiday terms based on the timestamps of the traffic volume test set.

[0052] The Prophet model is similar to a regression model Y = A × X1 + B × X2 + C × X3 + R. The trend term, periodic term, holiday term, and residual term are analogous to the components A × X1, B × X2, C × X3, and R in a regression model, but the Prophet model is more complex, requiring individual modeling for each component. The Prophet model needs to be trained to obtain the parameters of each component, such as the offset parameter m and the Fourier coefficients a. n and b n The parameter k in the holiday item i During the training phase, appropriate parameter values ​​are selected by decomposing and fitting the traffic volume corresponding to each timestamp t. During the prediction phase, predicted values ​​are generated at the corresponding timestamp t based on the obtained parameters.

[0053] Step 3: Build a DeepAR model. Train the DeepAR model using the residual data and covariate data obtained from the Prophet model decomposition, and generate the prediction results of the residuals based on the timestamps of the traffic volume test set.

[0054] Step 4: Add the results from the Prophet model and the DeepAR model together to obtain the traffic volume prediction result.

[0055] Step 5: Adjust the parameters based on the fitting results of the trend term, period term, holiday term, residual term, and statistical information of the traffic volume prediction results.

[0056] The Prophet model models traffic volume growth trends, cyclical fluctuations, and the impact of holidays separately, allowing for individual parameter adjustments. For example, in the trend parameter, users can choose between a logistic growth model and a piecewise linear growth model, adjust the number of trend change points, the coverage area of ​​these points, and the flexibility of trend changes. In the cyclical parameter, users can decide whether to include annual, weekly, and daily cyclical patterns, and select the flexibility of cyclical fluctuations. In the holiday parameter, users can select holidays, their impact range, and the flexibility of holiday impacts. The Prophet model can also output line graphs for each parameter, providing users with a more intuitive way to adjust parameters.

[0057] Since the DeepAR model is built using LSTM, parameters such as the number of neurons in the hidden layers, the number of hidden layers, and the stride can be adjusted.

[0058] The main process is as follows: The Prophet model is trained using the traffic volume training set, and the parameters of the Prophet model are adjusted to adapt to the trend changes, periodic fluctuations, and holiday effects of traffic volume; then the remaining residual dataset is input into the DeepAR model, along with the covariate dataset, to train the DeepAR model, and the parameters are adjusted to fit the residual dataset; finally, the results of the Prophet model and the DeepAR model are added together, and the difference between the added result and the actual traffic volume is observed. The above parameter adjustment steps are repeated until the difference between the predicted and actual traffic volume values ​​meets the accuracy requirements.

[0059] Furthermore, the traffic volume dataset from Step 1 must contain two columns: timestamp and traffic volume. The timestamp column is stored in date format, specifically "YYYY-MM-DD HH:MM:SS"; the traffic volume column is stored in numeric format.

[0060] Furthermore, the covariate dataset in Step 1 includes, but is not limited to, road traffic condition-related variables such as rainfall, wind speed, temperature, road capacity, whether an emergency has occurred, and whether traffic closure measures have been implemented. Whether an emergency has occurred and whether traffic closure measures have been implemented are stored as binary variables; road capacity, wind speed, rainfall, and temperature are stored as numbers.

[0061] Furthermore, the Prophet model in step 2 is used to effectively process the overall trend, periodic fluctuations, and holiday impacts of traffic volume. Inputting the traffic volume training set, time series decomposition techniques are used to obtain the trend inflection points, periodic fluctuations, and short-term jump characteristics of traffic volume. The specific model structure is as follows:

[0062] y(t) = g(t) + s(t) + h(t) + r(t)

[0063] Where g(t) represents the trend term obtained from the decomposition of traffic volume time series; s(t) is the periodic term obtained by modeling the periodic changes of traffic volume time series, and the modeling method of this term is the same as that used in the exponential smoothing method; h(t) represents the random impact of holidays on traffic volume time series; and r(t) is the error term.

[0064] Furthermore, the trend term in step 2 can be modeled in two ways depending on whether the road capacity has reached saturation. When the road capacity is nearing or has already reached saturation, a logistic growth model is used to fit the trend term:

[0065]

[0066] Where C(t) represents the time-varying road capacity; k represents the initial traffic volume growth rate; and m is the offset parameter. This represents the change in the rate of traffic volume growth, where t corresponds to the timestamps of the model training and prediction periods, and exp() is an exponential function with the natural constant e as its base. This represents the change in offset. a j (t) represents the j-th rate change point t. j Does the growth rate change at point J, where j = 1, 2, ..., and can take values ​​of 0 or 1? δ j (t) at the j-th rate change point t j The change in growth rate at points j = 1, 2, ..., J, δ j The values ​​of (t) conform to the Laplace transform, δ j (t)~laplace(0,τ); If the growth rate changes, the offset will also change accordingly. Let J represent the J points of rate change. It is not difficult to calculate and derive the following:

[0067]

[0068] Where, ∑ l<j γ l Represents the j-th rate change point t j Previously, the sum of the changes in offset, γ l Represents the l-th rate change point t l The change in offset at δ l Represents the j-th rate change point t j The change in the growth rate, ∑ l≤j It is the summation symbol, representing the sum of terms from l to j;

[0069] When the road capacity is not saturated, a piecewise linear growth model is used to fit the trend term:

[0070]

[0071] Where k is the initial traffic volume growth rate, and m is the offset parameter. This represents the change in the rate of increase of traffic volume. This represents the change in the offset parameter;

[0072] Furthermore, for the periodic term in step 2, since traffic volume is affected by people's travel patterns, such as daytime traffic volume being significantly higher than nighttime traffic volume, traffic volume will exhibit obvious daily periodicity. Therefore, Fourier series is used to model the periodic term.

[0073]

[0074] Where P represents the number of cycles; a n and b n Let β = [a1, b1, ..., a] represent the vector of Fourier coefficients. N b N ] T There are 2N components in total. As N increases, it can better fit the more rapidly changing seasonality. N is the number of sine and cosine components in the Fourier series, π is pi, n is a positive integer that can take values ​​from 1 to N, t corresponds to the timestamps of the model training and prediction periods, and a... n Here, b represents the Fourier coefficients, indicating the amplitude of the cosine component in the Fourier series. n For Fourier coefficients, representing the amplitude of the sinusoidal component in the Fourier series;

[0075] Furthermore, in step 2, regarding the holiday term, since traffic volume on most road segments is affected by holidays, resulting in random step fluctuations, it is assumed that the traffic volume time series to be analyzed has a total of L holidays in the past and future prediction periods. A parameter κ is assigned to each holiday. i The holiday term was fitted using a weighted method.

[0076]

[0077] Where κ represents the parameter vector, D i k represents the period of influence of the i-th holiday. i Let κ be the i-th component in the parameter vector, representing the influence of the i-th holiday, and t be the timestamp of the model training period and the prediction period. F(t) = [1 (t∈D1), ..., 1 (t∈D1)]. L )).

[0078] Furthermore, in step 3, the DeepAR model is used to capture unconventional changes in traffic volume affected by sudden events. The DeepAR model adopts the basic architecture of a Long Short-Term Memory Neural Network (LSTM), and its conditional probability distribution is represented by the product of the following likelihood functions.

[0079]

[0080] t0 is the boundary between the past training period and the future prediction period; [1:t0-1] is the set of timestamps used for past training, and [t0:T] is the set of timestamps used for future prediction. This is a predicted value for traffic volume; It is the actual historical traffic volume; x 1:T These are covariates whose training and prediction periods are both known; z t This is the traffic volume at time t. tIt is the output of the Long Short-Term Memory Neural Network at time t, h t =h(h t-1 , z t-1 x t θ(·) is the model parameter, θ(·) is the transfer function of the long short-term memory neural network, and P(·|·) is the probability likelihood function specified by the predictor, such as Gaussian likelihood and negative binomial likelihood. The product sign indicates the product of consecutive terms from t0 to T, z 1:t-1 Let t be the traffic volume from time 1 to time t-1.

[0081] Furthermore, in step 5, the statistical indicators for the traffic volume prediction results include: mean absolute error, root mean square error, and decision coefficient. The mean absolute error and root mean square error are used to evaluate the prediction accuracy, while the decision coefficient is used to measure the fit.

[0082]

[0083]

[0084]

[0085] Among them, y n and These represent the actual value and the predicted value, respectively, and N is the number of samples.

[0086] Furthermore, the traffic volume prediction of the Prophet-DeepAR algorithm of this invention has the following characteristics:

[0087] (1) Using the Prophet model as the main framework, the traffic volume time series is decomposed into trend, seasonal, holiday, and residual terms through time series decomposition technology. The trend inflection points, periodic fluctuations, and short-term jumps caused by holidays are fitted separately, achieving good prediction results. In addition, the Prophet model has low requirements for input data. It does not require regular continuous data, nor does it require smoothing before input.

[0088] (2) The DeepAR model is applied to refit and predict the residuals obtained from the Prophet model decomposition. After a sudden event occurs, the effects of growth trends, cyclical factors, and holidays are weakened, and traffic volume changes are greatly affected by the sudden event, and these effects are hidden in the residuals. The DeepAR model incorporates useful assumptions into the model by autonomously learning and training multiple covariate time series related to traffic volume (such as road traffic conditions), making the model more adaptable to sudden event conditions, and can further explore the uncertainty information hidden in the residuals. Moreover, even if there is little or no traffic volume data under past sudden events, the DeepAR model can still achieve prediction using the cold start function.

[0089] (3) The traffic volume prediction using the Prophet-DeepAR algorithm of this invention efficiently combines existing prediction techniques. The Prophet model is highly adaptable to handling trend points and periodic fluctuations, and also performs well in handling short-term jumps in time series (such as holidays). However, the Prophet model does not validate the fitting of the residual term. When a sudden event with a long and strong impact period occurs for the first time, the model may underfit and fail to achieve the expected prediction accuracy. The DeepAR model can solve the shortcomings of the Prophet model and accurately predict unconventional changes in traffic volume during sudden events. However, the DeepAR model lacks an attention mechanism, so it may suffer from memory loss problems for longer time series and cannot capture long-term or seasonal information, which is precisely the capability of the Prophet model. By effectively integrating the Prophet and DeepAR models, their respective advantages are fully utilized, and their shortcomings are mutually compensated, ultimately achieving accurate prediction of traffic volume during sudden events.

[0090] In this invention, taking the Luxembourg N12 national highway (Hamiville to Feitsch section) as an example, hourly traffic volume data from 2018 to 2020 was collected and compiled. Due to the outbreak of COVID-19 and the subsequent implementation of traffic lockdown policies, traffic volume on Luxembourg's highways experienced a significant decline for two months. Therefore, the period from the week before the COVID-19 traffic lockdown to the week after its end was used as the prediction target, i.e., March 14, 2020 to June 13, 2020, for modeling and prediction experiments.

[0091] This invention provides a traffic volume prediction method based on the Prophet-DeepAR algorithm, the specific process of which is as follows: Figure 1 As shown, the specific implementation process includes the following:

[0092] 101. Data Acquisition. The traffic volume data used in this embodiment comes from the publicly available highway network traffic count dataset on the Luxembourg data platform. This dataset includes variables such as detection point number, highway name, timestamp, direction of travel, vehicle type, hourly traffic count, daily traffic count, monitoring point location and coordinates, etc. The covariate data used in this embodiment comes from the ERA5 European Weather Forecasting Centre and relevant announcements from the Luxembourg government, including variables such as rainfall, temperature, wind speed, road capacity, whether there are any emergencies, and whether traffic closure measures are implemented, etc.

[0093] 102. Construct a traffic volume dataset. Using database criteria, extract hourly traffic volume and timestamp data for standard vehicle types from the original highway network traffic count dataset for the Luxembourg N12 national highway (Hamiville to Feitsch section) from 2018 to 2021 to construct a traffic volume dataset. This dataset will contain two columns: timestamp and traffic volume. Modify the timestamp data format to "YYYY-MM-DDHH:MM:SS".

[0094] 103. Construct a covariate dataset. Combine covariates from different sources into a single dataset, using the variable category as the join index, and define a timestamp for the covariate dataset that corresponds to the timestamp for the traffic volume dataset.

[0095] 104. Split the traffic volume dataset. Traffic volume data from January 1, 2018 to March 13, 2020 is used as the training data to form the traffic volume training set; traffic volume data from March 14, 2020 to June 13, 2020 is used as the test data to form the traffic volume test set. A total of 20,398 samples are used, including 18,263 training samples and 2,135 test samples.

[0096] 201. This embodiment uses the fbprophet library to call the DeepAR model, inputs the traffic volume training set, and sets the basic structure of the Prophet model. Among them, the trend term is selected as the Logistic model; the periodic term is selected as the multiplicative model, including annual periodicity, weekly periodicity, and daily periodicity components; the holiday term is implemented by setting the Luxembourg holiday set (Table 1), which is a table of holiday information for the Luxembourg region.

[0097] Table 1

[0098]

[0099] 202. After the basic framework of the Prophet model is set, the optimal hyperparameters are selected by cross-validation using the mean absolute error (MAE) as the criterion. In this invention, the range of the trend term flexibility parameter Changepoint_prior_scale is set to (0,1]; the range of the seasonal term flexibility parameter seasonality_prior_scale and the holiday term flexibility parameter holidays_prior_scale is set to (0,50).

[0100] 203. Model using the optimal parameter combination. Decompose the traffic volume training data into trend terms, seasonal terms, holiday terms, and residuals, and obtain the prediction results for each component.

[0101] 301. Extract the residual terms obtained from the Prophet model decomposition to form a residual training set, whose timestamps correspond to the traffic volume training set terms.

[0102] 302. This embodiment uses the GluonTS and PyTorch libraries to build a DeepAR model, inputting the residual training set and covariate dataset, and establishing the basic architecture of the DeepAR model with a 2-layer LSTM as the base, as follows: Figure 2 As shown.

[0103] 303. Set the number of neurons in the hidden layer to 32, context_length to 24, time_freq to per hour, prediction_length to 1, and epochs to 50 to obtain the prediction results of the residual terms.

[0104] 401. Add the results from the Prophet model and the DeepAR model together to obtain the traffic volume prediction result.

[0105] 501. Calculate the statistical indicators of the prediction results in 401, and adjust the parameters based on the calculated statistical indicators and the visualization charts output by the Prophet model. The final prediction results are shown in the appendix. Figure 3 As shown.

[0106] To verify the effectiveness of the prediction model proposed in this invention, the model was compared with four other single models and three combined models. The evaluation indicators for each prediction result are shown in Table 2, which contains the statistical indicators of the evaluation results.

[0107] Table 2

[0108]

[0109] As shown in Table 2, Prophet-DeepAR has the smallest mean absolute error (MAE) and root mean square error (RMSE) among the eight models, indicating that the Prophet-DeepAR model has the best predictive performance. The decision coefficient (R²) of Prophet-DeepAR... 2 The Prophet model also has the largest value among the eight models, indicating that it can more effectively uncover the potential information in traffic volume data, such as... Figure 3 As shown.

[0110] In summary, the method proposed in this invention can effectively predict traffic volume during emergencies.

[0111] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A traffic volume prediction method of a Prophet-DeepAR model, characterized by, The method comprises the following steps: obtaining a traffic volume dataset and a covariate dataset; building a Prophet model, inputting the traffic volume dataset into the Prophet model, decomposing the traffic volume dataset, and outputting a first prediction result; inputting the traffic volume dataset into the Prophet model, decomposing the traffic volume dataset, and outputting a first prediction result comprises: dividing the traffic volume dataset into a traffic volume training set and a traffic volume test set, inputting the traffic volume training set into the Prophet model, decomposing the traffic volume time series in the traffic volume training set into a trend item, a periodic item, a holiday item, and a residual item, generating prediction results of the trend item, the periodic item, and the holiday item according to the time stamp of the traffic volume test set, and outputting the first prediction result; the method for obtaining the trend item comprises: judging whether the road capacity reaches saturation, and dividing the modeling mode, when the road capacity is close to or has reached saturation, using a logistic growth model to fit the trend item: where C(t) is the time-varying road capacity, k is the initial traffic volume growth rate, and m is the shift parameter, is the change in traffic volume growth rate, and t corresponds to the time stamp of the model training and prediction period, exp() is the exponential function with base e, is the change in shift value. when the road capacity is not saturated, using a piecewise linear growth model to fit the trend item: where k is an initial traffic volume growth rate and m is a shift parameter, is a change in traffic volume growth rate, is a change in shift parameter; the method for obtaining the periodic item comprises: wherein P is the number of periods, a n and b n are vectors of Fourier coefficients, N is the number of sine and cosine components in the Fourier series, π is the ratio of a circle's circumference to its diameter, n is a positive integer that can take values from 1 to N, t corresponds to the time stamp of the training and prediction periods, a n is a Fourier coefficient representing the amplitude of the cosine component in the Fourier series, and b n is a Fourier coefficient representing the amplitude of the sine component in the Fourier series. the method for obtaining the holiday item comprises: wherein k denotes a parameter vector, D i denotes the impact period of the i-th holiday, k i is the i-th component of the parameter vector k, representing the impact degree of the i-th holiday, t corresponds to the time stamp of the model training period and the prediction period; building a DeepAR model, training the DeepAR model based on the decomposed traffic volume dataset and the covariate dataset, generating a second prediction result based on the trained DeepAR model; combining the first prediction result and the second prediction result to obtain a traffic volume prediction result. 2.The traffic volume prediction method of the Prophet-DeepAR model according to claim 1, wherein, The traffic volume dataset comprises a time stamp and traffic volume; The covariate dataset comprises rainfall, wind speed, air temperature, road capacity, and whether a sudden event occurs and whether a traffic blockade measure is implemented. 3.The traffic volume prediction method of the Prophet-DeepAR model according to claim 1, wherein, The Prophet model is: y(t) = g(t) + s(t) + h(t) + r(t) wherein g(t) represents a trend item obtained by decomposing a traffic volume time series, s(t) is a periodic item obtained by modeling the periodic change of the traffic volume time series, the modeling method of this item is the same as that used by the exponential smoothing method; h(t) represents the random influence of holidays on the traffic volume time series, and r(t) is an error term. 4.The traffic volume prediction method of the Prophet-DeepAR model according to claim 1, wherein, Building the DeepAR model comprises: using a long short-term memory neural network to build the DeepAR model. 5.The traffic volume prediction method of the Prophet-DeepAR model according to claim 4, characterized in that, The conditional probability distribution of the DeepAR model is: where t0is the dividing point between past training period and future prediction period, 1:t0-1is the training period, t0:Tis the prediction period, is the predicted value of traffic volume, is the true value of historical traffic volume, x 1:T is the covariate known in both training period and prediction period, z t is the value of traffic volume at time t, h t is the output of LSTM neural network at time t, Θ is the model parameter, θ(·) is the transfer function of LSTM neural network, P(·|·) is the probability likelihood function specified by the predictor, is the product sign, indicating the multiplication of cumulative terms from t0to T, z 1:t-1 is the traffic volume value from time 1 to t-1. 6.The traffic volume prediction method of the Prophet-DeepAR model according to claim 1, wherein, training the DeepAR model based on the decomposed traffic volume dataset and the covariate dataset comprises training the DeepAR model based on the residual item and the covariate dataset. 7.The traffic volume prediction method of the Prophet-DeepAR model according to claim 1, wherein, The method further comprises: adjusting parameters according to the fitting results of the trend item, the periodic item, the holiday item, and the residual item, and statistical information of the traffic volume prediction result. 8.The traffic volume prediction method of the Prophet-DeepAR model according to claim 7, characterized in that, The statistical indicators of the traffic volume prediction result comprise: mean absolute error, root mean square error, and decision coefficient.

Citation Information

Patent Citations

  • Short-term air traffic flow prediction method based on combined model

    CN115293417A