A method, device and electronic equipment for predicting dangerous individuals
By constructing the target feature parameter set of traffic data and inputting a prediction model, the problem of difficult to identify and predict risk factors in traffic scenarios in the prior art is solved, and safety hazard prediction for drivers, roads and vehicles is achieved, and traffic accident incidence is reduced.
Patent Information
- Application Number
- CN202411606635.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-11
AI Technical Summary
The prior art is difficult to quickly and accurately identify and predict different risk factors in traffic scenarios, which makes it difficult to effectively reduce the incidence of traffic accidents.
By constructing a target feature parameter set based on the original traffic data, including the feature parameters of people, roads and vehicles, and entering them into a pre-trained target prediction model, the categories and accident probability of dangerous individuals are obtained.
It realizes predictions of drivers, roads and vehicles with safety hazards in traffic scenarios, manages dangerous individuals in advance, and reduces the incidence of traffic accidents.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and electronic equipment for predicting dangerous individuals. Background Art
[0002] The most important issue that deserves attention during vehicle driving is safety, and there are many factors that affect safety. The driver's own factors, the vehicle's condition, road conditions, etc. will all have an impact on driving safety.
[0003] How to quickly and accurately identify potential drivers, potential vehicles and potential roads, and control them, is the most direct and effective way to reduce the incidence of traffic accidents. The current identification of traffic safety hazards mainly relies on the experience of staff. However, this method cannot accurately identify and is inefficient.
[0004] In related technologies, the original traffic violation data and accident data can be used to train and adjust the corresponding models, and then the violation attribute information can be input into the model to achieve the identification and prediction of dangerous persons. However, this type of method mainly focuses on the identification and prediction of dangerous drivers, and ignores the impact of other factors in traffic scenarios.
[0005] In view of this, how to identify and predict different risk factors in traffic scenarios is an urgent problem that needs to be solved. Summary of the invention
[0006] The embodiments of the present application provide a dangerous individual prediction method, device and electronic device for predicting drivers, roads and vehicles with safety hazards in traffic scenarios at the time series level, so as to manage them in advance and reduce the incidence of traffic accidents.
[0007] In a first aspect, an embodiment of the present application provides a method for predicting a dangerous individual, the method comprising:
[0008] Based on the original traffic data, a target feature parameter set is constructed; wherein the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset, and a vehicle feature parameter subset;
[0009] The target feature parameter set is input into a pre-trained target prediction model to obtain a prediction result output by the target prediction model. The prediction result is used to indicate the category of dangerous individuals and the probability of accidents. The target prediction model is obtained based on the feature parameter training set.
[0010] Through the above method, it is possible to predict drivers, roads and vehicles with safety hazards in traffic scenarios, ensuring that staff can manage dangerous individuals in advance and reduce the accident rate.
[0011] In an optional implementation, a target feature parameter set is constructed based on the original traffic data, including:
[0012] Get raw traffic data;
[0013] The original traffic data is divided into safe individual samples and dangerous individual samples according to preset rules and data attributes;
[0014] Based on safe individual samples and dangerous individual samples, a target feature parameter set is obtained.
[0015] Through the above method, data samples can be divided into safe individual samples and dangerous individual samples based on the original traffic data, which is convenient for subsequent training of the model.
[0016] In an optional implementation, obtaining a target feature parameter set based on the safe individual sample and the dangerous individual sample includes:
[0017] respectively obtaining a first number of safe individual samples and a second number of dangerous individual samples;
[0018] If the ratio of the first quantity to the second quantity is greater than a preset ratio, determining whether the second quantity is greater than or equal to a first preset quantity threshold;
[0019] If so, a random sampling method is used to sample the safety data sample, and the target feature parameter set is obtained based on the dangerous individual sample;
[0020] If not, the smote sampling method is used to sample dangerous individual samples, and the target feature parameter set is obtained based on the safe individual samples.
[0021] Through the above method, the data samples are adopted according to the preset rules to form a target feature parameter set, which avoids the situation where the prediction model is easily unable to predict dangerous individuals due to the prior information learned according to the proportion of the samples after the data samples are unbalanced.
[0022] In an optional implementation, the target prediction model is trained in the following manner:
[0023] Dividing the target feature parameter set into a feature parameter training set and a feature parameter test set according to a preset ratio;
[0024] A pre-built prediction model is trained based on a feature parameter training set, and the model parameters of the pre-built prediction model are adjusted using the Gridsearch grid optimization method to obtain a target prediction model; wherein, when the model parameters of the pre-built prediction model are adjusted, a confusion matrix is used to evaluate the indicators of the prediction model, and the prediction model with the best evaluation is selected as the target prediction model.
[0025] Through the above method, the pre-built prediction model is trained using the feature training data set, and the model parameters are adjusted using the Gridsearch grid optimization method, so that the optimal hyperparameters of the model can be obtained, thereby making the prediction model have better performance.
[0026] In an optional implementation, inputting the target feature parameter set into a pre-trained target prediction model to obtain a prediction result output by the target prediction model includes:
[0027] Inputting the target feature parameter set into the target prediction model to obtain the prediction probability corresponding to each data sample;
[0028] Sort the predicted probabilities, select the risky individuals with a second preset number threshold, and obtain a risky individual data set;
[0029] The prediction results are obtained based on the predicted probability of each dangerous individual and the cause of the traffic accident.
[0030] Through the above method, dangerous individuals with hidden dangers can be accurately predicted based on the predicted probability of dangerous individuals and the predicted causes of traffic accidents that may occur to dangerous individuals.
[0031] In an optional implementation, the prediction result is obtained according to the prediction probability of each dangerous individual and the cause of the traffic accident, including:
[0032] Based on the importance of the traffic accident cause corresponding to each dangerous individual, a set of traffic accident causes corresponding to each dangerous individual is determined; wherein the importance of each traffic accident cause in the set of traffic accident causes is greater than the average importance of the traffic accident causes;
[0033] Based on each set of accident causes, determining each set of traffic accident causes whose number of accident causes is greater than a third preset number;
[0034] Based on the predicted probability and the set of traffic accident causes, a prediction result is obtained.
[0035] In a second aspect, the present application provides a dangerous individual prediction device, the device comprising:
[0036] A processing module, used to construct a target feature parameter set based on the original traffic data; wherein the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset, and a vehicle feature parameter subset;
[0037] The prediction module is used to input the target feature parameter set into a pre-trained target prediction model to obtain the prediction result output by the target prediction model. The prediction result is used to indicate the category of dangerous individuals and the probability of accidents. The target prediction model is obtained based on the feature parameter training set.
[0038] In an optional implementation, when constructing the target feature parameter set based on the original traffic data, the processing module is specifically used to:
[0039] Get raw traffic data;
[0040] The original traffic data is divided into safe individual samples and dangerous individual samples according to preset rules and data attributes;
[0041] Based on safe individual samples and dangerous individual samples, a target feature parameter set is obtained.
[0042] In an optional implementation, when obtaining a target feature parameter set based on the safe individual sample and the dangerous individual sample, the processing module is specifically used to:
[0043] Respectively obtaining a first number of safe individual samples and a second number of dangerous individual samples;
[0044] If the ratio of the first quantity to the second quantity is greater than the preset ratio, determining whether the second quantity is greater than or equal to the first preset quantity threshold;
[0045] If so, a random sampling method is used to sample safe individual samples, and a target feature parameter set is obtained based on the dangerous individual samples;
[0046] If not, the smote sampling method is used to sample dangerous individual samples, and the target feature parameter set is obtained based on the safe individual samples.
[0047] In an optional implementation, a training module is further included, and the training module is specifically used to:
[0048] Dividing the target feature parameter set into a feature parameter training set and a feature parameter test set according to a preset ratio;
[0049] A pre-built prediction model is trained based on a feature parameter training set, and the model parameters of the pre-built prediction model are adjusted using the Gridsearch grid optimization method to obtain a target prediction model; wherein, when the model parameters of the pre-built prediction model are adjusted, a confusion matrix is used to evaluate the indicators of the prediction model, and the prediction model with the best evaluation is selected as the target prediction model.
[0050] In an optional implementation, when the target feature parameter set is input into a pre-trained target prediction model to obtain a prediction result output by the target prediction model, the prediction module is specifically used to:
[0051] Input the target feature parameter set into the target prediction model to obtain the prediction probability corresponding to each data sample;
[0052] Sort the predicted probabilities, select the risky individuals with a second preset number threshold, and obtain a risky individual data set;
[0053] The prediction results are obtained based on the predicted probability of each dangerous individual and the cause of the traffic accident.
[0054] In an optional implementation, when obtaining the prediction result according to the prediction probability of each dangerous individual and the cause of the traffic accident, the prediction module is specifically used to:
[0055] Based on the importance of the traffic accident cause corresponding to each dangerous individual, a set of traffic accident causes corresponding to each dangerous individual is determined; wherein the importance of each traffic accident cause in the set of traffic accident causes is greater than the average importance of the traffic accident causes;
[0056] Based on each of the accident cause sets, determining each of the traffic accident cause sets whose number of accident causes is greater than a third preset number;
[0057] Based on the predicted probability and the set of traffic accident causes, the prediction results are obtained.
[0058] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the dangerous individual prediction method described in the first aspect above.
[0059] In a fourth aspect, the present application provides a computer-readable storage medium comprising a program code. When the program code is executed on an electronic device, the program code is used to enable the electronic device to execute the steps of the dangerous individual prediction method described in the first aspect above.
[0060] In a fifth aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the method for predicting dangerous individuals as described in the first aspect.
[0061] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0063] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0064] Figure 2 A schematic diagram of an implementation flow of a method for predicting dangerous individuals provided in an embodiment of the present application;
[0065] Figure 3 A schematic diagram of the structure of a dangerous individual prediction device provided in an embodiment of the present application;
[0066] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0068] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A and B are connected, which can represent two situations: A and B are directly connected and A and B are connected through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0069] In addition, the collection, dissemination, and use of data in the technical solution of this application comply with the requirements of relevant national laws and regulations.
[0070] The following is a brief introduction to the design concept of the embodiment of the present application:
[0071] In daily life, the most important issue when driving a vehicle is safety, and there are many factors that affect safety. The driver's own factors, the vehicle's condition, road conditions, etc. will all have an impact on driving safety.
[0072] How to quickly and accurately identify potential drivers, potential vehicles and potential roads, and control them, is the most direct and effective way to reduce the incidence of traffic accidents. The current identification of traffic safety hazards mainly relies on the experience of staff. However, this method cannot accurately identify and is inefficient.
[0073] In related technologies, it is also possible to train and adjust the corresponding model through the original traffic violation data and accident data, and then input the violation attribute information into the model to achieve the identification and prediction of dangerous persons. However, this type of method mainly focuses on the identification and prediction of dangerous drivers, ignoring the influence of other factors in traffic scenes.
[0074] In view of this, in order to identify and predict different dangerous factors in traffic scenes, an embodiment of the present application provides a method for predicting dangerous individuals, which includes: first, constructing a target feature parameter set based on original traffic data; wherein the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset, and a vehicle feature parameter subset; then, inputting the target feature parameter set into a pre-trained target prediction model to obtain a prediction result output by the target prediction model, and the prediction result is used to indicate the category of dangerous individuals and the probability of accident mode, and the target prediction model is obtained based on the feature parameter training set. Through the above method, it is possible to predict dangerous individuals from three levels: driver, vehicle, and road, and predict individuals that may have safety hazards, thereby reducing the workload of traffic police in checking traffic safety hazards, and at the same time, it is also possible to increase the coverage of safety hazard inspections, so as to timely manage dangerous individuals with safety hazards and reduce the incidence of safety accidents.
[0075] The following describes a method for predicting dangerous individuals provided by an exemplary embodiment of the present application with reference to the accompanying drawings.
[0076] See also Figure 1 , which is a schematic diagram of a possible application scenario in an embodiment of the present application. The application scenario diagram includes a server 11 and a terminal device 12 (including a terminal device 121, a terminal device 122 ... a terminal device 12n).
[0077] The server 11 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device 12 may be directly or indirectly connected to the server 11 via wired or wireless communication, which is not limited in this application.
[0078] The terminal device 120 includes but is not limited to mobile phones, tablet computers, laptop computers, desktop computers, electronic reading books, intelligent voice interaction devices, smart home appliances, car terminals and other devices; various software can be installed on the terminal device, such as applications and applets.
[0079] It should be noted that Figure 1 The figure is only an example. In fact, the number of terminal devices 12 and servers 11 is not limited and is not specifically limited in the embodiments of the present application.
[0080] In an embodiment of the present application, any one or all of the server 11 and the terminal device 12 may be configured with a trained target prediction model, so that the trained target prediction model can be used to predict dangerous individuals in the traffic scene based on a target feature parameter set.
[0081] It should be noted that in the embodiments of the present application, the target prediction model used on the device can be obtained by self-training or other training.
[0082] The terminal device 12 adopts a pre-trained target prediction model to predict dangerous individuals according to a target feature parameter set. The target prediction model adopted by the terminal device 12 can be obtained by self-training, or other devices (such as the server 11 or other terminal devices) can complete the training of the target prediction model and then send it directly to the terminal device 12.
[0083] In the following description of this application, the training process and application process of the target prediction model will be schematically described from the perspective of the processing device. According to different application scenarios of this application, the processing device may specifically correspond to Figure 1 This application does not make any specific limitation on any of the server 11 and terminal device 12 in the schematic diagram.
[0084] In addition, in an embodiment of the present application, the target prediction model is a gradient boosting tree (eXtreme GradientBoosting, XGBoost) model. According to actual processing needs, the trained target prediction model can be a periodic process, and the feature parameter training set can be periodically regenerated to train the target prediction model.
[0085] See also Figure 2 As shown, it is a schematic diagram of the implementation process of a dangerous individual prediction method provided in an embodiment of the present application. The specific implementation process of the method is as follows:
[0086] S1: Construct the target feature dataset based on the original traffic data.
[0087] It should be noted that, in the embodiment of the present application, the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset, and a vehicle feature parameter subset.
[0088] Therefore, the dangerous individual prediction method provided in the embodiment of the present application can be used to predict dangerous persons, dangerous vehicles and dangerous roads.
[0089] Furthermore, first, the original traffic data is obtained, and a target feature parameter set is constructed for the drivers, roads and vehicles in the traffic scene.
[0090] In the embodiment of the present application, basic attribute labels can be constructed for the driver from the aspects of driver type, driving experience, gender, education level, etc.; illegal behavior labels can be constructed from the number of times of failing to give way according to regulations, speeding, drunk driving, traffic light violations, illegal parking, driving in the wrong direction, driving without a license, driving under the influence, fatigue driving, illegal lane changes, illegal overtaking, illegal overtaking, illegal U-turns, illegal occupying of the road, illegal overloading and dangerous goods transportation, freight vehicle overloading, passenger vehicle overcrowding, etc.; illegal behavior labels can be constructed from the number of fatal accidents with primary responsibility, the number of fatal accidents with equal responsibility, the number of fatal accidents with secondary responsibility, the number of injuries with primary responsibility, the number of injuries with equal responsibility, the number of accidents with secondary responsibility, property damage Accident behavior labels are constructed based on the number of accidents with primary responsibility, the number of accidents with equal responsibility for property damage, and the number of accidents with secondary responsibility for property damage. Basic attribute labels can be constructed for vehicles from aspects such as vehicle type and vehicle age. Since there is a corresponding relationship between the driver and the vehicle, the vehicle's illegal attribute label and accident behavior label correspond to the driver. For roads, basic attribute labels are constructed mainly from aspects such as road type, highway administrative level, pavement structure, road physical isolation, road linearity, type of road protection facilities, traffic light mode, road safety attributes, pavement conditions, and intersection and section types. Illegal attribute labels are constructed from the number of illegal behaviors on the road, high-incidence periods of violations, and intersections / sections with high incidence of drunk driving. Accident attribute labels are constructed from the number of injury accidents and the number of fatal accidents.
[0091] Furthermore, when constructing the target feature parameter set, the original traffic data is divided into two parts from the time series level, namely, the original traffic data corresponding to the first time period [TK, T-(K-2)], and the original traffic data corresponding to the second time period [T-(K-2), T], where T is the current time for obtaining the original traffic data, and K is the preset number of years. For example, if T is 2024 and K is 4, then the first time period is [2020, 2022], and the second time period is [2022, 2024].
[0092] In an optional implementation, when the original traffic data is acquired, the target object is first divided into safe data samples and dangerous data samples according to preset rules.
[0093] Specifically, individuals who have had more than or equal to 3 ordinary accidents or more than or equal to 1 serious accidents in the first time period can be classified as dangerous individuals; if the number of ordinary accidents is less than 3 or the number of serious accidents is less than 1, they can be classified as safe individuals. Exemplarily, in the embodiment of the present application, ordinary accidents can be defined as: minor scratch accidents, and serious accidents can be defined as accidents that cause serious property losses due to major or full responsibility. For example, when driver A changes lanes, he scratches other vehicles three times and does not cause serious consequences. In this case, driver A can be determined as a dangerous individual sample. If driver A only scratches other vehicles once when changing lanes, driver A can be determined as a safe individual sample. For example, when driver A is driving, he hits a pedestrian crossing a zebra crossing, causing pedestrian injuries, driver A can be determined as a dangerous individual sample. In addition, if a certain section of road A has multiple traffic accidents, causing pedestrian injuries, section A can be determined as a dangerous individual sample.
[0094] Furthermore, after each target object is divided into safe individual samples or dangerous individual samples, the safe individual samples and dangerous individual samples corresponding to the target person constitute a person characteristic parameter subset, the safe individual samples and dangerous individual samples corresponding to the target road constitute a road characteristic parameter subset, and the safe individual samples and dangerous individual samples corresponding to the target vehicle constitute a vehicle characteristic parameter subset.
[0095] Furthermore, the target feature parameter subset is composed of the personnel feature parameter subset, the road feature parameter subset and the vehicle feature parameter subset.
[0096] In actual application scenarios, the number of safe individual samples is often much larger than the number of dangerous individual samples, which leads to serious data imbalance when training the prediction model. As a result, the obtained prediction model is more likely to be biased towards the category with more sample data. That is, the prediction model will learn the prior information according to the proportion of sample categories, which makes it difficult for the prediction model to predict dangerous individuals.
[0097] Therefore, in an optional implementation, before constructing the target feature parameter set, the safe individual samples and the dangerous individual samples need to be processed. Specifically, firstly, a first number of safe sample individuals and a second number of dangerous individual samples are obtained respectively.
[0098] Then, it is determined whether the ratio of the first number to the second number is greater than the preset ratio. For example, if the first number of safety sample individuals is 1100 and the second number of dangerous sample individuals is 100, then the ratio of the first number to the second number is 11:1. In the embodiment of the present application, the preset ratio may be 10:1, then the ratio of the first number to the second number is greater than the preset ratio. Further, it is determined whether the second number of dangerous individual samples is greater than or equal to the first preset number threshold. If the second number of dangerous individual samples is greater than or equal to the first preset number threshold, a random sampling method is used to randomly sample the safety individual samples. Specifically, when randomly sampling the safety individual samples, a simple random sampling method can be used, that is, according to the first number of safety individual samples, the number of samples or the sampling rate to be sampled is determined, and then the safety individual samples of the corresponding sampling number are randomly selected from the safety individual samples. A random sampling method without replacement can also be used to sample the safety individual samples. The specific random sampling method is not specifically limited in the embodiment of the present application. Then, the safety individual samples obtained by random sampling and the original dangerous individual samples are combined to form a target feature parameter set.
[0099] In addition, if the second number of dangerous individual samples is less than the first preset number, the synthetic minority over-sampling technique (smote) is used to sample the safe data samples. Then, the dangerous individual samples obtained by oversampling and the safe individual samples are combined to form the target feature parameter set. Sampling dangerous individual samples by the smote oversampling method can solve the problem of imbalance in the number of samples of different categories, so as to improve the performance of the prediction model.
[0100] It should be noted that, in the embodiment of the present application, dummy variable processing is also required for the categorical variables that cannot be quantitatively processed. The categorical variables that cannot be quantitatively processed can be quantified through dummy variable processing.
[0101] For example, it is necessary to process the driver's gender, education level and other category variables as dummy variables. See Table 1 for the results of processing the age groups as dummy variables in the embodiment of the present application:
[0102] Table 1
[0103]
[0104] In other words, for example, if the age group under 20 years old is assigned a value of 0, the parameter code after dummy variable processing is 10000.
[0105] S2: Input the target feature data set into a pre-trained target training model to obtain a prediction result output by a target prediction model.
[0106] It should be noted that the prediction results are used to indicate the category of dangerous individuals and the probability of accidents, and the target prediction model is obtained based on the feature parameter training set.
[0107] In the embodiment of the present application, when training the prediction model, the target feature parameter set is first divided into a feature parameter training set and a feature parameter test set according to a preset ratio by using a random sampling method. The prediction model is trained using the feature parameter training set. Exemplarily, the target feature data set can be split into a feature parameter training set and a feature parameter test set according to a ratio of 3:1.
[0108] In the process of training the prediction model, the pre-built prediction model is trained using the feature parameter training set, and the hyperparameters of the prediction model are adjusted using Gridsearch until the optimal hyperparameters of the prediction model are found, thereby obtaining the target prediction model.
[0109] When adjusting the model parameters of the pre-built prediction model, the confusion matrix is used to evaluate the prediction model indicators, and the prediction model with the best evaluation is selected as the target prediction model. In the embodiment of the present application, the indicators in the confusion matrix are accuracy and precision, respectively. Accuracy is used to evaluate the overall performance of the prediction model, and precision is used to evaluate the probability of accurate prediction of the prediction model for dangerous individuals.
[0110] See Table 2, which is a schematic diagram of a confusion matrix provided in an embodiment of the present application:
[0111] Table 2
[0112]
[0113] In the embodiment of the present application, the accuracy is calculated by the following formula:
[0114] The accuracy is calculated by the following formula: ;
[0115] Among them, TP is the number of samples that the prediction model correctly predicts as dangerous categories when the samples are actually dangerous individuals; FN is the number of samples that the prediction model incorrectly predicts as safe categories when the samples are actually dangerous individuals; FP is the number of samples that the prediction model incorrectly predicts as dangerous categories when the samples are actually safe individuals; TN is the number of samples that the prediction model correctly predicts as safe categories when the samples are actually safe individuals.
[0116] The precision and accuracy of the prediction model are evaluated through the confusion matrix. When the accuracy reaches the expected requirements, the prediction model can quickly and accurately predict dangerous individuals.
[0117] In an optional implementation, when predicting a risk individual, the target feature parameter set is input into a target prediction model to obtain the prediction probability corresponding to each data sample.
[0118] Specifically, the target prediction model determines the prediction probability that the target person, target road, and target vehicle are each a dangerous individual based on the target feature parameter set, and then sorts the obtained prediction probabilities, selects dangerous individuals of the second preset quantity threshold, and obtains a dangerous individual data set. For example, the second preset quantity threshold is 3, the prediction probability corresponding to target person 1 is 95%, the prediction probability corresponding to target person 2 is 83%, the prediction probability corresponding to target person 3 is 75%, the prediction probability corresponding to target person 4 is 93%, and the prediction probability corresponding to target person 5 is 32%. Then, the following is sorted: target person 1>target person 4>target person 2>target person 3>target person 5. According to the second preset quantity threshold, target person 1, target person 4, and target person 5 are selected as the dangerous individual data set.
[0119] Furthermore, the final prediction result is obtained according to the prediction probability of each dangerous individual and the cause of the traffic accident.
[0120] Specifically, in an optional implementation, the importance of the traffic accident cause corresponding to each dangerous individual is first determined, and the traffic accident cause set corresponding to each dangerous individual is determined. It should be noted that the importance of each traffic accident cause in the traffic accident cause set is greater than the average importance of the traffic accident cause.
[0121] Specifically, in the embodiment of the present application, the principal component analysis method can be used to determine the real potential cause of the accident caused by the dangerous individual.
[0122] As shown below: ;
[0123] Where F=(F1,F2…F p ) is the common factor of X; A=(a p1 , a p2 …a pm ) is the factor score coefficient matrix, that is, the factor loading matrix; a ij is the weight value of the i-th indicator variable on the j-th common factor.
[0124] a ij The higher the weight of the i-th accident cause on the j-th common factor, the closer the relationship between the i-th indicator and the j-th factor is. Therefore, the calculation formula for the importance of the i-th accident cause is as follows:
[0125] ;
[0126] Among them, wi is the importance of the i-th accident cause, and is the degree of dependence of the i-th observed variable on the k-th potential common factor. The larger the factor loading, the closer the relationship between the observed variable and the potential factor. is the eigenvalue corresponding to the kth potential common factor in the sample covariance matrix,
[0127] Furthermore, the importance of all traffic accident causes is calculated, and the average importance of all traffic accident causes is obtained, and the traffic accident causes with an importance greater than the average importance are regarded as the real factors that induce the accident.
[0128] For example, the set of traffic accident causes corresponding to target person 2 is: driving under the influence of alcohol 2 times, illegal overtaking 1 time, fatigue driving 1 time, illegal occupying lane driving 1 time. The set of traffic accident causes corresponding to target person 4 is: illegal overtaking 2 times, driving against traffic 1 time, illegal U-turn 2 times, and violating traffic signals 1 time; then based on each set of accident causes, determine each set of traffic accident causes whose number of accident causes is greater than the third preset number. For example, the third preset number is 3, that is, the number of traffic accident causes corresponding to target person 2 is greater than the third preset number, and the number of traffic accident causes corresponding to target person 4 is greater than the third preset number.
[0129] Therefore, target person 2 and target person 4 are taken as the final prediction results. Similarly, vehicles and roads with accident probability can also be predicted.
[0130] Further, based on the same technical concept, the embodiment of the present application provides a dangerous individual prediction device, which is used to implement the above method flow of the embodiment of the present application. Figure 3 As shown, the device includes: a processing module 301 and a prediction module 302, wherein:
[0131] The processing module 301 is used to construct a target feature parameter set based on the original traffic data; wherein the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset and a vehicle feature parameter subset;
[0132] The prediction module 302 is used to input the target feature parameters into a pre-trained target prediction model to obtain the prediction results output by the target prediction model. The prediction results are used to indicate the category of dangerous individuals and the probability of accidents. The target prediction model is obtained based on the feature parameter training set.
[0133] In an optional implementation, when constructing the target feature parameter set based on the original traffic data, the processing module 301 is specifically used to:
[0134] Get raw traffic data;
[0135] Based on the original traffic data, the target objects are divided into safe individual samples and dangerous individual samples according to preset rules; the target objects include target persons, target roads and target vehicles;
[0136] Based on safe individual samples and dangerous individual samples, a target feature parameter set is obtained.
[0137] In an optional implementation, when obtaining a target feature parameter set based on the safe individual sample and the dangerous individual sample, the processing module 301 is specifically used to:
[0138] respectively obtaining a first number of safe individual samples and a second number of dangerous individual samples;
[0139] If the ratio of the first quantity to the second quantity is greater than a preset ratio, determining whether the second quantity is greater than or equal to a first preset quantity threshold;
[0140] If yes, a random sampling method is used to sample the safety data sample, and the target feature parameter set is obtained based on the danger data sample;
[0141] If not, the smote sampling method is used to sample the dangerous data samples, and the target feature parameter set is obtained based on the safe data samples.
[0142] In an optional implementation, a training module 303 is further included, and the training module 303 is specifically used to:
[0143] Dividing the target feature parameter set into a feature parameter training set and a feature parameter test set according to a preset ratio;
[0144] A pre-constructed prediction model is trained based on a feature parameter training set, and the model parameters of the pre-constructed prediction model are adjusted using a Gridsearch grid optimization method to obtain a target prediction model; wherein, when the model parameters of the pre-constructed prediction model are adjusted, a confusion matrix is used to perform indicator evaluation on the prediction model, and the prediction model with the best evaluation is selected as the target prediction model.
[0145] In an optional implementation, when the target feature parameter set is input into a pre-trained target prediction model to obtain a prediction result output by the target prediction model, the prediction module 302 is specifically used to:
[0146] Inputting the target feature parameter set into the target prediction model to obtain the prediction probability corresponding to each data sample;
[0147] Sort the predicted probabilities, select the risky individuals with a second preset number threshold, and obtain a risky individual data set;
[0148] The prediction results are obtained based on the predicted probability of each dangerous individual and the cause of the traffic accident.
[0149] In an optional implementation, when obtaining the prediction result according to the prediction probability of each dangerous individual and the cause of the traffic accident, the prediction module 302 is specifically used to:
[0150] Based on the importance of the traffic accident cause corresponding to each dangerous individual, a set of traffic accident causes corresponding to each dangerous individual is determined; wherein the importance of each traffic accident cause in the set of traffic accident causes is greater than the average importance of the traffic accident causes;
[0151] Based on each set of accident causes, determining each set of traffic accident causes whose number of accident causes is greater than a third preset number;
[0152] Based on the predicted probability and the set of traffic accident causes, the prediction results are obtained.
[0153] Based on the same technical concept, the embodiment of the present application also provides an electronic device, which can implement the dangerous individual prediction method process provided in the above embodiment of the present application. In one embodiment, the electronic device can be a server, or a terminal device or other electronic device. Figure 4 As shown, the electronic device may include:
[0154] At least one processor 401, and a memory 402 connected to the at least one processor 401. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 In the example, the processor 401 and the memory 402 are connected via the bus 400. The bus 400 is Figure 4 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 401 can also be called a controller, and there is no limitation on the name.
[0155] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute a dangerous individual prediction method discussed above by executing the instructions stored in the memory 302. The processor 401 can implement Figure 3 The functions of each module in the device shown.
[0156] Among them, the processor 401 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 402 and calling the data stored in the memory 402, the various functions of the device and process data, the device can be monitored as a whole.
[0157] In one possible design, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0158] Processor 401 can be a general-purpose processor, such as a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of a dangerous individual prediction method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or can be executed by a combination of hardware and software modules in the processor.
[0159] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. The memory 302 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 302 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, used to store program instructions and / or data.
[0160] By programming the processor 401, the code corresponding to the frequency offset estimation method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 1 The steps of a method for predicting dangerous individuals in the embodiment shown are as follows: How to design and program the processor 401 is a technique known to those skilled in the art and will not be described in detail here.
[0161] Based on the same inventive concept, an embodiment of the present application also provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes a dangerous individual prediction method discussed above.
[0162] In some possible embodiments, the present application also provides various aspects of a method for predicting dangerous individuals, which can also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a method for predicting dangerous individuals according to various exemplary embodiments of the present application described above in this specification.
[0163] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0164] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0165] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0166] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a server, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0167] Program code for performing the operations of the present application may be written using any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0169] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for predicting dangerous individuals, characterized in that: The method comprises: Based on the original traffic data, a target feature parameter set is constructed; wherein the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset, and a vehicle feature parameter subset; Inputting the target feature parameter set into a pre-trained target prediction model to obtain the prediction probability corresponding to each data sample; Sorting the predicted probabilities, selecting a second preset number threshold of risky individuals, and obtaining a risky individual data set; Based on the importance of the traffic accident cause corresponding to each dangerous individual, a set of traffic accident causes corresponding to each dangerous individual is determined; wherein the importance of each traffic accident cause in the set of traffic accident causes is greater than the average importance of the traffic accident causes; Based on each of the accident cause sets, determining each of the traffic accident cause sets whose number of accident causes is greater than a third preset number; Based on the predicted probability and the set of traffic accident causes, a prediction result is obtained, and the prediction result is used to indicate the category of the dangerous individual and the probability of an accident. The target prediction model is obtained based on a feature parameter training set.
2. The method according to claim 1, characterized in that The target feature parameter set is constructed based on the original traffic data, including: Get raw traffic data; Based on the original traffic data, the target objects are divided into safe individual samples and dangerous individual samples according to preset rules; wherein the target objects include target persons, target roads and target vehicles; The target feature parameter set is obtained based on the safe individual samples and the dangerous individual samples.
3. The method according to claim 2, characterized in that The step of obtaining the target feature parameter set based on the safe individual sample and the dangerous individual sample includes: Respectively obtaining a first number of the safe individual samples and a second number of the dangerous individual samples; If the ratio of the first quantity to the second quantity is greater than a preset ratio, determining whether the second quantity is greater than or equal to a first preset quantity threshold; If so, a random sampling method is used to sample the safe individual sample, and the target feature parameter set is obtained based on the dangerous individual sample; If not, the dangerous individual sample is sampled using the smote sampling method, and the target feature parameter set is obtained based on the safe individual sample.
4. The method according to claim 1, characterized in that The target prediction model is obtained by training in the following way: Dividing the target feature parameter set into a feature parameter training set and a feature parameter test set according to a preset ratio; A pre-constructed prediction model is trained based on the feature parameter training set, and the model parameters of the pre-constructed prediction model are adjusted using the Gridsearch grid optimization method to obtain the target prediction model; wherein, when the model parameters of the pre-constructed prediction model are adjusted, a confusion matrix is used to perform indicator evaluation on the prediction model, and the prediction model with the best evaluation is selected as the target prediction model.
5. A dangerous individual recommendation device, characterized in that: The device comprises: A processing module, used to construct a target feature parameter set based on the original traffic data; wherein the target feature parameter set includes a personnel feature parameter subset, a road feature parameter subset and a vehicle feature parameter subset; A prediction module is used to input the target feature parameter set into a pre-trained target prediction model to obtain the prediction probability corresponding to each data sample; Sorting the predicted probabilities, selecting a second preset number threshold of risky individuals, and obtaining a risky individual data set; Based on the importance of the traffic accident cause corresponding to each dangerous individual, a set of traffic accident causes corresponding to each dangerous individual is determined; wherein the importance of each traffic accident cause in the set of traffic accident causes is greater than the average importance of the traffic accident causes; Based on each of the accident cause sets, determining each of the traffic accident cause sets whose number of accident causes is greater than a third preset number; Based on the predicted probability and the set of traffic accident causes, a prediction result is obtained, and the prediction result is used to indicate the category of the dangerous individual and the probability of an accident. The target prediction model is obtained based on a feature parameter training set.
6. The device according to claim 5, characterized in that When constructing the target feature parameter set based on the original traffic data, the processing module is specifically used for: Get raw traffic data; The raw traffic data is divided into safe data samples and dangerous data samples according to preset rules and data attributes; wherein the data attributes are used to characterize the data category of the raw traffic data; The target feature parameter set is obtained based on the safety data sample and the danger data sample.
7. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Prediction model construction method, vehicle accident prediction method and device
CN113096405A