Real-time road switching rapid identification method and electronic equipment based on machine learning
Through machine learning technology, logistic regression and gradient descent method are used to identify road models, combine probability difference and discrimination results to identify road switching, and obtain attachment coefficients through magic formula models, solving the poor recognition effect of existing technology in bad weather The problem is to achieve high accuracy and real-time road switching recognition.
Patent Information
- Application Number
- CN202111140099.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-09-28
AI Technical Summary
Existing sensor-based road surface recognition systems have poor recognition performance in bad weather conditions, and algorithms such as least squares method and Kalman filters are difficult to meet the high requirements for real-time and accuracy in the field of autonomous driving.
Using the real-time road switching fast recognition method based on machine learning, the data characteristics of different road models are learned through logistic regression and gradient descent, and slip rate and traction data are collected in real time, preprocessing and discrimination, and identifying them based on probability difference and discrimination results. The road surface is switched and the adhesion coefficient of the road surface is obtained through the magic formula tire model.
It improves the accuracy and real-time nature of road switching recognition, reduces the rate of misjudgment, can quickly identify road surface changes in bad weather conditions and provide accurate adhesion coefficients, meeting the needs of the field of autonomous driving.
Smart Images

Figure CN113963196B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of road surface recognition, and in particular relates to a real-time road surface switching rapid recognition method based on machine learning and an electronic device. Background Art
[0002] At present, the number of cars is increasing rapidly, and safety performance has become the most important consideration for cars. Especially in the field of autonomous driving, faster recognition switching and recognition of which road surface to switch to are particularly important.
[0003] In the existing sensor-based road classification recognition and switching system, the direct recognition equipment of the sensor is limited by the installation environment, usage environment, high price and other conditions. In some special circumstances (such as severe weather such as heavy fog and snow), the recognition and switching effect of the road surface is not obvious, and the switching speed does not meet the actual needs.
[0004] General algorithms, such as using the least squares method to judge data features in a windowed manner at sampling points, cannot meet the actual needs of real-time vehicles when driving, as the high-speed driving of vehicles requires high real-time recognition of road surface switching. Other algorithms, such as fast filtering through Kalman filters, can meet real-time requirements and obtain results as soon as the road surface switching occurs. However, the filtering results fluctuate greatly and can easily lead to misjudgment, which cannot meet the actual needs of the field of autonomous driving, which has very strict requirements on road conditions. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a real-time road surface switching rapid identification method and electronic device based on machine learning, which are used to quickly identify the switching of road surfaces.
[0006] To achieve the above object, the present invention provides a real-time road surface switching rapid identification method based on machine learning. The method quickly identifies the road surface switching through a data point set of the traction force and the slip rate of the vehicle when the vehicle is driving, determines the attribution of the road model, and obtains the adhesion coefficient of the current road model. The method includes the following steps:
[0007] Obtain a set of data points including slip rate and traction under different road models;
[0008] The optimal decision boundary is obtained by combining the principle of logistic regression with the gradient descent method;
[0009] Real-time collection of data points including slip rate and traction;
[0010] Preprocess the data points collected in real time;
[0011] Based on the optimal decision boundary, calculate the logical probability of each data point after preprocessing;
[0012] There are two methods for rapid identification of road surface switching:
[0013] ① Calculate the sum of the difference between the logical probability and the boundary probability of N consecutive data points. If the sum exceeds the preset probability threshold, the road surface is switched, otherwise the road surface is not switched;
[0014] ②According to the logical probability of each data point and the boundary probability, the judgment result of each data point is obtained, and the judgment results of N consecutive data points are counted. If the statistical result exceeds the preset counting threshold, the road surface is switched, otherwise the road surface is not switched.
[0015] In some optional implementation schemes, the slip rate is the slip rate of the left side or the right side of the vehicle during the driving process of the vehicle.
[0016] In some optional implementations, finding the optimal decision boundary by combining the principle of logistic regression with the gradient descent method includes:
[0017] Label the data points of different road models with corresponding classification labels;
[0018] Set the initial decision boundary and obtain the classification result based on logistic regression;
[0019] Construct a loss function and use gradient descent to update the decision boundary;
[0020] Iterate to get the optimal decision boundary.
[0021] In some optional implementation schemes, preprocessing includes removing data points during gear shifting and braking.
[0022] The preprocessing further includes: taking the average slip rate and traction force of the data point set as the slip rate and traction force of a new single data point, and calculating the logical probability using the new single data point.
[0023] In some optional implementation schemes, when the slip ratio variation range is greater than a preset slip ratio variation threshold, the counting threshold is reduced.
[0024] In some optional implementation schemes, when a road surface switch is identified, the adhesion coefficient of the road surface after the switch is given by the magic formula tire model.
[0025] Use the data points after the road surface is switched to fit the linear area of the magic formula tire model, match the fitted straight line with the preset magic formula coefficient, and find the closest magic formula curve, which is the adhesion coefficient of the current road model;
[0026] The magic formula tire model formula is:
[0027] F(x)=D*sin(C*atan(B*x))
[0028] In the formula, x represents the slip rate, D is the peak value of the curve and also represents the adhesion coefficient of the current road surface, and B and C are the parameters of the tire magic formula.
[0029] The present invention also provides an electronic device, comprising one or more processors and a memory;
[0030] One or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs are configured to execute the above-mentioned real-time road surface switching rapid identification method based on machine learning.
[0031] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0032] When a car is driving, the data point sets of slip rate and traction of different road models have different data characteristics. Therefore, the present invention first studies the set of data points of slip rate and traction of different known road models, and obtains an optimal decision boundary using the gradient descent method. Then, the real-time data points are preprocessed to reduce the error of the algorithm. After the processing is completed, the logical probability and discrimination result of the data point can be obtained through the optimal decision boundary and the logic function. Then, it is judged whether the road surface has switched by the sum of the probability difference or the counting of the discrimination results. Finally, the adhesion coefficient of the road surface is obtained by the magic formula tire model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flowchart of a method for rapid identification of real-time road surface switching based on machine learning;
[0034] Figure 2 A data point set diagram of slip rate and traction provided by an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of the Sigmoid function in logistic regression provided by an embodiment of the present invention;
[0036] Figure 4 A time performance diagram of a vehicle switching from a high-adhesion coefficient road surface to a low-adhesion coefficient road surface provided by an embodiment of the present invention;
[0037] Figure 5 A schematic diagram of magic formula fitting for high adhesion coefficient road surfaces and low adhesion coefficient road surfaces provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0039] The present invention mainly involves how to perform a priori learning on a sample set to obtain the optimal a priori decision. When a real-time data point set arrives, data preprocessing is first performed, and the optimal decision boundary learned in advance is used to discriminate and calculate the logical probability. Then, the road surface switching is quickly identified by the probability difference recognition based on the logical function and the counting recognition method based on the discrimination result. Finally, the adhesion coefficient of the road surface is obtained by the magic formula tire model. Specifically, it includes:
[0040] First, the data features of different road models are learned. The distribution characteristics of the data point sets of roads with different adhesion coefficients are quite different, and this difference is the basis for this algorithm to achieve binary classification through logistic regression.
[0041] Then, the prior road model data point set is labeled with classification labels, and the optimal prior decision boundary is calculated through the gradient descent method and the set learning efficiency.
[0042] Then, when the real-time data point sets arrive, these data point sets are preprocessed to filter out some invalid points, and the average slip rate and traction are calculated with every 8 data points as a set as the input of the classification algorithm.
[0043] Afterwards, two algorithms are used for joint discrimination to ensure the timeliness of the algorithm and realize the rapid identification of road surface switching. ① The logical probability of each data point is calculated through the logic function, and the sum of the difference between the logical probability of continuous data points and the boundary probability (with probability 0.5 as the boundary) is calculated. When this sum is greater than the set probability threshold, the alarm function issues a warning signal for road surface switching; ② The real-time data point set is discriminated using the a priori optimal decision boundary, and the discrimination results of 10 consecutive data point sets are counted. When this result is greater than the set counting threshold, the alarm function issues a warning signal for road surface switching. At the same time, in order to increase the efficiency of algorithm execution, an auxiliary logic is added to adjust the counting threshold in real time through the characteristics of the data point set, that is, when the slip rate before and after the discrimination suddenly changes and the change range is greater than the set slip rate change threshold, the counting threshold will be reduced, making it easier for the algorithm to identify road surface switching.
[0044] Finally, the adhesion coefficient of the current road surface is obtained through the tire magic formula model.
[0045] The real-time road switching rapid identification method based on machine learning in the embodiment of the present invention is as follows: Figure 1 As shown, the following steps are included:
[0046] Step 1: Collect a priori data point sets of different road models.
[0047] The real-time road switching fast recognition algorithm based on machine learning relies on the data set of the slip rate (S) and vehicle traction (F) of the left side (XL) or right side (XR) of the vehicle during driving under different road models. f ) dataset.
[0048] Take the calculation of the slip rate on the left side of a car with the front wheels as the driving wheels as an example: where S XL is the left slip rate, ω FL ,ω RL are the angular velocities of the left front wheel and the left rear wheel, respectively, R FL R RL are the tire radii of the left front wheel and the left rear wheel, respectively, S XL The calculation formula is:
[0049]
[0050] Step 2: Use the principle of logistic regression combined with the gradient descent method to find the prior optimal decision boundary.
[0051] Applying the algorithm principle of logistic regression in machine learning to the data set of the present invention is a prerequisite of the present invention. The data sets of traction and slip rate of different road models have significant differences. Only then can the logistic regression method be used to learn a priori optimal decision boundary. The upper and lower sides of the boundary represent two different road surfaces. In this embodiment, the lower side of the decision boundary represents a low adhesion coefficient road surface, and the upper side of the decision boundary represents a high adhesion coefficient road surface.
[0052] like Figure 2 As shown in Figure 1, it is a point set diagram of the slip rate and traction of a car driving on roads with different adhesion coefficients, and the experimental condition is the switch from a high adhesion coefficient road to a low adhesion coefficient road. Among them, the vertical axis is the traction (F f ), the horizontal axis is the slip rate S. In the figure, "·" represents dry asphalt pavement, and "×" represents gravel pavement. It can be seen that the linear characteristics of the two pavements are obvious. Due to the large difference in the adhesion coefficients of the two pavements, the logistic regression method can be used to obtain an optimal decision boundary with accurate classification.
[0053] First, we learn the data sets of different road models. All data sets are vehicle traction (F f) and the point set plane diagram of the slip rate (S) on the left or right side of the car, that is, the horizontal coordinate of each data point set is the slip rate, and the vertical coordinate is the traction.
[0054] The data sets of different road models are labeled with different classification labels. The classification label of the road surface with high adhesion coefficient is set to 1, and the classification label of the road surface with low adhesion coefficient is set to 0. The vector composed of these real classification results is called Y.
[0055] Logistic regression is a probability model that needs to output results between (0, 1), so a mapping function is needed. The commonly used mapping function in logistic regression is the Sigmoid function, which is the logistic function:
[0056]
[0057] The vector form of the function is as follows:
[0058]
[0059] Among them, Z = XW, X represents the input sample vector, and W represents the decision boundary weight vector.
[0060] like Figure 3 As shown in Figure 1, it is a schematic diagram of the Sigmoid function in logistic regression. This mapping function maps the (-∞, +∞) interval to (0, 1) to obtain a probability value.
[0061] The goal of logistic regression is to solve the binary classification problem. After obtaining a probability value, it is necessary to "classify" this probability value. In this embodiment, when the probability value is greater than 0.5, the sample is classified as a high adhesion coefficient road surface, and when the probability value is less than 0.5, it is classified as a low adhesion coefficient road surface.
[0062]
[0063] The main idea of logistic regression is to first fit the decision boundary, and then use the mapping function to establish the relationship between the boundary and the classification probability. Given some samples, find a set of parameters, that is, the optimal decision boundary, to maximize the probability of the existing samples.
[0064] Here we introduce the loss function to measure the deviation between the predicted value and the actual value. The smaller the value of the loss function, the more accurate the classifier. The "optimal parameter" is to minimize the loss function. The expression of the loss function is as follows:
[0065] Loss=-Ylog(H(Z))-(1-Y)log(1-H(Z)).
[0066] The input sample value X in this embodiment is [1 st], where s represents the slip rate of a certain side, t represents the traction force, and the optimal decision boundary W is [w0 w1 w2], then Z is XW = w0 + w1s + w2t.
[0067] Then, the gradient descent method is used to iterate the optimal W. The main steps are as follows:
[0068] 1. Initialize the weight vector (i.e., decision boundary) W and give the weight vector an initial value. The selection of the initial value will not have much impact on the algorithm result, but it will affect the efficiency of the algorithm. An initial value with a large deviation will require more iterations to update to the optimal value. In this embodiment, the initial value of the weight vector is set to [0 -301 41], which is a selected value that ensures the time efficiency of the algorithm.
[0069] 2. Update the weight vector W:
[0070]
[0071] Among them, alpha is the set learning rate, which is set to 0.001 in this embodiment. Through mathematical derivation, the derivative of the loss function with respect to the weight vector can be obtained as follows:
[0072]
[0073] 3. Iterate to a certain number of times or to a certain threshold. In this embodiment, it is found that the optimal decision boundary for binary classification can be obtained after 5000 iterations, so the number of iterations is set to 5000.
[0074] In this embodiment, a logistic regression method is used to learn an optimal decision boundary based on a priori data points of high adhesion coefficient road surface and low adhesion coefficient road surface, which is denoted as W. * .
[0075] Step 3: When the system is working, the vehicle body CAN signal message is analyzed in real time to calculate the slip rate and normalized traction force on the left and right sides.
[0076] Step 4: When the real-time data point set arrives, in order to increase the credibility of the algorithm, some invalid points of shifting and braking will be screened out, and then data preprocessing will be performed with every 8 data points as a set.
[0077] When real-time data point sets arrive, they need to be preprocessed to eliminate false positives caused by single data points as much as possible. In this embodiment, every 8 data points are merged into one data point by averaging, and data points that affect the algorithm results, such as braking and shifting, are disabled.
[0078] Step 5: Rapidly identify road surface switching using two methods.
[0079] ① Calculate the loss probability of each data point set through the logic function, and calculate the sum of the difference between the logical probability of the continuous data point set and the dividing probability (with probability 0.5 as the dividing line). When this sum is greater than the set probability threshold, the alarm function sends a warning signal for road surface switching.
[0080] ②Use the a priori optimal decision boundary to judge the real-time data point set, count the judgment results of 10 consecutive data point sets, and when this result is greater than the set counting threshold, the alarm function will issue a warning signal for road switching. At the same time, in order to increase the efficiency of algorithm execution, an auxiliary logic is added to adjust the counting threshold in real time based on the characteristics of the data point set.
[0081] The first is the probability difference method based on the logic function. In method ①, the inner product of the real-time data point and the weight vector is substituted into the logic function to obtain the logic probability, that is:
[0082] Z=XW * =w0+w1s+w2t
[0083] Substitute Z into the logic function to calculate the logical probability P:
[0084] P=H(Z)
[0085] Calculate the sum of the differences between the logical probability P of consecutive data points and the boundary probability (with probability 0.5 as the boundary). When this sum is greater than the set probability threshold, it proves that a road surface switch has occurred. When multiple consecutive points are located in the same road model, the sum of the differences will only continue to increase, thereby identifying road surface switches more accurately.
[0086] The other is a counting recognition method based on the discrimination result. The logical function calculation obtains not only the logical probability but also the discrimination result of each data point. In method ②, the discrimination results of 10 consecutive data point sets are counted. When this result is greater than the set counting threshold, it is considered that a road surface switch has occurred. In addition, the algorithm will detect the degree of change in the slip rate, and record the slip rate before and after the first-order low-pass filter. When the difference between the two is large, the counting threshold will be reduced, and the algorithm can identify the road surface switch more quickly.
[0087] from Figure 4 As shown in Figure 1, when the car is completely driving on the gravel road, the road surface changes and the slip rate changes significantly. Figure 3In the figure below, 1 represents the car on a dry asphalt road, and 0 represents the car on a gravel road. It can be seen that the road surface switch occurs at the 1670th data point, and this method recognizes that the road surface switch occurs at the 1675th data point. In this method, the sampling period of each data point set is 10ms, and data fusion is performed with 8 data points as a set, so the sampling period of each point in the figure is 80ms. It can be seen that the switching time is 5*80=400ms, that is, the switching can be recognized within 0.4s.
[0088] Step 6: After the road switch recognition is completed, the system will use the magic formula tire model to give the adhesion coefficient of the road after the switch. When the slip rate of the car is too large, the slip rate and traction at this time are a nonlinear relationship. The magic formula tire model can be used to obtain the adhesion coefficient of the current road.
[0089] In the example, a simplified magic formula tire model is used:
[0090] F(x)=D*sin(C*atan(B*x))
[0091] Among them, x represents the slip rate on the left or right side, D is the peak of the curve and also represents the adhesion coefficient of the current road surface, and B and C are the parameters of the tire magic formula. In actual engineering, the magic formula has become an industrial standard, that is, tire manufacturers provide tire data represented by magic formula coefficients to vehicle manufacturers. Therefore, the tire magic formula coefficients for different road models are all known values.
[0092] The input is a fusion point set of traction and slip rate after preprocessing. Through these point sets, the linear area of the magic formula tire model can be fitted, and the fitted straight line is matched with the magic formula coefficients provided in advance by the vehicle manufacturer to find the closest magic formula curve, which is the adhesion coefficient of the current road model.
[0093] like Figure 5 As shown, it is a fitting diagram of the simplified tire magic formula model for high adhesion coefficient road surface and low adhesion coefficient road surface, where the peak of the curve represents the adhesion coefficient of the road surface. It can be seen that the adhesion coefficient of the high adhesion coefficient road surface is 0.9, and the adhesion coefficient of the low adhesion coefficient road surface is 0.3.
[0094] The present invention also provides an electronic device, comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above method.
[0095] In summary, when a car is driving, the data point sets of traction and slip rate of different road models have different data characteristics. The real-time road surface switching rapid identification method based on machine learning of the present invention performs a priori learning on the data point sets of different road models through the principle of logistic regression to obtain a priori optimal decision boundary. It can be generally considered that the upper and lower sides of the boundary represent two different classification results, but in order to minimize the error as much as possible, this method designs two auxiliary algorithms for joint identification on this basis, one is a probability difference identification method based on the loss function, and the other is a counting identification method based on the discrimination result. When the real-time data point arrives, the above method can quickly identify the switching of the road surface, and judge whether the road model at this time is a high-adhesion road surface or a low-adhesion road surface. After that, the adhesion coefficient of the current road surface can also be obtained through the magic formula tire model.
[0096] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, and two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.
[0097] It will be easily understood by those skilled in the art that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A real-time road switching fast identification method based on machine learning, It is characterized in that The following steps are involved: Obtain a set of data points including slip rate and traction under different road models; The optimal decision boundary is obtained by combining the principle of logistic regression with the gradient descent method, including: Label the data points of different road models with corresponding classification labels; Set the initial decision boundary and obtain the classification result based on logistic regression; Construct a loss function and use gradient descent to update the decision boundary; Iterate to get the optimal decision boundary; Real-time collection of data points including slip rate and traction; Preprocess the data points collected in real time; Based on the optimal decision boundary, calculate the logical probability of each data point after preprocessing; There are two methods for rapid identification of road surface switching: ① Calculate the sum of the difference between the logical probability and the boundary probability of N consecutive data points. If the sum exceeds the preset probability threshold, the road surface is switched, otherwise the road surface is not switched; ②According to the logical probability of each data point and the boundary probability, the judgment result of each data point is obtained, and the judgment results of N consecutive data points are counted. If the statistical result exceeds the preset counting threshold, the road surface is switched, otherwise the road surface is not switched; When a road surface switch is detected, the magic formula tire model is used to give the adhesion coefficient of the road surface after the switch, including: Use the data points after the road surface is switched to fit the linear area of the magic formula tire model, match the fitted straight line with the preset magic formula coefficient, and find the closest magic formula curve, which is the adhesion coefficient of the current road model; The magic formula tire model formula is: In the formula, It represents the slip rate, D is the peak value of the curve and also represents the adhesion coefficient of the current road surface, and B and C are the parameters of the magic formula of the tire.
2. The real-time road surface switching rapid identification method based on machine learning according to claim 1, It is characterized in that The slip rate is the slip rate on the left or right side of the car during driving.
3. The real-time road surface switching rapid identification method based on machine learning according to claim 1, It is characterized in that Preprocessing includes: Remove the data points during gear shifting and braking.
4. The real-time road surface switching rapid identification method based on machine learning according to claim 3, It is characterized in that The preprocessing further includes: taking the average slip rate and traction force of the data point set as the slip rate and traction force of a new single data point, and calculating the logical probability using the new single data point.
5. The real-time road surface switching rapid identification method based on machine learning according to claim 1, It is characterized in that When the variation range of the slip ratio is greater than a preset slip ratio variation threshold, the counting threshold is reduced.
6. An electronic device, It is characterized in that including one or more processors and memory; One or more programs are stored in a memory and configured to be executed by one or more processors, and the one or more programs are configured to execute the real-time road surface switching rapid identification method based on machine learning as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Decision-making method for multi-lane driving of unmanned vehicle based on reinforcement learning
CN110716562A
Method For Selecting And Presenting Examples To Explain Decisions Of Algorithms
US20200175367A1
Road surface condition detection with recursive adaptive learning and validation
US9139204B1
