# Multi-Factor Highway Freight Volume Prediction Based on Backpropagation Neural Network
## 4 Case Analysis of Highway Freight Volume Forecasting Based on Neural Network
### MATLAB Running Process  
Based on the analysis of historical data and the influencing factors of the highway freight volume, the BP neural network is used to predict the highway freight volume in China. The neural network view is shown in Figure 6 below, which mainly includes the hidden layer, the input layer, and the output layer. The specific operation process is shown in Figure 7 below. Figure 6: Neural network view. 1. [label=(0)]
2. Emptying the environment variables. Delete the defined variables and start building our code again. 3. Import data. The data of five indicators such as road diesel consumption, road mileage, road operating truck ownership, gross domestic product, and road freight volume from 1997 to 2018 were selected as the imported data, a total of 22 sets of data, and the specific data were derived from the National Statistical Yearbook. 4. Divide the training set and test set. Partitioning the training set and test set is an important task in machine learning and data analysis, which is used to evaluate the performance and generalization ability of the model. Here, we select the first 17 sets of data, that is, the data from 1997 to 2013 as the divided training set; select the last 5 sets of data, that is, the data from 2014 to 2018 as the divided test set; and select the data from the last 3 years, 2019-2021, as the verification set. The training set is mainly used to construct the model. It refers to the data set used to train the model and algorithm. The classifier is established by training and fitting some parameters. By learning and summarizing the data patterns, trends, and rules in the training set, the model predicts, classifies, or infers unknown data. The test set is used to evaluate the final model. It is mainly used to evaluate the generalization ability of the final selected model after the entire training process is completed. The purpose is to provide an unbiased estimate of the model performance. Validation set: used for model selection, that is, to perform the final optimization and determination of the model and to assist in the construction of our model. The test set plays a vital role in the construction of machine learning models. The test set is a data set independent of the training set and the validation set, which is used to evaluate the performance of the trained model on unknown data. 1. [label=(0)]
2. Data normalization. The data are scaled to a certain range according to a certain proportion to improve the accuracy and efficiency of subsequent data processing or analysis, accelerate the speed of gradient descent to find the optimal solution, and improve the training efficiency of the model. 3. Data normalization. The data are scaled to a certain range according to a certain proportion to improve the accuracy and efficiency of subsequent data processing or analysis, accelerate the speed of gradient descent to find the optimal solution, and improve the training efficiency of the model. Figure 7: Operation flow chart. * Create a network. In MATLAB, a new feedforward neural network is created, where P _ train is the training input data, t _ train is the training target data, and 5 represents the number of neurons in the hidden layer of the network. * Set training parameters. The maximum number of iterations of training is set to 1000 times. The training algorithm will try to minimize the error by adjusting the weight and deviation of the network and perform up to 1000 iterations. If the set error threshold is reached within this number of iterations or other stop conditions are met, the training may end early. The training error threshold is set to \(10^{-6}\). The training algorithm will try to make the output error of the network less than or equal to this threshold. When the threshold is reached or is lower than this threshold, the training will stop, even if the maximum number of iterations has not been reached. The learning rate is set to 0.01, which determines the magnitude of the network weight and bias update in each iteration.