Automatic driving GNSS deception detection method based on LightGBM prediction model

Through the prediction model based on LightGBM and K-Fold cross-validation technology, a GNSS spoofing detection method for autonomous vehicles is constructed, which solves the takeover vulnerability problem of the MSF positioning algorithm in the face of GNSS spoofing attacks and achieves efficient spoofing detection and Defense ensures the positioning accuracy and safety of autonomous vehicles.

CN118778073APending Publication Date: 2024-10-15SHANGHAI UNI SENTRY INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310350169.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-04
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The existing multi-sensor fusion (MSF) positioning algorithm has a takeover vulnerability when faced with GNSS spoofing attacks, making it difficult to effectively resist complex attack methods, resulting in a decrease in positioning accuracy and affecting the safety of autonomous vehicles.

Method used

An autonomous driving GNSS spoofing detection method based on the LightGBM prediction model is adopted. By preprocessing and feature screening of vehicle sensor data, a gradient boosting decision tree aggregation model is constructed, and K-Fold cross-validation is used to optimize model parameters to detect abnormalities in GNSS signals. Then determine whether you have been deceived.

Benefits of technology

It achieves a GNSS spoofing signal detection rate of more than 99% and a false alarm rate of 0.2%, significantly improving the detection capabilities of autonomous vehicles against GNSS spoofing attacks and ensuring road safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778073A_ABST
    Figure CN118778073A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic driving GNSS deception detection method based on a LightGBM prediction model, and the method comprises the following steps: 1, obtaining vehicle sensor data, carrying out the preprocessing of related sensor data, calculating the displacement of a vehicle in a period of time according to the vehicle sensor data of adjacent timestamps, taking the displacement as a training label, and carrying out the calculation of the displacement of the vehicle in a period of time; meanwhile, performing feature screening on the sensor data, and selecting feature data with high contribution degree to a prediction target; 2, labeling the preprocessed data, and dividing the data into a training data set, a verification data set and a test data set for subsequent LightGBM model training; step 3, constructing a LightGBM model used for prediction, training the LightGBM model on the training data set, and determining optimal hyper-parameters of the model by using a K-Fold cross validation method; gNSS positioning data to be detected and other vehicle sensor data are input into the model after the model is trained, the model can be used for predicting the position of a vehicle after being trained, and deception can be detected by comparing the predicted position with the position of a signal received in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of autonomous driving navigation safety technology and relates to an autonomous driving GNSS deception detection method based on a LightGBM prediction model. Technical Background

[0002] Today, more and more companies are developing level 3 and above autonomous vehicles, and some are already in use. In the future, highly automated vehicles will increasingly appear on the road, and the key prerequisite for achieving this is accurate and secure positioning. This means that the vehicle must always know its current position in an absolutely reliable way, with an error of less than a few centimeters. Because most applications on autonomous vehicles, including vehicle navigation and digital communications, rely on location and timing services based on the Global Navigation Satellite System (GNSS). Therefore, the motivation and events to disrupt these systems to endanger life safety and critical applications are increasing day by day. In addition to these natural environmental influences, the Global Navigation Satellite System is also subject to artificial spoofing attacks, including forwarding spoofing and generative spoofing. Since the structure of civilian GPS signals is known, it is not complicated to implement spoofing attacks. In recent years, the implementation of spoofing based on software receivers has become feasible and less costly.

[0003] In the past, it was generally believed that the multi-sensor fusion (MSF) positioning algorithm could defeat GNSS spoofing. However, a team from the University of California conducted the first security study on MSF-based positioning in high-level autonomous vehicles under GPS spoofing. The study showed that although the multi-sensor fusion scheme can indeed enhance the security against GPS spoofing, they found a takeover vulnerability that can fundamentally defeat the design principle of multi-sensor fusion and use it to design a new attack method, which captures and exploits the sensor noise and algorithm uncertainty of MSF in a timely manner, causing MSF to enter an uncertain period and be dominated by spoofing signals to achieve exponential growth of deviations. Summary of the invention

[0004] In order to cope with the emerging and increasingly complex and sophisticated attack methods, and in view of the wide application of MSF positioning in autonomous driving and the high attention paid to road safety, the present invention proposes an autonomous driving deception detection method based on the LightGBM prediction model. The vehicle dynamics are modeled based on the LightGBM prediction tree model, and after the K-Fold cross-validation is introduced to optimize the model parameters, the model can be used to predict the vehicle position after training, and deception can be detected by comparing the predicted position and the real-time received signal position.

[0005] It includes the following four steps:

[0006] Step 1: Obtain vehicle sensor data, pre-process relevant sensor data, calculate the displacement of the vehicle in a period of time based on the vehicle sensor data of adjacent timestamps, use it as a training label, and perform feature screening on the sensor data at the same time, and select a subset of features with high feature importance by manually setting thresholds;

[0007] Step 2: Label the preprocessed data and divide it into training, validation, and test data sets for subsequent LightGBM model training;

[0008] Step 3: Build a LightGBM model for prediction and train it on the training dataset, and use the K-Fold cross-validation method to determine the optimal hyperparameters of the model;

[0009] Step 4: After the model is trained, the GNSS positioning data to be detected is input into it, which can be used to predict the vehicle position. By comparing the predicted position with the real-time received signal position, deception can be detected.

[0010] In step one of the present invention, firstly extract the data of various vehicle sensors as the entire data set, including the longitude and latitude from GNSS and the vehicle attitude (current timestamp and previous timestamp), the speed, steering angle data and four wheel speeds from the controller area network (CAN), and the acceleration vector (front, right, and bottom) from the inertial measurement unit (IMU). According to the longitude and latitude data of the GNSS of adjacent timestamps, the corresponding training set label, i.e., the distance and direction traveled by the vehicle in the adjacent timestamps, can be calculated by the Vincenty formula. When screening features, first perform a training on the data set containing all features, derive the feature importance by calling feature_importance, and then screen out the top-ranked features on the training set and the test set of the complete feature data set by setting a threshold to form a feature subset. The feature subset is composed of features that contribute more to improving the accuracy of the regression model. The feature subset is screened to reduce the number of features of the model and reduce the time and memory consumed during training and prediction. The importance of features on the training set is quantified by recording the total number of feature splits and the total / average information gain during the training process. The model will score the feature importance according to the number of times it is used in LightGBM or the total / average information gain it brings, and finally sort it. The importance of features on the test set is a quantitative calculation of feature importance using test data after the model is trained. Specifically, the OOB data is first scored with the trained model to calculate the AUC or other business-defined evaluation indicators; then for each feature in the test data:

[0011] (1) Randomly shuffle the value of the current feature;

[0012] (2) Re-score the current data and calculate the evaluation indicators;

[0013] (3) Calculate the index change rate

[0014] According to the above method, a change rate will be obtained for each feature, and finally the importance of the feature will be quantified by sorting according to the change rate.

[0015] For the prediction object of direction, the invention introduces the driving direction of the last time stamp as feature data, because the driving direction of the vehicle is continuous. After the features are screened, the feature subsets are normalized and downsampled to align the data from different sensor sources.

[0016] Normalizing the feature subset refers to scaling the data so that it falls into a specific interval, removing the unit restriction of the data, and converting it into a dimensionless pure value, so that indicators of different units or magnitudes can be compared and weighted; the normalization adopts the Z-score standardization method, and after sampling to obtain the expected and standard deviation of the data, the data is shrunk to [0,1]. The formula used for normalization is as follows:

[0017] expect:

[0018] Standard Deviation:

[0019] Normalized results:

[0020] Among them, datagram i Indicates a feature of the message. Represents datagram i After normalization, Mean represents the expectation of the input feature, Variance represents the standard deviation of the input feature, and n is the number of features.

[0021] The downsampling of the feature data refers to that the method selects data features from GNSS as benchmark data. The frequencies of GNSS, CAN and IMU data are 10, 50 and 100 Hz respectively. Data with a frequency higher than the benchmark data needs to be downsampled. The downsampling uses the resample function of MATLAB, and a multi-phase filter is used to resample the time series at a specified ratio to obtain a new sequence. Here, the ratio is the ratio of the length of GNSS feature data to the length of IMU or CAN feature data. The ratio of the length of GNSS feature data to the length of IMU feature data is 1:5, and the ratio of the length of GNSS feature data to the length of CAN feature data is 1:10. Resample uses an anti-aliasing low-pass filter designed by the FIR method by default. The filter can have a strict linear phase-frequency characteristic while ensuring an arbitrary amplitude-frequency characteristic. At the same time, its unit sampling response is of finite length, so it is a stable system. This method calls it as a black box.

[0022] In step 2, the labeling is to add labels to the selected vehicle sensor feature data, and identify their true values ​​corresponding to each timestamp through the program. The true values ​​include distance and direction, which are subsequently used to train the LightGBM model. In addition, there is a label value, which is marked as normal for normal data and abnormal for deception data, but this label value does not participate in the LightGBM training. It is only used when measuring the detection rate and false alarm rate of the method in the end. That is, after the model is trained, we can introduce deception data sets or deception data set fragments, and the real data and deception data are marked with different labels. The prediction model and judgment criteria are used to detect the deception data set. The detection rate and false alarm rate of the model can be calculated based on the difference between the judgment results and the label values. The abnormal data includes both traditional GNSS deception methods such as forwarding attacks and generative attacks, as well as new GNSS attacks against multi-sensor fusion positioning solutions. The data set division is to divide the labeled data set into three parts: training, validation, and test data sets. The training data set is mainly used to train the LightGBM model so that the loss function of the LightGBM model is smaller. The validation data set is mainly used to verify the generalization ability of the LightGBM model, that is, the model's ability to adapt to new data. By comparing different generalization abilities, the selection of hyperparameters is optimized and the complexity of the LightGBM model is controlled. The test data is finally used to verify the LightGBM model's ability to judge unfamiliar data.

[0023] In step 3, the LightGBM model constructed for prediction is a gradient boosting decision tree aggregation model. The specific implementation process of the gradient boosting decision tree aggregation model is as follows: Input data T has N samples, n features, and the prediction target y of this algorithm iis the distance or direction traveled by the vehicle in a period of time, corresponding to different feature subsets x i , the decision tree aggregation model uses M additive functions to obtain the final regression tree At initialization, the current tree contains only one root node, which outputs a constant value c for any input sample, that is, f 0 (x) = c. Assuming the loss function is L(y, f(x)), first find c that minimizes the current loss function. The formula is: Then gradually update the current regression tree. When updating the m-1th (m=1, 2, ..., M)th regression tree to obtain the mth regression tree, calculate the residual of the current regression tree for each sample. The gradient boosting algorithm uses the value of the negative gradient of the loss function in the current model as the approximate value of the residual in the boosting tree algorithm for the regression problem. For the i-th (i=1, 2, ..., N)th sample, the residual calculation formula is: The residual of the previous regression tree is used as the fitting target of the next regression tree to be updated. Fitting a regression tree is actually to further divide the feature space, traverse possible split points, introduce new feature space units, and obtain the leaf node area R of the mth tree by minimizing the loss function through linear search. mj ,j=1,2,…,J. For j=1,2,…,J, calculate the regression constant of the region This results in the mth regression tree, namely I(x∈R mj ) means that when the sample feature value belongs to region R mj The update operation of the regression tree is actually to add new rules to the original rule set, and add different constant values ​​to the function values ​​of the samples divided into different leaf nodes for correction to achieve more refined regression prediction. The final regression tree model is obtained by continuously iteratively adding decision trees. The final regression tree is It can be seen as a set of rules applied to the divided feature areas.

[0024] When choosing a loss function, the negative gradient of the squared loss function is the residual, while the negative gradient of the general loss function is an approximation of the residual. This algorithm uses least squares as the loss function. The custom gradient solver and loss function are as follows:

[0025] Gradient solution function:

[0026]

[0027] Residuals:

[0028] gradient:

[0029] Second order derivative:

[0030] Where y is the true value, is the predicted value.

[0031] Loss measure function:

[0032]

[0033]

[0034] In the present invention, the K-Fold cross-validation method is used to determine the optimal hyperparameters of the model. The samples are first shuffled and then evenly divided into K parts. K-1 parts are selected for training in turn, and the remaining part is used for verification. The sum of squares of the prediction errors is calculated, and finally the sum of squares of the K prediction errors is averaged as the basis for selecting the optimal model structure. The steps of K-Fold cross validation are as follows: (1) Divide the entire training set S into k non-overlapping subsets. Assuming that the number of training samples in S is m, each subset has m / k training samples; (2) Take a model from the candidate models with different hyperparameters each time, then select k-1 from the training subset as the training set, and the remaining subset as the test set. Test the trained model to obtain the empirical error of the model until all k empirical errors of the model are obtained; (3) Since a subset is left as the test set each time, k empirical errors will be obtained. For each candidate model, its empirical error is the average of these k empirical errors; (4) Select the model with the smallest average error rate, which is the final model, and then use the entire data set to train again to obtain the final error. The K-Fold cross validation can be used to determine the hyperparameters of the model, that is, to determine the maximum depth of the heap regression tree, the number of leaf nodes, etc. The selection of hyperparameters needs to strike a balance between model complexity and accuracy.

[0035] The training in step three uses the labeled training set data to train the model, then iterates the model through the error of the model on the validation set, and finally tests the generalization ability of the model through the validation set; the above operations are repeated until the error converges to a certain value, that is, the model training is completed, and finally it is used to predict the position where the vehicle should appear at the next timestamp based on the input vehicle sensor data.

[0036] In step 4, the trained LightGBM model is a regression tree. Its logic for verifying deception is to predict a displacement vector in advance based on the input GNSS and other sensor data to obtain the expected location of the next timestamp. Each timestamp compares the position predicted by the previous timestamp with the position solved by the current positioning system. If the deviation distance exceeds the threshold, it is judged to be deception. The specific formula is

[0037] d p =LightGBM d (GNSS,IMU,CAN)

[0038] b p =LightGBM b (GNSS,IMU,CAN)

[0039] Among them, d p ,b p They are respectively the distance and direction of the vehicle to the next timestamp predicted by LightGBM based on the real sensor data passed in, and then the error between the real positioning longitude and latitude and longitude predicted by the model is calculated, that is, the distance d between the two longitude and latitude coordinates is calculated by the Vincenty formula diff = VincentyInverse(lat g ,lon g ,lat p ,lon p ), lat g ,lon g ,lat p ,lon p are the actual and predicted longitude and latitude respectively. Finally, the root mean square error of the m test samples is taken where d i The error between the predicted position and the real position for each timestamp is about 0.7m. Since the current positioning accuracy of the MSF positioning solution is 5-10cm, the threshold for the algorithm to determine whether it is deceived is set to 0.1m+0.7=0.8m. Chinese law stipulates that even when the speed is less than 20km / h, the distance between the front and rear vehicles should not be greater than 10m, and the latest attack against MSF requires a minimum deception offset of 1.945m. Therefore, it is impossible for an attacker to deceive and cause a safety accident within the error tolerance range of the deception detection method. Figure 2A schematic diagram of the model for detecting deception is given. At each timestamp, the predicted position of the previous timestamp is compared with the position calculated by the current positioning system. If the deviation distance exceeds the threshold, it is judged as being deceived and the recovery mechanism is triggered. Otherwise, it is judged as normal. This method converts the classification problem into a regression problem. The detection rate of GNSS deception attacks can be improved by adjusting the threshold and the model's fit to the vehicle dynamics model. It can resist both traditional GNSS deception attacks and increasingly complex and diverse new attack methods. Experiments show that the detection rate of deception signals by this method is over 99%, and the false alarm rate is only 0.2%. Figure 3 A comparison chart of the longitude and latitude coordinates predicted by this algorithm and the actual longitude and latitude coordinates on the test data set is given. The predicted trajectory and the actual trajectory are marked on Google Earth with dark and light colors respectively. In the non-deception scenario, the two trajectories are highly overlapped, which illustrates the accuracy of the prediction of this algorithm.

[0040] The beneficial effects of the present invention include: the present invention innovatively introduces a prediction-based machine learning method for detecting positioning signal anomalies, and indirectly solves the classification problem through a regression model, so as to improve the detection rate of GNSS spoofing attacks by adjusting the threshold and the model's fit to the vehicle dynamics model. It can resist both traditional GNSS spoofing attacks and increasingly complex and diverse new attack methods. The LightGBM model avoids the cumulative error of the Kalman filter in the MSF positioning system by directly learning the relationship between the vehicle's real-time sensor data and the actual displacement, and can more realistically reflect the vehicle's dynamic model, greatly improving the anomaly detection rate and accuracy; this aspect can resist new attacks against the MSF positioning system, making autonomous driving vehicles based on MSF positioning safer, and is expected to resist increasingly complex and diverse new attack methods in the future; and based on the message data and potential attack scenarios, a machine learning model structure and feature set that can be solved accordingly are proposed.

[0041] The present invention is experimentally compared with "PREDICTION-BASED GNSS SPOOFING ATTACK DETECTION FOR AUTONOMOUS VEHICLES" published in the Transportation Research Board 100th Annual Meeting. The paper uses the latitude and longitude and speed data from GNSS, the steering angle and speed data from CAN and the acceleration information in the front, right and lower three directions from IMU, and adopts the LSTM model to fit only the distance label. After training and testing with the same training set and test set, the detection threshold of the LSTM-based method is 1.565m, and the detection threshold of the present invention is 0.8m. The present invention is also compared with the "Edge Computingbased GPS Spoofing Detection Methods" published in the 2018 IEEE 23rd International Conference on Digital Signal Processing (DSP). This method uses OpenXC to directly collect the angle and speed data on the CAN bus in the car to form a data set containing 15 routes, each route lasting 10-20 minutes. The paper uses linear regression for fitting, and the average error is 6.25m. This method is also compared with "Efficientdrone hijacking detection using two-step GA-XGBoost" published in the "Journal of Systems Architecture". This method uses the GA-XGBoost model, and the detection accuracy in deception and non-deception scenarios is 96.3% and 100% respectively. The method of the present invention has a deception signal detection rate of more than 99%, and a false alarm rate of only 0.2%. Therefore, the present invention can improve the deception detection rate and reduce the false alarm rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flow chart of the autonomous driving GNSS spoofing detection method based on the LightGBM prediction model from training to application of the present invention.

[0043] Figure 2 This is a schematic diagram of GNSS deception determination for autonomous driving based on the LightGBM prediction model of the present invention.

[0044] Figure 3 It is a comparison chart between the predicted trajectory and the actual trajectory based on the LightGBM prediction model of the present invention. DETAILED DESCRIPTION

[0045] The invention is further described in detail with reference to the following specific embodiments and drawings. The process, conditions, experimental methods, etc. for implementing the present invention, except for the contents specifically mentioned below, are all common knowledge and common common sense in the art and are not particularly limited by the present invention.

[0046] The present invention discloses a method for detecting GNSS spoofing in an autonomous driving system based on a LightGBM prediction model, comprising the following steps: Step 1, obtaining vehicle sensor data, preprocessing relevant sensor data, calculating the displacement of the vehicle in a period of time according to the vehicle sensor data of adjacent timestamps, using it as a training label, and performing feature screening on the sensor data at the same time, selecting feature data with high contribution to the prediction target; Step 2, labeling the preprocessed data and dividing it into training, verification, and test data sets for subsequent LightGBM model training; Step 3, constructing a LightGBM model for prediction and training it on the training data set, and using the K-Fold cross-validation method to determine the optimal hyperparameters of the model; After the model is trained, the GNSS positioning data to be detected and other vehicle sensor data are input to it, and the model can be used to predict the vehicle position after training, and deception can be detected by comparing the predicted position and the real-time received signal position. The GNSS deception detection method described in the present invention can cope with the latest deception attacks against multi-sensor fusion positioning solutions, and can resist more complex and diverse GNSS deception attacks in the future.

[0047] Figure 1 As shown in the present invention, an autonomous driving GNSS spoofing detection method based on the LightGBM prediction model is provided, which specifically includes the following four steps:

[0048] Step 1: Obtain vehicle sensor data, pre-process relevant sensor data, calculate the displacement of the vehicle in a period of time based on the vehicle sensor data of adjacent timestamps, use it as a training label, and perform feature screening on the sensor data to select feature data with high contribution to the prediction target;

[0049] Step 2: Label the preprocessed data and divide it into training, validation, and test data sets for subsequent LightGBM model training;

[0050] Step 3: Build a LightGBM model for prediction and train it on the training dataset, and use the K-Fold cross-validation method to determine the optimal hyperparameters of the model;

[0051] Step 4: After the model is trained, the GNSS positioning data and vehicle sensor data to be detected are input into it. The trained model can be used to predict the vehicle position, and deception can be detected by comparing the predicted position with the real-time received signal position.

[0052] Figure 1 As shown in , in step one, first extract data from various vehicle sensors, including longitude and latitude and vehicle attitude from GNSS, speed and steering angle data from the controller area network (CAN), and acceleration vector from the inertial measurement unit (IMU). Based on the GNSS longitude and latitude data of adjacent timestamps, the Vincenty formula can be used to calculate the corresponding training set labels, that is, the distance and direction traveled by the vehicle in adjacent timestamps. When screening features, first perform a training on the entire data set to derive the feature importance, and then simultaneously screen out the feature subsets with the highest contribution on the training set and the test set by setting a threshold. After screening the feature data, normalize and downsample the data from different sensor sources to align them.

[0053] In step 1, the displacement (including distance and direction) of the vehicle during the period of time under the adjacent time stamps is calculated by the Vincenty formula, which is based on the assumption that the earth is an ellipsoid and has a smaller error than the great circle formula based on the earth being a sphere. For the prediction object of direction, since the driving direction of the vehicle is continuous, the invention introduces the driving direction of the previous time stamp as feature data to improve the prediction accuracy.

[0054] Normalizing the feature data refers to scaling the data so that it falls into a specific range, removing the unit restrictions of the data, and converting it into a dimensionless pure value, so that indicators of different units or magnitudes can be compared and weighted; the normalization adopts the Z-score standardization method, and after sampling the expected and standard deviation of the data, the data is shrunk to [0,1]. The formula used for normalization is as follows:

[0055] expect:

[0056] Standard Deviation:

[0057] Normalized results:

[0058] Among them, datagram i Indicates a feature of the message. Represents datagram i After normalization, Mean represents the expectation of the input feature, and Variance represents the standard deviation of the input feature.

[0059] The downsampling of the feature data refers to the method selecting data features from GNSS as benchmark data. The frequencies of GNSS, CAN and IMU data are 10, 50 and 100 Hz respectively. Data with a frequency higher than the benchmark data needs to be downsampled. The downsampling uses the resample function of MATLAB, and a multi-phase filter is used to resample the time series at a specified ratio to obtain a new sequence. Here, the ratio is the ratio of the length of GNSS feature data to the length of IMU or CAN feature data. Resample uses an anti-aliasing low-pass filter designed by the FIR method by default.

[0060] In step 2, the labeling is to add labels to the selected vehicle sensor feature data, and identify their true values ​​corresponding to each timestamp through the program. The true values ​​include distance and direction, which are subsequently used to train the LightGBM model. In addition, there is a label value, which is marked as normal for normal data and abnormal for deception data, but this label value does not participate in LightGBM training, and is only used when measuring the detection rate and false alarm rate of the method in the end; the abnormal data includes both traditional GNSS deception methods such as forwarding attacks and generative attacks, and new GNSS attacks against multi-sensor fusion positioning solutions.

[0061] Figure 1 As shown in , in step 2, the data set is divided into three parts: training, validation, and test data sets. The training data set is mainly used to train the LightGBM model to make the loss function of the LightGBM model smaller. The validation data set is mainly used to verify the generalization ability of the LightGBM model, that is, the model's ability to adapt to new data. By comparing different generalization capabilities, the selection of hyperparameters is optimized to control the complexity of the LightGBM model. The test data is finally used to verify the LightGBM model's ability to judge unfamiliar data.

[0062] In step 3, the LightGBM model constructed for prediction is a gradient boosting decision tree aggregation model. The specific implementation process of the gradient boosting decision tree aggregation model is as follows: Input data T has N samples, n features, and the prediction target y of this algorithm i is the distance or direction traveled by the vehicle in a period of time, corresponding to different feature subsets x i , the decision tree aggregation model uses M additive functions to obtain the final regression tree At initialization, the current tree contains only one root node, which outputs a constant value c for any input sample, that is, f 0 (x) = c. Assuming the loss function is L(y, f(x)), first find c that minimizes the current loss function. The formula is: Then gradually update the current regression tree. When updating the m-1th (m=1,2,…,M)th regression tree to obtain the mth regression tree, calculate the residual of the current regression tree for each sample. The gradient boosting algorithm uses the value of the negative gradient of the loss function in the current model as the approximate value of the residual in the boosting tree algorithm for the regression problem. For the i-th (i=1,2,…,N)th sample, the residual calculation formula is The residual of the previous regression tree is used as the fitting target of the next regression tree to be updated. Fitting a regression tree is actually to further divide the feature space, traverse possible split points, introduce new feature space units, and obtain the leaf node area R of the mth tree by minimizing the loss function through linear search. mj ,j=1,2,…,J. For j=1,2,…,J, calculate the regression constant of the region This results in the mth regression tree, namely I(x∈R mj ) means that when the sample feature value belongs to region R mj The value is 1 when , otherwise it is 0. The update operation is actually to add new rules to the original rule set. For the function values ​​where the sample feature values ​​fall in certain areas, a constant value is added to make corrections to achieve more refined regression predictions. The final regression tree is It can be seen as a set of rules applied to the divided feature areas.

[0063] When choosing the loss function, the negative gradient of the squared loss function is the residual, while the negative gradient of the general loss function is an approximation of the residual. The algorithm uses least squares as the loss function.

[0064] Gradient solution function:

[0065] Residuals:

[0066] gradient:

[0067] Second order derivative:

[0068] Where y is the true value, is the predicted value.

[0069] Loss measure function:

[0070]

[0071] Figure 1As shown in , in step 3, the K-Fold cross-validation method is used to determine the optimal hyperparameters of the model. The samples are first shuffled and then evenly divided into K parts. K-1 parts are selected for training in turn, and the remaining part is used for verification. The sum of squares of the prediction errors is calculated, and finally the sum of squares of the K prediction errors is averaged as the basis for selecting the optimal model structure. The steps of K-Fold cross validation are as follows: (1) Divide the entire training set S into k non-overlapping subsets. Assuming that the number of training samples in S is m, each subset has m / k training samples; (2) Take a model from the candidate models with different hyperparameters each time, then select k-1 from the training subset as the training set, and the remaining subset as the test set. Test the trained model to obtain the empirical error of the model until all k empirical errors of the model are obtained; (3) Since a subset is left as the test set each time, k empirical errors will be obtained. For each candidate model, its empirical error is the average of these k empirical errors; (4) Select the model with the smallest average error rate, which is the final model, and then use the entire data set to train again to obtain the final error. The K-Fold cross validation can be used to determine the hyperparameters of the model, that is, to determine the maximum depth of the heap regression tree, the number of leaf nodes, etc. The selection of hyperparameters needs to strike a balance between model complexity and accuracy.

[0072] Figure 1 As shown in , the LightGBM model trained in step 4 is a regression tree. Its logic for verifying deception is to predict a displacement vector in advance based on the input GNSS and other sensor data to obtain the expected location of the next timestamp. Each timestamp compares the position predicted by the previous timestamp with the position solved by the current positioning system. If the deviation distance exceeds the threshold, it is judged to be deception. The specific formula is

[0073] d p =LightGBM d (GNSS,IMU,CAN)

[0074] b p =LightGBM b (GNSS,IMU,CAN)

[0075] Among them, d p ,b p They are respectively the distance and direction of the vehicle to the next timestamp predicted by LightGBM based on the real sensor data passed in, and then the error between the real positioning longitude and latitude and longitude predicted by the model is calculated, that is, the distance d between the two longitude and latitude coordinates is calculated by the Vincenty formula diff = VincentyInverse(latg ,lon g ,lat p ,lon p ), lat g ,lon g ,lat p ,lon p are the actual and predicted longitude and latitude respectively. Finally, the root mean square error of the m test samples is taken where d i The error between the predicted position and the real position for each timestamp is about 0.7m. Since the current positioning accuracy of the MSF positioning solution is 5-10cm, the threshold for the algorithm to determine whether it is deceived is set to 0.1m+0.7=0.8m. Chinese law stipulates that even when the speed is less than 20km / h, the distance between the front and rear vehicles should not be greater than 10m, and the latest attack against MSF requires a minimum deception offset of 1.945m. Therefore, it is impossible for an attacker to deceive and cause a safety accident within the error tolerance range of the deception detection method. Figure 2 A schematic diagram of the model for detecting deception is given. At each timestamp, the position predicted by the previous timestamp is compared with the position solved by the current positioning system. If the deviation distance exceeds the threshold, it is judged as deception and the recovery mechanism is triggered. Otherwise, it is judged as normal.

[0076] Specifically, the present invention is divided into two stages. In the first stage, it is first necessary to collect a certain amount of sensor data on the vehicle, and then pre-process the collected data as described in step one, including using a program to calculate the label corresponding to each timestamp of the collected data and down-sampling and aligning data from different sources, so that it can be used for model training later. After the model is built, as described in step three, it is necessary to use K-fold cross-validation to optimize the hyperparameters to obtain an optimal model. At this time, the model can be trained using the pre-processed data. The model learns the vehicle dynamics model through the features and labels of the input data, which is used for subsequent displacement vector prediction. After the model is trained, the first stage is marked as completed. After that, the test set sensor data required by the prediction model can be directly passed into the prediction model for detection, and a predicted position can be obtained, and then compared with the position solved by the positioning system according to the threshold to determine whether it is deceptive or not.

[0077] The present invention is experimentally compared with "PREDICTION-BASED GNSS SPOOFING ATTACK DETECTION FOR AUTONOMOUS VEHICLES" published in the Transportation Research Board 100th Annual Meeting. The paper uses the latitude and longitude and speed data from GNSS, the steering angle and speed data from CAN and the acceleration information in the front, right and lower three directions from IMU, and adopts the LSTM model to fit only the distance label. After training and testing with the same training set and test set, the detection threshold of the LSTM-based method is 1.565m, and the detection threshold of the present invention is 0.8m. The present invention is also compared with the "Edge Computingbased GPS Spoofing Detection Methods" published in the 2018 IEEE 23rd International Conference on Digital Signal Processing (DSP). This method uses OpenXC to directly collect the angle and speed data on the CAN bus in the car to form a data set containing 15 routes, each route lasting 10-20 minutes. The paper uses linear regression for fitting, and the average error is 6.25m. This method is also compared with the "Efficientdrone hijacking detection using two-step GA-XGBoost" published in the "Journal of Systems Architecture". This method uses the GA-XGBoost model, and the detection accuracy in the deception and non-deception scenarios is 96.3% and 100% respectively. Our method has a deception signal detection rate of more than 99%, and a false alarm rate of only 0.2%. Therefore, the present invention can improve the deception detection rate and reduce the false alarm rate.

[0078] The protection content of the present invention is not limited to the above embodiments. Without departing from the spirit and scope of the inventive concept, changes and advantages that can be thought of by those skilled in the art are included in the present invention and are protected by the attached claims.

Claims

1. A GNSS spoofing detection method for autonomous driving based on the LightGBM prediction model, characterized in that: The following steps are involved: Step 1: Obtain vehicle sensor data, preprocess the relevant sensor data, calculate the vehicle's displacement over a period of time based on the vehicle sensor data of adjacent timestamps, use this as the training label, and perform feature screening on the sensor data. By manually setting the threshold, a subset of features with high feature importance is selected. Step 2: Label the preprocessed data and divide it into training, validation, and test data sets for subsequent LightGBM model training; Step 3: Build a LightGBM model for prediction and train it on the training dataset, and use the K-Fold cross-validation method to determine the optimal hyperparameters of the model; Step 4: After the model is trained, the GNSS positioning data to be detected and other vehicle sensor data are input into it to predict the vehicle position. By comparing the predicted position with the real-time received signal position, deception can be detected.

2. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: In step 1, the data obtained from the vehicle sensors include the latitude and longitude and vehicle attitude from the GNSS, the speed and steering angle data and four wheel speeds from the controller area network CAN, and the acceleration vector from the inertial measurement unit IMU.

3. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: In step 1, the displacement of the vehicle during the period of adjacent timestamps is calculated using the Vincenty formula, and the driving direction of the previous timestamp is introduced as training feature data to improve prediction accuracy.

4. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: Step 1 also includes the steps of normalizing and downsampling the feature subsets to align data from different sensor sources; Normalizing data features refers to scaling the data so that it falls within a specific range, removing the unit restrictions of the data, and converting it into dimensionless pure values ​​to facilitate comparison and weighting of indicators of different units or magnitudes. The normalization adopts the Z-score standardization method. After sampling to obtain the expected value and standard deviation of the data, the data is shrunk to the range [0, 1]. The formula used for normalization is as follows: expect: Standard Deviation: Normalized results: Among them, datagram i Indicates a feature of the message. Represents datagram i After normalization, Mean represents the expectation of the input feature, and Variance represents the standard deviation of the input feature; The downsampling of the feature data refers to the method selecting data features from GNSS as benchmark data. The frequencies of GNSS, CAN and IMU data are 10, 50 and 100 Hz respectively. Data with a frequency higher than the benchmark data needs to be downsampled. The downsampling uses MATLAB's resample function, and a polyphase filter is used to resample the time series according to a specified ratio to obtain a new sequence. Here, the ratio is the ratio of the length of GNSS feature data to the length of IMU or CAN feature data. The ratio of the length of GNSS feature data to the length of IMU feature data is 1:5, and the ratio of the length of GNSS feature data to the length of CAN feature data is 1:

10. Resample uses an anti-aliasing low-pass filter designed using the FIR method by default.

5. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: In step 2, the labeling is to add labels to the selected vehicle sensor feature data, and identify their true values ​​corresponding to each timestamp through a program. The true values ​​include distance and direction, which are subsequently used to train the LightGBM model; normal data is labeled as normal, and deception data is labeled as abnormal. The label value does not participate in the LightGBM training, but is only used when measuring the detection rate and false alarm rate of the method. That is, after the model is trained, a deception data set or a deception data set fragment is introduced, and the real data and the deception data are marked with different labels. The prediction model and judgment criteria are used to detect the deception data set, and the detection rate and false alarm rate of the model are calculated according to the difference between the judgment result and the label value; the abnormal data includes both traditional GNSS deception methods such as forwarding attacks and generative attacks, as well as new GNSS attacks against multi-sensor fusion positioning solutions; The data set division is to divide the labeled data set into three parts: training, validation, and test data sets. The training data set is used to train the model so that the loss function of the model is smaller under the gradient boosting algorithm. The validation data set is used to verify the generalization ability of the model and optimize the selection of hyperparameters by comparing different generalization abilities. The test data is finally used to verify the model's ability to judge unfamiliar data.

6. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: In step 3, the constructed LightGBM prediction model is a gradient boosting decision tree aggregation model; The specific implementation process of the gradient boosting decision tree aggregation model is as follows: Input data T has N samples, n features, and predicts the target y i is the distance or direction traveled by the vehicle within a period of time, corresponding to different feature subsets x i , the decision tree aggregation model uses M additive functions to obtain the final regression tree At initialization, the current tree contains only one root node, which outputs a constant value c for any input sample, that is, f0(x)=c. Assuming that the loss function is L(y,f(x)), we first look for c that minimizes the current loss function. The formula is Then gradually update the current regression tree. When updating the m-1th (m=1,2,…,M)th regression tree to obtain the mth regression tree, calculate the residual of the current regression tree for each sample. The gradient boosting algorithm uses the negative gradient of the loss function in the current model as the approximate value of the residual in the regression problem boosting tree algorithm. For the i-th (i=1,2,…,N)th sample, the residual calculation formula is The residual of the previous regression tree is used as the fitting target of the next regression tree to be updated. Fit a regression tree, further divide the feature space, traverse possible split points, introduce new feature space units, and obtain the leaf node area R of the mth tree by minimizing the loss function through linear search mj ,j=1,2,…,J; for j=1,2,…,J, calculate the regression constant of the region This results in the mth regression tree, namely I(x∈R mj ) means that when the sample feature value belongs to region R mj The update operation of the regression tree refers to adding new rules to the original rule set, adding different constant values ​​to the function values ​​of the samples divided into different leaf nodes for correction, and achieving more refined regression prediction; the final regression tree model is obtained by continuously iteratively adding decision trees, and the final regression tree is Represents a set of rules applied to the divided feature areas.

7. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: In step 2, when selecting the loss function, the algorithm uses least squares as the loss function. The custom gradient solver function and loss function are as follows. Gradient solver function: Residuals: gradient: Second-order derivative: Where y is the true value, is the predicted value; Loss measurement function:

8. The autonomous driving GNSS spoofing detection method based on the LightGBM prediction model according to claim 1 is characterized in that: In step 3, the K-Fold algorithm is used to determine the hyperparameters of the model, that is, to determine the maximum depth of the heap regression tree, the number of leaf nodes, etc. The steps of K-Fold cross validation are as follows: (1) Divide the entire training set S into k disjoint subsets. Assuming that the number of training examples in S is m, then each subset has m / k training examples. (2) Each time a model is selected from the candidate models with different hyperparameters, and then k-1 models are selected from the training subset as the training set, and the remaining subset is used as the test set. The trained model is tested to obtain the empirical error of the model until all k empirical errors of the model are obtained; (3) Since a subset is left as a test set each time, k empirical errors will be obtained. For each candidate model, its empirical error is the average of these k empirical errors; (4) Select the model with the smallest average error rate, which is the final model, and then use the entire data set to train again to obtain the final error.

9. The method for detecting GNSS spoofing in autonomous driving based on the LightGBM prediction model according to claim 1, characterized in that: In step 4, the trained LightGBM model is a regression tree. Its logic for verifying deception is to predict a displacement vector in advance based on the input GNSS and other sensor data to obtain the expected arrival position of the next timestamp. At each timestamp, the position predicted by the previous timestamp is compared with the currently received GNSS position. If the position exceeds the threshold, it is judged to be deception. The specific formula is: d p =LightGBM d (GNSS,IMU,CAN), b p =LightGBM b (GNSS,IMU,CAN), Among them, d p ,b p They are respectively the distance and direction of the vehicle to the next timestamp predicted by LightGBM based on the real sensor data passed in, and then the error between the real positioning longitude and latitude and longitude predicted by the model is calculated.

Citation Information

Cited By

  • Intelligent data processing method and system of vehicle-mounted monitoring equipment

    CN120528986A