CN117494866A - Traffic accident severity prediction method based on cyclic neural network - Google Patents

Traffic accident severity prediction method based on cyclic neural network Download PDF

Info

Publication number
CN117494866A
CN117494866A CN202311132079.9A CN202311132079A CN117494866A CN 117494866 A CN117494866 A CN 117494866A CN 202311132079 A CN202311132079 A CN 202311132079A CN 117494866 A CN117494866 A CN 117494866A
Authority
CN
China
Prior art keywords
training
clustering
traffic accident
function
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311132079.9A
Other languages
Chinese (zh)
Inventor
徐学才
钱程
肖代全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN202311132079.9A priority Critical patent/CN117494866A/en
Publication of CN117494866A publication Critical patent/CN117494866A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services
    • G06Q50/265Personal security, identity or safety
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Biophysics (AREA)
  • Tourism & Hospitality (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Strategic Management (AREA)
  • Mathematical Physics (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Development Economics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • General Business, Economics & Management (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Marketing (AREA)
  • Evolutionary Biology (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Educational Administration (AREA)
  • Primary Health Care (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)

Abstract

The invention relates to a traffic accident severity prediction method and a traffic accident severity prediction system based on a cyclic neural network, which specifically comprise the following steps: s1, performing discretization on continuous variables in influence factors of traffic accidents to obtain a quantization index table corresponding to each accident factor; s2, clustering accident data based on a density clustering algorithm OPTICS, and compiling based on a Python environment to realize an algorithm to obtain a training sample set of accident severity; s3, selecting parameters such as a loss function, an activation function, an optimizer and the like of the deep learning model based on Keras, and realizing training of the model and visualization of training results; s4, inputting the quantized data corresponding to various influencing factors of the real road traffic accident into the trained cyclic neural network, and outputting a prediction result of the traffic accident severity. The method can effectively predict the severity of the urban road traffic accident and improve the running safety of the urban road.

Description

Traffic accident severity prediction method based on cyclic neural network
Technical Field
The invention belongs to the technical field of traffic accident prediction, and particularly relates to a traffic accident severity prediction method based on a cyclic neural network.
Background
With the acceleration of the urban process and the continuous improvement of the living standard of residents, the quantity of the motor vehicles is rapidly increased, and the lives of people are more convenient. However, the following social problems such as traffic jams and traffic accidents are increasingly highlighted, and especially casualties and property loss caused by traffic accidents are one of the important factors affecting the peace and stable society and the peace and happiness of residents. With the gradual application of the intelligent traffic system and the internet of vehicles, traffic accident prediction not only provides traffic flow change for automatic driving, but also can effectively reduce traffic trip risks, and is an important foundation for future internet of vehicles and automatic driving trips.
The traffic accident prediction mainly comprises the aspects of accident frequency, accident severity, accident risk and the like, wherein the traffic accident severity prediction can guide pedestrians to travel safely and efficiently, and meanwhile, the traffic accident prediction provides allocation management and the direction and experience of optimizing traffic organization for city managers. With the advent of the big data age and the perfection and progress of deep learning technology, the wide application of big data driving and machine learning is further advanced. The invention adopts a data-driven machine learning method, and establishes a deep learning model by means of clustering processing of a data set to predict the severity of traffic accidents in urban areas.
Disclosure of Invention
Aiming at the existing demands, the invention provides the traffic accident severity prediction method based on the cyclic neural network, which can effectively predict the road traffic accident severity and improve the running safety of the highway. The technical scheme of the invention comprises the following steps:
s1, respectively carrying out assignment quantification on discrete variables in factors such as people, vehicles, roads, environments and the like which influence the severity of urban road traffic accidents so as to obtain a quantification index table corresponding to each accident factor;
s2, clustering accident data based on a density clustering algorithm OPTICS, compiling based on a Python environment to realize an algorithm, and forming an urban road traffic accident training sample set x by corresponding a clustering result to each influence factor;
s3, selecting parameters such as a loss function, an activation function, an optimizer and the like of the deep learning model by means of Keras, and realizing training of the model and visualization of training results;
s4, inputting the quantized data corresponding to various influencing factors of the real road traffic accident into the trained cyclic neural network, and outputting a prediction result of the traffic accident severity.
The traffic accident severity prediction system based on the RNN comprises a variable assignment module, a model training module and a prediction module which are connected in sequence;
the variable assignment module is used for respectively carrying out assignment quantification on each discrete variable sub-factor in each accident factor affecting the severity of the road traffic accident, and carrying out discrete interval assignment on each continuous variable sub-factor in each accident factor based on a traffic accident training sample set and an OPTICS clustering algorithm so as to obtain a processed road traffic accident training sample set;
the model training module is used for training the RNN model based on the quantitative index table and the processed road traffic accident training sample set to obtain a circulating neural network model capable of predicting the severity of the road traffic accident;
and the prediction module inputs the quantized data corresponding to various important sub-factors in the real road traffic scene into the trained RNN model, and finally outputs a prediction result of the traffic accident severity.
Effects of the invention
The method can effectively predict the severity of urban traffic accidents and improve the running safety of urban roads. According to the invention, the accident data is clustered by adopting the density clustering algorithm OPTICS, so that the problem of different sample densities can be effectively solved, and a better clustering result can be obtained. The scheme is based on the improvement of an OPTICS algorithm, the problem that the whole data set needs to be retrained each time the eps and the Minpts values are adjusted is avoided, and different results can be obtained by fixing the Minpts values after the eps value and the Minpts value are given and trained once. These advantages make the OPTICS algorithm particularly useful for screening training sample sets for traffic accident severity. Noise points can be removed by adopting an improved OPTICS algorithm, and the accuracy of a training model is improved. The Keras framework is a high-level neural network API, is written by pure Python and is based on Tensorflow, theano and CNTK back ends, and can use GPU to carry out hardware acceleration, and is often many times faster than CPU operation. Therefore, the setting of the RNN layer number and the optimizer and the selection of the Batch size and epoch are carried out under the Keras framework, so that higher precision and smaller loss can be brought to model training and results.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the description of the embodiments or the prior art will be briefly described, in which the drawings are only examples of embodiments of the invention, and other drawings can be obtained according to these drawings on the premise of different parameter settings for a person skilled in the art.
FIG. 1 is a flow chart of a traffic accident severity prediction method based on a recurrent neural network according to the present invention;
FIG. 2 is a schematic structural diagram of OPTICS cluster analysis;
FIG. 3 is a schematic diagram of the structure of a recurrent neural network;
fig. 4 is a training batch graph of a traffic accident severity prediction method based on a recurrent neural network.
Detailed Description
The following specific examples are presented to illustrate the embodiments of the present invention, and those skilled in the art will readily appreciate the advantages and capabilities of the present invention as set forth in the present specification. The invention may be practiced or carried out in other embodiments and details in this description may be varied or modified from various points of view and applications without departing from the invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
Implementation case:
referring to fig. 1, the embodiment provides a traffic accident severity prediction method based on a convolutional neural network, which includes the steps of:
s1, respectively carrying out assignment quantification on each discrete variable in accident factors affecting the severity of urban road traffic accidents to obtain a quantification index table corresponding to each accident factor, wherein the accident factors comprise people, vehicles, roads and environments;
s2, clustering accident data based on a density clustering algorithm OPTICS, compiling based on a Python environment to realize an algorithm, and forming an urban road traffic accident training sample set x by corresponding a clustering result to each influence factor;
s3, selecting parameters such as a loss function, an activation function, an optimizer and the like of the deep learning model by means of Keras, and realizing training of the model and visualization of training results;
s4, inputting quantitative data corresponding to various accident factors of the real road traffic accident into the trained cyclic neural network, and outputting a prediction result of the traffic accident severity.
The method can effectively predict the severity of urban traffic accidents and improve the running safety of urban roads.
Since accident data contains continuous independent variables and discrete independent variables, the accident analysis model needs to discretize the two variables.
Specifically: the accident factor data includes driver factor, vehicle factor, road factor and environment factor, so that traffic accident severity and each influence factor are quantized for convenient observation and counting and in favor of training and prediction of the deep learning model, and the corresponding quantization indexes are shown in the following table, and table 1 is a quantization index table of each accident factor.
TABLE 1 influence factor quantization index Table
The numbers in the table represent classifications of influencing factors for quantification and modeling, not dangerous values, and the OPTICS cluster analysis uses distances between neighboring points and reachable graph distances to separate clusters of different densities from noise points. The OPTICS clustering method treats the search distance value as the maximum distance to compare with the core distance. OPTICS uses the concept of maximum reachable distance, which refers to the distance from a point to its nearest neighbor that has not been accessed by a search. The OPTICS searches for all neighbor distances within a specified search Distance (search Distance) range and compares each Distance to the Core Distance (Core Distance). If any distance is less than the core distance, then the core distance will be assigned to the element as its reachable distance (reachability distance). If all distances are greater than the core distance, the smallest distance is assigned as the reachable distance. When there are no more points within the search distance range, the process will restart at a new point that has not been previously accessed. The reachable distances are recalculated and sorted at each iteration. The shortest distance will be used as the final reachable distance of each point. These reachable distances can then be used to create a reachable graph, which is an ordered graph of reachable distances that can be used to detect clusters, the principle of which is shown in fig. 2.
The OPTICS performs clustering by calculating an accessible distance list, firstly, calculating all core points, then randomly selecting any core point, arranging the accessible distances of nearby points according to the sequence from large to small, and if the nearby points have core points, continuously calculating the accessible distances of the surrounding points of the nearby core points until all the core points are traversed. Therefore, in step S2, the clustering of accident data based on the density clustering algorithm OPTICS specifically includes the following steps:
s21, determining a radius eps and a density Minpts, wherein a core distance calculation formula is as follows:
for any point p, if p 'is an adjacent point and p' meets the minimum adjacent point number requirement of p, the Distance between the two points is taken as a Core Distance; if the condition is not satisfied, the core distance is taken as positive infinity.
S22, the reachable distance calculation formula is as follows:
for the adjacent points p1, p2, …, pn of the core point p, if the distance from the point p is greater than the core distance of p, the reachable distance (reachability distance) is the distance from the point p, and if the distance from the point p is less than or equal to the core distance of p, the reachable distance is equal to the core distance of the point p.
S23, constructing OPTICS class by using sklearn library function. Library functions that need to be called are as follows:
Import numpy as np
Import matplotlib.pyplot as plt
Import copy
From sklear.datasets import make_moons
the numpy function, matplotlib. Pyplot function, copy function, and make_moons function are called by the import function to execute the OPTICS class.
S24, using Python3.8 to realize an OPTICS clustering algorithm, defining a recursive structure function of a core distance and an reachable distance, wherein the method comprises the following specific processes:
s25, adjusting a clustering result in the OPTICS class through repeatedly debugging a radius value eps and a density value Minpts until the result is ideal, adopting matplotlib to perform clustering result visualization, removing noise points in an original data set, and further, selecting parameters such as a loss function, an activation function, an optimizer and the like of a deep learning model by means of the characteristics of Keras and strong expandability to realize training of the model and training result visualization;
s3, training of the model is achieved by means of selecting parameters of the deep learning model through Keras, training results are visualized, and the parameters of the deep learning model comprise: the loss function, the activation function and the optimizer specifically comprise the following steps:
s31, assuming yi is a true value, y' is a predicted value, and Keras represents the difference between the true value and the predicted value through a loss function. The cross entropy is used to represent the magnitude of the difference between the actual result obtained and the real result, i.e. the smaller the cross entropy, the closer the two probability distributions are. The calculation formula of the cross entropy loss function is as follows:
s32, the optimizer is another important parameter besides the loss function. The model adopts an Adam optimizer, and the parameters of the optimizer are set as follows:
Keras.optimizers.Adam(lr=0.01,beta_1=0.9,beta_2=0.999,epslion
=None,decay=0.0,amsgrad=false)
where lr is the learning rate; epsleep is a blurring factor, defaulting to k.epsleep (); the decay is a learning attenuation value after each parameter update; AMSGrad is used to determine whether to apply the AMSGrad variant of Adam optimizer.
S33, in order to enable neurons in a training network to add nonlinear factors, an activation function can be set during training, so that an independent activation layer is established. The activation functions employed are the softmax activation function and the Relu activation function. The Softmax activation function is applicable to multiple classification logistic regression problems, and the calculation formula is selected as follows:
the Relu activation function is a simple linear piecewise function whose function image is shown. The unique value range of the Relu activation function enables the neural network to better extract data connection and characteristics in the neural network, and the training result is more ideal. Meanwhile, the gradient disappearance phenomenon can be relieved to a certain extent by utilizing the characteristic of the Relu activation function, and the calculation formula of the Relu activation function is as follows:
where x is the discrete sequence data set.
S34, adjusting training rounds (epoch) and training batch sizes (batch size) based on an Adam optimizer and Softmax and Relu activation functions by selecting a cross entropy loss function as a loss function so as to optimize the prediction precision of the training model.
S35, a loss-acc diagram of the training model is drawn by defining a History class in Keras. The History class contains two attributes: training round (epoch) and dictionary type (history) and four key values: val loss, val acc, train loss, train acc. And importing a necessary module into Keras and adding an RNN layer to realize the construction of the RNN circulating neural network. The method adopts a nested model with 3 nonlinear layers to complete pretreatment of a data set, and training can be started after a training data set is added, and the specific steps are as follows:
model=tf. keras. Sequential ([ #3 nested models of nonlinear layers)
Tf. keras. Layers. Flag () # flatten multidimensional data
Tf. keras. Layers. Dense (64, activation= 'relu'), call activation function relu
Tf. keras. Layers. Dense (64, activation= 'relu'), call activation function relu
Tf. keras. Layers. Dense (64, activation= 'relu'), call activation function relu
Tf. keras. Layer. Dense (3, activation= 'softmax') # softmax classification)
Model building (None, 13, 1)) build model
Still further, the existing traffic accident data set extracts key parameters (weather, vehicle type, accident type and the like), numbers and preprocessing suitable for model training are carried out on the parameter data, then a deep learning algorithm model is built according to an RNN frame, feature learning and extraction are carried out on input accident influence factors, finally, the traffic accident severity is taken as a target to be output, and the rationality and the accuracy of an output result are evaluated. The experimental environment is an RNN cyclic neural network constructed based on a deep learning framework of Tensorflow2.8.0 and Keras2.8.0, the programming language uses Python3.8, the CUDA version of the running environment is 10.0, and the operating system is Windows10. The hardware environment for the experiments herein is: CPU is Intel (R) Core (TM) i5-9300HF CPU@2.40GHz 2.40GHz,GPU is GeForce GTX 1660 Ti, and memory is 16GB. The data processing capacity and training speed of the model are limited by the GPU performance. The method specifically comprises the following steps:
s42, considering that the accident data set reaches more than one hundred thousand, the method can be implemented according to 9: the training set and the testing set are distributed according to the proportion of 1, so that the data of the testing set can be ensured to be more than ten thousand. Therefore, the number of the selected training sets is 13000 pieces of data, and the number of the test sets is 15000 pieces of data.
S43, in order to improve the nonlinear fitting capacity of the deep learning model, and meanwhile, in order to avoid over fitting, a nested model of 3 nonlinear layers is constructed to obtain an optimal training result, and an Adam optimizer is adopted as a training tool.
S44, based on GPU performance limitation and practical training data set size consideration, in order to improve experimental efficiency, three training batches of 64, 128 and 256 are adopted for experimental comparison, so that the most reasonable training batch is obtained. The setting of the training round epoch needs to confirm that the deep learning model is converged, and on the basis, the training round is controlled to be smaller as much as possible so as to reduce the machine load and the experiment time. The experiment was gradually incremented from 300 training rounds until the deep learning model converged.
S45, under the condition of the same training round, the Batchsize is gradually increased from 64 to 256, the training precision of the result is higher and higher, and the loss function is smaller and smaller, as shown in the table 2. Meanwhile, the training time difference of each round under different Batchsize is not great, so the experiment sets the Batchsize to 256; from the training round epoch, when the training round is 300, the training result is greatly different from the other two results, and the training model is not converged yet. When the training rounds are 500 and 700, the training accuracy and the loss function are not greatly different, and the performance is better when the training round is 700, so that the experiment adopts the training result that the training round is 700 and the batch size is 256, as shown in fig. 4.
TABLE 2 training results of different training runs and lots
Under the condition that experimental equipment and experimental data sets are the same, the optimal result is taken to compare the text model with a comparison algorithm, and the experimental result is shown in table 3. Through experimental data comparison, the deep learning model has higher learning capacity and data processing capacity than the traditional machine learning model because of the high-dimensional data mining characteristic, and the prediction accuracy is higher than that of the traditional machine learning model.
TABLE 3 comparison of experimental results for different models

Claims (10)

1. The traffic accident severity prediction method based on the cyclic neural network is characterized by comprising the following steps of:
s1, respectively carrying out assignment quantification on each discrete variable in accident factors affecting the severity of urban road traffic accidents to obtain a quantification index table corresponding to each accident factor, wherein the accident factors comprise people, vehicles, roads and environments;
s2, clustering traffic accident severity data based on a density clustering algorithm OPTICS, compiling based on a Python environment to realize an algorithm, and forming an urban road traffic accident training sample set x by corresponding a clustering result to each influence factor;
s3, training a cyclic neural model and visualizing a training result by selecting parameters of a deep learning model through Keras, wherein the parameters of the deep learning model comprise a loss function, an activation function and an optimizer;
s4, inputting quantitative data corresponding to various accident factors of the real road traffic accident into the trained cyclic neural network, and outputting a prediction result of the traffic accident severity.
2. The method for predicting the severity of a traffic accident based on a recurrent neural network as claimed in claim 1, wherein the accident factors include driver factors, pedestrian factors, vehicle factors, road factors and environmental factors.
3. The traffic accident severity prediction method based on the recurrent neural network according to claim 1, wherein in step S2, the method for forming the urban road traffic accident training sample set x based on the density clustering algorithm OPTICS, clustering accident data, compiling based on the Python environment to realize the algorithm, and corresponding the clustering result to each influence factor is as follows:
s21, determining a radius eps and a density Minpts, wherein a core distance calculation formula is as follows:
s22, the reachable distance calculating method comprises the following steps:
s23, establishing an OPTICS clustering function module based on a clustering module in a sklearn library function in python compiling software, calculating core distances among data sets of all sections according to attributes of the data sets by using the OPTICS clustering function, and clustering distances between the data sets of different sections and core points.
4. The traffic accident severity prediction method based on a recurrent neural network according to claim 3, wherein the clustering module in the sklearn library function based on python compiling software in S23 establishes an OPTICS clustering function module, calculates a core distance between data sets of each segment according to attributes of the data sets by using the OPTICS clustering function, and clusters distances between the data sets of different segments from the core point by:
j1, calling an OPTICS clustering function in a clustering module in python software;
j2, further defining a recursive structure function of the core distance and the reachable distance;
and J3, debugging the clustering parameters in the OPTICS function to compare the clustering results, and adopting matplotlib to visualize the clustering results and output the optimal clustering results.
5. The method for predicting traffic accident severity based on recurrent neural network as claimed in claim 4, wherein the method for further defining the recursive structural function of the core distance and the reachable distance in J2 is:
j201, setting a recursive structure function on a data set core object x based on an OPTICS clustering function in a clustering module, so that x becomes a minimum neighborhood distance r of the core object, namely a core distance of x; j202, the maximum value of the euclidean distance and the core distance based on the data set core object Y to the data set core object x is the reachable distance of the data set core object Y to the data set core object x.
6. The traffic accident severity prediction method based on the recurrent neural network according to claim 4, wherein the method for debugging the clustering parameters in the OPTICS function to compare the clustering results and visualizing the clustering results by adopting matplotlib in the J3 is as follows: and debugging the cluster radius values eps and the density values mps in the OPTICS function to obtain the clustering results of the same data set under different clustering parameters, and carrying out clustering result visualization by adopting matplotlib by comparing the clustering results under different clustering parameters to output an optimal clustering result.
7. The traffic accident severity prediction method based on the recurrent neural network according to claim 1, wherein in step S3, parameters of a deep learning model are selected by means of Keras, and the method for training the model and visualizing the training result is as follows:
s31, assuming yi is a true value, y' is a predicted value, keras represents the difference between the true value and the predicted value through a loss function, and cross entropy is used for representing the difference between the obtained actual result and the actual result; the calculation formula of the cross entropy loss function is as follows:
s32, adopting an Adam optimizer as an optimizer model, and setting parameters as follows:
Keras.optimizers.Adam(lr=0.01,beta_1=0.9,beta_2
=0.999,epslion=None,decay=0.0,amsgrad=false)
where lr is the learning rate; epsleep is a blurring factor, defaulting to k.epsleep (); the decay is a learning attenuation value after each parameter update; AMSGrad is used to determine whether to apply the AMSGrad variant of Adam optimizer;
s33, an independent activation layer is established by using a Softmax activation function and a Relu activation function, wherein the calculation formula of the Softmax activation function is as follows:
the calculation formula of the ReLu activation function is as follows:
wherein x is a discrete sequence dataset;
s34, a loss function is established, a data training model is established based on the optimizer and the activation function, preprocessing of the data set is completed, and training is performed after the training data set is added into the training model.
8. The traffic accident severity prediction method according to claim 7, wherein the step S34 of creating a loss function, creating a data training model based on an optimizer and an activation function, completing preprocessing of the data set, and performing training after adding the training data set to the training model comprises the steps of:
j1, selecting a cross entropy loss function as a loss function, and enabling the prediction accuracy of a training model to be optimal by adjusting the training round and the training batch size based on an Adam optimizer, a Softmax and a Relu activation function;
j2, defining a loss-acc diagram of a History drawing training model in Keras, importing necessary modules in Keras and adding an RNN layer to realize the construction of an RNN cyclic neural network, adopting a nested model with 3 nonlinear layers to complete preprocessing of a data set, and executing training after adding the training data set in the model.
9. The traffic accident severity prediction method based on the cyclic neural network according to claim 1, wherein the quantitative data corresponding to the various influencing factors of the real road traffic accident in step S4 is input into the trained cyclic neural network, and the method for outputting the traffic accident severity prediction result is as follows:
s41, considering that the accident data set reaches more than hundred thousand, according to 9:1, distributing training sets and test sets according to the proportion, wherein the number of the selected training sets is 13000 pieces of data, and the number of the test sets is 15000 pieces of data;
s42, constructing nested models of 3 nonlinear layers by adopting an Adam optimizer to obtain an optimal training result;
s43, according to the number of training sets of S41 and the adopted 3-layer model of S42, adopting three training batches of 64, 128 and 256 to carry out experimental comparison, wherein the comparison experiment is gradually increased from 300 training rounds until the deep learning model converges;
s44, under the condition of the same training round, the Batchsize is gradually increased from 64 to 256, the training precision of the result is higher and higher, the loss function is smaller and smaller, and the Batchsize is set to 256 in the experiment; from the training round of Epochs, the experiment adopts the training result with the training round of 700 and the batch size of 256 as the optimal selection parameter.
10. The traffic accident severity prediction system based on the RNN is characterized by comprising a variable assignment module, a model training module and a prediction module;
the variable assignment module carries out assignment quantification on each discrete variable sub-factor in each accident factor, and carries out discrete interval assignment on each continuous variable sub-factor in each accident factor based on a traffic accident training sample set and an OPTICS clustering algorithm so as to obtain a processed road traffic accident training sample set;
the model training module is used for training the RNN model based on the quantitative index table and the processed road traffic accident training sample set so as to obtain a circulating neural network model capable of predicting the severity of the road traffic accident;
and the prediction module is used for inputting the quantized data corresponding to the multiple important sub-factors in the real road traffic scene into the trained RNN model so as to output a prediction result of the traffic accident severity.
CN202311132079.9A 2023-09-01 2023-09-01 Traffic accident severity prediction method based on cyclic neural network Pending CN117494866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311132079.9A CN117494866A (en) 2023-09-01 2023-09-01 Traffic accident severity prediction method based on cyclic neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311132079.9A CN117494866A (en) 2023-09-01 2023-09-01 Traffic accident severity prediction method based on cyclic neural network

Publications (1)

Publication Number Publication Date
CN117494866A true CN117494866A (en) 2024-02-02

Family

ID=89671440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311132079.9A Pending CN117494866A (en) 2023-09-01 2023-09-01 Traffic accident severity prediction method based on cyclic neural network

Country Status (1)

Country Link
CN (1) CN117494866A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117854321A (en) * 2024-03-07 2024-04-09 北京建筑大学 Traffic accident risk prediction method and system based on traffic environment early perception

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722486A (en) * 2021-08-31 2021-11-30 平安普惠企业管理有限公司 Intention classification method, device and equipment based on small samples and storage medium
CN115600726A (en) * 2022-09-19 2023-01-13 浙江省交通运输科学研究院(Cn) Neural network-based tunnel traffic accident severity prediction method
CN115689040A (en) * 2022-11-11 2023-02-03 浙江省交通运输科学研究院 Traffic accident severity prediction method and system based on convolutional neural network
KR20230040727A (en) * 2021-09-16 2023-03-23 숙명여자대학교산학협력단 Modeling method for predicting the traffic accident severity and apparatus thereof
CN116468138A (en) * 2022-12-06 2023-07-21 国网(北京)综合能源规划设计研究院有限公司 Air conditioner load prediction method, system, electronic equipment and computer storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722486A (en) * 2021-08-31 2021-11-30 平安普惠企业管理有限公司 Intention classification method, device and equipment based on small samples and storage medium
KR20230040727A (en) * 2021-09-16 2023-03-23 숙명여자대학교산학협력단 Modeling method for predicting the traffic accident severity and apparatus thereof
CN115600726A (en) * 2022-09-19 2023-01-13 浙江省交通运输科学研究院(Cn) Neural network-based tunnel traffic accident severity prediction method
CN115689040A (en) * 2022-11-11 2023-02-03 浙江省交通运输科学研究院 Traffic accident severity prediction method and system based on convolutional neural network
CN116468138A (en) * 2022-12-06 2023-07-21 国网(北京)综合能源规划设计研究院有限公司 Air conditioner load prediction method, system, electronic equipment and computer storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MAHER IBRAHIM SAMEEN: "《Severity Prediction of Traffic Accidents with Recurrent Neural Networks》", 《APPLIED SCIENCE》, 8 June 2017 (2017-06-08), pages 1 *
抢我糖还想跑: "《optics》", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/qq_41749451/article/details/119456076> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117854321A (en) * 2024-03-07 2024-04-09 北京建筑大学 Traffic accident risk prediction method and system based on traffic environment early perception

Similar Documents

Publication Publication Date Title
CN110889546B (en) Attention mechanism-based traffic flow model training method
CN109034448B (en) Trajectory prediction method based on vehicle trajectory semantic analysis and deep belief network
Zhang et al. DNEAT: A novel dynamic node-edge attention network for origin-destination demand prediction
Yan et al. Spatial-temporal chebyshev graph neural network for traffic flow prediction in iot-based its
CN112820105B (en) Road network abnormal area processing method and system
CN114664091A (en) Early warning method and system based on holiday traffic prediction algorithm
CN115148019A (en) Early warning method and system based on holiday congestion prediction algorithm
Shao et al. The Traffic Flow Prediction Method Using the Incremental Learning‐Based CNN‐LTSM Model: The Solution of Mobile Application
CN117494866A (en) Traffic accident severity prediction method based on cyclic neural network
CN115034496A (en) Urban rail transit holiday short-term passenger flow prediction method based on GCN-Transformer
CN112215269A (en) Model construction method and device for target detection and neural network architecture
Fan et al. Multi-system fusion based on deep neural network and cloud edge computing and its application in intelligent manufacturing
CN115496257A (en) Short-term vehicle speed prediction based on space-time fusion
Hu et al. Driver identification using 1D convolutional neural networks with vehicular CAN signals
Peng et al. A forecast model of tourism demand driven by social network data
Xing et al. A short-term traffic flow prediction method based on kernel extreme learning machine
Li et al. First-order sensitivity analysis for hidden neuron selection in layer-wise training of networks
Qu et al. Temporal backtracking and multistep delay of traffic speed series prediction
Dong et al. A short-term traffic flow forecasting model based on spatial-temporal attention neural network
Tao et al. A delay-based deep learning approach for urban traffic volume prediction
ABBAS A survey of research into artificial neural networks for crime prediction
Chen et al. Short-term traffic flow prediction of expressway based on Seq2seq model
Zhou et al. Time related class association rule mining and its application to traffic prediction
Wang et al. A proactive decision support system for online event streams
CN115238775A (en) Model construction method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination