Decision tree vehicle type classification method based on roadside millimeter wave radar, electronic equipment
Through the decision tree model classification method based on roadside millimeter wave radar, the problem of poor accuracy in model identification under the influence of environmental factors in the prior art is solved, and high-precision model classification is achieved, which is suitable for roadside perception applications all-day and all-weather.
Patent Information
- Application Number
- CN202210538961.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-05-17
AI Technical Summary
It is difficult to accurately identify moving vehicles under the influence of environmental factors in the existing optical model identification technology, and radar-based vehicle model classification identification has differences in signal strength, length and width characteristics at different distances of vehicle, resulting in increased classification difficulty.
The decision tree model classification method based on roadside millimeter wave radar is adopted to extract vehicle data through radar echo signal, and the decision tree model of the corresponding distance segment is selected according to the distance between the vehicle and the radar for vehicle model classification.
It improves the accuracy of model classification, achieves stable and accurate model identification under different environmental conditions, and does not require additional hardware equipment, and has the advantages of strong real-time and small data calculation.
Smart Images

Figure CN114879192B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle classification technology, and in particular to a decision tree-based vehicle classification method and electronic equipment based on roadside millimeter-wave radar. Background Art
[0002] As a crucial component of intelligent transportation systems, roadside sensing devices play a vital role in vehicle-to-everything (V2X) and vehicle-road cooperation. As the core of refined road information acquisition and intelligent traffic management, vehicle type classification and recognition technology is the foundation for achieving intelligent traffic condition perception and management.
[0003] Optical vehicle model recognition technology primarily relies on image acquisition and processing techniques. While it can capture detailed information about stationary targets, it faces challenges in detecting moving targets. Roadside equipment is often used to capture information about moving vehicles. Furthermore, optical vehicle model classification and recognition technology is significantly affected by environmental factors such as road conditions and visibility. In situations where vehicle images are incomplete, multiple vehicles overlap, or visibility is poor due to rain, snow, smoke, or fog, some vehicles may be missed, and the probability of misclassifying vehicle types is relatively high. Therefore, it is difficult to accurately and reliably identify vehicle models on the road using optical technology.
[0004] Radar-based vehicle classification and recognition involves using radar to emit electromagnetic waves and then acquiring target feature information of different types of vehicles from the radar's scattered echoes. These target features include information such as the target vehicle's length, width, speed, signal strength, and distance. The vehicle type is then classified and identified based on a classification model.
[0005] Radar-based vehicle classification and recognition technologies can be broadly categorized into three types: ultrasonic radar, lidar, and millimeter-wave radar. Ultrasonic radar has an effective detection range of only 5 to 10 meters, limiting its suitability as a roadside sensing device. While lidar can reach a detection range of 300 meters, similar to optical systems, its propagation distance is significantly affected by increased laser attenuation in heavy rain or fog. Furthermore, the high cost of lidar (tens of thousands of yuan) also hinders its widespread adoption as a roadside device. Compared to ultrasonic and lidar, millimeter-wave radar boasts a detection range exceeding 500 meters, is unaffected by visibility factors such as light, and possesses all-weather, all-day operational capabilities.
[0006] For the same vehicle, the width, length, and signal strength detected by radar vary significantly at different distances. When the vehicle is close, the radar signal reflection is strong, and the signal strength value is large. Due to the limitations of radar angular resolution and the reflection angle of the same vehicle at different distances, the length of a vehicle measured by radar tends to be shorter at a distance and longer at a closer distance, while the width is wider at a closer distance and narrower at a farther distance, which poses a certain challenge to vehicle type classification. Summary of the Invention
[0007] To overcome the shortcomings of the prior art, this invention provides a decision tree-based vehicle classification method based on roadside millimeter-wave radar. This method uses radar echo signals to extract vehicle data and classifies and identifies vehicle types with high accuracy.
[0008] To achieve the above objectives, the present invention adopts the following technical solution, including:
[0009] A decision tree-based vehicle classification method based on roadside millimeter-wave radar includes the following steps:
[0010] S11, Vehicle detection is performed by receiving vehicle echo signals using roadside radar, and vehicle data is extracted. The vehicle data includes: vehicle speed, length, width, signal strength, and distance of the vehicle relative to the radar.
[0011] S12. Based on the distance value of the vehicle relative to the radar, select the decision tree model of the corresponding distance segment to classify the vehicle type. The vehicle's speed, length, width, and signal strength are used as input variables and input into the decision tree model of the corresponding distance segment to predict the vehicle type.
[0012] Among them, vehicle types are divided into large vehicles and small vehicles. Vehicles with a length greater than h are classified as large vehicles, and vehicles with a length less than or equal to h are classified as small vehicles.
[0013] Preferably, the decision tree model is generated in the following way:
[0014] S1. Use roadside radar to acquire a certain amount of vehicle data of known vehicle types as sample data to construct a sample set; the sample data includes: vehicle speed, length, width, signal strength, vehicle distance relative to radar, and known vehicle type;
[0015] S2, sort the sample data in the sample set according to the order of the vehicle relative radar distance from small to large, and divide the sorted sample data into N equal parts with an equal number of samples. These N equal parts correspond to N distance segments.
[0016] In the nth sample data, if the maximum value of the vehicle's relative radar distance is... The minimum distance between the vehicle and the radar is Then the distance segment corresponding to the nth equal part is...
[0017] S3 extracts a portion of the sample data from each distance segment as the training set for the corresponding distance segment, and uses the training set of each distance segment for learning and training to generate a decision tree model for each distance segment.
[0018] The preferred learning and training method for decision tree models is as follows:
[0019] S31, the input variables of the decision tree model are defined as the length x1, width x2, speed x3, and signal strength x4 of the vehicle, which constitute the input variable set {x1,x2,x3,x4}; the output variable, i.e. the prediction result, is the vehicle type y, which is divided into two categories: large vehicles y1 and small vehicles y2.
[0020] S32, using the training set as the first node of the decision tree, finds the optimal split point of the current node and splits it to obtain two nodes;
[0021] For each node obtained from the split, continue to find the optimal split point for the current node and split it again to obtain two nodes; if a node has reached the stop tree building condition, then do not split the current node; when all nodes have reached the stop tree building condition, stop splitting and obtain the final decision tree model.
[0022] Preferably, in step S32, the splitting method of the current node is as follows:
[0023] S321, determine whether the current node S meets the conditions for continuing to split. If the decision tree depth of node S is less than the preset maximum depth maxDepth, and the number of samples of node S is greater than the minimum number of samples required by the node minSamples, then the conditions for continuing to split are met. Calculate the Gini coefficient value of node S, which is obtained by the following formula (1):
[0024]
[0025] In equation (1), p j Let represent the probability distribution of the j-th vehicle type in node S, where j = 1 represents large vehicle y1 and j = 2 represents small vehicle y2; Gini(S) represents the Gini coefficient value of node S.
[0026] Initialize i = 1; initialize the optimal split point of node S to be empty, and set the coefficient difference GiniDifference of the optimal split point to 0;
[0027] S322, Select the i-th variable x from the input variable set {x1,x2,x3,x4}. i As a potential splitting variable for the current node S;
[0028] S323, Select the splitting variable x i A certain value in [x] is used as the splitting value. i ], and with the split value [x iThe dataset in node S is split into two datasets in nodes S1 and S2, with the boundary [x]. Node S1 corresponds to the variable [x] less than the splitting value. i In the dataset, node S2 corresponds to a value not less than the splitting value [x]. i The dataset is used to calculate the Gini coefficients of node S after it is split into nodes S1 and S2, which are obtained by the following formula (2):
[0029]
[0030] In equation (2), [x i ] represents the splitting variable x i The splitting value; |S|, |S1|, and |S2| represent the number of samples contained in nodes S, S1, and S2, respectively; Gini(S1) and Gini(S2) are the Gini coefficient values of nodes S1 and S2, respectively, and Gini(S1) and Gini(S2) are calculated by equation (1); Gini(S1,S2) represents the Gini coefficient values of nodes S1 and S2 after splitting node S into two nodes S1 and S2;
[0031] Calculate the split value [x] i The difference in Gini coefficients resulting from the split node S is calculated using the following formula (3):
[0032] Gini(S,[x i ])=Gini(S)-Gini(S1,S2) (3)
[0033] In equation (3), Gini(S,[x i ]) represents the split variable x i The splitting value [x] i The difference in Gini coefficients resulting from splitting node S into two nodes S1 and S2, with ] as the boundary;
[0034] S324, following the method in S323, iterates to find the splitting variable x. i The splitting values [x] i ], the variable x will be split i The values in [x] are respectively used as splitting values. i ], calculate each splitting value [x] i The resulting Gini coefficient difference at node S, Gini(S,[x]). i ]), select the Gini coefficient difference Gini(S,[x i The maximum split value [x] i [x as a splitting variable] i The final split value;
[0035] S325, Determine the splitting variable xi The final split value [x] i The Gini coefficient difference Gini(S,[x]) i Is the coefficient difference GiniDifference greater than the optimal split point?
[0036] If Gini(S,[x i If x is greater than GiniDifference, it indicates that the split variable x is greater than GiniDifference. i The final split value [x] i Let x be the potential optimal split point of node S, and update the optimal split point of node S as the split variable x. i The final split value [x] i ], and update the coefficient difference GiniDifference of the optimal split point as Gini(S,[x i ]);
[0037] Otherwise, the optimal split point and the coefficient difference GiniDifference of node S are not updated;
[0038] S326 uses an iterative approach, letting i = i + 1, to select the next variable, x. i+1 As the splitting variable, the splitting variable x is selected according to steps S323-S324. i+1 The final split value [x] i+1 Then execute step S325 to determine whether to update the difference between the optimal split point and the GiniDifference coefficient.
[0039] After traversing the input variable set {x1,x2,x3,x4], output the optimal split point of node S;
[0040] S327, determine the number of samples contained in nodes S1 and S2 obtained after splitting node S using the optimal split point, i.e., determine |S1| and |S2|.
[0041] If |S1| or |S2| is less than a set threshold T, then the splitting of node S is abandoned.
[0042] If both |S1| and |S2| are greater than or equal to the set quantity threshold T, then the node S is split using the optimal split point to obtain nodes S1 and S2, and nodes S1 and S2 are taken as the final split result of node S.
[0043] Preferably, in step S32, the condition for stopping tree building is: the decision tree depth of the node is greater than or equal to the preset maximum depth maxDepth, or the number of samples of the node is less than or equal to the minimum number of samples required by the node minSamples.
[0044] Preferably, in step S327, the threshold T is set to be half of the minimum number of samples minSamples required by the node.
[0045] Preferably, based on the vehicle echo signals received by the roadside radar, the vehicle echo signals are aggregated to detect vehicles, and the length and width information of the vehicles are obtained after aggregation.
[0046] Preferably, the vehicle classification results are dynamically corrected based on the vehicle trajectory multi-frame classification results;
[0047] For each frame of vehicle trajectory data, the vehicle type is determined, and the vehicle type classification result is input into the vehicle trajectory chain. Based on the vehicle type classification results of the M adjacent frames in the trajectory chain, the current vehicle type classification result is corrected.
[0048] If the number of frames in the vehicle classification results of this M frames that are consistent with the current vehicle classification result is greater than or equal to L, it means that the current vehicle classification result is accurate and no correction is made to the current vehicle classification result.
[0049] If the number of frames in the vehicle classification results of this M frames that are consistent with the current vehicle classification result is less than L, it means that the current vehicle classification result is inaccurate. The current vehicle classification result is then corrected to the mode of the vehicle prediction result in this M frames.
[0050] Preferably, the roadside radar is a 24GHz millimeter-wave radar.
[0051] The present invention also provides an electronic device, including a processor and a memory connected together, the memory being used to store a computer program, the computer program including program instructions, and the processor being configured to invoke the program instructions to execute the above-described method.
[0052] The advantages of the present invention are:
[0053] (1) This invention uses decision trees to classify vehicle models, and selects decision tree models of different distance ranges to classify vehicle models according to the different distances of the vehicle relative to the radar, thereby improving the classification accuracy.
[0054] (2) The vehicle classification method of the present invention is based solely on real-time radar data and does not require the addition of other hardware devices. It has the advantages of strong real-time performance, high classification accuracy, and low data computation.
[0055] (3) Based on the characteristic that the vehicle width, length and signal strength are significantly different when the vehicle is at different distances from the radar, this invention uses vehicle data from different distance segments to construct decision tree models for each distance segment, thereby improving the model accuracy.
[0056] (4) The present invention also corrects the vehicle type prediction results in real time based on several adjacent frames of vehicle trajectory data, further improving the accuracy of vehicle type classification.
[0057] (5) The present invention uses millimeter-wave radar as a roadside sensing device, which is not affected by environmental factors such as visibility, and has the ability to detect long distances and work in all weather conditions.
[0058] (6) The method of the present invention adds vehicle type classification on the basis that roadside radar can provide target distance and speed information, thus enriching the function of roadside perception equipment. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of a decision tree-based vehicle classification system based on roadside millimeter-wave radar according to the present invention.
[0060] Figure 2 This is a flowchart of the decision tree training method of the present invention.
[0061] Figure 3 The decision tree model is trained for the first distance segment.
[0062] Figure 4 The decision tree model is trained for the second distance segment.
[0063] Figure 5 The decision tree model is trained for the third distance segment.
[0064] Figure 6 This is the decision tree test model for the first distance segment.
[0065] Figure 7 This is a test model for the decision tree in the second distance segment.
[0066] Figure 8 This is a test model for the decision tree in the third distance segment.
[0067] Figure 9 This is a general decision tree training model for full sample data without distinguishing distance segments.
[0068] Figure 10 This is a general decision tree test model for full sample data without distinguishing distance segments. DETAILED DESCRIPTION
[0069] The technical solutions of the embodiments of the present invention 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 the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0070] Example 1 (Exemplary Method)
[0071] Depend on Figure 1 As shown, a decision tree-based vehicle classification method based on roadside millimeter-wave radar includes the following steps:
[0072] S11, Vehicle detection is performed by receiving vehicle echo signals using roadside millimeter-wave radar, and vehicle data is extracted. The vehicle data includes: vehicle speed, length, width, signal strength, and distance of the vehicle relative to the radar.
[0073] In this embodiment, a 24GHz millimeter-wave radar is selected as the roadside sensing device. The vehicle classification method of this invention adds vehicle identification function to the radar based on the statistical information of target distance, speed, track and traffic flow, which improves the function of the radar and is conducive to realizing comprehensive statistics and monitoring of road information.
[0074] In this embodiment, a millimeter-wave radar is mounted on a highway gantry. Based on the echo signal received by the millimeter-wave radar, the distance, speed, and signal strength information of the target (vehicle) relative to the radar are obtained. The 24GHz millimeter-wave radar used in this embodiment has a distance resolution of 1.34m and a speed resolution of 0.0678m / s. Because the 24GHz millimeter-wave radar has a high resolution, the same vehicle may have multiple radar reflection points. Therefore, the DBSCAN algorithm is used to perform point aggregation, and the aggregated vehicle target includes the length and width information of the vehicle.
[0075] S12. Based on the distance value of the vehicle relative to the radar, select the decision tree model of the corresponding distance segment to classify the vehicle type. The vehicle's speed, length, width, and signal strength are used as input variables and input into the decision tree model of the corresponding distance segment to predict the vehicle type.
[0076] Based on the actual conditions of highways and vehicles, vehicle types are divided into large vehicles and small vehicles. Vehicles with a length greater than 6m are classified as large vehicles, and vehicles with a length of 6m or less are classified as small vehicles. The vehicle length here is the vehicle length estimated by millimeter-wave radar point aggregation.
[0077] In this invention, the predicted vehicle type classification result is also corrected based on continuous multi-frame trajectory data of the vehicle, as shown below:
[0078] For each frame of vehicle trajectory data, determine the vehicle type and input the vehicle type classification result into the vehicle trajectory chain list;
[0079] Based on the vehicle model classification results of multiple consecutive frames of vehicle trajectory data, the L / M dynamic sliding window method is used to correct the vehicle model classification results. In this embodiment, L is set to 3 and M is set to 5. According to the vehicle trajectory list, if the vehicle model classification results of the previous 5 frames of trajectory data are consistent with the current trajectory's vehicle model classification result in 3 or more frames, then the current trajectory's vehicle model classification result is maintained; if the number of frames consistent with the current vehicle model classification result in the previous 5 frames of trajectory data is less than 3 frames, then the mode of the vehicle model classification result is selected from the previous 5 frames of trajectory data, and this mode is used as the current trajectory's vehicle model classification result, thereby correcting the current trajectory's vehicle model classification result.
[0080] Depend on Figure 2 As shown, the decision tree model for each distance segment is constructed as follows:
[0081] S1. A sample set is constructed by using roadside millimeter-wave radar to acquire a certain amount of vehicle data of known vehicle types. The sample data includes: vehicle speed, length, width, signal strength, vehicle distance relative to radar, and known vehicle type.
[0082] The statistical sample data in this embodiment is as follows: 4246 sample data were collected, including 2593 small vehicles and 1653 large vehicles. The statistical information of the sample data is shown in Table 1 below:
[0083] Table 1
[0084] Vehicle type Large vehicles Small vehicles unit Number of vehicles 1653 2593 vehicle Average speed 20.94 28.97 m / s Average vehicle length 10.15 3.04 m Average vehicle width 2.45 0.77 m Average signal strength 117.78 109.61 dB
[0085] S2, sort the sample data in the sample set according to the vehicle relative radar distance from smallest to largest, and divide the sorted sample data into N equal parts with an equal number of samples. These N equal parts correspond to N distance segments.
[0086] In the nth sample data, if the maximum value of the vehicle's relative radar distance is... The minimum distance between the vehicle and the radar is Then the distance segment corresponding to the nth equal part is...
[0087] This embodiment collected 4246 sample data points, with the minimum vehicle-to-radar distance being 25.64m, the maximum distance being 598.50m, and the average distance being 285.02m. The sample data was discretized by sorting the 4246 data points in ascending order of distance and then dividing these 4246 data points into three equal parts, resulting in three distance ranges of sample data.
[0088] The first segment has 1415 samples, and the minimum distance between the vehicle and the radar in the first segment is 25.64m and the maximum distance is 198.00m. That is, the first segment consists of 1415 sample data points traveling at distances between 25.64m and 198.00m relative to the radar.
[0089] The second part has 1415 samples, and the minimum distance between the vehicle and the radar in the second part is 198.00m and the maximum distance is 379.50m. That is, the second part consists of 1415 sample data in the distance range between 198.00m and 379.50m relative to the radar.
[0090] The third segment has 1416 samples, and the minimum distance between the vehicle and the radar in the third segment is 379.50m and the maximum distance is 598.50m. That is, the third segment consists of 1416 sample data points traveling in the range of 379.50m to 598.50m relative to the radar.
[0091] The statistical information of the sample data for each distance segment in this embodiment is shown in Table 2 below:
[0092] Table 2
[0093] Equal parts First division Second part Third division unit Distance segment 25.65m-198.00m 198.00m-379.50m 379.50m-598.50m m Large vehicles 551 549 553 vehicle Small vehicles 864 866 863 vehicle Average speed 25.35 25.83 26.32 m / s Average vehicle length 7.36 5.33 4.73 m Average vehicle width 1.04 1.31 1.93 m Average signal strength 123.11 112.28 103.99 dB
[0094] S3. The sample data in each distance segment are randomly selected and divided into training and test sets. In this embodiment, the ratio of the training set to the test set for each distance segment is 8:2.
[0095] The decision tree model is trained using the training sets for each distance, resulting in decision tree models for each distance segment, as shown below:
[0096] S31, the input variables of the decision tree model are defined as the length x1, width x2, speed x3, and signal strength x4 of the vehicle, which constitute the input variable set {x1,x2,x3,x4}; the output variable, i.e. the prediction result, is the vehicle type y, which is divided into two categories: large vehicles y1 and small vehicles y2.
[0097] The four factors that millimeter-wave radar collects that may affect vehicle type, namely the vehicle's length, width, speed, and signal strength, are all continuous variables.
[0098] Decision trees use a recursive approach, splitting layer by layer from top to bottom. Commonly used decision tree algorithms include ID3, C4.5, and CART (Classification and Regression Tree). Since CART's classification performance is usually better than other algorithms, this embodiment uses CART to split the decision tree.
[0099] S32, using the training set as the first node of the decision tree, finds the optimal split point of the current node and splits it to obtain two nodes;
[0100] For each node obtained from the split, continue to find the optimal split point for the current node and split it again to obtain two nodes; if a node has reached the stop tree building condition, then the current node is not split; when all nodes have reached the stop tree building condition, the splitting stops, and the final decision tree model is obtained.
[0101] In step S32, the splitting method of the current node is as follows:
[0102] S321, determine whether the current node S meets the conditions for continuing to split. If the decision tree depth of the current node S is less than the preset maximum number depth maxDepth, and the number of samples of node S is greater than the minimum number of samples required by the node minSamples, the conditions for continuing to split are met. Calculate the Gini coefficient value of node S, which is obtained by the following formula (1):
[0103]
[0104] In equation (1), p j Let represent the probability distribution of the j-th vehicle type in node S, where j=1 represents large vehicle y1 and j=2 represents small vehicle y2; Gini(S) represents the Gini coefficient value of node S; the Gini coefficient value is a value that reflects the purity of the sample. The smaller the Gini coefficient value, the purer and more ordered the sample is.
[0105] In this embodiment, the minimum number of samples required by the node, minSamples, is set to 100.
[0106] Initialize i = 1; initialize the optimal splitting point of node S to be empty, and the coefficient difference GiniDifference of the optimal splitting point to be 0;
[0107] S322, Select the i-th variable x from the input variable set {x1,x2,x3,x4}. i As a potential splitting variable for the current node S;
[0108] S323, Select the splitting variable x i A certain value in [x] is used as the splitting value. i ], and with the split value [x i The dataset in node S is split into two datasets in nodes S1 and S2, with the boundary [x] as the splitting boundary. Node S1 corresponds to a value less than the splitting value [x]. i In the dataset, node S2 corresponds to a value not less than the splitting value [x].i The dataset is used to calculate the Gini coefficients of node S after it is split into nodes S1 and S2, which are obtained by the following formula (2):
[0109]
[0110] In equation (2), [x i ] represents the splitting variable x i The splitting value; |S|, |S1|, and |S2| represent the number of samples contained in nodes S, S1, and S2, respectively; Gini(S1) and Gini(S2) are the Gini coefficient values of nodes S1 and S2, respectively, and Gini(S1) and Gini(S2) are calculated by equation (1); Gini(S1,S2) represents the Gini coefficient value of nodes S1 and S2 together after splitting node S into two nodes S1 and S2;
[0111] Calculate the split value [x] i The difference in Gini coefficients resulting from the split node S is calculated using the following formula (3):
[0112] Gini(S,[x i ])=Gini(S)-Gini(S1,S2) (3)
[0113] In equation (3), Gini(S,[x i ]) represents the split variable x i The splitting value [x] i The difference in Gini coefficients resulting from splitting node S into two nodes, S1 and S2;
[0114] S324, following the method in S323, iterates to find the splitting variable x. i The splitting values [x] i ], the variable x will be split i The values in [x] are respectively used as splitting values. i ], calculate each splitting value [x] i The resulting Gini coefficient difference at node S, Gini(S,[x]). i ]), select the Gini coefficient difference Gini(S,[x i The maximum split value [x] i As a splitting variable x i The final split value;
[0115] S325, Determine the splitting variable x i The final split value [x] i The Gini coefficient difference Gini(S,[x]) iIs the coefficient difference GiniDifference greater than the optimal split point?
[0116] If Gini(S,[x i If x is greater than GiniDifference, it indicates that the split variable x is greater than GiniDifference. i The final split value [x] i Let x be the potential optimal split point of node S. Update the optimal split point of node S to the split variable x. i The final split value [x] i ], and update the coefficient difference GiniDifference of the optimal split point as Gini(S,[x i ]);
[0117] Otherwise, the optimal split point and the coefficient difference GiniDifference of node S are not updated;
[0118] S326 uses an iterative approach, letting i = i + 1, to select the next variable, x. i+1 As the splitting variable, the splitting variable x is selected according to steps S323-S324. i+1 The final split value [x] i+1 Then execute step S325 to determine whether to update the difference between the optimal split point and the GiniDifference coefficient.
[0119] After traversing the input variable set {x1,x2,x3,x4}, output the optimal split point of node S;
[0120] S327, determine the number of samples contained in nodes S1 and S2 obtained after splitting node S using the optimal split point, i.e., determine |S1| and |S2|.
[0121] If |S1| or |S2| is less than the set threshold T, then the splitting of node S is abandoned;
[0122] If both |S1| and |S2| are greater than or equal to the set quantity threshold T, then the node S is split using the optimal split point to obtain nodes S1 and S2, and nodes S1 and S2 are taken as the final split result of node S.
[0123] Continue splitting nodes S1 and S2 according to steps S321 to S327, searching for the optimal split point for nodes S1 and S2, until all nodes meet the conditions for stopping tree building, then stop splitting.
[0124] In step S32, the condition for stopping tree building is: the decision tree depth of the node is greater than or equal to the preset maximum depth maxDepth, or the number of samples of the node is less than or equal to the minimum number of samples required by the node minSamples. In this embodiment, the preset maximum depth maxDepth is 5, and the minimum number of samples required by the node minSamples is 100.
[0125] In step S37, since the minimum number of samples minSamples is half of the node threshold T, in this embodiment, the threshold T is set to 50.
[0126] In this embodiment, training is performed using training sets for three distance segments to generate decision tree models for the three distance segments, such as... Figure 3 , 4 , as shown in 5.
[0127] S4, input the sample data from the test set for each distance segment into the decision tree model for that distance segment for testing. The prediction results for the test set for each distance segment are as follows: Figure 6 , 7 As shown in Figure 8.
[0128] The prediction accuracy of the sample data for each distance segment during the training process in step S3 and the testing process in step S4 is statistically analyzed, as shown in Table 3 below:
[0129] Table 3
[0130]
[0131]
[0132] As shown in Table 3 above, this embodiment predicts the vehicle type for each distance segment, and the overall prediction accuracy for each distance segment can reach over 90%.
[0133] In this embodiment, the distance between the vehicle and the radar is divided into several distance segments, and a decision tree model is generated for each distance segment to improve the accuracy of vehicle type prediction.
[0134] To verify whether segmented modeling improves the prediction accuracy of the decision tree vehicle type classification model, this embodiment also uses the same sample data and the same training and testing methods, but without segmenting the distances, to obtain a general decision tree model without segmenting. The prediction results for the training and testing sets are as follows: Figure 9 , 10 As shown in Table 4, the prediction accuracy of this general decision tree model during the training and testing processes is as follows:
[0135] Table 4
[0136]
[0137] Comparing Tables 3 and 4, it can be seen that after dividing the distance into segments, the overall prediction accuracy of the decision tree model for each distance segment reaches over 90%. Without segmenting the distance, the overall percentage of prediction accuracy and training accuracy of the general decision tree model fails to reach over 90%. This demonstrates that dividing the distance into segments based on the distance between the vehicle and the radar, and using decision tree models for different distance segments, is beneficial for improving the prediction accuracy of vehicle types.
[0138] Figures 1 to 10 In the diagram, the improvement at the splitting point represents the rate of decrease in the Gini coefficient after splitting. The larger the improvement value, the more rapidly the Gini coefficient decreases and the better the splitting effect.
[0139] Example 2 (Exemplary Electronic Device)
[0140] The electronic device can be the mobile device itself, or a standalone device that can communicate with the mobile device and roadside sensing devices, i.e., roadside radar, to receive the collected input signals from them and send the selected target decision-making behavior to them.
[0141] Electronic devices include one or more processors and memory.
[0142] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0143] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the decision-making behavior and decision-making methods of the various embodiments of this application described above, and / or other desired functions.
[0144] Additionally, the electronic device may include input devices and output devices, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). For example, the input device may include various devices such as radar or radar processors, and may also include, for example, a keyboard, mouse, etc.; the output device may include, for example, a display, speaker, printer, and communication networks and their connected remote output devices, etc.
[0145] In addition, depending on the specific application, electronic devices may include any other suitable components.
[0146] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A decision tree vehicle type classification method based on roadside millimeter wave radar, characterized in that: The following steps are involved: S11, using a roadside radar to receive a vehicle echo signal to perform vehicle detection and extract vehicle data, wherein the vehicle data includes: vehicle speed, length, width, signal strength, and distance of the vehicle relative to the radar; S12, according to the distance value of the vehicle relative to the radar, select the decision tree model of the corresponding distance segment to classify the vehicle type, and input the speed, length, width, and signal strength of the vehicle as input variables into the decision tree model of the corresponding distance segment to predict the vehicle type; Among them, the vehicle types are divided into large vehicles and small vehicles. Vehicles with a length greater than h are considered large vehicles, and vehicles with a length less than or equal to h are considered small vehicles. The decision tree model is generated as follows: S1, using roadside radar to obtain a certain number of vehicle data of known vehicle types as sample data, and construct a sample set; the sample data includes: vehicle speed, length, width, signal strength, distance of the vehicle relative to the radar, and known vehicle type; S2, sorting the sample data in the sample set in ascending order of the distance of the vehicle relative to the radar, and dividing the sorted sample data into N equal parts with equal sample numbers, and the N equal parts correspond to N distance segments; Among them, in the nth sample data, if the maximum value of the vehicle relative to the radar is The minimum distance between the vehicle and the radar is Then the distance segment corresponding to the nth equal part is n=1,2,3…N; S3, extracting part of the sample data from the sample data in each distance segment as a training set for the corresponding distance segment, using the training set for each distance segment to perform learning training, and generating a decision tree model for each distance segment; Based on the vehicle model classification results of multiple frames of vehicle tracks, the vehicle model classification results are dynamically corrected; The vehicle type is determined for each frame of vehicle track data, and the vehicle type classification result is input into the vehicle track chain table. According to the vehicle type classification results of the adjacent M frames in the track chain table, the current vehicle type classification result is corrected; If the number of frames in the vehicle classification results of the M frames that are consistent with the current vehicle classification result is greater than or equal to L, it means that the current vehicle classification result is accurate and the current vehicle classification result is not corrected; If the number of frames in the vehicle type classification results of these M frames that are consistent with the current vehicle type classification result is less than L, it means that the current vehicle type classification result is inaccurate, and the current vehicle type classification result is corrected to the mode of the vehicle type prediction results of these M frames.
2. The decision tree vehicle type classification method based on roadside millimeter wave radar according to claim 1 is characterized in that: The learning and training method of the decision tree model is as follows: S31, defining the input variables of the decision tree model including the length x1, width x2, speed x3, and signal strength x4 of the vehicle, forming an input variable set {x1, x2, x3, x4}; the output variable, i.e., the prediction result, is the vehicle type y, which is divided into two categories: large vehicle y1 and small vehicle y2; S32, using the training set as the first node of the decision tree, finding the optimal splitting point of the current node for the first node, and splitting it to obtain two nodes; For each node obtained by splitting, continue to find the optimal splitting point of the current node and split it, and continue to split to obtain two nodes; If a node has reached the condition for stopping tree building, the current node will not be split; when all nodes have reached the condition for stopping tree building, the splitting will stop and the final decision tree model will be obtained.
3. The decision tree vehicle type classification method based on roadside millimeter wave radar according to claim 2 is characterized in that: In step S32, the current node is split as follows: S321, determine whether the current node S meets the conditions for continued splitting. If the decision tree depth of node S is less than the preset maximum depth maxDepth, and the number of samples of node S is greater than the minimum number of samples minSamples required by the node, the conditions for continued splitting are met, and the Gini coefficient value of node S is calculated, which is calculated by the following formula (1): In formula (1), p j represents the distribution probability of the j-th vehicle type in node S, where j=1 represents a large vehicle y1, and j=2 represents a small vehicle y2; Gini(S) represents the Gini coefficient value of node S; Initialize i=1; initialize the optimal splitting point of node S to be empty, and the coefficient difference GiniDifference of the optimal splitting point to be 0; S322, select the i-th variable x from the input variable set {x1, x2, x3, x4} i As a potential splitting variable for the current node S; S323, select split variable x i A value in is used as the split value [x i ], and split the value [x i ] is used as the boundary to split the data set in node S into data sets in two nodes S1 and S2, where node S1 corresponds to a variable smaller than the split value [x i ] data set, node S2 corresponds to a value not less than the split value [x i ] data set; calculate the Gini coefficient value after node S is split into nodes S and S1, which is calculated by the following formula (2): In formula (2), [x i ] represents the split variable x i The split value; |S|, |S1|, |S2| represent the number of samples contained in nodes S, S1, and S2 respectively; Gini(S1) and Gini(S2) are the Gini coefficient values of nodes S1 and S2 respectively, and Gini(S1) and Gini(S2) are calculated by formula (1); Gini(S1, S2) represents the Gini coefficient values of nodes S1 and S2 after node S is split into two nodes S1 and S2; Calculate the split value [x i The Gini coefficient difference caused by splitting node S is calculated by the following formula (3): <h2 style=";text-align:left;direction:ltr">Gini(S,[x<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> ])=Gini(S)-Gini(S1,S2) (3) In formula (3), Gini(S,[x i ]) represents the split variable x i The split value [x i ] as the boundary, the difference in Gini coefficient caused by splitting node S into two nodes, S and S1; S324, follow the method of S323 to traverse and find the split variable x i The split values [x i ], which will split the variable x i Each value in is used as the split value [x i ], calculate each split value [x i ] brings the Gini coefficient difference of node S Gini(S,[x i ]), select the Gini coefficient difference Gini(S,[x i ])The maximum split value [x i ] as the splitting variable x i The final split value of S325, determine the split variable x i The final split value [x i ]'s Gini coefficient difference Gini(S,[x i ]) is greater than the coefficient difference GiniDifference of the optimal split point, If Gini(S,[x i ]) is greater than GiniDifference, it means the split variable x i The final split value [x i ] is the potential optimal splitting point of node S, and the optimal splitting point of node S is updated to the splitting variable x i The final split value [x i ], and update the coefficient difference GiniDifference of the optimal split point to Gini(S,[x i ]); Otherwise, the optimal splitting point of node S and the coefficient difference GiniDifference of the optimal splitting point are not updated; S326, using variable-by-variable iteration, let i=i+1, select the next variable, that is, x i+1 As the splitting variable, select the splitting variable x according to the method of steps S323 to S324. i+1 The final split value [x i+1 ], and execute step S325 to determine whether to update the GiniDifference coefficient difference between the optimal splitting point and the optimal splitting point; After traversing the input variable set {x1, x2, x3, x4}, the optimal split point of the output node S is output; S327, determine the number of samples contained in nodes S1 and S2 obtained after node S is split using the optimal splitting point, that is, determine |S1|, |S2|, If |S1| or |S2| is less than the set threshold T, the split of node S is abandoned. If |S1| and |S2| are both greater than or equal to the set quantity threshold T, the node S is split using the optimal splitting point to obtain nodes S1 and S2, and nodes S1 and S2 are used as the final splitting result of node S.
4. The decision tree vehicle type classification method based on roadside millimeter wave radar according to claim 2 is characterized in that: In step S32, the condition for stopping tree building is: the decision tree depth of the node is greater than or equal to the preset maximum depth maxDepth, or the number of samples of the node is less than or equal to the minimum number of samples minSamples required by the node.
5. The decision tree vehicle type classification method based on roadside millimeter wave radar according to claim 3 is characterized in that: In step S327, the number threshold T is set to half of the minimum number of samples minSamples required by the node.
6. The decision tree vehicle type classification method based on roadside millimeter wave radar according to claim 1 is characterized in that: Based on the vehicle echo signals received by the roadside radar, the vehicle echo signals are condensed to perform vehicle detection, and the length and width information of the vehicle are obtained after condensation.
7. The decision tree vehicle type classification method based on roadside millimeter wave radar according to claim 1 is characterized in that: The roadside radar uses 24GHz millimeter wave radar.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected, the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method as claimed in claim 1, 2, 3, 4 or 5.
Citation Information
Patent Citations
Method for initiating radar target track based on random forest
CN107688170A
Method for generating vehicle recognizer
CN108182807A
Vehicle model identification method of microwave radar in multiple scenes
CN112162271A
Vehicle type judgment method based on video radar fusion perception
CN114463660A