Driving behavior and traffic risk early warning method and device, computer equipment and storage medium
Traffic flow prediction and driving behavior analysis are carried out through wavelet filter analysis and multi-hidden layer BP neural network model, which solves the problem of insufficient accuracy of traffic volume collection and prediction systems in the existing technology and achieves higher stability and reliability. sex, providing effective risk warning.
Patent Information
- Application Number
- CN202410766675.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-24
AI Technical Summary
Existing driving behavior analysis technology has shortcomings in improving the accuracy, stability and reliability of traffic volume collection and prediction systems, especially in the face of traffic flow changes and complexity, it is difficult to effectively respond.
Wavelet filtering analysis and multi-hidden layer BP neural network model are used to perform wavelet filtering, normalization and denormalization processing on the initial data, and the highway traffic flow is used as a sample set to train the prediction model to predict traffic flow. and driving behavior analysis, and finally carry out risk warning.
It improves the accuracy, stability and reliability of the traffic volume collection and prediction system, can better cope with traffic flow changes and complexity, provides effective risk warning, and improves driving safety.
Smart Images

Figure CN118692238A
Abstract
Description
Technical Field
[0001] The present invention relates to a driving behavior analysis method, and more specifically to a driving behavior and traffic risk early warning method, device, computer equipment and storage medium. Background Art
[0002] Driving behavior and traffic risk warning is a technology based on vehicle sensor data and driver behavior analysis, which aims to identify unsafe driver behaviors and potential risks in the traffic environment, and improve driving safety by providing timely warnings and suggestions.
[0003] There are many models available for the analysis of existing driving behaviors, such as historical average model, time series model, Kalman filter model, neural network model, non-parametric regression model, chaos theory model, and wavelet model. The advantages and disadvantages of these models include: the historical average model is simple and fast, but has poor accuracy and is suitable for static models; the time series model is simple to model and has high prediction accuracy, but requires a large amount of uninterrupted historical data; the Kalman filter model has strong adaptability and is suitable for linear and nonlinear data, but has a large amount of calculation; the neural network model has strong real-time performance, but the training process is complex and requires a large amount of original data; the non-parametric regression model can directly obtain information from historical data, but is relatively complex; the chaos theory model is theoretically complex, but has high prediction accuracy and is suitable for short-term prediction; the wavelet model has high prediction accuracy, but has a large amount of calculation.
[0004] Therefore, it is necessary to design a new method to solve the problems existing in the existing technology, to improve the accuracy, stability and reliability of the traffic volume collection and prediction system, and to help better cope with the changes and complexity of traffic flow. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a driving behavior and traffic risk warning method, device, computer equipment and storage medium.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a driving behavior and traffic risk warning method, comprising:
[0007] Obtain original survey data of highway sites to obtain initial data;
[0008] Performing wavelet filtering analysis on the initial data to obtain analysis results;
[0009] Performing normalization processing on the traffic network data of the analysis result to obtain a normalized processing result;
[0010] Inputting the normalized processing result into the prediction model to predict traffic flow and analyze driving behavior to obtain an output result;
[0011] Performing a denormalization process on the output result to obtain a denormalization process result;
[0012] Providing risk warning according to the denormalization processing result;
[0013] The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
[0014] A further technical solution is: performing wavelet filtering analysis on the initial data to obtain analysis results includes:
[0015] Performing data preprocessing on the initial data to obtain a preprocessing result;
[0016] Performing wavelet transform multi-scale decomposition on the preprocessing result to obtain a decomposition result;
[0017] Performing multi-scale filtering on the decomposition result to obtain a filtering result;
[0018] The filtering result is subjected to inverse wavelet transform to reconstruct the signal to obtain the analysis result.
[0019] A further technical solution is: the filtering result is subjected to inverse wavelet transform to reconstruct the signal to obtain the analysis result, including:
[0020] The filtering result is subjected to inverse wavelet transform using wavelet basis functions to reconstruct the signal, so as to obtain the analysis result.
[0021] A further technical solution is: performing normalization processing on the analysis result of the traffic network data to obtain a normalized processing result, including:
[0022] The analysis results are normalized using the minimum-maximum normalization technique to obtain normalized results.
[0023] Its further technical solution is: the structure of the prediction model includes an input layer, several hidden layers and an output layer, and the number of the hidden layers is three; the initial weight setting range during the prediction model training is -1 to 1, and the learning rate setting range during the prediction model training is 0.01 to 1.
[0024] Its further technical solution is: the number of neurons in the hidden layer satisfies m=log2 n , Among them, n is the number of input layer units, l is the number of output layer units, m is the number of hidden layer units, and a is a constant between 1 and 10.
[0025] Its further technical scheme is: the training process of the prediction model includes the learning of a multi-hidden layer BP neural network, and the learning of the multi-hidden layer BP neural network includes a forward calculation process and an error back propagation; in the forward calculation process, the sample set is calculated layer by layer from the input layer through the hidden layer and transmitted to the output layer, and the state of each layer of neurons only affects the state of the next layer of neurons; if the output layer cannot obtain the expected output, it enters the error back propagation process, and the error signal returns along the original connection path, and the weights and thresholds of each layer of the network are adjusted successively until it reaches the input layer, and then the calculation is repeated, and the forward calculation process and error back propagation are repeated in sequence, and the weights and thresholds of each layer are continuously adjusted, so that when the network error reaches the set requirements, the learning process ends and the prediction model is obtained.
[0026] The present invention also provides a driving behavior and traffic risk warning device, comprising:
[0027] A data acquisition unit is used to acquire original survey data of highway sites to obtain initial data;
[0028] A filtering and analysis unit, used for performing wavelet filtering analysis on the initial data to obtain an analysis result;
[0029] A normalization unit, used for performing normalization processing on the traffic network data of the analysis result to obtain a normalized processing result;
[0030] An output unit, used for inputting the normalized processing result into a prediction model to predict traffic flow and analyze driving behavior to obtain an output result;
[0031] A denormalization unit, used for performing denormalization processing of the traffic network data on the output result to obtain a denormalization processing result;
[0032] An early warning unit, used for issuing risk early warning according to the denormalization processing result;
[0033] The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
[0034] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.
[0035] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0036] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention performs wavelet filtering analysis on the acquired data, normalizes the traffic network data, inputs the data into the prediction model to predict traffic flow and analyze driving behavior, and finally performs denormalization processing to determine the final prediction result, and based on this, conducts risk warning to solve the problems existing in the prior art, thereby improving the accuracy, stability and reliability of the traffic volume collection and prediction system, and helping to better cope with traffic flow changes and complexity.
[0037] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0039] Figure 1 A schematic diagram of an application scenario of a driving behavior and traffic risk warning method provided by an embodiment of the present invention;
[0040] Figure 2 A flowchart of a driving behavior and traffic risk warning method provided by an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of a sub-process of a driving behavior and traffic risk warning method provided by an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of the network structure of a multi-hidden layer BP neural network provided in an embodiment of the present invention;
[0043] Figure 5 A schematic diagram of the prediction analysis results of short-term traffic driving behavior at station 1 provided by an embodiment of the present invention;
[0044] Figure 6 A schematic diagram of the prediction analysis results of short-term traffic driving behavior at station 2 provided by an embodiment of the present invention;
[0045] Figure 7 A schematic diagram of the prediction analysis results of long-term traffic driving behavior at station 1 provided by an embodiment of the present invention;
[0046] Figure 8 A schematic diagram of the prediction analysis results of long-term traffic driving behavior at station 2 provided by an embodiment of the present invention;
[0047] Fig. 9A trend chart for predicting and analyzing the uplink traffic data of a certain site provided by an embodiment of the present invention;
[0048] Fig.10 A traffic congestion prediction and analysis diagram for the upstream part of a monitoring site provided in an embodiment of the present invention;
[0049] Fig.11 A schematic block diagram of a driving behavior and traffic risk warning device provided by an embodiment of the present invention;
[0050] Fig.12 A schematic block diagram of a filtering analysis unit of a driving behavior and traffic risk warning device provided by an embodiment of the present invention;
[0051] Fig.13 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0054] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0055] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0056] See also Figure 1 and Figure 2 , Figure 1 Schematic diagram of application scenario of the driving behavior and traffic risk warning method provided in an embodiment of the present invention. Figure 2A schematic flow chart of a driving behavior and traffic risk warning method provided in an embodiment of the present invention. The driving behavior and traffic risk warning method is applied in a server. The server interacts with a terminal to obtain original survey data of a highway site from the terminal, and uses wavelet filtering analysis, normalization processing, and processing based on a prediction model of a multi-hidden layer BP neural network to form a prediction of traffic flow and a result corresponding to the analysis of driving behavior, and then obtains the final result through inverse normalization processing. A risk warning is performed based on the final result to solve the problems existing in the prior art, improve the accuracy, stability and reliability of the traffic volume collection and prediction system, and help to better cope with traffic flow changes and complexity.
[0057] Figure 2 is a flow chart of a driving behavior and traffic risk warning method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S160.
[0058] S110. Obtain original survey data of highway sites to obtain initial data.
[0059] In this embodiment, the initial data refers to the original data obtained from the original survey data of the highway station, which may include various information about traffic conditions, such as traffic flow, speed, vehicle type, time, etc. These data are the basis for subsequent analysis and processing, such as noise removal through wavelet filtering, and then normalization and input into the prediction model for traffic flow prediction and driving behavior analysis. The quality and accuracy of the initial data are crucial to the final prediction and analysis results, and therefore play a key role in the entire process.
[0060] S120, performing wavelet filtering analysis on the initial data to obtain analysis results.
[0061] In this embodiment, the analysis result refers to the result obtained after noise filtering is performed on the initial data.
[0062] Due to natural or inherent factors, the data collected by the traffic information collector on the highway may contain a large amount of Gaussian white noise. Noisy data is fatal to traffic volume prediction, so it is necessary to remove white noise before using it for data prediction to obtain relatively accurate traffic volume data.
[0063] In one embodiment, see Figure 3 , the above-mentioned step S120 may include steps S121 to S124.
[0064] S121, performing data preprocessing on the initial data to obtain a preprocessing result.
[0065] In this embodiment, the preprocessing result refers to the result formed after data preprocessing is performed on the initial data.
[0066] The initial data is subjected to data preprocessing, including data cleaning, denoising, filling missing values, outlier processing and other operations to obtain preprocessing results; data preprocessing can improve data quality and availability, remove useless information and interference, and make subsequent analysis and processing more accurate and reliable.
[0067] S122, performing wavelet transform multi-scale decomposition on the preprocessing result to obtain a decomposition result.
[0068] In this embodiment, the decomposition result refers to wavelet coefficients of different scales formed by decomposing the preprocessing result.
[0069] The preprocessing results are subjected to multi-scale decomposition using wavelet transform, and the signal is decomposed into wavelet coefficients of different scales. Wavelet transform can decompose the signal into components of different scales in the time domain and frequency domain, providing multi-scale signal information, which is conducive to better understanding and analysis of data characteristics.
[0070] S123, performing multi-scale filtering processing on the decomposition result to obtain a filtering processing result.
[0071] In this embodiment, the filtering processing result refers to the result formed by performing multi-scale filtering processing on the wavelet transform decomposition result.
[0072] Multiscale filtering processing includes filtering to remove noise or weak signal components; multiscale filtering can effectively remove noise, smooth signals, highlight the main features of signals, and improve the accuracy and stability of subsequent analysis.
[0073] S124, performing inverse wavelet transform on the filtering result to reconstruct the signal to obtain an analysis result.
[0074] Specifically, the filtering result is subjected to inverse wavelet transform using wavelet basis functions to reconstruct the signal, so as to obtain the analysis result.
[0075] In this embodiment, the filtering result is subjected to an inverse wavelet transform, and the processed wavelet coefficients are reconstructed into the original signal; the inverse wavelet transform can restore the filtered signal to the original signal, retaining the main features of the signal while removing noise and interference, providing an accurate data basis for subsequent analysis and prediction.
[0076] In this embodiment, the model of the one-dimensional traffic flow signal containing noise can be expressed in the form of the following formula: S(t)=f(t)+r*e(t), t=0, 1,…, n-1; wherein f(t) is the real signal, e(t) is the noise, r is the noise intensity, and S(t) is the noisy signal.
[0077] In the real traffic volume analysis, it can be seen that the high-frequency part contained in the data is generally useless noise signal, while the relatively stable low-frequency signal contained in it is useful actual data. Therefore, the traffic volume data containing noisy signals is filtered to obtain the useful information we need, which is used as the data source. The purpose of denoising the original signal S(t) is to filter out the noise part of the signal as much as possible, and then inversely construct the real signal f(t) from S(t), making the traffic volume source data more realistic.
[0078] Simply put, the wavelet function is a function that satisfies the condition A function cluster generated by scaling and translating the function ψ.
[0079] Since the initial data is discrete data, the discrete wavelet filter transform is used to define the function as shown in the following formula: Where: m,n (t) = a -m / 2 ψ(a0 -m t-nb0), a0>1, a=a0 m , m, n∈Z, b0≠0.
[0080] When certain discrete conditions are met, f(t) can be expanded into a wavelet series using discrete wavelet transform as coefficients, as shown in the following formula: f(t) = ∑ m,n C m,n (f)ψ m,n (t).
[0081] Since the highway traffic volume collection equipment itself has certain errors, and the accuracy of traffic volume collection will be further affected by reasons such as weather, the data signal collected by the collection equipment contains white noise interference information compared with the real data information. Therefore, data preprocessing is required before data prediction to eliminate white noise and make the data information more in line with the actual situation, which is also more conducive to data processing and prediction.
[0082] Among many wavelet transform functions, the Symlet-8 wavelet transform function is a linear phase, approximately symmetrical and biorthogonal function with good smoothness and relatively simple calculation. Therefore, this embodiment uses this wavelet basis function to reconstruct the wavelet filter function.
[0083] S130, performing normalization processing on the traffic network data of the analysis result to obtain a normalized processing result.
[0084] In this embodiment, the normalized processing result refers to the result that the traffic network data in the analysis result is subjected to certain mathematical processing so that its numerical range is mapped to a specific interval.
[0085] Normalization is a data processing technique used to convert data into a uniform scale range to eliminate the dimensional differences between different variables. Through normalization, data can be mapped to a specific range, such as [0, 1] or [-1, 1], so that different features or attributes have similar numerical ranges. The purpose is to eliminate the order of magnitude differences between data of each dimension and avoid excessive network prediction errors caused by large order of magnitude differences in input and output data.
[0086] Normalization can eliminate dimensional differences. Different features often have different dimensions. For example, the number of vehicles and vehicle weight are measured in units of vehicles and in tons, and their numerical ranges vary greatly. If normalization is not performed, these dimensional differences may affect the results of certain data analysis and model algorithms.
[0087] Normalization can avoid weight imbalance. In some machine learning algorithms, such as distance-based algorithms (such as K-means clustering, K nearest neighbor algorithm, etc.), the large difference in the numerical range between features may cause some features to have a greater impact on the algorithm. Through normalization, each feature can play the same role in calculating distance or similarity, avoiding the problem of weight imbalance and ensuring that small values in the output data are not swallowed.
[0088] Normalization can improve the convergence speed of the model. Some machine learning algorithms, such as neural networks and support vector machines, are sensitive to the numerical range of the input data. If the numerical range of the input data varies greatly, the model training process may converge slowly. Through normalization, the convergence speed of the model can be accelerated and the training efficiency can be improved.
[0089] Normalization can avoid neuron saturation. When the activation of a neuron is close to 0 or 1, the gradient in these areas is almost 0. In this way, during the back propagation process, the local gradient will be close to 0, which is very unfavorable for network training.
[0090] In short, the purpose of normalization is to limit the preprocessed data to a certain range (such as [0, 1] or [-1, 1]), thereby eliminating the adverse effects caused by singular sample data. Singular sample data refers to sample vectors (i.e., feature vectors) that are particularly large or small relative to other input samples.
[0091] In this embodiment, the analysis result is normalized using the minimum-maximum normalization technique to obtain a normalized result.
[0092] Specifically, Min-Max Scaling: linearly maps data to a specific range (usually [0, 1] or [-1, 1]), the formula is as follows: Among them, x is the original data, x * is the normalized data, min(x) and max(x) are the minimum and maximum values of the original data respectively.
[0093] The linear function converts the linearization method of the original data to the range of [0, 1]. The calculation result is the normalized data, and x is the original data. The above normalization method is more suitable for situations where the values are relatively concentrated. If max and min are unstable, it is easy to make the normalization result unstable, making the subsequent use effect unstable. In actual use, empirical constants can be used to replace max and min.
[0094] In the past, when training neural networks, only the input layer data was normalized, but not the middle layer. Although the input data was normalized, the data distribution of the input data is likely to change greatly after matrix multiplication, and as the number of layers of the network continues to increase, the change in data distribution will become greater and greater. Therefore, the introduction of normalization in the middle layer of the multi-hidden layer BP neural network makes the training effect better. Its advantages are: reducing the number of artificially selected parameters; reducing the requirements for learning rate, and using a large learning rate in the initial state or when using a smaller learning rate, the algorithm can also quickly train and converge; replacing the original data distribution, to a certain extent, alleviates overfitting and prevents a certain sample from being frequently selected in each batch of training; reducing gradient disappearance, accelerating convergence, and improving training accuracy.
[0095] like Figure 4 As shown in the figure, the hidden layer in the conventional BP neural network only includes 1 in the figure, and no normalization processing is performed, that is, 2 in the figure. The purpose of introducing normalization processing in the middle layer of the multi-hidden layer BP neural network is: after the input data is normalized and the data interacts with the initial matrix of the hidden layer, there is a possibility that the intermediate output result is uncontrollable. After the intermediate result interacts with other matrices in the hidden layer, the error will be further enlarged, so that the intermediate transmission error cannot be effectively reduced, thereby slowing down the convergence speed and reducing the learning efficiency, and may eventually lead to ineffective convergence. By introducing normalization processing after the interaction of the intermediate conduction matrix, the unknown boundary of the data after the matrix product is effectively reduced, so that it tends to a controllable convergence matrix, the data calculation speed is faster, the learning efficiency is higher, and the convergence boundary is reached as soon as possible.
[0096] S140, inputting the normalized processing result into a prediction model to predict traffic flow and analyze driving behavior to obtain an output result.
[0097] In this embodiment, the output results include traffic flow prediction results and driving behavior analysis results.
[0098] The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
[0099] The structure of the prediction model includes an input layer, a plurality of hidden layers and an output layer, and the number of the hidden layers is three; the initial weight setting range during the prediction model training is -1 to 1, and the learning rate setting range during the prediction model training is 0.01 to 1.
[0100] The number of neurons in the hidden layer satisfies m=log2 n , Among them, n is the number of input layer units, l is the number of output layer units, m is the number of hidden layer units, and a is a constant between 1 and 10.
[0101] See also Figure 4 , the multi-hidden layer BP neural network (Back-Propagation Neural Network) is a multi-layer feedforward network based on the BP algorithm, which is widely used in pattern classification, prediction and other aspects. The most basic BP network is a three-layer feedforward network: there are three layers: input layer, hidden layer and output layer. Each layer is composed of many simple neurons that operate in parallel. The layers of the network are fully interconnected, and there is no connection between the neurons in the layer. The network structure of the BP neural network is as follows: Figure 4 As shown in the figure, the topology of a general three-layer BP network. There are two types of signals circulating between layers: one is the working signal, which is a signal that propagates forward after the input signal is applied until the actual output is generated at the output end, and is a function of the input and weights; the other is the error signal, which is the difference between the actual output of the network and the expected output, and propagates backward layer by layer starting from the output end.
[0102] The training process of the prediction model includes the learning of a multi-hidden layer BP neural network, and the learning of the multi-hidden layer BP neural network includes a forward calculation process and error back propagation; in the forward calculation process, the sample set is calculated layer by layer from the input layer through the hidden layer and transmitted to the output layer, and the state of each layer of neurons only affects the state of the next layer of neurons; if the output layer cannot obtain the expected output, it enters the error back propagation process, and the error signal returns along the original connection path, and the weights and thresholds of each layer of the network are adjusted successively until it reaches the input layer, and then the calculation is repeated, and the forward calculation process and error back propagation are repeated in turn, and the weights and thresholds of each layer are continuously adjusted, so that when the network error reaches the set requirements, the learning process ends and the prediction model is obtained. It is worth noting that the set requirements here refer to the minimum network error or the requirements that people expect.
[0103] In this embodiment, since the transfer function is derived during the error back propagation process, the transfer function of the BP network must be differentiable. For example, the sigmoid type logarithm, tangent function or linear function are commonly used transfer functions.
[0104] In this embodiment, the training process of the multi-hidden layer BP neural network is the process of adjusting the connection weights between neurons according to the sample set, that is, the multi-hidden layer BP network performs tutor learning and training. All these sample sets should be derived from the actual operation results of the system that the network is about to simulate. The guiding ideology of the multi-hidden layer BP neural network learning process is to correct the network weights and thresholds along the negative gradient direction in which the error function drops fastest.
[0105] The learning of multi-hidden layer BP neural network can be divided into two stages: forward propagation stage and error back propagation stage. The main tasks of the forward propagation stage are: taking a sample or a batch of samples X from the sample set, inputting X into the network, and calculating the corresponding actual output Y. The main tasks of the error back propagation stage are: calculating the error E between the actual output Y and the expected output D, and adjusting the network weights and thresholds in the direction of the fastest gradient descent of the error function.
[0106] Assume that the multi-hidden layer BP network has three layers, M learning samples, the input layer node is xi, the hidden layer node is xj, the output layer node is yk, the expected output is dk, the weight vector of the hidden layer is wj, the weight vector of the output layer is wk, the threshold of the hidden layer is θ, the threshold of the output layer is θ', and f is the activation function. Then the expression of the error function is:
[0107] The error function Er is derived from the output node:
[0108] Then the output layer weight correction is:
[0109] The correction amount of the output layer threshold is:
[0110] Then the corrected output layer weight vector wk is: ω k (N+1)=ω k (N)+αΔ′ k ;
[0111] The corrected output layer threshold θ' is: θ'(N+1)=θ'(N)+αΔθ;
[0112] Similarly, for the hidden layer nodes, the error function is derived and we get:
[0113]
[0114] Then the weight correction of the hidden layer is:
[0115]
[0116] The threshold correction of the hidden layer is:
[0117]
[0118] Then the corrected output layer weight vector wj is:
[0119] ω j (N+1)=ω j (N)+βΔω j ;
[0120] The corrected output layer threshold vector θ is:
[0121] θ(N+1)=θ(N)+βΔθ j ;
[0122] In the above formula, α and β are the learning efficiency of the network, which are generally set between 0 and 1 and can be selected according to the convergence effect and training situation of the network.
[0123] The training of multi-hidden layer BP neural network is generally processed by batch samples. The network calculates the actual output O1 and error measure E1 based on (X1, Y1), and adjusts the weight W and threshold θ of each layer once. On this basis, the actual output O2 and error measure E2 are calculated based on (X2, Y2), and W and θ are adjusted for the second time. In this way, the actual output Os and error measure Es are calculated based on (Xs, Ys) at the end of the cycle, and W and θ are adjusted for the sth time, until the global error E of the network is less than the preset minimum value, that is, the network converges. If the number of learning times is greater than the preset value, the network will not converge.
[0124] When training a multi-hidden layer BP neural network, preparing training samples is the primary task in neural network research. For highway traffic flow prediction, input and output variables can be selected according to different needs. Long-term or short-term predictions can be made based on historical data from a single traffic flow observation site or data from multiple sites. Therefore, it is necessary to sort out and analyze the existing historical data to support various prediction needs.
[0125] Designing the input layer and the output layer is key. The number and type of input neurons depends on the problem to be solved and the data representation method. For example, if you want to predict the traffic flow on the same day in the next year, the traffic flow of this year or previous years is used as the input variable. The output variable directly reflects the functional goal of the network, such as traffic flow data.
[0126] It is also crucial to determine the number of hidden layers. Hidden layers exist to handle nonlinear relationships in data. For simple data sets, one or two hidden layers are usually sufficient. But for complex data sets, such as time series or computer vision data, more hidden layers may be required. The number of hidden layers is related to the complexity of the network and the purpose of use. The deeper the number of layers, the stronger the network's fitting ability in theory, but it is also prone to overfitting and increased training difficulty. The number of hidden layers and the effect / use of neural networks can be summarized as follows: No hidden layers: can only represent linearly separable functions or decisions; Hidden layers = 1: can fit any function that "contains a continuous mapping from one finite space to another finite space"; Hidden layers = 2: with appropriate activation functions, it can represent any decision boundary of arbitrary precision, and can fit any smooth mapping of any precision; Hidden layers > 2: The extra hidden layers can learn complex descriptions (some kind of automatic feature engineering). The deeper the number of layers, the better the ability to fit functions in theory, but in practice, deeper layers may cause overfitting problems, and will also increase the difficulty of training, making it difficult for the model to converge. Therefore, when using the BP neural network, you can refer to the existing models with excellent performance. According to the above hidden layer setting rules, three hidden layers are used for simulation, including input layer and output layer, totaling five layers.
[0127] The number of neurons in the hidden layer also needs to be determined experimentally. Usually, it starts from a small number and gradually increases until it reaches a reasonable number. The selection of initial weights directly affects the learning and training time of the network. Usually, a random number between (-1, 1) is selected as the initial weight, and the input samples are normalized.
[0128] The choice of learning rate plays a key role in cyclic training. Choosing a smaller learning rate can ensure the stability of the system, but may lead to longer training time; while a larger learning rate may lead to system instability. Generally, the learning rate is selected between 0.01 and 1.
[0129] Finally, the choice of expected error also needs to be determined by comparing the training results of different networks. Smaller expected errors usually require increasing the number of nodes in the hidden layer and training time. By comparing networks with different expected errors, we can finally decide to use one of the networks.
[0130] In addition, in the process of predicting traffic flow on highways and national and provincial road networks, the accuracy of the prediction results and whether they can better reflect the traffic flow changes at the current road network nodes require corresponding evaluation indicators. Therefore, we choose the commonly used traffic flow evaluation indicators such as mean absolute error (MAE), mean square error (MSE), mean absolute percentage error (MAPE) and determination coefficient (R-Square) for analysis.
[0131] The range is [0, +∞). When the predicted value is completely consistent with the true value, it is equal to 0, that is, a perfect model; the larger the error, the larger the value.
[0132] The range is [0, +∞). When the predicted value is completely consistent with the true value, it is equal to 0, that is, a perfect model; the larger the error, the larger the value.
[0133] The range is [0, +∞), a MAPE of 0% indicates a perfect model, and a MAPE greater than 100% indicates a poor model. The smaller the MAPE value, the better the accuracy of the prediction model.
[0134] The quality of the model is judged by the value of R-Squared, which ranges from [0 to 1]. If the result is 0, it means that the model fits poorly; if the result is 1, it means that the model has no errors. Generally speaking, the larger the R-Squared, the better the model fits.
[0135] Therefore, by using the above four indicator formulas to calculate the predicted traffic flow data and the actual traffic flow data, the corresponding values of MAE, MSE, MAPE and R2 can be obtained. At the same time, we know that the smaller the values of MAE, MSE and MAPE, the closer the predicted value is to the actual value, and the closer the value of R2 is to 1, the closer the predicted value curve is to the actual observation curve, which means that the prediction effect is better. Therefore, through the values of these four evaluation indicators, it can be explained whether the traffic flow predicted by this prediction method can better reflect the actual traffic flow situation.
[0136] The above multi-hidden layer BP neural network has the following advantages:
[0137] Nonlinear mapping capability: The multi-hidden layer BP neural network essentially realizes a mapping function from input to output, that is, the multi-hidden layer BP neural network has a strong nonlinear mapping capability, which conforms to the complex nonlinear characteristics of traffic flow.
[0138] How to determine the number of hidden layers is a crucial question. First of all, it is important to note that in neural networks, hidden layers are only needed if and only if the data is non-linearly separable. Therefore, for general simple data sets, one or two hidden layers are usually sufficient. However, for complex data sets involving time series or computer vision, additional layers are required. Single-layer neural networks can only be used to represent linearly separable functions, that is, very simple problems, such as classification problems where the two classes can be neatly separated by a straight line.
[0139] In summary, multiple hidden layers can be used to fit nonlinear functions. The number of hidden layers and the effect / use of neural networks can be summarized as follows: No hidden layers: can only represent linearly separable functions or decisions; Hidden layers = 1: can fit any function that "contains a continuous mapping from one finite space to another finite space"; Hidden layers = 2: with appropriate activation functions, can represent any decision boundary of any precision, and can fit any smooth mapping of any precision; Hidden layers > 2: extra hidden layers can learn complex descriptions (some kind of automatic feature engineering).
[0140] The deeper the number of layers, the better the function fitting ability will be in theory. However, in practice, deeper layers may lead to overfitting problems and increase the difficulty of training, making it difficult for the model to converge. Therefore, when using the BP neural network, you can refer to the existing excellent models. According to the above hidden layer setting rules, three hidden layers are used for simulation, including the input layer and the output layer, totaling five layers.
[0141] Self-learning and adaptive capabilities: During training, the multi-hidden layer BP neural network can automatically extract the reasonable rules between output and output data through learning, and adaptively memorize the learning content in the network weights. That is, the multi-hidden layer BP neural network has a high degree of self-learning and adaptive capabilities, which is conducive to improving the accuracy of traffic flow simulation.
[0142] Generalization ability: that is, the multi-hidden layer BP neural network has the ability to apply learning results to new knowledge.
[0143] Fault tolerance: The multi-hidden layer BP neural network will not have a significant impact on the global training results after its local or partial neurons are damaged. That is to say, the system can still work normally even when it is locally damaged.
[0144] S150, performing a denormalization process on the output result of the traffic network data to obtain a denormalization process result.
[0145] In this embodiment, denormalization is the process of restoring the normalized data back to the original data. In a neural network, the input and output data are usually normalized to improve the training speed and stability of the model. Once the model training is completed and used for actual prediction, the output results need to be restored to the original data, which requires denormalization.
[0146] The method of implementing denormalization is usually to perform the inverse operation based on the method and parameters used in the normalization process. For example, if the data is scaled to the range of [0, 1] or [-1, 1] during normalization, then the process needs to be reversed during denormalization.
[0147] Taking traffic network data as an example, suppose that when training the neural network, the traffic flow data is normalized to the range of [0,1]. Then during the denormalization process, the normalized output results need to be rescaled to the original traffic flow range.
[0148] Denormalization can make the output results have intuitive physical meanings, which are easier to understand and explain. In practical applications, the range of the original data may be unknown during model training, so the output results need to be denormalized to the original data for subsequent decision-making and analysis. By denormalizing the output results, you can compare them with the actual observed data to evaluate the accuracy and performance of the model.
[0149] In summary, denormalization is an important step in converting model output results into raw data that can be understood and used in practical applications.
[0150] S160, issuing a risk warning according to the denormalization processing result;
[0151] When the reverse normalization results show road congestion or driving violations, risk warnings are issued through warning methods such as sending reminder messages.
[0152] For example: Based on the data of stations 1, 2, and 3 on a certain highway, the overall trend characteristics of highway driving behavior in this interval are analyzed. First, the relevant intermodulation station data is subjected to wavelet transform filtering analysis, and the noise of the intermodulation equipment statistical data is reduced by filtering to obtain relatively real traffic flow data that is less affected by the environment. Then, the filtered data is normalized as the input data for improved BP neural network analysis, and the subsequent driving behavior of relevant highway drivers going up and down and the driving rules on a certain highway are predicted, and travel suggestions are provided for drivers, providing management suggestions for highway managers.
[0153] The data from August 7 to August 13, 2023 at the relevant monitoring points of a certain highway station are used as source data for data analysis, and the data of the above intermodulation monitoring points are processed by wavelet transform filtering to reduce the possibility of the data being affected by other uncertain factors (equipment factors, environmental factors, vehicle factors, etc.).
[0154] Since the highway traffic volume collection equipment itself has certain errors, and the accuracy of traffic volume collection will be further affected by reasons such as weather, the data signal collected by the collection equipment contains white noise interference information compared with the real data information. Therefore, data preprocessing is required before data prediction to eliminate white noise and make the data information more in line with the actual situation, which is also more conducive to data processing and prediction.
[0155] Among the many wavelet transform functions, the Symlet-8 wavelet transform function is a function with linear phase, approximate symmetry and biorthogonality, and has good smoothness and is relatively simple to calculate. Therefore, this wavelet basis function is used to reconstruct the wavelet filter function. From the specific data processing and the noise filtered out, it can be clearly seen that there are many burrs in the initial data, which is very unfavorable for data calculation prediction and even directly leads to prediction failure. After processing the original data, the filtered data is saved for subsequent prediction and analysis of the driving behavior of highway drivers.
[0156] At the same time, when performing wavelet transform filtering analysis on the data of intermodulation sites such as stations 1-3, it can be clearly seen that the overall driving behavior trend of the randomly selected uplink data of each station from August 7 to 13, 2023 (Monday to Sunday, including both weekdays and weekends) is consistent, and there are two peaks in driving travel behavior, which are specifically reflected in the two time periods of 9:10-11:20 and 13:20-15:40. However, compared with normal working days, the second peak on Saturdays and Sundays ends later. Normal working days generally end before 20:00, while the second peak on Saturdays and Sundays will continue until after 20:00.
[0157] After filtering and normalization, relatively accurate source data is obtained, and then a multi-hidden layer BP neural network model is established with this data as input signal for training. The first 200 data points of the data from August 7 to 9 of station 1 are selected for training the data on August 10. After the training is completed, a model is established, and the next 88 data points are predicted and analyzed based on this model. At the same time, the first 238 data points of the data from August 7 to 9 of station 2 are selected for training the data on August 10. After the training is completed, a model is established, and the next 50 data points are predicted and analyzed based on this model. By calculating the data from August 10 to 11, the actual traffic volume of the day is analyzed and compared to demonstrate its feasibility.
[0158] like Figure 5 to Figure 6 As shown in the figure, the accuracy analysis of the driving behavior prediction analysis results is mainly expressed and compared by MAE, MSE, MAPE, R2 and other parameters. MAE, mean absolute error, is the average value of the absolute error between the predicted value and the true value. The mean absolute error (MAE) is used to measure the average absolute error between the predicted value and the true value. It is a non-negative value. The smaller the MAE, the better the model. MSE, mean squared error, is the average value of the absolute squared error between the predicted value and the true value. The mean squared error (MSE) also measures the difference between the predicted value and the true value. The smaller the difference, the better the effect. MAPE, mean absolute percentage error, is sensitive to relative error and will not change due to the global scaling of the target variable. It is suitable for problems with large dimensional differences in the target variable. The smaller the MAPE, the better the model. R2, determination coefficient, R2 evaluates the degree of fit of the model to the data. Its value range is 0 to 1. The closer it is to 1, the better the degree of fit of the model. The advantage of R2 is that its results are normalized, making it easier to see the gap between models. The larger the R2, the better. When our predicted model is completely accurate, R2 is equal to the maximum value of 1. When R2 < 0, it means that the model is not as good as the benchmark model, and it is likely that there is no linear relationship between the data. The corresponding parameters are shown in Table 1 below.
[0159] Table 1. Accuracy evaluation indicators
[0160] name MAE MSE MAPE R2 Site 1 6.84 20.16 6.16% 0.98 Site 2 11.22 24.64 7.65% 0.93
[0161] Similarly, relatively accurate source data is obtained after filtering, and then the BP neural network model is established with this data as input signal for training. Among them, all 288 data points of site 1 from August 7 to 9 are selected to train the data of August 10. After the training is completed, a model is established, and a prediction analysis is carried out on August 11 based on this model. All 288 data points of site 2 from August 7 to 9 are selected to train the data of August 10. After the training is completed, a model is established, and a prediction analysis is carried out on August 11 based on this model. By calculating the data of August 11, the actual traffic volume of that day is analyzed and compared to demonstrate its feasibility.
[0162] like Figure 7 and Figure 8 As shown in the figure, in the process of traffic flow prediction, the accuracy of the prediction and whether it can better reflect the current traffic flow changes require certain evaluation indicators. Here we also choose the commonly used evaluation indicators MAE, MSE, MAPE, R2, etc., as shown in Table 2 below.
[0163] Table 2 Accuracy evaluation indicators
[0164] name MAE MSE MAPE R2 Site 1 14.65 6.54 7.03% 0.95 Site 2 28.24 21.54 4.96% 0.93
[0165] It can be seen that by filtering and predicting the driving flow data of Station 1 and Station 2, it is found that the model generally expresses the current driving flow situation well by judging it through various indicators. Therefore, the model can be used to effectively predict and analyze the uplink and downlink conditions of each station on a certain highway in the future.
[0166] In addition, another example is given: based on the data of each traffic flow observation point on the national and provincial highways in the province and the traffic operation conditions of the provincial road network during holidays, some regional road networks and their traffic flow monitoring data are selected for analysis. The road sections with high road saturation are mainly concentrated on the expressways, while the saturation analysis of ordinary provincial highways is also considered. This embodiment mainly analyzes the basic conditions of monitoring point A on the expressway, monitoring point B on the expressway, monitoring point C on the expressway and monitoring point D on the ordinary provincial highway.
[0167] After filtering, relatively accurate source data is obtained, and then the BP neural network model is established with this as the input signal for training. A total of 288 data points from monitoring points A on the expressway, monitoring points B on the expressway, monitoring points C on the expressway and monitoring points D on the ordinary provincial road from May 22 to 24 are selected to train the data on May 25. After the training is completed, a model is established, and a prediction analysis is carried out on May 26 based on this model. By calculating the data on May 26, the actual traffic volume of that day is analyzed and compared to demonstrate its feasibility. Similarly, the traffic data on May 28 is analyzed. The specific content is analyzed as follows.
[0168] The traffic volume of the next working day or holiday can be predicted according to the proposed working day and holiday traffic volume prediction model, and its traffic volume trend can be predicted in advance. This can help the traffic management department make decisions in advance to reduce the risk of traffic congestion, and also provide a basis for travelers to arrange travel time and travel routes.
[0169] According to the described method, the traffic volume of Highway A on May 26 (Friday) and May 28 (Sunday), the traffic volume of Highway B on May 26 (Friday) and May 28 (Sunday), the traffic volume of Highway C on May 26 (Friday) and May 28 (Sunday), and the traffic volume of Highway D on May 26 (Friday) and May 28 (Sunday) are predicted.
[0170] The corresponding values of MAE, MSE, MAPE and R2 are calculated, as shown in Tables 3 and 4. According to the results in Tables 3 and 4, the R2 values calculated by comparing the traffic flow prediction values of the four nodes with the actual values are all greater than 0.8, with an average of 0.854, and the average values of MAE, MSE and MAPE are 9.37, 28.74 and 15.16% respectively. The analysis shows that the prediction results can better reflect the actual traffic flow values of each node and are credible.
[0171] Table 3. Accuracy evaluation indicators (May 26)
[0172] name MAE MSE MAPE R2 A Monitoring Site 15.17 47.30 13.96% 0.839 Monitoring Station B 9.44 42.05 15.33% 0.813 C Monitoring Site 5.67 32.71 15.49% 0.918 D Monitoring Site 3.59 28.12 18.20% 0.945
[0173] Table 4. Accuracy evaluation indicators (May 28)
[0174] name MAE MSE MAPE R2 A Monitoring Site 12.61 26.51 14.19% 0.815 Monitoring Station B 11.66 17.59 16.36% 0.826 C Monitoring Site 10.85 18.20 14.89% 0.821 D Monitoring Site 5.95 17.43 12.89% 0.857
[0175] According to the technical analysis of the traffic volume prediction on weekdays and holidays of the road network, the general steps of traffic flow prediction of road network nodes can be known, and the relevant traffic monitoring nodes have a certain correlation. According to this step, the road network nodes are cyclically predicted and analyzed one by one. For example, the traffic flow of the relevant monitoring nodes of A, C, and D highways on May 18 (Thursday), May 22 (Monday) and May 27 (Saturday) is used as input to train the B monitoring node on the same day, and the traffic flow of the B monitoring node on May 25 (Thursday), May 29 (Monday) and June 3 (Saturday) is predicted. Then, a comparison chart between the predicted value and the actual value of the road network monitoring node B is obtained, and the same method can be used to predict the traffic data of other nodes.
[0176] According to the above formula, the corresponding calculation can be performed to obtain the corresponding values of MAE, MSE, MAPE and R2, as shown in Table 5. According to the results in Table 5, the R2 values calculated by comparing the traffic flow prediction values of the four nodes with the actual values are all greater than 0.8, with an average of 0.828, and the average values of MAE, MSE and MAPE are 11.81, 22.62 and 11.54% respectively. Through the previous analysis, it can be seen that the prediction results can better reflect the actual traffic flow values of each node and are credible.
[0177] Table 5. Accuracy evaluation indicators (B monitoring site)
[0178] time MAE MSE MAPE R2 May 25 14.81 26.65 10.51% 0.847 May 29 11.58 24.05 13.05% 0.813 June 3 9.05 17.17 11.05% 0.825
[0179] By predicting the traffic flow of relevant working day or holiday road network nodes based on the proposed traffic flow prediction model for the expressway network and national and provincial road nodes, the traffic flow trend of the nodes can be predicted in advance, which will provide inspiration for the traffic management department to alleviate the risk of traffic congestion. It can also analyze the regional economic situation based on the traffic flow growth rate, and provide guidance for the maintenance, expansion and new construction of expressway network roads.
[0180] The traffic flow results of B-related nodes predicted by the prediction method are as follows: Fig. 9 As shown, it can be seen that except for the relatively large fluctuations in traffic flow on different dates, the overall traffic flow trend chart throughout the day is relatively regular and can basically reflect the actual situation.
[0181] In order to better reflect the current road congestion, the congestion degree method is introduced, which is the ratio of equivalent traffic volume to adapted traffic volume. The congestion degree method is to convert various types of vehicles into equivalent traffic volume of passenger cars and then compare them with the lane adapted traffic volume or the full-section adapted traffic volume. In this way, the traffic congestion index can be calculated. The traffic congestion index is a conceptual index value set by some cities based on road traffic conditions to comprehensively reflect the smoothness or congestion of the road network, which is equivalent to digitizing the congestion situation. This embodiment uses the currently recognized and more commonly used congestion index value as an example. The congestion index between 0 and 2 is "smooth", between 2 and 4 is "basically unobstructed", between 4 and 6 is "mild congestion", between 6 and 8 is "moderate congestion", and between 8 and 10 is "severe congestion". Therefore, through the above method, Fig. 9 The traffic flow trend diagram is transformed to correspond to Fig.10 The traffic congestion risk status prediction diagram shown in the figure can clearly show the traffic congestion status of each node on that day, so as to provide early warning.
[0182] According to the results of the prediction and analysis of long-term traffic driving behavior, the busy and idle periods of the highway can be clearly identified. During busy periods, the traffic management department can take measures in advance based on the prediction information, such as strengthening information guidance and adding guidance systems to busier sections to display traffic conditions in real time or in advance, thereby guiding diversion and alleviating traffic congestion. At the same time, travelers can plan routes based on the prediction information, travel during off-peak hours, choose other routes or adjust travel time to avoid peak hours. In addition, implementing dynamic control measures at the entrances and exits of highways is also an effective means, such as appropriately slowing down traffic flow and guiding some vehicles to choose other smooth routes for diversion to alleviate traffic congestion.
[0183] In addition, in terms of regional traffic network risk warning, by establishing a multi-hidden layer BP neural network model for training, it is possible to predict traffic congestion risks and propose corresponding mitigation measures. For example, based on the predicted congestion risk information, travelers can plan corresponding routes, and the transportation department can release forecast information in advance and strengthen recommended routes and information guidance to display traffic conditions in real time or in advance, thereby guiding diversion. At the same time, implementing real-time dynamic control measures is also an effective way to alleviate traffic congestion risks, such as appropriately slowing down import and export traffic and guiding vehicles to choose other roads for diversion.
[0184] These prediction and warning methods not only help departments take timely measures to maintain traffic order, but also provide travelers with more convenient and safe travel options. At the same time, this method also helps to show the economic status of the region, provide guidance for road maintenance, expansion and new construction, and promote the healthy development of the transportation network.
[0185] The above-mentioned driving behavior and traffic risk warning method performs wavelet filtering analysis on the acquired data, normalizes the traffic network data, inputs it into the prediction model to predict traffic flow and analyze driving behavior, and finally performs denormalization to determine the final prediction result, and based on this, conducts risk warning to solve the problems existing in the existing technology, improve the accuracy, stability and reliability of the traffic volume collection and prediction system, and help to better cope with traffic flow changes and complexity.
[0186] Fig.11 is a schematic block diagram of a driving behavior and traffic risk warning device 300 provided in an embodiment of the present invention. Fig.11 As shown, corresponding to the above driving behavior and traffic risk warning method, the present invention also provides a driving behavior and traffic risk warning device 300. The driving behavior and traffic risk warning device 300 includes a unit for executing the above driving behavior and traffic risk warning method, and the device can be configured in a server. Fig.11The driving behavior and traffic risk warning device 300 includes a data acquisition unit 301, a filtering and analysis unit 302, a normalization unit 303, an output unit 304, a denormalization unit 305 and a warning unit 306.
[0187] The data acquisition unit 301 is used to acquire the original survey data of the highway site to obtain the initial data; the filtering analysis unit 302 is used to perform wavelet filtering analysis on the initial data to obtain the analysis result; the normalization unit 303 is used to perform normalization processing of the traffic network data on the analysis result to obtain the normalization processing result; the output unit 304 is used to input the normalization processing result into the prediction model to predict the traffic flow and analyze the driving behavior to obtain the output result; the denormalization unit 305 is used to perform denormalization processing of the traffic network data on the output result to obtain the denormalization processing result; the early warning unit 306 is used to issue a risk early warning according to the denormalization processing result;
[0188] The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
[0189] In one embodiment, if Fig.12 As shown, the filtering analysis unit 302 includes a preprocessing subunit 3021 , a decomposition subunit 3022 , a filtering processing subunit 3023 and a reconstruction subunit 3024 .
[0190] The preprocessing subunit 3021 is used to perform data preprocessing on the initial data to obtain a preprocessing result; the decomposition subunit 3022 is used to perform wavelet transform multi-scale decomposition on the preprocessing result to obtain a decomposition result; the filtering processing subunit 3023 is used to perform multi-scale filtering processing on the decomposition result to obtain a filtering processing result; the reconstruction subunit 3024 is used to perform wavelet inverse transform on the filtering processing result to reconstruct the signal to obtain an analysis result.
[0191] In one embodiment, the reconstruction subunit 3024 is used to perform inverse wavelet transform on the filtering result using wavelet basis functions to reconstruct the signal to obtain the analysis result.
[0192] In one embodiment, the normalization unit 303 is used to perform normalization processing on the analysis result by using a minimum-maximum normalization technique to obtain a normalized processing result.
[0193] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned driving behavior and traffic risk warning device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0194] The driving behavior and traffic risk warning device 300 can be implemented in the form of a computer program. Fig.13 Runs on the computer device shown.
[0195] See also Fig.13 , Fig.13 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0196] See also Fig.13 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0197] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a driving behavior and traffic risk warning method.
[0198] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0199] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a driving behavior and traffic risk warning method.
[0200] The network interface 505 is used to communicate with other devices over the network. Fig.13 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0201] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0202] Obtaining original survey data of highway stations to obtain initial data; performing wavelet filtering analysis on the initial data to obtain analysis results; performing normalization processing of traffic network data on the analysis results to obtain normalization processing results; inputting the normalization processing results into a prediction model to predict traffic flow and analyze driving behavior to obtain output results; performing anti-normalization processing of traffic network data on the output results to obtain anti-normalization processing results; and performing risk warning according to the anti-normalization processing results;
[0203] The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
[0204] The structure of the prediction model includes an input layer, a plurality of hidden layers and an output layer, and the number of the hidden layers is three; the initial weight setting range during the prediction model training is -1 to 1, and the learning rate setting range during the prediction model training is 0.01 to 1.
[0205] The number of neurons in the hidden layer satisfies m=log2 n , Among them, n is the number of input layer units, l is the number of output layer units, m is the number of hidden layer units, and a is a constant between 1 and 10.
[0206] The training process of the prediction model includes the learning of a multi-hidden layer BP neural network, and the learning of the multi-hidden layer BP neural network includes a forward calculation process and an error back propagation; in the forward calculation process, the sample set is calculated layer by layer from the input layer through the hidden layer and transmitted to the output layer, and the state of each layer of neurons only affects the state of the next layer of neurons; if the output layer cannot obtain the expected output, the error back propagation process is entered, and the error signal is returned along the original connection path, and the weights and thresholds of each layer of the network are adjusted successively until it reaches the input layer, and the calculation is repeated, and the forward calculation process and error back propagation are repeated in sequence, and the weights and thresholds of each layer are continuously adjusted, so that when the network error reaches the set requirements, the learning process ends and the prediction model is obtained.
[0207] In one embodiment, when the processor 502 implements the step of performing wavelet filtering analysis on the initial data to obtain the analysis result, the processor 502 specifically implements the following steps:
[0208] The initial data is preprocessed to obtain a preprocessing result; the preprocessing result is subjected to wavelet transform multi-scale decomposition to obtain a decomposition result; the decomposition result is subjected to multi-scale filtering to obtain a filtering result; the filtering result is subjected to wavelet inverse transform to reconstruct a signal to obtain an analysis result.
[0209] In one embodiment, when the processor 502 implements the step of performing inverse wavelet transform on the filtering result to reconstruct the signal to obtain the analysis result, the processor 502 specifically implements the following steps:
[0210] The filtering result is subjected to inverse wavelet transform using wavelet basis functions to reconstruct the signal, so as to obtain the analysis result.
[0211] In one embodiment, when the processor 502 implements the step of normalizing the analysis result of the traffic network data to obtain the normalized processing result, the processor 502 specifically implements the following steps:
[0212] The analysis results are normalized using the minimum-maximum normalization technique to obtain normalized results.
[0213] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0214] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0215] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0216] Obtaining original survey data of highway stations to obtain initial data; performing wavelet filtering analysis on the initial data to obtain analysis results; performing normalization processing of traffic network data on the analysis results to obtain normalization processing results; inputting the normalization processing results into a prediction model to predict traffic flow and analyze driving behavior to obtain output results; performing anti-normalization processing of traffic network data on the output results to obtain anti-normalization processing results; and performing risk warning according to the anti-normalization processing results;
[0217] The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
[0218] The structure of the prediction model includes an input layer, a plurality of hidden layers and an output layer, and the number of the hidden layers is three; the initial weight setting range during the prediction model training is -1 to 1, and the learning rate setting range during the prediction model training is 0.01 to 1.
[0219] The number of neurons in the hidden layer satisfies m=log2 n , Among them, n is the number of input layer units, l is the number of output layer units, m is the number of hidden layer units, and a is a constant between 1 and 10.
[0220] The training process of the prediction model includes the learning of a multi-hidden layer BP neural network, and the learning of the multi-hidden layer BP neural network includes a forward calculation process and an error back propagation; in the forward calculation process, the sample set is calculated layer by layer from the input layer through the hidden layer and transmitted to the output layer, and the state of each layer of neurons only affects the state of the next layer of neurons; if the output layer cannot obtain the expected output, the error back propagation process is entered, and the error signal is returned along the original connection path, and the weights and thresholds of each layer of the network are adjusted successively until it reaches the input layer, and the calculation is repeated, and the forward calculation process and error back propagation are repeated in sequence, and the weights and thresholds of each layer are continuously adjusted, so that when the network error reaches the set requirements, the learning process ends and the prediction model is obtained.
[0221] In one embodiment, when the processor executes the computer program to implement the step of performing wavelet filtering analysis on the initial data to obtain an analysis result, the processor specifically implements the following steps:
[0222] The initial data is preprocessed to obtain a preprocessing result; the preprocessing result is subjected to wavelet transform multi-scale decomposition to obtain a decomposition result; the decomposition result is subjected to multi-scale filtering to obtain a filtering result; the filtering result is subjected to wavelet inverse transform to reconstruct a signal to obtain an analysis result.
[0223] In one embodiment, when the processor executes the computer program to implement the step of performing inverse wavelet transform on the filtering result to reconstruct the signal to obtain the analysis result, the processor specifically implements the following steps:
[0224] The filtering result is subjected to inverse wavelet transform using wavelet basis functions to reconstruct the signal, so as to obtain the analysis result.
[0225] In one embodiment, when the processor executes the computer program to implement the step of normalizing the analysis result of the traffic network data to obtain the normalized processing result, the processor specifically implements the following steps:
[0226] The analysis results are normalized using the minimum-maximum normalization technique to obtain normalized results.
[0227] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0228] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0229] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0230] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0231] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0232] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A driving behavior and traffic risk warning method, characterized in that: include: Obtain original survey data of highway sites to obtain initial data; Performing wavelet filtering analysis on the initial data to obtain analysis results; Performing normalization processing on the traffic network data of the analysis result to obtain a normalized processing result; Inputting the normalized processing result into the prediction model to predict traffic flow and analyze driving behavior to obtain an output result; Performing a denormalization process on the output result to obtain a denormalization process result; Providing risk warning according to the denormalization processing result; The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
2. A driving behavior and traffic risk warning method according to claim 1, characterized in that: The performing wavelet filtering analysis on the initial data to obtain the analysis result includes: Performing data preprocessing on the initial data to obtain a preprocessing result; Performing wavelet transform multi-scale decomposition on the preprocessing result to obtain a decomposition result; Performing multi-scale filtering on the decomposition result to obtain a filtering result; The filtering result is subjected to inverse wavelet transform to reconstruct the signal to obtain the analysis result.
3. A driving behavior and traffic risk warning method according to claim 2, characterized in that: The performing inverse wavelet transform on the filtering result to reconstruct the signal to obtain the analysis result includes: The filtering result is subjected to inverse wavelet transform using wavelet basis functions to reconstruct the signal, so as to obtain the analysis result.
4. A driving behavior and traffic risk warning method according to claim 1, characterized in that: The normalizing of the traffic network data on the analysis result to obtain a normalized result includes: The analysis results are normalized using the minimum-maximum normalization technique to obtain normalized results.
5. A driving behavior and traffic risk warning method according to claim 1, characterized in that: The structure of the prediction model includes an input layer, a plurality of hidden layers and an output layer, and the number of the hidden layers is three; the initial weight setting range during the prediction model training is -1 to 1, and the learning rate setting range during the prediction model training is 0.01 to 1.
6. A driving behavior and traffic risk warning method according to claim 5, characterized in that: The number of neurons in the hidden layer satisfies m=log2 n , Among them, n is the number of input layer units, l is the number of output layer units, m is the number of hidden layer units, and a is a constant between 1 and 10.
7. A driving behavior and traffic risk warning method according to claim 5, characterized in that: The training process of the prediction model includes the learning of a multi-hidden layer BP neural network, and the learning of the multi-hidden layer BP neural network includes a forward calculation process and an error back propagation; in the forward calculation process, the sample set is calculated layer by layer from the input layer through the hidden layer and transmitted to the output layer, and the state of each layer of neurons only affects the state of the next layer of neurons; if the output layer cannot obtain the expected output, the error back propagation process is entered, and the error signal is returned along the original connection path, and the weights and thresholds of each layer of the network are adjusted successively until it reaches the input layer, and the calculation is repeated, and the forward calculation process and error back propagation are repeated in sequence, and the weights and thresholds of each layer are continuously adjusted, so that when the network error reaches the set requirements, the learning process ends and the prediction model is obtained.
8. A driving behavior and traffic risk warning device, characterized in that: include: A data acquisition unit is used to acquire original survey data of highway sites to obtain initial data; A filtering and analysis unit, used for performing wavelet filtering analysis on the initial data to obtain an analysis result; A normalization unit, used for performing normalization processing on the traffic network data of the analysis result to obtain a normalized processing result; An output unit, used for inputting the normalized processing result into a prediction model to predict traffic flow and analyze driving behavior to obtain an output result; A denormalization unit, used for performing denormalization processing of the traffic network data on the output result to obtain a denormalization processing result; An early warning unit, used for issuing risk early warning according to the denormalization processing result; The prediction model is obtained by training a multi-hidden layer BP neural network using the traffic flow of the expressway as a sample set.
9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
