Driving behavior data analysis method based on end-cloud cooperation
Through the driving behavior data analysis method based on end-cloud collaboration, the improved Faster-RCNN model and decision tree model are used to solve the problems of unpredictable safety problems and inaccurate scoring in the existing technology, and achieve higher driving The accuracy and safety of employee behavior assessments reduce the risk of accidents.
Patent Information
- Application Number
- CN202411314933.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-03
AI Technical Summary
The existing driving behavior analysis methods cannot predict potential safety problems during driving, and the scoring algorithm is not accurate enough, resulting in insufficient accuracy and reliability of the scoring results, and the inability to effectively identify potential safety hazards, affecting driver improvements.
Using the driving behavior data analysis method based on end-cloud collaboration, the driving behavior image data set and vehicle data set are constructed, and the image recognition is used using the improved Faster-RCNN model, and driving safety scores are scored in combination with the decision tree model, and the API interface is used to Data is transferred to the cloud for processing and corresponding reports are generated.
It realizes a more reliable assessment of driver behavior, improves the accuracy and safety of accident risk identification, provides a more reliable driving experience, reduces accident risks, and ensures road safety.
Smart Images

Figure CN119249289A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of vehicle driving analysis, and in particular relates to a method for analyzing driving behavior data based on end-cloud collaboration. Background Art
[0002] With the increase in global automobile production, private cars have become more and more popular, which has also caused frequent traffic accidents. Improving road safety has become a top priority. The development of intelligent safe driving detection system as a driver's safety steward monitors the driver's behavior, collects data for storage and analysis, displays important indicators in real time, and predicts and warns of potential dangers, which can effectively reduce traffic accidents caused by driver negligence or bad driving habits.
[0003] Most current driving behavior analysis methods analyze the driver's driving habits after an accident occurs, and cannot predict whether safety problems will arise during driving. Existing technologies for driving behavior analysis either focus on real-time detection of drivers' dangerous driving behaviors and real-time prompts, or focus on real-time analysis of vehicle operation data. In fact, drivers' driving behaviors are characterized by coupling, randomness, and complexity. The demand for driving assistance systems that help drivers reduce fatigue driving, get rid of bad driving habits, and develop correct and safe driving behaviors is becoming increasingly apparent. Summary of the invention
[0004] The purpose of the invention is to address the pain points of current big data processing and analysis, as well as the problem that the existing system may have inaccurate scoring algorithms, which cannot fully evaluate the driver's behavior, resulting in insufficient accuracy and reliability of the scoring results. Inaccurate scoring may not effectively identify potential safety hazards and affect the driver's improvement.
[0005] Technical solution, in order to solve the above technical problems and achieve the purpose of the present invention, the present invention proposes a method for analyzing driving behavior data based on end-cloud collaboration, the method comprising the following steps:
[0006] Step 1) constructing a driving behavior image dataset and a vehicle dataset;
[0007] Step 2) performing image recognition on the driving behavior image dataset based on the improved Faster-RCNN model and obtaining behavior data;
[0008] Step 3) The collected vehicle data and generated behavior data are transmitted to the backend server or cloud based on the API interface provided by the platform;
[0009] Step 4) Construct a driving behavior scoring dataset, use a decision tree model combined with the data to score driving safety, generate a corresponding report based on the scoring strategy, and feedback to platform users through an event trigger mechanism.
[0010] Furthermore, in step 1), a driving behavior image dataset is constructed, and the driving behavior data is classified into a training set, a validation set, and a test set, and the training set is labeled, and speed, acceleration, and steering angular velocity data are obtained to construct a vehicle dataset, wherein the steering angular velocity data is calculated as follows:
[0011] The angular velocity is measured based on the inertial measurement unit (IMU), and the steering angle is obtained by integrating the angular velocity.
[0012]
[0013] In formula (1), ω is the angular velocity, t1 is the start time of the measurement, t2 is the end time of the measurement, and θ is the steering angle within the measurement time period t2-t1.
[0014] Further, the specific method of step 2) is as follows:
[0015] Step 2.1) Use MobileNetv3-SMALL as the neural network of the Faster-RCNN algorithm to extract features from the input driver behavior image through deep separable convolution;
[0016] The driver behavior image (RGB type) is input and processed through deep convolution to generate three-channel results. The three-channel results are processed through cross-channel convolution through point-by-point convolution. The overall process is as follows:
[0017] (D Kernel ×D Kernel )×(M×D Filter ×D Filter )+N×(M×D Filter ×D Filter )
[0018] D Kernel : The length and width of the convolution kernel of the depth convolution;
[0019] D Filter : The length and width of the convolution kernel of point-by-point convolution;
[0020] D Kernel ×D Kernel ×1: The kernel size of the depthwise convolution is set to 32*32*1;
[0021] M: the number of depth convolution kernels, set to 3;
[0022] D Filter ×D Filter ×M: The convolution kernel size of point-by-point convolution is set to 1*1*3;
[0023] N: The number of point-wise convolution kernels, set to 4.
[0024] The final output contains a feature map that fuses features from different channels.
[0025] Step 2.2) After obtaining the feature image generated by the neural network, slide a window on the feature image through RPN, and cover the targets of different sizes through anchor boxes. At the same time, predict multiple different candidate boxes for different positions of the target. The candidate boxes include bounding boxes and confidence levels to determine whether there are targets in the boxes. Finally, multiple candidate boxes containing target objects are obtained;
[0026] Step 2.3) After obtaining the candidate box, the feature region pooling ROIPooling module obtains a set of candidate regions from the RPN. The ROIPooling module maps each feature region to the feature map; processes different feature regions to make them uniform in size. ROIPooling calculates the area covered by the feature region on the feature map and divides its area into a fixed number of sub-regions. After pooling, multiple different feature regions are finally converted into a fixed-size feature map.
[0027] Step 2.4) The feature map generated by the feature region pooling operation will be used as input to filter the feature map through the non-maximum suppression algorithm (NMS). Compared with the NMS in the traditional Faster-RCNN algorithm, which directly deletes the rest and only retains the maximum confidence candidate box, this patent uses soft-NMS for processing in the confidence adjustment module, using a linear attenuation function to retain the bounding box for iteration. This has a certain degree of effect in suppressing overlapping boxes, thereby improving the accuracy of target detection.
[0028] Soft-NMS first calculates the intersection-over-union ratio for the two candidate boxes (hypotheses) generated in the feature map, and their coordinate positions are:
[0029] A=[x a1 ,y a1 ,x a2 ,y a2 ]
[0030] B=[x b1 ,y b1 ,x b2 ,y b2 ]
[0031] (x a1 ,y a1 ): The vertex coordinates of the upper left corner of the first candidate box;
[0032] (x a2 ,y a2 ): The vertex coordinates of the lower right corner of the first candidate box;
[0033] (x b1 ,y b1 ): The vertex coordinates of the upper left corner of the second candidate box;
[0034] (x b2 ,y b2 ): The vertex coordinates of the lower right corner of the second candidate box.
[0035] The coordinates of the upper left corner of the intersection are:
[0036] x1=max(x a1 ,x b1 ),y1=max(y a1 ,y b1 )
[0037] The coordinates of the lower right corner of the intersection are:
[0038] x1=min(x a2 ,x b2 ),y1=min(y a1 ,y b1 )
[0039] Calculate the area of the intersection:
[0040] overlapping=max(x2-x1+1.0,0)·max(y2-y1+1.0,0)
[0041] Calculate the area of the combined part:
[0042] SA=(xa2-xa1+1.0)·(ya2-ya1+1.0)
[0043] SB=(xb2-xb1+1.0)·(yb2-yb1+1.0)
[0044] union=SA+SB-overlapping
[0045] Calculate the intersection-over-union ratio:
[0046]
[0047] After calculating the intersection-over-union ratio, the confidence is adjusted using a linear decay function:
[0048]
[0049] Where, df i represents the score of each detection box; IoU represents intersection over union; H represents the detection box with the highest score; S represents one of the remaining detection boxes; Pt represents the preset threshold;
[0050] According to the adjusted confidence score, the confidence of the candidate box is updated. The candidate boxes with confidence higher than a certain threshold are filtered as the final detection results. Finally, the above process is repeated to select the next candidate box with the highest confidence, and the confidence of the remaining boxes is adjusted and filtered until all candidate boxes are processed and the only candidate box remains, which is output as the driver behavior recognition result.
[0051] Step 2.5) Collect the driver behavior recognition results and generate a behavior dataset.
[0052] Further, the specific method of step 3) is as follows:
[0053] Register the virtual device with Huawei Cloud to obtain the key and ID; configure the Python SDK on the device side, call the file transfer port API, establish a connection between the device and the cloud platform through the MQTT protocol, and call and use the check_file_uodate function at the same time. If the JSON file has been updated, record the new modification time. If the file has not been updated, record the message waiting for the file to be updated and make the thread sleep for 5 seconds. Finally, the data in the behavior dataset and vehicle dataset will be uploaded to the cloud in real time for data processing.
[0054] The specific method of step 4) is as follows:
[0055] Step 4.1) Combine the vehicle data set and the behavior data set to construct a driving behavior score data set, including 4000 rows of samples, each row has 4 feature driving behavior image data, speed, acceleration and angle, and 1 label including driving behavior score. The data set is divided into a training set and a validation set with a ratio of 7:3.
[0056] Step 4.2) Create an improved decision tree joint scoring algorithm based on vehicle data and driving behavior, and use the training data set divided in step 4.1 as the algorithm input for training. The specific training steps are as follows:
[0057] In the input space where the driving behavior score dataset is located, each area is recursively divided into two sub-areas Q1 and Q2, and the output value on each sub-area is determined to construct a binary decision tree:
[0058] (1) Select a feature k as the optimal segmentation feature from the four features including driving behavior image data, speed, acceleration and turning angle, and select the value corresponding to the feature from the sample as a segmentation point t.
[0059]
[0060] Traverse the optimal segmentation feature k, scan the segmentation point t for the fixed segmentation feature, and select the segmentation variable [k, t] that minimizes the above formula;
[0061] in;
[0062] N1 is the number of samples in sub-region Q1
[0063] N2 is the number of samples in sub-region Q2
[0064] x i is the sample in the sub-region Q1 to which the optimal segmentation point t of the optimal segmentation feature k belongs;
[0065] z i The driving behavior score corresponding to the sample in the sub-region Q1 to which the optimal segmentation point under the optimal segmentation feature belongs;
[0066] (2) Use the selected pair (k, t) to divide the region and determine the corresponding output value
[0067]
[0068] Where m = 1, 2;
[0069] N m For sub-region Q m The number of samples in
[0070] Q1(k,t)={x|x (k) ≤t}
[0071] Q2(k,t)={x|x (k) >t}
[0072] x (k) is the value corresponding to the optimal segmentation feature k;
[0073] (3) Continue to call steps (1) and (2) for the two sub-regions until the stop condition is met;
[0074] (4) Divide the input space into M regions Q1, Q2, …, Q M , generate a decision tree:
[0075]
[0076] Where I is the indicator function,
[0077] Rm represents one of the divided regions.
[0078] Step 4.3) The improved decision tree joint scoring algorithm based on vehicle data and driving behavior created in step 4.2 is evaluated on the test data set to adjust the hyperparameters to obtain the best performing algorithm on the test data set. The evaluation index is the determination coefficient R 2 ;
[0079]
[0080] in:
[0081] represents the residual sum of squares, z i is the actual driving behavior score, is the score predicted by the model;
[0082] represents the total sum of squares, is the mean of the driving behavior scores.
[0083] Step 4.4) The algorithm with the best performance evaluated on the test data set in step 4.3 is used to evaluate the real-time vehicle data and driving behavior, and generate a corresponding score or report.
[0084] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0085] The technical solution proposed by the present invention evaluates vehicle data and driving behavior data, makes corresponding adjustments to potential risks, and provides users with a more reliable driving experience. In addition, the technical solution of the present invention has high recognition accuracy, increased safety, more comprehensive reduction of accident risks, and road safety, and is scalable. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0087] like Figure 1 As shown, the present invention proposes a method for analyzing driving behavior data based on end-cloud collaboration, which includes the following steps:
[0088] Step 1) constructing a driving behavior image dataset and a vehicle dataset;
[0089] Step 2) performing image recognition on the driving behavior image dataset based on the improved Faster-RCNN model and obtaining behavior data;
[0090] Step 3) The collected vehicle data and generated behavior data are transmitted to the backend server or cloud based on the API interface provided by the platform;
[0091] Step 4) Construct a driving behavior scoring dataset, use a decision tree model combined with the data to score driving safety, generate a corresponding report based on the scoring strategy, and feedback to platform users through an event trigger mechanism.
[0092] Furthermore, in step 1), a driving behavior image dataset is constructed, and the driving behavior data is classified into a training set, a validation set, and a test set, and the training set is labeled, and speed, acceleration, and steering angular velocity data are obtained to construct a vehicle dataset, wherein the steering angular velocity data is calculated as follows:
[0093] The angular velocity is measured based on the inertial measurement unit (IMU), and the steering angle is obtained by integrating the angular velocity.
[0094]
[0095] In formula (1), ω is the angular velocity, t1 is the start time of the measurement, t2 is the end time of the measurement, and θ is the steering angle within the measurement time period t2-t1.
[0096] Further, the specific method of step 2) is as follows:
[0097] Step 2.1) Use MobileNetv3-SMALL as the neural network of the Faster-RCNN algorithm to extract features from the input driver behavior image through deep separable convolution;
[0098] The driver behavior image (RGB type) is input and processed through deep convolution to generate three-channel results. The three-channel results are processed through cross-channel convolution through point-by-point convolution. The overall process is as follows:
[0099] (D Kernel ×D Kernel )×(M×D Filter ×D Filter )+N×(M×D Filter ×D Filter )
[0100] D Kernel : The length and width of the convolution kernel of the depth convolution;
[0101] D Filter : The length and width of the convolution kernel of point-by-point convolution;
[0102] D Kernel ×D Kernel ×1: The kernel size of the depthwise convolution is set to 32*32*1;
[0103] M: the number of depth convolution kernels, set to 3;
[0104] DFilter ×D Filter ×M: The convolution kernel size of point-by-point convolution is set to 1*1*3;
[0105] N: The number of point-wise convolution kernels, set to 4.
[0106] The final output contains a feature map that fuses features from different channels.
[0107] Step 2.2) After obtaining the feature image generated by the neural network, slide a window on the feature image through RPN, and cover the targets of different sizes through anchor boxes. At the same time, predict multiple different candidate boxes for different positions of the target. The candidate boxes include bounding boxes and confidence levels to determine whether there are targets in the boxes. Finally, multiple candidate boxes containing target objects are obtained;
[0108] Step 2.3) After obtaining the candidate box, the feature region pooling ROIPooling module obtains a set of candidate regions from the RPN. The ROIPooling module maps each feature region to the feature map; processes different feature regions to make them uniform in size. ROIPooling calculates the area covered by the feature region on the feature map and divides its area into a fixed number of sub-regions. After pooling, multiple different feature regions are finally converted into a fixed-size feature map.
[0109] Step 2.4) The feature map generated by the feature region pooling operation will be used as input for screening through NMS. Compared with the NMS in the traditional Faster-RCNN algorithm, which directly deletes the rest and only retains the maximum confidence candidate box, this patent uses soft-NMS for processing in the confidence adjustment module, using a linear attenuation function to retain the bounding box for iteration. This has a certain degree of effect in suppressing overlapping boxes, thereby improving the accuracy of target detection.
[0110] Soft-NMS first calculates the intersection-over-union ratio for the two candidate boxes (hypotheses) generated in the feature map, and their coordinate positions are:
[0111] A=[x a1 ,y a1 ,x a2 ,y a2 ]
[0112] B=[x b1 ,y b1 ,x b2 ,y b2 ]
[0113] (x a1 ,y a1 ): The vertex coordinates of the upper left corner of the first candidate box;
[0114] (x a2 ,y a2 ): The vertex coordinates of the lower right corner of the first candidate box;
[0115] (x b1 ,y b1 ): The vertex coordinates of the upper left corner of the second candidate box;
[0116] (x b2 ,y b2 ): The vertex coordinates of the lower right corner of the second candidate box.
[0117] The coordinates of the upper left corner of the intersection are:
[0118] x1=max(x a1 ,x b1 ),y1=max(y a1 ,y b1 )
[0119] The coordinates of the lower right corner of the intersection are:
[0120] x1=min(x a2 ,x b2 ),y1=min(y a1 ,y b1 )
[0121] Calculate the area of the intersection:
[0122] overlapping=max(x2-x1+1.0,0)·max(y2-y1+1.0,0)
[0123] Calculate the area of the combined part:
[0124] SA=(xa2-xa1+1.0)·(ya2-ya1+1.0)
[0125] SB=(xb2-xb1+1.0)·(yb2-yb1+1.0)
[0126] union=SA+SB-overlapping
[0127] Calculate the intersection-over-union ratio:
[0128]
[0129] After calculating the intersection-over-union ratio, the confidence is adjusted using a linear decay function:
[0130]
[0131] Where, df irepresents the score of each detection box; IoU represents intersection over union; H represents the detection box with the highest score; S represents one of the remaining detection boxes; Pt represents the preset threshold;
[0132] According to the adjusted confidence score, the confidence of the candidate box is updated. The candidate boxes with confidence higher than a certain threshold are filtered as the final detection results. Finally, the above process is repeated to select the next candidate box with the highest confidence, and the confidence of the remaining boxes is adjusted and filtered until all candidate boxes are processed and the only candidate box remains, which is output as the driver behavior recognition result.
[0133] Step 2.5) Collect the driver behavior recognition results and generate a behavior dataset.
[0134] Further, the specific method of step 3) is as follows:
[0135] Register the virtual device with Huawei Cloud to obtain the key and ID; configure the Python SDK on the device side, call the file transfer port API, establish a connection between the device and the cloud platform through the MQTT protocol, and call and use the check_file_uodate function at the same time. If the JSON file has been updated, record the new modification time. If the file has not been updated, record the message waiting for the file to be updated and make the thread sleep for 5 seconds. Finally, the data in the behavior dataset and vehicle dataset will be uploaded to the cloud in real time for data processing.
[0136] The specific method of step 4) is as follows:
[0137] Step 4.1) Combine the vehicle data set and the behavior data set to construct a driving behavior score data set, including 4000 rows of samples, each row has 4 feature driving behavior image data, speed, acceleration and turning angle, and 1 label including driving behavior score. The data set is divided into training set and validation set with a ratio of 7:3.
[0138] Step 4.2) Create an improved decision tree joint scoring algorithm based on vehicle data and driving behavior, and use the training data set divided in step 4.1 as the algorithm input for training. The specific training steps are as follows:
[0139] In the input space where the driving behavior score dataset is located, each area is recursively divided into two sub-areas Q1 and Q2, and the output value on each sub-area is determined to construct a binary decision tree:
[0140] (1) Select a feature k as the optimal segmentation feature from the four features including driving behavior image data, speed, acceleration and turning angle, and select the value corresponding to the feature from the sample as a segmentation point t.
[0141]
[0142] Traverse the optimal segmentation feature k, scan the segmentation point t for the fixed segmentation feature, and select the segmentation variable [k, t] that minimizes the above formula;
[0143] in;
[0144] N1 is the number of samples in sub-region Q1
[0145] N2 is the number of samples in sub-region Q2
[0146] x i is the sample in the sub-region Q1 to which the optimal segmentation point t of the optimal segmentation feature k belongs;
[0147] z i The driving behavior score corresponding to the sample in the sub-region Q1 to which the optimal segmentation point under the optimal segmentation feature belongs;
[0148] (2) Use the selected pair (k, t) to divide the region and determine the corresponding output value
[0149]
[0150] Where m = 1, 2;
[0151] N m For sub-region Q m The number of samples in
[0152] Q1(k,t)={x|x (k) ≤t}
[0153] Q2(k,t)={x|x (k) >t}
[0154] x (k) is the value corresponding to the optimal segmentation feature k;
[0155] (3) Continue to call steps (1) and (2) for the two sub-regions until the stop condition is met;
[0156] (4) Divide the input space into M regions Q1, Q2, …, Q M , generate a decision tree:
[0157]
[0158] Where I is the indicator function,
[0159] Rm represents one of the divided regions.
[0160] Step 4.3) The improved decision tree joint scoring algorithm based on vehicle data and driving behavior created in step 4.2 is evaluated on the test data set to adjust the hyperparameters to obtain the best performing algorithm on the test data set. The evaluation index is the determination coefficient R 2 .
[0161] Step 4.4) The algorithm with the best performance evaluated on the test data set in step 4.3 is used to evaluate the real-time vehicle data and driving behavior, and generate a corresponding score or report.
[0162] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for analyzing driving behavior data based on end-cloud collaboration, characterized in that: The method comprises the following steps: Step 1) constructing a driving behavior image dataset and a vehicle dataset; Step 2) performing image recognition on the driving behavior image dataset based on the improved Faster-RCNN model and obtaining behavior data; Step 3) The collected vehicle data and generated behavior data are transmitted to the backend server or cloud based on the API interface provided by the platform; Step 4) Construct a driving behavior scoring dataset, use a decision tree model combined with the data to score driving safety, generate a corresponding report based on the scoring strategy, and feedback to platform users through an event trigger mechanism.
2. The method for analyzing driving behavior data based on end-cloud collaboration according to claim 1, characterized in that: In step 1), a driving behavior image dataset is constructed, and the driving behavior data is classified and labeled, and divided into a training set, a validation set, and a test set. Speed, acceleration, and steering angular velocity data are obtained to construct a vehicle dataset, wherein the steering angular velocity data is calculated as follows: The angular velocity is measured based on the inertial measurement unit (IMU), and the steering angle is obtained by integrating the angular velocity. In formula (1), ω is the angular velocity, t1 is the start time of the measurement, t2 is the end time of the measurement, and θ is the steering angle within the measurement time period t2-t1.
3. The method for analyzing driving behavior data based on end-cloud collaboration according to claim 1, characterized in that: The specific method of step 2) is as follows: Step 2.1) Use MobileNetv3-SMALL as the neural network of the Faster-RCNN algorithm to extract features from the input driver behavior image through deep separable convolution; The driver behavior image obtained by input is of RGB type, which is processed by deep convolution to generate three channel results. The three channel results are processed by cross-channel convolution through point-by-point convolution. The overall process is as follows: (D Kernel ×D Kernel )×(M×D Filter ×D Filter )+N×(M×D Filter ×D Filter ) D Kernel is the length and width of the convolution kernel of the depth convolution; D Filter is the length and width of the convolution kernel of point-by-point convolution; D Kernel ×D Kernel ×1: The kernel size of the depthwise convolution is set to 32*32*1; M is the number of depth convolution kernels, which is set to 3; D Filter ×D Filter ×M: The convolution kernel size of point-by-point convolution is set to 1*1*3; N is the number of point-by-point convolution kernels, which is set to 4; The final output contains a feature map that fuses features from different channels; Step 2.2) After obtaining the feature image generated by the neural network, slide a window on the feature image through RPN, and cover the targets of different sizes through anchor boxes; predict multiple different candidate boxes for different positions of the target, and the candidate boxes include bounding boxes and confidences to determine whether there is a target in the box, so as to obtain multiple candidate boxes containing the target object; Step 2.3) After obtaining the candidate box, the feature region pooling ROIPooling module obtains a set of candidate regions from the RPN. The ROIPooling module maps each feature region to the feature map; processes different feature regions to make them uniform in size. ROIPooling calculates the area covered by the feature region on the feature map and divides its area into a fixed number of sub-regions. After pooling, multiple different feature regions are converted into a fixed-size feature map; Step 2.4) The feature map generated by the feature region pooling operation is screened using Soft-NMS. After the generated feature map is input, Soft-NMS first calculates the intersection-over-union ratio for the two candidate boxes generated in the feature map. Their coordinate positions are as follows: A=[x a1 ,and a1 ,x a2 ,and a2 ] B=[x b1 ,y b1 ,x b2 ,y b2 ] (x a1 ,y a1 ) is the vertex coordinate of the upper left corner of the first candidate box; (x a2 ,y a2 ) is the vertex coordinate of the lower right corner of the first candidate box; (x b1 ,y b1 ) is the vertex coordinate of the upper left corner of the second candidate box; (x b2 ,y b2 ) is the vertex coordinate of the lower right corner of the second candidate box; The coordinates of the upper left corner of the intersection are: x1=max(x a1 ,x b1 ), and 1 = max(y a1 ,and b1 ) The coordinates of the lower right corner of the intersection are: x2=min(x a2 ,x b2 ),y2=min(y a1 ,y b1 ) Calculate the area of the intersection: overlapping=max(x2-x1+1.0,0)·max(y2-y1+1.0,0) Calculate the area of the combined part: SA=(xa2-xa1+1.0)·(ya2-ya1+1.0) SB=(xb2-xb1+1.0)·(yb2-yb1+1.0) union=SA+SB-overlapping Calculate the intersection-over-union ratio: Adjust the confidence using a linear decay function: Where, df i represents the score of each detection box; IoU represents intersection over union; H represents the detection box with the highest score; S represents one of the remaining detection boxes; Pt represents the preset threshold; According to the adjusted confidence score, the confidence of the candidate box is updated, and the candidate box with a confidence higher than the preset threshold is selected as the final detection result; Repeat the above process, select the next candidate box with the highest confidence, and adjust and filter the confidence of the remaining boxes until all candidate boxes are processed and only one candidate box remains, which is output as the driver behavior recognition result; Step 2.5) Collect the driver behavior recognition results and generate a behavior dataset.
4. The method for analyzing driving behavior data based on end-cloud collaboration according to claim 1, characterized in that: The specific method of step 3) is as follows: Use the cloud to register the virtual device to obtain the key and ID; configure the Python SDK on the device side, call the file transfer port API, establish a connection between the device and the cloud platform through the MQTT protocol, and call and use the check_file_uodate function at the same time. If the JSON file has been updated, record the new modification time. If the file has not been updated, record the message waiting for the file to be updated and make the thread sleep for 5 seconds. The data in the behavior dataset and vehicle dataset are uploaded to the cloud in real time for data processing.
5. The method for analyzing driving behavior data based on end-cloud collaboration according to claim 1, characterized in that: The method of step 4) is as follows: Step 4.1), combining the vehicle data set and the behavior data set to construct a driving behavior score data set, including 4000 rows of samples, each row has 4 feature driving behavior image data, speed, acceleration and turning angle, and 1 label including driving behavior score; The dataset is divided into training set and validation set with a ratio of 7:3; Step 4.2) Create an improved decision tree joint scoring algorithm based on vehicle data and driving behavior, and use the training data set divided in step 4.1 as the algorithm input for training. The specific training steps are as follows: In the input space where the driving behavior score dataset is located, each area is recursively divided into two sub-areas Q1 and Q2, and the output value on each sub-area is determined to construct a binary decision tree: (1) Select a feature k as the optimal segmentation feature from the four features including driving behavior image data, speed, acceleration, and turning angle, and select the value corresponding to the feature from the sample as a segmentation point t; Traverse the optimal segmentation feature k, scan the segmentation point t for the fixed segmentation feature, and select the segmentation variable [k, t] that minimizes the above formula; in N1 is the number of samples in sub-region Q1; N2 is the number of samples in sub-region Q2; x i is the sample in the sub-region Q1 to which the optimal segmentation point t of the optimal segmentation feature k belongs; z i The driving behavior score corresponding to the sample in the sub-region Q1 to which the optimal segmentation point under the optimal segmentation feature belongs; (2) Use the selected pair (k, t) to divide the region and determine the corresponding output value Where m = 1, 2, N m For sub-region Q m The number of samples in the medium; Q1(k,t)={x|x (k) ≤t} Q2(k,t)={x|x (k) >t} x (k) is the value corresponding to the optimal segmentation feature k; (3) Continue to call steps (1) and (2) for the two sub-regions until the stop condition is met; (4) Divide the input space into M regions Q1, Q2, …, Q M , generate a decision tree: Where I is the indicator function, R m Indicates one of the divided areas; Step 4.3) The decision tree joint scoring algorithm based on vehicle data and driving behavior created in step 4.2 is evaluated on the test data set to adjust the hyperparameters to obtain the best performing algorithm on the test data set. The evaluation index is the determination coefficient R 2 ; in represents the residual sum of squares, is the score predicted by the model; represents the total sum of squares, is the mean of driving behavior scores; In step 4.4), the algorithm with the best performance evaluated on the test data set in step 4.3 is used to evaluate the real-time vehicle data and driving behavior, and generate a corresponding score or report.
Citation Information
Cited By
Intelligent automobile-oriented end-side cloud collaborative driving test and evaluation method and system
CN122312349A
