Driving safety level determination method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310841782.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-07-10
AI Technical Summary
[0003]有鉴于此,本申请的目的在于提出一种驾驶安全级别确定方法、装置、电子设备和存储介质,以解决传统机器学习模型对于驾驶安全级别识别效果较差的问题
[0030]从上面所述可以看出,本申请提供的驾驶安全级别确定方法、装置、电子设备和存储介质,所述方法包括:获取驾驶行为数据;将所述驾驶行为数据分别输入至经过训练的第一分类模型和第二分类模型,通过所述第一分类模型输出第一概率分布,以及通过所述第二分类模型输出第二概率分布,分别通过第一分类模型和第二分类模型提取驾驶行为数据的特征之间的不同关系,以得到驾驶安全级别对应的第一概率分布和第二概率分布,为后续的驾驶安全级别确定提供数据基础,所述第一概率分布和所述第二概率分布均用于表征所述驾驶行为数据对应各驾驶安全级别的概率。对所述第一概率分布和所述第二概率分布进行计算得到目标概率分布,并基于所述目标概率分布确定所述驾驶行为数据对应的目标概率,通过目标概率融合了两个分类模型的预测结果,降低了通过单一分类模型进行预测的过拟合风险,提升了驾驶安全级别预测的准确性,根据所述目标概率能够准确确定所述驾驶行为数据对应的驾驶安全级别。
Smart Images

Figure CN116842388B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of safe driving technology, and in particular to a method, apparatus, electronic device and storage medium for determining driving safety level. Background Technology
[0002] With the development of the automotive industry, more and more vehicles are entering households, making the identification of driving safety levels increasingly important. By identifying a driver's driving safety level, real-time feedback and suggestions can be provided to improve driving safety. Driving safety level identification can also be applied to intelligent transportation systems to help optimize road resource allocation and traffic management strategies. Currently, driving safety level identification mainly relies on traditional machine learning, but its recognition accuracy and generalization ability are challenged, making it unable to keep pace with the rapid iteration of intelligent vehicle products. Summary of the Invention
[0003] In view of this, the purpose of this application is to propose a method, device, electronic device and storage medium for determining driving safety level, so as to solve the problem that traditional machine learning models have poor performance in identifying driving safety level.
[0004] The first aspect of this application provides a method for determining driving safety levels, including:
[0005] Acquire driving behavior data;
[0006] The driving behavior data is input into a first classification model and a second classification model that have been trained respectively. The first classification model outputs a first probability distribution, and the second classification model outputs a second probability distribution. Both the first probability distribution and the second probability distribution are used to characterize the probability of the driving behavior data corresponding to each driving safety level.
[0007] A target probability distribution is determined based on the first probability distribution and the second probability distribution, and a target probability corresponding to the driving behavior data is determined based on the target probability distribution.
[0008] The driving safety level corresponding to the driving behavior data is determined based on the target probability.
[0009] Optionally, the training methods for the first classification model and the second classification model include:
[0010] Acquire multiple historical driving behavior data;
[0011] Based on the multiple driving behavior features contained in each historical driving behavior data, the historical driving behavior data is labeled to obtain the driving safety level corresponding to the historical driving behavior data;
[0012] Based on the driving safety level, a driving safety level label is determined according to preset rules;
[0013] A training set was constructed based on multiple historical driving behavior data and corresponding driving safety level labels;
[0014] Based on the training set, the first classification model and the second classification model are iteratively trained until the training cutoff condition is met.
[0015] Optionally, the first classification model and the second classification model are iteratively trained based on the training set until the training cutoff condition is met, including:
[0016] The first classification model is trained based on the training set, and training of the first classification model is stopped in response to minimizing the loss function corresponding to the first classification model; and,
[0017] The second classification model is trained based on the training set, and training of the second classification model stops upon reaching a preset number of iterations. Optionally, the first classification model is a TabNet model; the TabNet model sequentially includes an input layer, a first feature transformation layer, multiple neural network layers, and an output layer, wherein the number of nodes in the input layer is the same as the number of driving behavior features contained in the driving behavior data, the first feature transformation layer adopts a multi-head self-attention mechanism, and the number of nodes in the output layer is the same as the number of categories of driving safety levels.
[0018] Optionally, the plurality of neural network layers include a plurality of TabNet blocks, each of the TabNet blocks sequentially including a second feature transformation layer, a normalization layer, a sparsification layer, and a nonlinear activation function.
[0019] Optionally, determining a target probability distribution based on the first probability distribution and the second probability distribution, and determining a target probability corresponding to the driving behavior data based on the target probability distribution, includes:
[0020] The target probability distribution is obtained by weighted summation of the first probability distribution and the second probability distribution.
[0021] The maximum probability value in the target probability distribution is taken as the target probability. Optionally, before inputting the driving behavior data into the trained first classification model and second classification model respectively, the following steps are included:
[0022] The driving behavior data is then normalized.
[0023] A second aspect of this application also provides a driving safety level determination device, comprising:
[0024] The acquisition module is configured to acquire driving behavior data;
[0025] The prediction module is configured to input the driving behavior data into a trained first classification model and a second classification model, respectively, output a first probability distribution through the first classification model, and output a second probability distribution through the second classification model, wherein the first probability distribution and the second probability distribution are both used to characterize the probability of the driving behavior data corresponding to each driving safety level;
[0026] The first determining module is configured to determine a target probability distribution based on the first probability distribution and the second probability distribution, and to determine the target probability corresponding to the driving behavior data based on the target probability distribution.
[0027] The second determining module is configured to determine the driving safety level corresponding to the driving behavior data based on the target probability.
[0028] This application also provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor, when executing the computer program, implements the method as described in the first aspect.
[0029] This application also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as described in the first aspect.
[0030] As can be seen from the above, the driving safety level determination method, device, electronic device, and storage medium provided in this application include: acquiring driving behavior data; inputting the driving behavior data into a trained first classification model and a second classification model respectively; outputting a first probability distribution through the first classification model and a second probability distribution through the second classification model; extracting different relationships between features of the driving behavior data through the first and second classification models respectively to obtain a first probability distribution and a second probability distribution corresponding to the driving safety level, providing a data foundation for subsequent driving safety level determination; both the first and second probability distributions are used to characterize the probability of the driving behavior data corresponding to each driving safety level; calculating a target probability distribution from the first and second probability distributions; and determining the target probability corresponding to the driving behavior data based on the target probability distribution; by fusing the prediction results of the two classification models through the target probability, the overfitting risk of prediction using a single classification model is reduced, and the accuracy of driving safety level prediction is improved; the driving safety level corresponding to the driving behavior data can be accurately determined based on the target probability. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart illustrating the classification model training method according to an embodiment of this application;
[0033] Figure 2 This is a flowchart illustrating the method for determining driving safety levels according to an embodiment of this application.
[0034] Figure 3 This is a schematic diagram of the driving safety level determination device according to an embodiment of this application;
[0035] Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0037] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0038] As described in the background section, driver safety level identification is becoming increasingly important in the field of safe driving. By identifying a driver's safety level, real-time feedback and suggestions can be provided to improve driving safety. Furthermore, for traffic management departments, understanding a driver's safety level helps assess potential traffic risks and take appropriate measures to prevent traffic accidents. For example, for high-risk drivers, speed limits and traffic restrictions can be implemented to reduce the risk of traffic accidents. Driver safety level identification can also provide targeted recommendations for driver education and training. By assessing drivers' driving behavior, instructors can provide customized training plans to improve trainees' driving skills in specific areas. In addition, drivers can adjust their training plans according to their own safety level for better training results. Driver safety level identification can also be applied to intelligent transportation systems to help optimize road resource allocation and traffic management strategies. By monitoring drivers' driving behavior and safety levels in real time, intelligent transportation systems can better predict traffic flow and potential congestion points, thereby improving road utilization efficiency.
[0039] However, current technologies for identifying driving safety levels primarily rely on traditional machine learning. With the iterative updates of intelligent vehicle products, traditional machine learning suffers from poor generalization capabilities and cannot adequately adapt to diverse driving needs, resulting in poor identification of driving safety levels. Therefore, this application proposes a method for determining driving safety levels to address the aforementioned problems and improve the identification performance.
[0040] The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0041] This application identifies the driving safety level corresponding to driving behavior through a classification model. To accurately identify the driving safety level, the classification model first needs to be trained to learn the driving behavior features contained in the driving behavior data and then identify the corresponding driving safety level based on these features. This application uses two classification models to classify the acquired driving behavior data separately to avoid overfitting due to using a single classification model and to improve the accuracy of the classification of driving behavior data. The training of the classification model can be performed on a local server or in the cloud; this application does not impose any restrictions on this. The following specific embodiments illustrate the training method of the classification model in this application.
[0042] In some embodiments, the classification model includes a first classification model and a second classification model, and the training methods for the first classification model and the second classification model are described in reference to... Figure 1 This includes the following steps:
[0043] Step 102: Obtain multiple historical driving behavior data.
[0044] Historical driving behavior data can be obtained from online platforms related to vehicle driving information. These platforms statistically analyze each driver's driving behavior over a specific period to compile historical driving behavior data. For example, historical driving behavior data could be the driver's driving behavior data over the past six months. After obtaining the historical driving behavior data, it undergoes preprocessing. Preprocessing includes at least data cleaning and redundancy removal to eliminate outliers and duplicates. Subsequently, the historical driving behavior data is normalized to eliminate scale differences between different driving behavior characteristics.
[0045] Step 104: Based on the multiple driving behavior features contained in each historical driving behavior data, the historical driving behavior data is labeled to obtain the driving safety level corresponding to the historical driving behavior data.
[0046] Specifically, based on each historical driving behavior data point, multiple driving behavior characteristics are analyzed to determine which preset driving safety level it belongs to, and these characteristics are then labeled. Combining multiple driving behavior characteristics allows for the determination of the driving safety level according to preset rules. For instance, if several driving behavior characteristics exceed certain preset thresholds within a month, the driving safety level is determined to be "mildly dangerous." For example, if a driver's nighttime driving distance exceeds 50km, fatigue driving time exceeds 10 hours, and speeding occurs more than 5 times in a month, the corresponding driving safety level is determined to be "mildly dangerous." If all driving behavior characteristics are within the preset threshold range, the driving safety level is determined to be "highly safe." This process continues, allowing for the determination of the correspondence between different driving behavior characteristics and driving safety levels based on actual needs.
[0047] Step 106: Determine the driving safety level label according to preset rules based on the driving safety level.
[0048] For model training, driving safety levels need to be digitized to improve the speed and accuracy of training. Different driving safety level labels are assigned to different levels. For example, driving safety levels include five levels: highly safe, moderately safe, safe, slightly dangerous, and highly dangerous, with corresponding labels of 0, 1, 2, 3, and 4, respectively. The first and second probability distributions can take the form (0-0.2, 1-0.6, 2-0.4, 3-0.5, 4-0.7), representing a probability of 0.2 for highly safe, 0.6 for moderately safe, 0.4 for safe, 0.5 for slightly dangerous, and 0.7 for highly dangerous.
[0049] Step 108: Construct a training set based on multiple historical driving behavior data and corresponding driving safety level labels.
[0050] Multiple historical driving behavior data sets and their corresponding driving safety level labels are combined into a training set to train both the first and second classification models. The historical driving behavior data in the training set can be updated periodically to adapt to changes in driver behavior. Each historical driving behavior data set includes multiple driving behavior features, such as nighttime driving distance, travel time, fatigue driving duration, energy consumption per 100 kilometers, number of rapid accelerations per 100 kilometers, number of rapid decelerations per 100 kilometers, number of sharp turns per 100 kilometers, and number of speeding violations. Specifically, the greater the nighttime driving distance, the longer the fatigue driving duration, and the more frequent the rapid accelerations and decelerations per 100 kilometers, the worse the driving safety, and the corresponding driving safety level label is "dangerous driving."
[0051] Step 110: Iteratively train the first classification model and the second classification model based on the training set until the training cutoff condition is met.
[0052] Based on the constructed training set, the first and second classification models are iteratively trained separately. Appropriate training cutoff conditions can be selected according to actual training needs. For example, the training cutoff condition can be a preset number of iterations, minimizing the loss function, or the model's accuracy. Simultaneously, a portion of the data in the training set can be used as a validation set to validate the trained first and second classification models, evaluating their predictive ability. The evaluation metric can be the model's classification accuracy, and subsequent training strategies for the first and second classification models can be formulated based on the classification accuracy.
[0053] In some embodiments, the first classification model and the second classification model are iteratively trained based on the training set until the training cutoff condition is met, including:
[0054] The first classification model is trained based on the training set, and training of the first classification model is stopped in response to minimizing the loss function corresponding to the first classification model; and,
[0055] The second classification model is trained based on the training set, and training of the second classification model is stopped when a preset number of iterations is reached.
[0056] In this embodiment, different training cutoff conditions are selected when training the first classification model and the second classification model. For the first classification model, training stops when the loss function of the first classification model is minimized, where the loss function corresponding to the first classification model is the classification cross-entropy loss function. For the second classification model, training stops when the number of training iterations of the second classification model reaches a preset number, where the preset number of iterations can be 50. After training stops, the trained first and second classification models are obtained.
[0057] In some embodiments, the first classification model is a TabNet model; the TabNet model sequentially includes an input layer, a first feature transformation layer, multiple neural network layers, and an output layer, wherein the number of nodes in the input layer is the same as the number of driving behavior features contained in the driving behavior data, the first feature transformation layer adopts a multi-head self-attention mechanism, and the number of nodes in the output layer is the same as the number of categories of the driving safety level.
[0058] Specifically, the first classification model in this embodiment is the TabNet model. The TabNet model is a neural network based on a self-attention mechanism, capable of capturing complex relationships between features. Compared to traditional machine learning methods, it can better learn non-linear relationships between features, improving the model's representational ability. The TabNet model can directly learn useful representations from the original features without tedious feature engineering. This makes deep learning-based methods more efficient when processing complex data. The TabNet model structure includes an input layer, a first feature transformation layer, multiple neural network layers, and an output layer arranged sequentially. The number of nodes in the input layer is the same as the number of driving behavior features contained in the driving behavior data; for example, if there are 8 driving behavior features, then the input layer has 8 nodes. The first feature transformation layer uses a multi-head self-attention mechanism to transform the input driving behavior features. Multiple attention heads can be set in the first feature transformation layer to capture different relationships between features; for example, 4 attention heads can be set. The number of nodes in the output layer is the same as the number of categories of driving safety levels; for example, if there are 5 types of driving safety levels, then the output layer has 5 nodes. Finally, the output of the first classification model is converted into a probability distribution using the Softmax activation function to obtain the first probability distribution. In this embodiment, the classification cross-entropy loss function is selected to calculate the error between the prediction result of the TabNet model and the label. The parameters of the model are adjusted by minimizing the classification cross-entropy loss function to obtain the trained TabNet model. In addition, the model with the best performance on the validation set during training can be selected as the final TabNet model. In this embodiment, the model is optimized by flexibly adjusting parameters such as the network structure, number of self-attention heads, and number of layers of the TabNet model, making the deep learning-based method more adaptable to different datasets and problem scenarios, and improving the model's generalization performance.
[0059] In some embodiments, the plurality of neural network layers include a plurality of TabNet blocks, each TabNet block sequentially comprising a second feature transformation layer, a normalization layer, a sparsity layer, and a nonlinear activation function. The second feature transformation layer is used to output new features after applying certain rules or mappings to the input features. The normalization layer is used to ensure that the input distribution of each layer remains consistent during training, avoiding gradient vanishing and exploding. The sparsity layer can effectively suppress model overfitting. The nonlinear activation function can convert linear inputs into nonlinear ones, enhancing the network's representational power. After the outputs of each TabNet block are summed, they are mapped to the final output of the TabNet model through a fully connected layer. In this embodiment, five TabNet blocks are stacked to form a deep network structure to improve the model's prediction accuracy.
[0060] In some embodiments, the second classification model is a LightGBM model. LightGBM is an ensemble learning method based on gradient boosting decision trees, which improves model performance by combining multiple weak learners. Compared with single traditional machine learning models, ensemble learning methods typically have higher performance and stronger generalization ability. Before training the LightGBM model, its parameters need to be initialized, including the learning rate, the number of trees, and the depth of the trees. The training cutoff condition for the LightGBM model can be a preset number of iterations; that is, when the LightGBM model has been trained for the preset number of iterations, training stops, and the trained LightGBM model is obtained.
[0061] After outputting the first and second partial probabilities from the TabNet and LightGBM models respectively, the first and second probabilities are weighted and summed, effectively fusing the outputs of the two models. The optimal weight coefficients for the weighted summation can be found by trying different combinations. In this embodiment, the weight coefficients for the TabNet and LightGBM models are selected as 0.75 and 0.25, respectively. By fusing the TabNet and LightGBM models, the advantages of each model in data processing can be fully utilized. The TabNet model can capture non-linear relationships, while the LightGBM model can learn linear combinations between features. Model fusion helps improve the prediction accuracy of the final driving safety level and reduces the risk of overfitting by a single classification model.
[0062] After the above iterative training, the trained first and second classification models are obtained, which can be used to predict the driving safety level corresponding to driving behavior data. The following specific examples illustrate the specific process of the first and second classification models predicting driving safety levels. The first and second classification models can be deployed on a local server or in the cloud. When it is necessary to predict the driving safety level of driving behavior data, the pre-deployed first and second classification models can be retrieved.
[0063] This application provides a method for determining driving safety levels, with reference to... Figure 2 This includes the following steps:
[0064] Step 202: Obtain driving behavior data.
[0065] Driving behavior data is data related to driving safety. It can include multiple driving behavior characteristics, such as nighttime driving distance, travel time, fatigue driving frequency, fuel consumption per 100 kilometers, number of rapid accelerations per 100 kilometers, number of rapid decelerations per 100 kilometers, number of sharp turns per 100 kilometers, and number of speeding violations. By analyzing multiple driving behavior characteristics, a driver's driving safety level can be determined, such as whether it is considered safe driving or dangerous driving. Driving behavior data can be obtained from online platforms related to vehicle driving information. These platforms statistically analyze each driver's driving behavior over a period of time to compile driving behavior data. Alternatively, it can be obtained from user-inputted driving behavior data with predictive requirements.
[0066] Step 204: Input the driving behavior data into the trained first classification model and second classification model respectively, output a first probability distribution through the first classification model, and output a second probability distribution through the second classification model, wherein the first probability distribution and the second probability distribution are both used to characterize the probability of the driving behavior data corresponding to each driving safety level.
[0067] The first and second classification models are different deep learning models that can capture different relationships between driving behavior features in driving behavior data. For example, the first classification model can capture non-linear relationships between driving behavior features, while the second classification model can capture linear relationships. Both the first and second probability distributions are used to characterize the probability of driving behavior data corresponding to each driving safety level. For example, if there are five categories of driving safety levels, then both the first and second probability distributions will each include five probability values, each corresponding to one of the five categories of driving safety levels.
[0068] Step 206: Determine the target probability distribution based on the first probability distribution and the second probability distribution, and determine the target probability corresponding to the driving behavior data based on the target probability distribution.
[0069] Because the first and second classification models are used to capture different relationships between driving behavior features, the first and second probability distributions output by these models differ. Based on the first and second probability distributions, and combined with predetermined weighting coefficients, a target probability distribution can be obtained. This target probability distribution characterizes the probability of the driving behavior data corresponding to each driving safety level. Since the target probability distribution integrates the first and second probability distributions, it overcomes the overfitting problem that easily occurs with single classification models; therefore, the target probability distribution has higher accuracy than both the first and second probability distributions. After determining the target probability distribution, a target probability is selected from it; the target probability is the maximum probability value in the target probability distribution.
[0070] Step 208: Determine the driving safety level corresponding to the driving behavior data based on the target probability.
[0071] Once the target probability is determined, the final driving safety level can be determined by the correspondence between the target probability and the driving safety level. For example, the driving safety level can include five levels: highly safe, moderately safe, safe, slightly dangerous, and highly dangerous, each corresponding to a different indicator. For instance, the indicators for highly safe, moderately safe, safe, slightly dangerous, and highly dangerous are 0, 1, 2, 3, and 4, respectively. If the indicator for the target probability is 1, it indicates that the driving safety level is moderately safe.
[0072] Based on steps 202 to 208 above, this embodiment provides a method for determining driving safety levels. The method includes: acquiring driving behavior data; inputting the driving behavior data into a trained first classification model and a second classification model respectively; outputting a first probability distribution through the first classification model and a second probability distribution through the second classification model; extracting different relationships between features of the driving behavior data through the first and second classification models respectively to obtain a first probability distribution and a second probability distribution corresponding to the driving safety level, providing a data foundation for subsequent determination of driving safety levels. Both the first and second probability distributions are used to characterize the probability of the driving behavior data corresponding to each driving safety level. A target probability distribution is calculated from the first and second probability distributions, and a target probability corresponding to the driving behavior data is determined based on the target probability distribution. By fusing the prediction results of the two classification models through the target probability, the overfitting risk of prediction using a single classification model is reduced, and the accuracy of driving safety level prediction is improved. The driving safety level corresponding to the driving behavior data can be accurately determined based on the target probability.
[0073] In some embodiments, determining a target probability distribution based on the first probability distribution and the second probability distribution, and determining a target probability corresponding to the driving behavior data based on the target probability distribution, includes:
[0074] The target probability distribution is obtained by weighted summation of the first probability distribution and the second probability distribution.
[0075] The maximum probability value in the target probability distribution is taken as the target probability.
[0076] Specifically, by pre-setting weighting coefficients, the proportions of the first and second probability distributions can be adjusted. The target probability corresponding to the driving behavior data is determined by weighted summation of the first and second probability distributions. For example, the weighting coefficient for the first probability distribution can be 0.75, and the weighting coefficient for the second probability distribution can be 0.25. After weighted summation, the target probability distribution is obtained, and the maximum probability value in the target probability distribution is the target probability. The target probability integrates the prediction results of the first and second classification models, effectively reducing the risk of overfitting by a single model and improving the accuracy of predicting driving safety levels.
[0077] In some embodiments, before inputting the driving behavior data into the trained first classification model and second classification model, respectively, the following steps are included:
[0078] The driving behavior data is normalized. Historical driving behavior data is normalized to eliminate scale differences between different driving behavior features. Before normalization, data cleaning and redundancy removal operations can be performed on the driving behavior data to remove outlier and duplicate data, thereby improving the model's prediction accuracy.
[0079] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0080] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] This application also provides a driving safety level determination device.
[0082] refer to Figure 3 The driving safety level determination device includes:
[0083] Module 302 is configured to acquire driving behavior data;
[0084] The prediction module 304 is configured to input the driving behavior data into a trained first classification model and a second classification model respectively, output a first probability distribution through the first classification model, and output a second probability distribution through the second classification model. Both the first probability distribution and the second probability distribution are used to characterize the probability of the driving behavior data corresponding to each driving safety level.
[0085] The first determining module 306 is configured to determine a target probability distribution based on the first probability distribution and the second probability distribution, and to determine the target probability corresponding to the driving behavior data based on the target probability distribution.
[0086] The second determining module 308 is configured to determine the driving safety level corresponding to the driving behavior data based on the target probability.
[0087] In some embodiments, a training module is also included, the training module being configured to,
[0088] Acquire multiple historical driving behavior data;
[0089] Based on the multiple driving behavior features contained in each historical driving behavior data, the historical driving behavior data is labeled to obtain the driving safety level corresponding to the historical driving behavior data;
[0090] Based on the driving safety level, a driving safety level label is determined according to preset rules;
[0091] A training set was constructed based on multiple historical driving behavior data and corresponding driving safety level labels;
[0092] Based on the training set, the first classification model and the second classification model are iteratively trained until the training cutoff condition is met.
[0093] In some embodiments, the training module is further configured to train the first classification model based on the training set, and to stop training the first classification model in response to minimization of the loss function corresponding to the first classification model; and,
[0094] The second classification model is trained based on the training set, and training of the second classification model is stopped when a preset number of iterations is reached.
[0095] In some embodiments, the first classification model is a TabNet model; the TabNet model sequentially includes an input layer, a first feature transformation layer, multiple neural network layers, and an output layer, wherein the number of nodes in the input layer is the same as the number of driving behavior features contained in the driving behavior data, the first feature transformation layer adopts a multi-head self-attention mechanism, and the number of nodes in the output layer is the same as the number of categories of the driving safety level.
[0096] In some embodiments, the plurality of neural network layers include a plurality of TabNet blocks, each of the TabNet blocks sequentially including a second feature transformation layer, a normalization layer, a sparsification layer and a nonlinear activation function.
[0097] In some embodiments, the first determining module 306 is further configured to perform a weighted summation of the first probability distribution and the second probability distribution to obtain the target probability distribution;
[0098] The maximum probability value in the target probability distribution is taken as the target probability.
[0099] In some embodiments, before inputting the driving behavior data into the trained first classification model and second classification model respectively, a preprocessing module is further included, the preprocessing module being configured to normalize the driving behavior data.
[0100] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0101] The apparatus described above is used to implement the corresponding driving safety level determination method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0102] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the driving safety level determination method described in any of the above embodiments.
[0103] Figure 4 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0104] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0105] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0106] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0107] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0108] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0109] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0110] The electronic devices described above are used to implement the corresponding driving safety level determination method in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0111] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the driving safety level determination method as described in any of the above embodiments.
[0112] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0113] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the driving safety level determination method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0114] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0115] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0116] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0117] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for determining driving safety levels, characterized in that, include: Acquire driving behavior data; The driving behavior data is input into a trained first classification model and a second classification model, respectively. The first classification model outputs a first probability distribution, and the second classification model outputs a second probability distribution. Both the first and second probability distributions are used to characterize the probability of the driving behavior data corresponding to each driving safety level. The first classification model is used to capture the nonlinear relationship between driving behavior features in the driving behavior data, and the second classification model is used to capture the linear relationship between driving behavior features in the driving behavior data. A target probability distribution is determined based on the first probability distribution and the second probability distribution, and a target probability corresponding to the driving behavior data is determined based on the target probability distribution. The driving safety level corresponding to the driving behavior data is determined based on the target probability. The first classification model is a TabNet model; the TabNet model sequentially includes an input layer, a first feature transformation layer, multiple neural network layers, and an output layer; the multiple neural network layers include multiple TabNet blocks, and the output of each TabNet block, after being summed, is mapped to the final output of the TabNet model through a fully connected layer; the number of nodes in the input layer is the same as the number of driving behavior features contained in the driving behavior data, the first feature transformation layer adopts a multi-head self-attention mechanism, and the number of nodes in the output layer is the same as the number of categories of driving safety level; each TabNet block sequentially includes a second feature transformation layer, a normalization layer, a sparsity layer, and a nonlinear activation function.
2. The method according to claim 1, characterized in that, The training methods for the first classification model and the second classification model include: Acquire multiple historical driving behavior data; Based on the multiple driving behavior features contained in each historical driving behavior data, the historical driving behavior data is labeled to obtain the driving safety level corresponding to the historical driving behavior data; Based on the driving safety level, a driving safety level label is determined according to preset rules; A training set was constructed based on multiple historical driving behavior data and corresponding driving safety level labels; Based on the training set, the first classification model and the second classification model are iteratively trained until the training cutoff condition is met.
3. The method according to claim 2, characterized in that, Based on the training set, the first classification model and the second classification model are iteratively trained until the training cutoff condition is met, including: The first classification model is trained based on the training set, and training of the first classification model is stopped in response to minimizing the loss function corresponding to the first classification model; and, The second classification model is trained based on the training set, and training of the second classification model is stopped when a preset number of iterations is reached.
4. The method according to claim 1, characterized in that, Determining a target probability distribution based on the first probability distribution and the second probability distribution, and determining a target probability corresponding to the driving behavior data based on the target probability distribution, includes: The target probability distribution is obtained by weighted summation of the first probability distribution and the second probability distribution. The maximum probability value in the target probability distribution is taken as the target probability.
5. The method according to claim 1, characterized in that, Before inputting the driving behavior data into the trained first classification model and second classification model respectively, the process includes: The driving behavior data is then normalized.
6. A driving safety level determination device, characterized in that, include: The acquisition module is configured to acquire driving behavior data; The prediction module is configured to input the driving behavior data into a trained first classification model and a second classification model, respectively, output a first probability distribution through the first classification model, and output a second probability distribution through the second classification model. Both the first and second probability distributions are used to characterize the probability of the driving behavior data corresponding to each driving safety level. The first classification model is used to capture the nonlinear relationship between driving behavior features in the driving behavior data, and the second classification model is used to capture the linear relationship between driving behavior features in the driving behavior data. The first determining module is configured to determine a target probability distribution based on the first probability distribution and the second probability distribution, and to determine the target probability corresponding to the driving behavior data based on the target probability distribution. The second determining module is configured to determine the driving safety level corresponding to the driving behavior data based on the target probability. The first classification model is a TabNet model; the TabNet model sequentially includes an input layer, a first feature transformation layer, multiple neural network layers, and an output layer; the multiple neural network layers include multiple TabNet blocks, and the output of each TabNet block, after being summed, is mapped to the final output of the TabNet model through a fully connected layer; the number of nodes in the input layer is the same as the number of driving behavior features contained in the driving behavior data, the first feature transformation layer adopts a multi-head self-attention mechanism, and the number of nodes in the output layer is the same as the number of categories of driving safety level; each TabNet block sequentially includes a second feature transformation layer, a normalization layer, a sparsity layer, and a nonlinear activation function.
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 program, it implements the method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-sensor data fusion-based driving behavior identification method and system
CN108108766A
Method and device for determining safety prediction model, equipment and storage medium
CN112183899A
Machine learning attention model featuring omnidirectional processing
CN114548423A