Traffic characteristics analysis method based on deep belief network black box visualization technology
By designing visual analysis tools, the contribution of the input layer neurons of the deep belief network is calculated, and the problem of the black box problem of deep belief network and the problem of difficult to determine the importance of influencing factors in traffic accident characteristics analysis is solved, and effective adjustment of network structure and traffic accidents are achieved. Improved prediction accuracy.
Patent Information
- Application Number
- CN202010654064.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-09
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2040-07-09
AI Technical Summary
It is difficult for the prior art to effectively understand and analyze the black box interior of deep belief networks, especially in traffic accident characteristics analysis, and there is a lack of intelligent analysis methods to determine the importance of influencing factors.
A visual analysis tool was designed to assist in determining the importance of factors affecting traffic accidents and adjusting network structure by calculating the potential contribution of each neuron in the input layer of the deep belief network during the entire training process.
It realizes an intuitive understanding of the deep belief network, helps determine the impact of each neuron in the input layer on network performance, and provides effective structural adjustments for the traffic accident prediction model, improving prediction accuracy.
Smart Images

Figure CN112016671B_ABST
Abstract
Description
Technical Field
[0001] The present invention uses visualization to understand the inside of the deep belief network black box, and analyzes the importance of each neuron in the input layer of the deep belief network to assist in determining the importance of factors affecting traffic accidents. This part, as an important link in the use of deep belief networks, is an important branch of the field of artificial intelligence technology and belongs to the field of deep neural networks. At the same time, this method solves the problem of traffic accident feature analysis and also belongs to the field of intelligent transportation. Background Art
[0002] Whether in the research field or the industrial field, deep learning is everywhere. Despite this, deep neural networks are usually still used as black box models, and practical models can only be obtained after manual screening of input features and a large number of attempts at different model structures. Users have little understanding of its internal working mechanism and the influence of each neuron, and it is relatively difficult. The research results of the present invention can effectively and intuitively help users understand the deep belief network and analyze the influence of each neuron in the input layer on the network performance, which has high practical value.
[0003] There are three main methods used to understand the black box problem of neural networks. The first is to adjust the input of artificial intelligence to see which changes affect the output and how. The second is to block the salient features and use visualization methods to understand which hidden layer features are activated. The third is to use cognitive psychology methods to understand deep learning systems. At present, these technologies are mainly focused on understanding convolutional neural networks and their extended networks. Such technologies for deep belief networks have not yet been discovered.
[0004] At present, the analysis method for traffic accident characteristics in the transportation field mainly relies on manual experience selection, and no intelligent analysis method similar to the present invention has been found. Summary of the invention
[0005] The present invention analyzes the input layer of a deep neural network and designs a visual analysis tool to calculate the potential contribution of each neuron in the input layer during the entire training process, providing an analysis method combined with application for the design of deep neural network structures. During the unsupervised training and fine-tuning stage of weights, the changes before and after weight training are made into a graph, and the contribution of each neuron to network performance is calculated to assist the neural network in deciding whether the neuron should be retained.
[0006] (1) Determine the model structure. A traffic accident prediction model is established using a deep belief network. The model input is six neurons, corresponding to six major factors affecting traffic accident prediction: traffic exposure (calculated by integrating the number of cars in the traffic with the length of the traffic flow), annual average daily commercial traffic (AADCT), left shoulder width, median width, right shoulder width, curve deflection and other factors related to traffic accidents. The model output is the amount of traffic accident data on the highway in a short period of time. Two hidden layers are used, and the number of neurons in each hidden layer ranges from 10 to 100. One output layer neuron is used to represent the predicted value of the number of traffic accidents.
[0007] (2) Initialize network weights. Set the connection weights and bias values between neural network layers and set them all to 0.
[0008] (3) Unsupervised training. Use an unsupervised greedy algorithm to train the network layer by layer, and analyze the changes in the importance of the six input variables during the unsupervised training process. The specific steps are as follows:
[0009] First, at the start time, the signal is passed from the input and output layers to the first hidden layer. Formula (1) is the value of the hidden layer neuron obtained from the known input layer neuron:
[0010]
[0011] Second, the signal is transmitted back from the hidden layer to the input layer; the value of the input layer neuron can be obtained from the hidden layer neuron, see formula (2):
[0012]
[0013] Formula (1) is the value of the hidden layer neuron obtained from the known input layer neuron, and (2) is the value of the input layer neuron obtained from the hidden layer neuron; v i and c i They correspond to the value and bias value of the i-th neuron in the input layer in this step, h j and b j They correspond to the value and bias value of the jth neuron in the hidden layer of the network, w ij is the weight between the input layer neuron i and the hidden layer neuron j, indicating the strength of the connection signal between the two neurons. The above value is initialized to 0 before training.j =1) indicates the hidden layer node h j The probability of taking the value 1, p(v i =1) indicates the visible layer node v i The probability of taking the value 1;
[0014] Third, after formula (1) and (2) are completed, use formula (1) again to pass the signal from the input layer to the hidden layer again. 0 is the input layer feature vector (i.e., the network input) at the start time, h 0 By v 0 According to formula (1), the hidden layer feature vector v 1 It is by h 0 According to formula (2), the input layer feature vector h 1 It is the hidden layer feature vector calculated after running formula (1) for the second time.
[0015] Fourth, use formula (3) to calculate the weight update, where ΔW unsup Represents the change in the weight matrix during training, <h 0 v 0 > is the average value of the dot product of the input feature vector at the start time and its corresponding hidden layer feature vector, <h 1 v 1 > is the average value of the product of the input feature vector and its corresponding hidden layer feature vector after step 3:
[0016] ΔW unsup = <h 0 v 0 >- <h 1 v 1 > (3)
[0017] Fifth, use formula (4) to calculate the feature importance of the input variables. represents the feature importance index of the rth input variable calculated after the unsupervised training is completed, Indicates the total value of all the nodes connected to i at the initial stage of training. It represents the total value of all nodes connected to i at the end of training, and Hid represents the number of neurons in the hidden layer.
[0018]
[0019] (4) Supervised training. Use the error back propagation algorithm to train all network weights layer by layer. The number of training steps is no less than 5000; the learning rate is set to 1;
[0020] (5) Calculate the feature importance of the input variables in the supervised training phase. Use the following formula:
[0021]
[0022] in, represents the feature importance index of the rth input variable calculated after the supervised training is completed, Indicates the total value of all the nodes connected to i at the initial stage of training. It represents the total value of all nodes connected to i at the end of training, and Hid represents the number of neurons in the hidden layer.
[0023] (6) Calculate the global comprehensive importance index of all input variables of the model using the following formula:
[0024]
[0025] Among them, FI r represents the global comprehensive importance index of the input variable r, and the definitions of the other two parameters are the same as before.
[0026] (7) Adjust the network input layer structure according to the calculation results, FI r The neuron with a positive calculation result is considered to have a positive effect on traffic accident prediction, and it is retained. r The calculation result is negative, and it is considered that the influencing factor represented by the rth input neuron has a negative effect on traffic accident prediction, so it is deleted.
[0027] The present invention has the following obvious advantages and beneficial effects:
[0028] The present invention targets the deep belief network, comprehensively considers both unsupervised and supervised weight training processes, calculates the contribution value of each neuron in the input layer, assists the deep belief network in determining its input layer network structure, and can determine key features for the application object. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Weight change process of unsupervised training process
[0030] Figure 2 Fine-tuning process weight change process
[0031] Figure 3 Contribution value of output layer neurons
[0032] Figure 4 Comparison of models obtained by deleting different neurons under different test samples DETAILED DESCRIPTION
[0033] The present invention is further described below in conjunction with the embodiments;
[0034] The present invention obtains a method for calculating the contribution of neurons in the input layer of a deep belief network; this method can effectively assist the deep belief network in effectively determining the number of input features during the application process, thereby determining the input layer network structure, and has high practical value.
[0035] The present invention adopts the following technical solutions and implementation steps:
[0036] (1) Determine the application object; the present invention applies a deep neural network to predict the number of traffic accidents on highways in a short period of time.
[0037] (2) Construct sample data;
[0038] The experimental data comes from the historical data of Highway 401 in Ontario, Canada. Traffic exposure, annual average daily commercial traffic (AADCT), left shoulder width, median width, right shoulder width, and curve deflection are inputs, and the amount of traffic accidents on the highway in a short period of time is output. A total of 3762 sets of experimental data were obtained;
[0039] (3) Design an initialized deep belief network for predicting the number of traffic accidents: Determine the 6-10-10-1 connection mode of the neural network, that is, the input layer neuron is 1, there are 2 hidden layers, 6 influencing factors as the input layer, each hidden layer neuron is 10, the output layer neuron is 1, and the weight of the neural network is initialized to 0; first, perform unsupervised training on the network and apply visualization technology to display the changes in the network weights, such as Figure 1 As shown, after the network stops changing, the contribution FI of each neuron in the input layer is calculated unsup , the potential contribution of the 6 input neurons in the unsupervised stage is [0.428, 0.117, 0.143, 0.084, 0.087, 0.393]. Then the network is fine-tuned and trained with 5000 training steps. The visualization technology is also used to display the changes of neurons, such as Figure 2 As shown, after the network stops changing, the contribution FI of the hidden layer neurons is calculated. sup , the potential contribution of the 6 input neurons in the fine-tuning stage is [0.928, -0.321, 0.688, 0.589, 0.635, 1.015], and the contribution of the 6 input neurons in the unsupervised stage and the fine-tuning stage is as follows Figure 3 shown.
[0040] (4) Adjust the neural network structure. From the calculation results of step (3), it can be seen that the potential impact of the second neuron on the overall performance of the network is negative, that is, the median width has a negative impact on the prediction of traffic accidents in the short term on highways. The second neuron is deleted in the input layer. The influencing factors of traffic accidents in the short term on highways are adjusted to the annual average daily commercial flow (AADCT), left shoulder width, right shoulder width, curve skewness and exposure.
[0041] (5) Verify the validity of the structure. The original 6-10-10-1 model is used as the baseline model. The 1st, 2nd, ... 6th neurons are deleted in sequence to form a new 5-10-10-1 model as a comparison model. The minimum MAE and average MAE of all models are obtained for different test data. Figure 4 As shown in the figure, the new model obtained by deleting the 1st, 3rd, 4th, 5th, and 6th neurons has a higher test MAE than the baseline model, and the new model obtained by deleting the 2nd neuron has a lower test MAE than the baseline model, which verifies the effectiveness of the method.
[0042] (6) Model performance verification. The models currently used to predict the number of traffic accidents mainly include the negative binomial (NB) model, kernel regression (KR) model and improved deep belief neural network model (R-DBN). The model that applies this technology is marked as R-DBN with ViFI. The accuracy of predicting the number of highway traffic accidents is described by the mean absolute error MAE. The comparison results are shown in Table 1. As can be seen from the table, the model that applies this technology has achieved the best results in the actual prediction of the number of traffic accidents.
[0043] Table 1 Model settings and performance comparison
[0044]
Claims
1. Traffic safety analysis method based on deep belief network black box visualization, characterized by: Here are the steps: (1) Determine the model structure; use a deep belief network to establish a traffic accident prediction model. The model input is six neurons, corresponding to the six main factors affecting traffic accident prediction: traffic flow exposure, which is calculated by integrating the number of cars in the traffic and the length of the traffic flow; annual average daily truck flow, left shoulder width, middle strip width, right shoulder width, and curve angle. The model output is the amount of traffic accident data on the highway in a short period of time; use two hidden layers, and the number of neurons in each hidden layer ranges from 10 to 100; use one output layer neuron, which represents the predicted value of the number of traffic accidents; (2) Initialize network weights: Set the connection weights and bias values between neural network layers and set them all to 0; (3) Unsupervised training: Use an unsupervised greedy algorithm to train the network layer by layer, and analyze the changes in the importance of the six input variables during the unsupervised training process; The specific steps are as follows: First, at the start time, the signal is passed from the input layer to the first hidden layer. Formula (1) is the value of the hidden layer neuron obtained from the known input layer neuron: Second, the signal is transmitted back from the hidden layer to the input layer; the value of the input layer neuron is obtained from the hidden layer neuron, see formula (2): Formula (1) is the value of the hidden layer neuron obtained from the known input layer neuron, and (2) is the value of the input layer neuron obtained from the hidden layer neuron; v i and c i They correspond to the value and bias value of the i-th neuron in the input layer in this step, h j and b j They correspond to the value and bias value of the jth neuron in the hidden layer of the network, w ij is the weight between the input layer neuron i and the hidden layer neuron j, indicating the strength of the connection signal between the two neurons. The above value is initialized to 0 before training. j =1) indicates the hidden layer node h j The probability of taking the value 1, p(v i =1) indicates the visible layer node v i The probability of taking the value 1; Third, after formula (1) and (2) are run, use formula (1) again to pass the signal from the input layer to the hidden layer again; use v 0 is the input layer feature vector representing the starting time, h 0 By v 0 According to formula (1), the hidden layer feature vector v 1 It is by h 0 According to formula (2), the input layer feature vector h 1 is the hidden layer feature vector calculated after running formula (1) for the second time; Fourth, use formula (3) to calculate the weight update, where ΔW unsup Represents the change in the weight matrix during training, <h 0 v 0 > is the average value of the dot product of the input feature vector at the start time and its corresponding hidden layer feature vector, <h 1 v 1 > is the average value of the product of the input feature vector and its corresponding hidden layer feature vector after step 3: ΔW unsup =<h 0 v 0 >-<h 1 v 1 > (3) Fifth, the feature importance of the input variables is calculated using formula (4); where represents the feature importance index of the rth input variable calculated after the unsupervised training is completed, Indicates the total value of all the nodes connected to i at the initial stage of training. It represents the total value of all nodes connected to i at the end of training, and Hid represents the number of neurons in the hidden layer; (4) Supervised training: use the error back propagation algorithm to train all network weights layer by layer; the number of training steps is not less than 5000; the learning rate is set to 1; (5) Calculate the feature importance of the input variables in the supervised training phase; use the following formula: in, represents the feature importance index of the rth input variable calculated after the supervised training is completed, Indicates the total value of all the nodes connected to i at the initial stage of training. It represents the total value of all nodes connected to i at the end of training, and Hid represents the number of neurons in the hidden layer; (6) Calculate the global comprehensive importance index of all input variables of the model using the following formula: Among them, FI r It represents the global comprehensive importance index of the input variable r. The definitions of the other two parameters are the same as before; (7) Adjust the network input layer structure according to the calculation results, FI r The neuron with a positive calculation result is considered to have a positive effect on traffic accident prediction, and it is retained; FI r The calculation result is negative, and it is considered that the influencing factor represented by the rth input neuron has a negative effect on traffic accident prediction, so it is deleted.