Traffic accident prediction model training method, traffic accident prediction method and device

By constructing a training model to predict traffic accidents on road segments, and by building a training sample set and an accident-free feature set, and by using a weighted calculation and adjustment method, the problem of predicting traffic accident risks on road segments was solved, achieving more accurate prediction and alert functions, and reducing the occurrence of traffic accidents.

CN117636627BActive Publication Date: 2026-06-23WESTERN CHINA SCI CITY INNOVATION CENT OF INTELLIGENT & CONNECTED VEHICLES (CHONGQING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WESTERN CHINA SCI CITY INNOVATION CENT OF INTELLIGENT & CONNECTED VEHICLES (CHONGQING) CO LTD
Filing Date
2023-11-21
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies are insufficient to predict the overall traffic accident risk of road sections, resulting in serious traffic safety problems and a lack of effective prediction methods to reduce the occurrence of accidents.

Method used

By acquiring historical traffic datasets, including traffic accident data and traffic safety data without accidents, a training sample set and a no-accident feature set are constructed. The model is trained using a weighted calculation and weight adjustment method. Multiple traffic features of each traffic accident are weighted and calculated until the model converges, predicting the traffic safety situation of the road segment.

Benefits of technology

It enables accurate prediction of traffic safety conditions on road sections, reduces the occurrence of traffic accidents, improves traffic safety, and helps prevent accidents in a timely manner through alert information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117636627B_ABST
    Figure CN117636627B_ABST
Patent Text Reader

Abstract

The application discloses a traffic accident prediction model training method, a traffic accident prediction method and device. The method comprises: obtaining a first historical traffic data set and a second historical traffic data set; extracting a plurality of traffic features of each traffic accident from the first historical traffic data set to form a training sample set, and extracting a plurality of traffic features of traffic safety data from the second historical traffic data set to form an accident-free feature set; in the process of training the prediction model based on the training sample set, the plurality of traffic features of each traffic accident are weighted and calculated to obtain a prediction result of each traffic accident; when it is determined based on the prediction result and a true value that the model does not meet a convergence condition, the weight value of the weighted calculation is adjusted by calculating the difference between the plurality of traffic features of each traffic accident and the corresponding traffic features in the accident-free feature set, until the prediction model required finally is obtained when it is determined based on the prediction result of the plurality of traffic accidents and the true value that the model meets the convergence condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traffic technology, and more specifically, to a training method for a traffic accident prediction model, a traffic accident prediction method, and an apparatus. Background Technology

[0002] With the increasing number of vehicles and the growing complexity of road conditions, traffic safety issues are becoming increasingly serious. Currently, the main approach to reducing traffic accidents is to optimize assisted driving and autonomous driving algorithms. For example, vehicles can perceive their surroundings and, when obstacles or large vehicles are detected, prompt them to slow down or change lanes to avoid them. However, this method primarily focuses on the driving conditions of the vehicle and its neighbors, lacking overall prediction for a road segment. Therefore, how to predict the traffic accident risk of a road segment and further reduce traffic accidents remains a pressing technical problem that needs to be solved. Summary of the Invention

[0003] This application provides a training method for a traffic accident prediction model, a traffic accident prediction method and device, which can predict the traffic accident risk of a road segment, thereby further reducing the occurrence of traffic accidents.

[0004] The specific technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a method for training a traffic accident prediction model, the method comprising:

[0006] Acquire a first historical traffic dataset and a second historical traffic dataset, wherein the first historical traffic dataset includes traffic accident data within a first historical time period, and the second historical traffic dataset includes traffic safety data within a second historical time period and / or a third historical time period. The second historical time period and the third historical time period are both earlier than the first historical time period. The second historical time period and the first historical time period are contemporaneous, and the third historical time period and the first historical time period are cyclical. The traffic safety data is data in which no traffic accidents have occurred.

[0007] Multiple traffic features of each traffic accident are extracted from the first historical traffic dataset to form a training sample set. Multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset are extracted from the second historical traffic dataset to form an accident-free feature set.

[0008] In the process of training the traffic accident prediction model based on the training sample set, multiple traffic features of each traffic accident are weighted and calculated to obtain the prediction result of each traffic accident.

[0009] When it is determined that the current traffic accident prediction model does not meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents, the weight values ​​of the weighted calculation are adjusted by calculating the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and the model training continues until it is determined that the current traffic accident prediction model meets the convergence condition based on the prediction results and ground truth values ​​of multiple traffic accidents, and the final required traffic accident prediction model is obtained.

[0010] In one possible implementation, the plurality of traffic features includes at least two of the following: road segment related features, accident type related features, number of lanes and traffic flow features, weather features, trajectory features of accident-related vehicles, driver related features, and driving style features.

[0011] In one possible implementation, when the training sample set also includes accident level labels, a weighted calculation is performed on multiple traffic features for each traffic accident to obtain a prediction result for each traffic accident, including:

[0012] For different accident levels, different weighting methods are used to calculate the weighted average of multiple traffic features of the traffic accident corresponding to the accident level, thereby obtaining the prediction result of the traffic accident.

[0013] In one possible implementation, model training continues by calculating the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and adjusting the weighted values ​​of the weighted calculation. This includes:

[0014] Calculate the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set;

[0015] Increase the weight of traffic features with relatively large differences and decrease the weight of traffic features with relatively small differences.

[0016] Based on the adjusted weight values, the current traffic accident prediction model is further trained.

[0017] Secondly, embodiments of this application provide a traffic accident prediction method, the method comprising:

[0018] Acquire near real-time traffic data, wherein the near real-time traffic data includes historical traffic data within a preset time period before the current time, traffic data at the current time, and predicted traffic data within the preset time period after the current time;

[0019] Extract multiple traffic features from the near real-time traffic data;

[0020] Multiple traffic features of the near real-time traffic data are input into a traffic accident prediction model, and a traffic accident prediction result is output. The traffic accident prediction model is trained according to the method described in any of the implementation methods in the first aspect.

[0021] In one possible implementation, the traffic accident prediction result includes a prediction of whether a traffic accident will occur within a second future time period and / or a predicted risk level of the accident.

[0022] When the traffic accident prediction result indicates the existence of a traffic accident risk, a traffic accident prediction reminder message is output to the user, wherein the traffic accident prediction reminder message is used to indicate the impending traffic accident and / or the risk level.

[0023] Thirdly, embodiments of this application provide a training device for a traffic accident prediction model, the device comprising:

[0024] The acquisition unit is used to acquire a first historical traffic dataset and a second historical traffic dataset. The first historical traffic dataset includes traffic accident data within a first historical time period, and the second historical traffic dataset includes traffic safety data within a second historical time period and / or a third historical time period. The second historical time period and the third historical time period are both earlier than the first historical time period. The second historical time period and the first historical time period are contemporaneous, and the third historical time period and the first historical time period are cyclical. The traffic safety data is data in which no traffic accidents have occurred.

[0025] The extraction unit is used to extract multiple traffic features of each traffic accident from the first historical traffic dataset to form a training sample set, and to extract multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset from the second historical traffic dataset to form an accident-free feature set.

[0026] The weighting unit is used to perform weighted calculations on multiple traffic features of each traffic accident during the training of the traffic accident prediction model based on the training sample set, so as to obtain the prediction result of each traffic accident.

[0027] An adjustment unit is used to adjust the weight values ​​of the weighted calculation when the current traffic accident prediction model does not meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set. The model training continues until the current traffic accident prediction model meets the convergence condition based on the prediction results and ground truth values ​​of multiple traffic accidents, and the final required traffic accident prediction model is obtained.

[0028] In one possible implementation, the plurality of traffic features includes at least two of the following: road segment related features, accident type related features, number of lanes and traffic flow features, weather features, trajectory features of accident-related vehicles, driver related features, and driving style features.

[0029] In one possible implementation, the weighting unit is used to, when the training sample set also includes accident level labels, employ different weighting units for different accident levels to perform weighted calculations on multiple traffic features of the traffic accident corresponding to the accident level, thereby obtaining the prediction result of the traffic accident.

[0030] In one possible implementation, the adjustment unit is used to calculate the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set; increase the weight values ​​of traffic features with relatively large differences and decrease the weight values ​​of traffic features with relatively small differences; and continue to train the current traffic accident prediction model based on the adjusted weight values.

[0031] Fourthly, embodiments of this application provide a traffic accident prediction device, the device comprising:

[0032] The acquisition unit is used to acquire near real-time traffic data, wherein the near real-time traffic data includes historical traffic data within a preset time period before the current time, traffic data at the current time, and predicted traffic data within the preset time period after the current time.

[0033] The extraction unit is used to extract multiple traffic features from the near real-time traffic data;

[0034] The prediction unit is used to input multiple traffic features of the near real-time traffic data into a traffic accident prediction model and output a traffic accident prediction result, wherein the traffic accident prediction model is trained according to the method described in any embodiment of the first aspect.

[0035] In one possible implementation, the traffic accident prediction result includes a prediction of whether a traffic accident will occur within a second future time period and / or a predicted risk level of the accident.

[0036] The device further includes:

[0037] The output unit is used to output traffic accident prediction reminder information to the user when the traffic accident prediction result indicates that there is a risk of traffic accident. The traffic accident prediction reminder information is used to indicate the impending traffic accident and / or the risk level.

[0038] Fifthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any possible implementation of the first aspect or any possible implementation of the second aspect.

[0039] Sixthly, embodiments of this application provide an electronic device, which includes:

[0040] One or more processors;

[0041] The processor is coupled to a storage device for storing one or more programs;

[0042] When one or more programs are executed by one or more processors, the electronic device performs the method as described in any possible implementation of the first aspect or any possible implementation of the second aspect.

[0043] In a seventh aspect, embodiments of this application provide a computer program product containing instructions that, when executed on a computer or processor, cause the computer or processor to perform the method described in any possible implementation of the first aspect.

[0044] The traffic accident prediction model training method, traffic accident prediction method, and apparatus provided in this application embodiment can first acquire a first historical traffic dataset including traffic accident data within a first historical time period, and a second historical traffic dataset including data with cyclical and / or concurrent relationships with the first historical traffic dataset. Then, multiple traffic features for each traffic accident are extracted from the first historical traffic dataset to form a training sample set. Multiple traffic features corresponding to traffic safety data for each traffic accident in the first historical traffic dataset are extracted from the second historical traffic dataset to form an accident-free feature set. During the training of the traffic accident prediction model based on the training sample set, weighted calculations are performed on the multiple traffic features for each traffic accident to obtain the prediction result for each traffic accident. If convergence is not achieved, the weights are adjusted by calculating the differences between the multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and the model training continues until a converged traffic accident prediction model is obtained. Therefore, this application embodiment can not only train the model based on a first historical traffic dataset containing traffic accident data, but also adjust the weights required for the model based on a second historical traffic dataset containing traffic safety data, thereby accelerating model convergence and obtaining a more accurate traffic accident prediction model. Compared to obstacle avoidance achieved solely through perception and decision-making, the traffic accident prediction model trained on historical traffic data in this application can predict the traffic safety situation of a road segment, further reducing the occurrence of traffic accidents.

[0045] The innovative aspects of this application's embodiments include at least the following:

[0046] (1) The embodiments of this application can not only train the model based on a first historical traffic dataset containing traffic accident data, but also adjust the weights required for the model based on a second historical traffic dataset containing traffic safety data, thereby accelerating the convergence of the model and obtaining a traffic accident prediction model with higher accuracy. Compared with obstacle avoidance achieved solely through perception and decision-making, the traffic accident prediction model trained on historical traffic data in the embodiments of this application can predict the traffic safety situation of a road segment, further reducing the occurrence of traffic accidents.

[0047] (2) By using different weighting groups for traffic accident data of different accident levels, more granular calculations can be achieved, thereby improving the accuracy of the prediction results for each level of accident.

[0048] (3) After calculating the differences between the multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the no-accident feature set, the weight values ​​of the traffic features with relatively large differences can be increased, and the weight values ​​of the traffic features with relatively small differences can be decreased, so that the predicted value is closer to the true value, thereby accelerating the convergence speed of the traffic accident prediction model.

[0049] (4) When the traffic accident prediction results indicate that there is a risk of traffic accident, by outputting traffic accident prediction reminder information to users, drivers can take timely evasive measures to further avoid traffic accidents and improve traffic safety. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0051] Figure 1 A flowchart illustrating a training method for a traffic accident prediction model provided in an embodiment of this application;

[0052] Figure 2 A flowchart illustrating a training method for a traffic accident prediction model provided in an embodiment of this application;

[0053] Figure 3 A flowchart illustrating a traffic accident prediction method provided in an embodiment of this application;

[0054] Figure 4 A block diagram illustrating the composition of a training device for a traffic accident prediction model provided in this application embodiment;

[0055] Figure 5 This is a block diagram of a traffic accident prediction device provided in an embodiment of this application. Detailed Implementation

[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0057] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The terms "comprising" and "having," and any variations thereof, in the embodiments and drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0058] Combination Figure 1 and Figure 2 This application provides a training method for a traffic accident prediction model. This method can be applied to electronic devices or computer equipment, specifically to a terminal or server. The terminal can be a vehicle or a roadside device. Specifically, the method may include the following steps:

[0059] S110: Obtain the first historical traffic dataset and the second historical traffic dataset.

[0060] The first historical traffic dataset includes traffic accident data within the first historical time period, and the second historical traffic dataset includes traffic safety data within the second historical time period and / or the third historical time period. Both the second and third historical time periods are earlier than the first historical time period. The second historical time period and the first historical time period are contemporaneous, while the third historical time period and the first historical time period are cyclical. The traffic safety data consists of data for which no traffic accidents have occurred.

[0061] For example, if the first historical traffic dataset includes traffic accident data from the most recent three months (e.g., June to August 2023), then the traffic safety data for the second historical period includes traffic safety data from June to August 2022, and the traffic safety data for the third historical period includes traffic safety data from March to May 2023.

[0062] After obtaining the first historical traffic dataset, it can be divided to obtain traffic data within a first time period (e.g., 5 minutes) before and after each historical accident (hereinafter referred to as the historical accident traffic data segment). Then, each historical accident traffic data segment is sliced ​​according to a preset time interval. For example, the sliced ​​data includes historical accident traffic data 5 seconds before, 5 seconds during, and 5 seconds after the historical accident. Then, the second historical traffic dataset is matched with the first historical traffic dataset and also sliced ​​according to a preset time interval. For example, the data from 0 to 5 seconds in the first historical traffic dataset corresponds to the data from 0 to 5 seconds in the second historical traffic dataset.

[0063] S120: Extract multiple traffic features for each traffic accident from the first historical traffic dataset to form a training sample set. Extract multiple traffic features for traffic safety data corresponding to each traffic accident in the first historical traffic dataset from the second historical traffic dataset to form an accident-free feature set.

[0064] Multiple traffic features include at least two of the following: road segment-related features, accident type-related features, number of lanes and traffic flow features, weather features, trajectory features of accident-related vehicles, driver-related features, and driving style features.

[0065] Road segment-related features include road information such as length, width, curvature, and gradient; accident type-related features include accident type, time of occurrence, and location. Accident types can include straight-ahead accidents, rear-end collisions, overtaking accidents (caused by a fast vehicle colliding with an oncoming vehicle while passing a slower vehicle, or colliding with a pedestrian or cyclist suddenly crossing the road), left-turn accidents, right-turn accidents, narrow-road accidents, curve accidents, and slope accidents. Accident levels can also be included, such as minor accidents, general accidents, major accidents, and catastrophic accidents. The time of occurrence includes, in addition to the specific time, other relevant information. It can also be categorized by time, such as whether it is peak time; lane number and traffic flow characteristics include lane number, traffic volume, average vehicle speed, etc.; trajectory characteristics of accident-related vehicles include the speed, acceleration, and steering angle of the vehicle involved in the accident and vehicles within a preset range around it; driver-related characteristics include the driver's age, gender, driving experience, driver's license type, driving behavior, and driving style, etc. Driving behavior includes whether the driver is speeding, running red lights, or driving while fatigued, etc., and driving style includes the degree of impatience and stability, etc.; driving mode characteristics include autonomous driving, assisted driving, and manual driving, etc.

[0066] S130: In the process of training the traffic accident prediction model based on the training sample set, multiple traffic features of each traffic accident are weighted and calculated to obtain the prediction result of each traffic accident.

[0067] After obtaining the training sample set, it can be input into the initial traffic accident prediction model. This initial model encodes or one-hot encodes each feature in the training sample set, enabling it to recognize the meaning of each feature. The initial model initializes weights for each traffic feature; for example, all traffic features have the same weight during initialization. After encoding each traffic feature, a score can be assigned to each feature based on machine learning. Then, for each traffic accident, the initial weights are used to perform a weighted calculation on the various traffic features to obtain a weighted result for each accident. The prediction result for each traffic accident is determined based on the weighted result. The strategy for assigning scores is as follows: during model initialization, all traffic features are assigned the same score. During model training, the scores of each traffic feature can remain unchanged, only the weights of each feature can be adjusted, or the score can be assigned according to the content of the traffic feature. For example, the less a traffic feature meets safety requirements, the higher the score is assigned, and vice versa. The prediction result includes a prediction conclusion of whether a traffic accident will occur and the risk level, determined based on the weighted result. This application embodiment can divide the full score into multiple score segments, with different score segments corresponding to different risk levels. After obtaining the weighted result, the risk level can be determined based on the score segment to which the weighted result belongs. For example, when the weighted result is greater than or equal to a preset score threshold, the prediction result includes the occurrence of a traffic accident, and the higher the weighted result, the higher the risk level. When the weighted result is less than the preset score threshold, the prediction result includes the occurrence of no traffic accident. For example, if the preset score threshold is 50 points, a score below 50 points will not result in a traffic accident. The risk level of [50, 60] is low risk, the risk level of [60-80] is medium risk, and the risk level of [70-100] is high risk.

[0068] In one implementation, when the training sample set also includes accident level labels, different weighting methods are used for different accident levels to perform weighted calculations on multiple traffic features of traffic accidents corresponding to those levels, thereby obtaining the traffic accident prediction results. In other words, the weight values ​​for the weighted calculation can differ depending on the accident level, enabling finer-grained calculations and improving the accuracy of the accident prediction results for each level.

[0069] S140: When it is determined that the current traffic accident prediction model does not meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents, the weight values ​​of the weighted calculation are adjusted by calculating the differences between the multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the no-accident feature set, and the model training continues until it is determined that the current traffic accident prediction model meets the convergence condition based on the prediction results and ground truth values ​​of multiple traffic accidents, and the final required traffic accident prediction model is obtained.

[0070] The true values ​​include the actual conclusion of whether a traffic accident will occur and / or the actual risk level, which can be manually labeled in advance. After obtaining the prediction result and corresponding true value for each traffic accident, the difference between the prediction result and the true value for each traffic accident can be calculated separately. Based on the differences of all traffic accidents, it can be determined whether the current traffic accident prediction model meets the convergence condition. For example, if the mean of all differences is greater than or equal to a preset loss threshold, it is determined that the convergence condition is not met; if the mean of all differences is less than the preset loss threshold, it is determined that the convergence condition is met.

[0071] When the current traffic accident prediction model fails to meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents, the model can be trained again by calculating the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and then adjusting the weighted values. Specifically, the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set can be calculated first. Then, the weight values ​​of traffic features with relatively large differences can be increased, and the weight values ​​of traffic features with relatively small differences can be decreased. Finally, the current traffic accident prediction model can be trained again based on the adjusted weight values. The adjustment range depends on the magnitude of the differences; the larger the difference, the larger the adjustment range, and vice versa. For example, the weighted formula before adjustment was: Road segment related features * 10% + Accident type related features * 5% + Lane number and traffic flow features * 15% + Weather features * 5% + Trajectory features of accident-related vehicles * 40% + Driver related features * 15% + Driving style * 10%. Since the difference in trajectory features of accident-related vehicles was the greatest, and the difference in driver related features was the smallest, the trajectory features of accident-related vehicles could be increased, and the difference in driver related features, which had the smallest difference, could be decreased. The adjusted weighted formula is: Road segment related features * 10% + Accident type related features * 5% + Lane number and traffic flow features * 15% + Weather features * 5% + Trajectory features of accident-related vehicles * 43% + Driver related features * 12% + Driving style * 10%.

[0072] The training method for the traffic accident prediction model provided in this application first acquires a first historical traffic dataset including traffic accident data within a first historical time period, and a second historical traffic dataset including data with cyclical and / or concurrent relationships to the first historical traffic dataset. Then, it extracts multiple traffic features for each traffic accident from the first historical traffic dataset to form a training sample set. It also extracts multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset from the second historical traffic dataset to form a no-accident feature set. During the training of the traffic accident prediction model based on the training sample set, it performs weighted calculations on the multiple traffic features for each traffic accident to obtain the prediction result for each traffic accident. If convergence fails, it adjusts the weighted calculation weights by calculating the differences between the multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the no-accident feature set, and continues model training until a converged traffic accident prediction model is obtained. Therefore, this application embodiment can not only train the model based on a first historical traffic dataset containing traffic accident data, but also adjust the required weights based on a second historical traffic dataset containing traffic safety data, thereby accelerating model convergence and obtaining a more accurate traffic accident prediction model. Compared to obstacle avoidance achieved solely through perception and decision-making, the traffic accident prediction model trained on historical traffic data in this application can predict the traffic safety situation of a road segment, further reducing the occurrence of traffic accidents.

[0073] Based on the above method embodiments, another embodiment of this application provides a traffic accident prediction method, such as... Figure 3 As shown, the method includes:

[0074] S210: Obtain near real-time traffic data.

[0075] The near real-time traffic data includes historical traffic data within a preset time period before the current moment, traffic data at the current moment, and predicted traffic data within a preset time period after the current moment. The preset time period can be the length of a preset time interval, such as 5 seconds.

[0076] To reduce the computational load on vehicles, this application embodiment can acquire only near real-time traffic data for accident-prone road sections. Accident-prone road sections can be acquired through cloud control platforms, traffic management centers, or manual reporting.

[0077] S220: Extract multiple traffic features from near real-time traffic data.

[0078] Multiple traffic features include at least two of the following: road segment-related features, accident type-related features, number of lanes and traffic flow features, weather features, trajectory features of accident-related vehicles, driver-related features, and driving style features.

[0079] S230: Input multiple traffic features from near real-time traffic data into the traffic accident prediction model and output the traffic accident prediction results.

[0080] The traffic accident prediction model is trained according to any embodiment of the training method described above. After inputting multiple traffic features from near-real-time traffic data into the traffic accident prediction model, the model first encodes or one-hot encodes these traffic features, then performs a weighted calculation on the encoded traffic features to obtain a weighted result. When the weighted result is greater than or equal to a preset score threshold, a traffic accident is determined, and the risk level is determined based on the score range to which the weighted result belongs.

[0081] When different accident levels are calculated using different weighting systems, the weighting system corresponding to the risk level with the smallest average difference between the various traffic features in real-time traffic data and the traffic features corresponding to various risk levels can be selected as the weighting system used for near-real-time traffic data. The traffic features corresponding to various risk levels include those in the training sample set.

[0082] When different accident levels are calculated using different weighting methods, different weighting methods can be used for weighted calculations, and the score with the highest weighted result can be selected as the final weighted result.

[0083] The traffic accident prediction method provided in this application first acquires near-real-time traffic data, then extracts multiple traffic features from the near-real-time traffic data, and finally inputs these multiple traffic features into a traffic accident prediction model trained on historical traffic data to obtain traffic accident prediction results. Compared with obstacle avoidance achieved solely through perception and decision-making, the traffic accident prediction model trained on historical traffic data in this application can predict the traffic safety situation of a road segment, further reducing the occurrence of traffic accidents.

[0084] In one implementation, to avoid traffic accidents, when the traffic accident prediction result includes a prediction of whether a traffic accident will occur within a preset time period and / or the risk level of the predicted accident, and the traffic accident prediction result indicates the existence of a traffic accident risk, a traffic accident prediction reminder message is output to the user, wherein the traffic accident prediction reminder message is used to indicate that a traffic accident is about to occur and / or the risk level.

[0085] Traffic accident prediction and alert information can be output in various ways, including but not limited to voice prompts, text, or a combination of both. It can be output on the central control screen or on a mobile terminal linked to the vehicle.

[0086] In addition, suggestions for avoidance measures, such as slowing down or changing the driving route, can be provided to further prevent traffic accidents and improve traffic safety.

[0087] It should be added that the above method has the following characteristics:

[0088] (1) Real-time performance: This method can predict the probability of traffic accidents on accident-prone road sections based on real-time calculations using big data. By timely collecting, analyzing and processing traffic data, it can monitor the traffic conditions of road sections in real time, quickly determine whether there is an accident risk, and issue early warnings.

[0089] (2) Accuracy: By using big data analytics technology, combined with historical traffic data and real-time traffic information, the probability of traffic accidents on accident-prone road sections can be accurately predicted. This prediction can be based on a large number of data samples and model training, thereby improving accuracy, reducing the occurrence of accidents, and ensuring traffic safety.

[0090] (3) Early warning function: When the system detects that there is a risk of traffic accidents on certain road sections, it can issue an early warning signal in advance to inform the driver or relevant departments to pay attention to the traffic situation on the road section so that corresponding measures can be taken, such as adjusting the driving route and slowing down, thereby reducing the risk of accidents.

[0091] (4) Efficiency: Utilizing real-time big data computing technology, this method can quickly analyze traffic data and process it according to a preset algorithm. Compared with traditional manual monitoring and prediction methods, it greatly shortens the prediction and response time and improves the efficiency of traffic management.

[0092] (5) Scalability: This method is based on big data and real-time computing technology and has good scalability. With the accumulation of traffic data and the continuous development of technology, it can learn more sample data, further improve and optimize the prediction model, and improve the performance and accuracy of the system.

[0093] (6) Model reusability: The trained traffic accident prediction model can be reused on accident-prone road sections. Data from each accident-prone road end can be collected to learn common features and improve the traffic accident prediction model. Moreover, the model can be provided to roadside equipment for reuse.

[0094] Based on the above method embodiments, another embodiment of this application also provides a training device for a traffic accident prediction model, such as... Figure 4 As shown, the device includes:

[0095] The acquisition unit 310 is used to acquire a first historical traffic dataset and a second historical traffic dataset. The first historical traffic dataset includes traffic accident data within a first historical time period, and the second historical traffic dataset includes traffic safety data within a second historical time period and / or a third historical time period. The second historical time period and the third historical time period are both earlier than the first historical time period. The second historical time period and the first historical time period are contemporaneous, and the third historical time period and the first historical time period are cyclical. The traffic safety data is data for which no traffic accidents have occurred.

[0096] Extraction unit 320 is used to extract multiple traffic features of each traffic accident from the first historical traffic dataset to form a training sample set, and to extract multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset from the second historical traffic dataset to form an accident-free feature set.

[0097] The weighting unit 330 is used to perform weighted calculations on multiple traffic features of each traffic accident during the process of training the traffic accident prediction model based on the training sample set, so as to obtain the prediction result of each traffic accident.

[0098] The adjustment unit 340 is used to adjust the weight values ​​of the weighted calculation when it is determined that the current traffic accident prediction model does not meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and continue to train the model until it is determined that the current traffic accident prediction model meets the convergence condition based on the prediction results and ground truth values ​​of multiple traffic accidents, and finally obtain the desired traffic accident prediction model.

[0099] In one possible implementation, the plurality of traffic features includes at least two of the following: road segment related features, accident type related features, number of lanes and traffic flow features, weather features, trajectory features of accident-related vehicles, driver related features, and driving style features.

[0100] In one possible implementation, the weighting unit 330 is used to, when the training sample set also includes accident level labels, use different weighting sets for different accident levels to perform weighted calculations on multiple traffic features of traffic accidents corresponding to the accident level, and obtain the prediction results of traffic accidents.

[0101] In one possible implementation, the adjustment unit 340 is used to calculate the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set; increase the weight values ​​of traffic features with relatively large differences and decrease the weight values ​​of traffic features with relatively small differences; and continue to train the current traffic accident prediction model based on the adjusted weight values.

[0102] The training apparatus for the traffic accident prediction model provided in this application embodiment can first acquire a first historical traffic dataset including traffic accident data within a first historical time period, and a second historical traffic dataset including data with cyclical and / or concurrent relationships to the first historical traffic dataset. Then, it extracts multiple traffic features for each traffic accident from the first historical traffic dataset to form a training sample set. It also extracts multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset from the second historical traffic dataset to form an accident-free feature set. During the training of the traffic accident prediction model based on the training sample set, it performs weighted calculations on the multiple traffic features for each traffic accident to obtain the prediction result for each traffic accident. If convergence fails, it adjusts the weighted calculation weights by calculating the differences between the multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and continues model training until a converged traffic accident prediction model is obtained. Therefore, this application embodiment can not only train the model based on a first historical traffic dataset containing traffic accident data, but also adjust the weights required for the model based on a second historical traffic dataset containing traffic safety data, thereby accelerating model convergence and obtaining a more accurate traffic accident prediction model. Compared to obstacle avoidance achieved solely through perception and decision-making, the traffic accident prediction model trained on historical traffic data in this application can predict the traffic safety situation of a road segment, further reducing the occurrence of traffic accidents.

[0103] Based on the above method embodiments, another embodiment of this application also provides a traffic accident prediction device, such as... Figure 5 As shown, the device includes:

[0104] The acquisition unit 410 is used to acquire near real-time traffic data, wherein the near real-time traffic data includes historical traffic data within a preset time period before the current time, traffic data at the current time, and predicted traffic data within the preset time period after the current time.

[0105] Extraction unit 420 is used to extract multiple traffic features from the near real-time traffic data;

[0106] The prediction unit 430 is used to input multiple traffic features of the near real-time traffic data into the traffic accident prediction model and output the traffic accident prediction result, wherein the traffic accident prediction model is trained according to the training method of the traffic accident prediction model described in any of the above embodiments.

[0107] In one possible implementation, the traffic accident prediction result includes a prediction of whether a traffic accident will occur within a second future time period and / or a predicted risk level of the accident.

[0108] The device further includes:

[0109] The output unit is used to output traffic accident prediction reminder information to the user when the traffic accident prediction result indicates that there is a risk of traffic accident. The traffic accident prediction reminder information is used to indicate the impending traffic accident and / or the risk level.

[0110] The traffic accident prediction device provided in this application first acquires near-real-time traffic data, then extracts multiple traffic features from the near-real-time traffic data, and finally inputs these multiple traffic features into a traffic accident prediction model trained based on historical traffic data to obtain traffic accident prediction results. Compared with obstacle avoidance achieved solely through perception and decision-making, the traffic accident prediction model trained on historical traffic data in this application can predict the traffic safety situation of a road segment, further reducing the occurrence of traffic accidents.

[0111] Based on the above method embodiments, another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the above embodiments.

[0112] Based on the above method embodiments, another embodiment of this application provides an electronic device or computer device, including:

[0113] One or more processors;

[0114] The processor is coupled to a storage device for storing one or more programs;

[0115] When the one or more programs are executed by the one or more processors, the electronic device or computer device performs the method as described in any of the above embodiments.

[0116] Based on the above method embodiments, another embodiment of this application provides a vehicle that includes the device as described in any of the above embodiments, or includes the electronic device as described above.

[0117] Based on the above embodiments, another embodiment of this application provides a computer program product, which includes instructions that, when executed on a computer or processor, cause the computer or processor to perform the method described in any of the above embodiments.

[0118] The above-described apparatus embodiments correspond to the method embodiments and have the same technical effects. For detailed descriptions, please refer to the method embodiments. The apparatus embodiments are derived from the method embodiments; detailed descriptions can be found in the method embodiments section, and will not be repeated here. Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application.

[0119] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A training method for a traffic accident prediction model, characterized in that, The method includes: Acquire a first historical traffic dataset and a second historical traffic dataset, wherein the first historical traffic dataset includes traffic accident data within a first historical time period, and the second historical traffic dataset includes traffic safety data within a second historical time period and / or a third historical time period. The second historical time period and the third historical time period are both earlier than the first historical time period. The second historical time period and the first historical time period are contemporaneous, and the third historical time period and the first historical time period are cyclical. The traffic safety data is data in which no traffic accidents have occurred. Multiple traffic features of each traffic accident are extracted from the first historical traffic dataset to form a training sample set. Multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset are extracted from the second historical traffic dataset to form an accident-free feature set. In the process of training the traffic accident prediction model based on the training sample set, multiple traffic features of each traffic accident are weighted and calculated to obtain the prediction result of each traffic accident. When it is determined that the current traffic accident prediction model does not meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents, the weight values ​​of the weighted calculation are adjusted by calculating the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, and the model training continues until it is determined that the current traffic accident prediction model meets the convergence condition based on the prediction results and ground truth values ​​of multiple traffic accidents, and the final required traffic accident prediction model is obtained. The model training continues by calculating the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set, adjusting the weighted values ​​of the weighted calculation, including: Calculate the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set; Increase the weight of traffic features with relatively large differences and decrease the weight of traffic features with relatively small differences. Based on the adjusted weight values, the current traffic accident prediction model is further trained.

2. The method according to claim 1, characterized in that, The multiple traffic features include at least two of the following: road segment related features, accident type related features, number of lanes and traffic flow features, weather features, trajectory features of accident-related vehicles, driver related features, and driving style features.

3. The method according to claim 1, characterized in that, When the training sample set also includes accident level labels, a weighted calculation is performed on multiple traffic features for each traffic accident to obtain the prediction result for each traffic accident, including: For different accident levels, different weighting methods are used to calculate the weighted average of multiple traffic features of the traffic accident corresponding to the accident level, thereby obtaining the prediction result of the traffic accident.

4. A method for predicting traffic accidents, characterized in that, The method includes: Acquire near real-time traffic data, wherein the near real-time traffic data includes historical traffic data within a first time period before the current time, traffic data at the current time, and predicted traffic data within the first time period after the current time; Extract multiple traffic features from the near real-time traffic data; Multiple traffic features of the near real-time traffic data are input into a traffic accident prediction model, and a traffic accident prediction result is output. The traffic accident prediction model is trained by the method according to any one of claims 1-3.

5. The method according to claim 4, characterized in that, The traffic accident prediction results include a prediction of whether a traffic accident will occur within a second time period and / or the risk level of the predicted accident. When the traffic accident prediction result indicates the existence of a traffic accident risk, a traffic accident prediction reminder message is output to the user, wherein the traffic accident prediction reminder message is used to indicate the impending traffic accident and / or the risk level.

6. A training device for a traffic accident prediction model, characterized in that, The device includes: The acquisition unit is used to acquire a first historical traffic dataset and a second historical traffic dataset. The first historical traffic dataset includes traffic accident data within a first historical time period, and the second historical traffic dataset includes traffic safety data within a second historical time period and / or a third historical time period. The second historical time period and the third historical time period are both earlier than the first historical time period. The second historical time period and the first historical time period are contemporaneous, and the third historical time period and the first historical time period are cyclical. The traffic safety data is data in which no traffic accidents have occurred. The extraction unit is used to extract multiple traffic features of each traffic accident from the first historical traffic dataset to form a training sample set, and to extract multiple traffic features of traffic safety data corresponding to each traffic accident in the first historical traffic dataset from the second historical traffic dataset to form an accident-free feature set. The weighting unit is used to perform weighted calculations on multiple traffic features of each traffic accident during the training of the traffic accident prediction model based on the training sample set, so as to obtain the prediction result of each traffic accident. An adjustment unit is used to adjust the weight values ​​of the weighted calculation when it is determined that the current traffic accident prediction model does not meet the convergence condition based on the prediction results and corresponding ground truth values ​​of multiple traffic accidents in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set. The model training continues until it is determined that the current traffic accident prediction model meets the convergence condition based on the prediction results and ground truth values ​​of multiple traffic accidents, and the final required traffic accident prediction model is obtained. The adjustment unit is used to calculate the differences between multiple traffic features of each traffic accident in the first historical traffic dataset and the corresponding traffic features in the accident-free feature set; increase the weight values ​​of traffic features with relatively large differences and decrease the weight values ​​of traffic features with relatively small differences; and continue to train the current traffic accident prediction model based on the adjusted weight values.

7. A traffic accident prediction device, characterized in that, The device includes: The acquisition unit is used to acquire near real-time traffic data, wherein the near real-time traffic data includes historical traffic data within a first time period before the current time, traffic data at the current time, and predicted traffic data within the first time period after the current time. The extraction unit is used to extract multiple traffic features from the near real-time traffic data; The prediction unit is used to input multiple traffic features of the near real-time traffic data into a traffic accident prediction model and output a traffic accident prediction result, wherein the traffic accident prediction model is trained by the method according to any one of claims 1-3.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-3, or the method as described in any one of claims 4-5.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; The processor is coupled to a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the electronic device causes the electronic device to implement the method as described in any one of claims 1-3, or to implement the method as described in any one of claims 4-5.