A method for detecting and defending against automotive sensor attacks based on multi-model fusion
Through a multi-model fusion method, combined with classification and regression functions, it can identify vehicle driving conditions and predict sensor data, solving the limitations of a single LSTM model in complex working conditions, achieving effective detection and defense of non-intrusive attacks, and improving improve the safety of automotive sensors.
Patent Information
- Application Number
- CN202110912649.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-08-10
AI Technical Summary
Existing technologies have limitations in the detection and defense of automotive sensor attacks. In particular, it is difficult for a single LSTM model to effectively identify non-intrusive high-frequency acoustic attacks under complex driving conditions, resulting in reduced detection and defense effects.
Using a multi-model fusion method, combined with the classification function of SVC and LSTM and the regression function of AR, RNN and LSTM, the vehicle driving conditions are identified and data predicted. Real-time attack detection and defense are realized through threshold comparison, which improves the accuracy of attack detection. performance and defense success rate.
It improves the recognition accuracy of complex driving conditions and the accuracy of automobile sensor attack detection, provides effective non-intrusive attack detection and defense methods, and significantly improves security.
Smart Images

Figure CN113722982B
Abstract
Description
Technical Field
[0001] The invention relates to an automobile sensor attack detection and defense method based on multi-model fusion, and belongs to the field of security. Background Art
[0002] In order to provide more functions and safety for cars, sensors are widely used, but they are vulnerable to physical attacks to a certain extent. Once the sensors are attacked, the car control system will receive data errors, which may cause unpredictable consequences and serious safety hazards. When the on-board sensors are attacked, if the system can identify them in the first time and take corresponding remedial measures, it will reduce the incidence of traffic accidents and protect people's personal safety.
[0003] In order to effectively ensure the safe driving of automobiles, many technicians have applied deep learning methods to the problem of automatic and efficient detection and defense of automobile attacks, but most of them are applied to CAN buses, and few people apply deep learning methods to attack detection and defense of automobile sensors. A single LSTM model will have certain limitations under a variety of complex driving conditions. The multi-model fusion method proposed in this invention: classification model (SVC, LSTM), regression prediction model (LSTM, AR, RNN), not only improves the accuracy of identifying complex driving conditions, but also improves the accuracy of attack detection and the success rate of defense of automobile sensors.
[0004] Although LSTM has good performance in solving classification and regression problems, a single LSTM model has certain limitations under various complex driving conditions, resulting in a decrease in the detection and defense effect of automobile sensors when they are attacked by non-invasive methods. The attack type mentioned here is a high-frequency sound wave attack, specifically the resonance generated by high-frequency sound waves and MEMS gyroscopes, which causes the MEMS gyroscopes to generate abnormal data. Therefore, the present invention proposes a method for detecting and defending automobile sensor attacks based on multi-model fusion. First, the classification function of SVC and LSTM is used to identify the driving conditions of the automobile. After accurately identifying the working conditions, the regression function of AR, RNN, and LSTM is used to predict the real-time data of the automobile sensor. The weight of the predicted value is allocated according to the accuracy of the above three models predicting the sensor data at different speeds under different working conditions. The actual value and the predicted value are compared in real time by a threshold-based method to defend against attacks on automobile sensors. In addition, few people at home and abroad are currently involved in the research on attack detection and defense of automobile sensors based on multi-model fusion. The present invention has certain foresight. Summary of the invention
[0005] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a vehicle sensor attack detection and defense method based on multi-model fusion.
[0006] The technical solution adopted by the present invention is:
[0007] A method for detecting and defending against attacks on automobile sensors based on multi-model fusion. The data collected by Carsim and MATLAB\Simulink joint simulation is preprocessed. The classification function of SVC and LSTM is first used to judge the driving conditions of the automobile. After accurately identifying the working conditions, AR, RNN, and LSTM are used to train the automobile sensor data. When the loss function meets the conditions, the training is terminated and the respective models are saved. The trained models are then verified on the test set. The window cumulative error method is used to determine whether the current sensor is under attack. If the sensor is under attack, the predicted value is used to replace the actual value of the sensor and enter the control unit for calculation, so as to defend. The specific steps include:
[0008] Step 1: Use Carsim and MATLAB\Simulink for joint simulation to collect various driving condition data at different speeds: vehicle speed V, yaw angular velocity AVz, lateral acceleration Ay, and steering wheel angle Steer_SW;
[0009] Step 2: Preprocess the dataset:
[0010] Step 2-1: Check the integrity of the data in the collected data set and make up for any missing values;
[0011] Step 2-2: Normalize the data in the dataset according to the following formula:
[0012]
[0013] Where, X * represents the normalized data, X represents the data before normalization, and X min Represents the minimum value of a certain sensor of the car in the current data sequence, X max Represents the maximum value of a certain sensor of the car in the current data sequence;
[0014] Step 2-3: The present invention mainly performs eight classifications for multiple complex driving conditions. Mainly through the different steering wheel angles Steer_SW, the three sensor data of the car: yaw angular velocity AVz, lateral acceleration Ay, steering wheel angle Steer_SW are classified according to different driving conditions of the car. "Straight line" is marked as 0, "left lane change" is marked as 1, "right lane change" is marked as 2, "left continuous lane change" is marked as 3, "right continuous lane change" is marked as 4, "left right-angle turn" is marked as 5, "right right-angle turn" is marked as 6, and "U-turn" is marked as 7, and the labels and other feature attributes are stored separately;
[0015] Step 3: Select and split the data set:
[0016] Step 3-1: The sensor data of a very short time T (0.5s) at the beginning of the vehicle driving under various driving conditions preprocessed in step 2 is used as classification samples;
[0017] Step 3-2: Introduce a data segmentation algorithm to perform equal-interval segmentation on the data set and expand the sample volume of the data set;
[0018] Step 3-3: Repeat step 3-2 to merge all segmented data into a large sample and name it the classification sample dataset Classify_data;
[0019] Step 3-4: Save all the data sets of sensor data collected in step 1, including vehicle speed V, yaw angular velocity AVz, and steering wheel angle Steer_SW, separately and name them as detection sample data set Prediction_data;
[0020] Step 4: Use the multi-model fusion algorithm to train in different driving conditions:
[0021] Step 4-1: Select 70% of the dataset Classify_data in step 3-3 as the training set for classification training, use a part of the dataset Classify_data in step 3-3 as the test set, and use the softmax function as the activation function;
[0022] Step 4-2: The evaluation indicators of classification accuracy are expressed using Accuracy and Error_rate:
[0023]
[0024]
[0025] In the formula, TP means that the true category is a positive example and the predicted category is a positive example; TN means that the true category is a negative example and the predicted category is a negative example, P represents the total number of positive examples and N represents the total number of negative examples; FP means that the true category is a negative example and the predicted category is a positive example; FN means that the true category is a positive example and the predicted category is a negative example;
[0026] Step 4-3: Select a part of the dataset Prediction_data in step 3-4 as the training set for regression prediction training, use a part of the dataset Prediction_data in step 3-4 as the test set, and use the linear function as the activation function;
[0027] Step 4-4: Regression prediction uses a sliding time window method, taking the value of the next time point as the training label of the sample at the previous time point. The regression model can be based on the previous sequence in Prediction_data in step 3-4. Predict the predicted value at the next moment (t) The first t-1 data are fed into the model’s input layer in sequence as input data, and the predicted value at the next moment is Only depends on Set the output prediction value X of LSTM, AR, and RNN in the regression prediction model (L) , X (A) , X (R) , the weight of the predicted value is obtained by the following formula, where Represents the actual value at time t:
[0028]
[0029] sta(NM)1+a(NM)2+a(NM)3=1
[0030]
[0031] Wherein, N represents the working condition, and the value range of N is 0 to 7; M represents the speed level, and the set vehicle speed range is 5 km / h to 80 km / h, and every 5 km / h represents a speed level, that is, the value range of M is 0 to 15.
[0032] Step 5: Training phase: The classification model uses CrossEntropyLoss as the loss function, and the optimization algorithm uses adam. The regression prediction model uses mse as the loss function, and the optimization algorithm uses rmsprop.
[0033] Step 6: When the loss converges to the minimum value, save the classification model and regression prediction model respectively;
[0034] Step 7: Design a multi-model fusion algorithm;
[0035] Step 7-1: Use the test set of Classify_data in step 3-3 as the input of the classification model, set the weights of the output values of SVC and LSTM, and then sum them up, and identify which driving condition it belongs to based on the summation result;
[0036] Step 7-2: Select different regression prediction models in step 6 according to different driving conditions, and predict the test set data of Prediction_data in step 3-4;
[0037] Step 8: Calculate the predicted value at the current moment With actual value The error e t ,The window error accumulation method is used to determine whether the car sensor data is attacked;
[0038] Step 9: Manually set a threshold W0, select a time sliding window m, and calculate the cumulative error between the predicted value and the actual value in the current window And compare it with W0. If it is greater than W0, the actual value at time t is determined to be abnormal data, that is, the car sensor is attacked. At the same time, the predicted value is used instead of the actual value to enter the next window sequence and input into the regression prediction model for calculation, achieving the effect of defending against attacks.
[0039] Preferably, the extremely short time T of step 3-1 is 0.5 s.
[0040] Preferably, 30% of the dataset Classify_data in step 3-3 is used as a test set; in step 4-3, 70% of the dataset Prediction_data in step 3-4 is selected as a training set for regression prediction training, and 30% of the dataset Prediction_data in step 3-4 is used as a test set.
[0041] Preferably, in step 4-4, the value range of the working condition N is 0-7; the value range of the speed level M is 0-15.
[0042] Preferably, in step 7-1, the weights of the output values of SVC and LSTM are both set to 0.5 and then summed.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] 1. Compared with the single model recognition of driving conditions, the multi-model fusion proposed in the present invention improves the accuracy of recognizing complex driving conditions;
[0045] 2. Compared with single model attack detection and defense, the multi-model fusion method proposed in the present invention improves the accuracy of attack detection and defense success rate of automobile sensors;
[0046] 3. For non-invasive covert attacks, the present invention proposes an effective detection and defense method, which has certain practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flow chart of the automobile sensor attack detection and defense method based on multi-model fusion of the present invention;
[0048] Figure 2 It is a schematic diagram of a sliding time window of the method of the present invention;
[0049] Figure 3 is a schematic diagram of the predicted substitution mechanism of the method of the present invention;
[0050] Figure 4 It is a schematic diagram of the framework of the automobile sensor attack detection and defense method based on multi-model fusion of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention is clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] A method for detecting and defending against attacks on automotive sensors based on multi-model fusion, such as Figure 1 As shown, it includes data preprocessing, data set selection and segmentation, classification model training, regression prediction model selection, attack detection and defense. The specific steps are as follows:
[0053] Step 1: Use Carsim and MATLAB\Simulink for joint simulation to collect various driving condition data at different speeds: V (vehicle speed), AVz (yaw angular velocity), Ay (lateral acceleration), Steer_SW (steering wheel angle);
[0054] Step 2: Preprocess the dataset:
[0055] Step 2-1: Check the integrity of the data in the collected data set and make up for any missing values;
[0056] Step 2-2: Normalize the data in the dataset according to the following formula:
[0057]
[0058] Where, X * represents the normalized data, X represents the data before normalization, and X min Represents the minimum value of a certain sensor of the car in the current data sequence, X max Represents the maximum value of a certain sensor of the car in the current data sequence;
[0059] Step 2-3: The present invention mainly classifies multiple complex driving conditions into eight categories. Mainly through the different Steer_SW (steering wheel) angles, the three sensor data of the car: AVz (yaw angular velocity), Ay (lateral acceleration), Steer_SW (steering wheel angle) are classified according to different driving conditions of the car. "Straight line" is marked as 0, "left lane change" is marked as 1, "right lane change" is marked as 2, "left continuous lane change" is marked as 3, "right continuous lane change" is marked as 4, "left right-angle turn" is marked as 5, "right right-angle turn" is marked as 6, and "U-turn" is marked as 7, and the labels and other feature attributes are stored separately;
[0060] Step 3: Select and split the data set:
[0061] Step 3-1: The sensor data of a very short time (0.5s) at the beginning of the vehicle driving under various driving conditions preprocessed in step 2 is used as classification samples;
[0062] Step 3-2: Introduce a data segmentation algorithm to perform equal-interval segmentation on the data set and expand the sample volume of the data set;
[0063] Step 3-3: Repeat step 3-2 to merge all segmented data into a large sample and name it the classification sample dataset Classify_data;
[0064] Step 3-4: Save all the data sets of sensor data V (vehicle speed), AVz (yaw angular velocity), and Steer_SW (steering wheel angle) collected in step 1 separately and name them as the detection sample data set Prediction_data;
[0065] Step 4: Use the multi-model fusion algorithm to train in different driving conditions:
[0066] Step 4-1: Select 70% of the dataset Classify_data in step 3-3 as the training set for classification training, use 30% of the dataset Classify_data in step 3-3 as the test set, and use the softmax function as the activation function;
[0067] Step 4-2: The evaluation indicators of classification accuracy are expressed using Accuracy and Error_rate:
[0068]
[0069]
[0070] In the formula, TP means that the true category is a positive example and the predicted category is a positive example; TN means that the true category is a negative example and the predicted category is a negative example, P represents the total number of positive examples and N represents the total number of negative examples; FP means that the true category is a negative example and the predicted category is a positive example; FN means that the true category is a positive example and the predicted category is a negative example;
[0071] Step 4-3: Select 70% of the dataset Prediction_data in step 3-4 as the training set for regression prediction training, use 30% of the dataset Prediction_data in step 3-4 as the test set, and use the linear function as the activation function; Step 4-4: Regression prediction uses a sliding time window, and uses the value of the next time point as the training label of the sample at the previous time point. The regression model can be based on the previous sequence in Prediction_data in step 3-4 Predict the predicted value at the next moment (t) The first t-1 data are fed into the model’s input layer in sequence as input data, and the predicted value at the next moment is Only depends on Set the output prediction value X of LSTM, AR, and RNN in the regression prediction model L , X A , X R , the weight of the predicted value is obtained by the following formula, where Represents the actual value at time t:
[0072]
[0073] sta(NM)1+a(NM)2+a(NM)3=1
[0074]
[0075] Wherein, N represents the working condition, and the value range of N is 0 to 7; M represents the speed level, and the set vehicle speed range is 5 km / h to 80 km / h, and every 5 km / h represents a speed level, that is, the value range of M is 0 to 15.
[0076] Step 5: Training phase: The classification model uses CrossEntropyLoss as the loss function, and the optimization algorithm uses adam. The regression prediction model uses mse as the loss function, and the optimization algorithm uses rmsprop.
[0077] Step 6: When the loss converges to the minimum value, save the classification model and regression prediction model respectively;
[0078] Step 7: Design a multi-model fusion algorithm;
[0079] Step 7-1: Use the test set of Classify_data in step 3-3 as the input of the classification model, set the weights of the output values of SVC and LSTM to 0.5, and then sum them up. According to the summation result, identify which driving condition it belongs to;
[0080] Step 7-2: Select different regression prediction models in step 6 according to different driving conditions, and predict the test set data of Prediction_data in step 3-4;
[0081] Step 8: Calculate the predicted value at the current moment With actual value The error e t ,The window error accumulation method is used to determine whether the car sensor data is attacked;
[0082] Step 9: Manually set a threshold W0, select a time sliding window m, and calculate the cumulative error between the predicted value and the actual value in the current window And compare it with W0. If it is greater than W0, the actual value at time t is determined to be abnormal data, that is, the car sensor is attacked. At the same time, the predicted value is used instead of the actual value to enter the next window sequence and input into the regression prediction model for calculation, achieving the effect of defending against attacks.
[0083] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A method for detecting and defending against vehicle sensor attacks based on multi-model fusion, specifically The following steps are involved: Step 1: Use Carsim and MATLAB\Simulink for joint simulation to collect various driving condition data at different speeds: vehicle speed V, yaw angular velocity AVz, lateral acceleration Ay, and steering wheel angle Steer_SW; Step 2: Preprocess the dataset: Step 2-1: Check the integrity of the data in the collected data set and make up for any missing values; Step 2-2: Normalize the data in the dataset according to the following formula: Where, X * represents the normalized data, X represents the data before normalization, and X min Represents the minimum value of a certain sensor of the car in the current data sequence, X max Represents the maximum value of a certain sensor of the car in the current data sequence; Step 2-3: For multiple complex driving conditions, eight classifications are performed. Mainly through the different angles of the steering wheel Steer_SW, the three sensor data of the car are marked as 0 for "straight line", 1 for "left lane change", 2 for "right lane change", 3 for "left continuous lane change", 4 for "right continuous lane change", 5 for "left right angle turn", 6 for "right right angle turn", and 7 for "U-turn" according to different driving conditions of the car, and the labels and other feature attributes are stored separately; the three sensor data refer to the yaw angular velocity AVz, the lateral acceleration Ay, and the steering wheel angle Steer_SW; Step 3: Select and split the data set: Step 3-1: The sensor data of the extremely short time T at the beginning of the vehicle driving under various driving conditions preprocessed in step 2 are used as classification samples, and the extremely short time T is 0.5s; Step 3-2: Introduce a data segmentation algorithm to perform equal-interval segmentation on the data set and expand the sample volume of the data set; Step 3-3: Repeat step 3-2 to merge all segmented data into a large sample and name it the classification sample dataset Classify_data; Step 3-4: Save all the data sets of sensor data collected in step 1, including vehicle speed V, yaw angular velocity AVz, and steering wheel angle Steer_SW, separately and name them as detection sample data set Prediction_data; Step 4: Use the multi-model fusion algorithm to train in different driving conditions: Step 4-1: Select 70% of the dataset Classify_data in step 3-3 as the training set for classification training, use a part of the dataset Classify_data in step 3-3 as the test set, and use the softmax function as the activation function; Step 4-2: The evaluation indicators of classification accuracy are expressed using Accuracy and Error_rate: In the formula, TP means that the true category is a positive example and the predicted category is a positive example; TN means that the true category is a negative example and the predicted category is a negative example, P represents the total number of positive examples and N represents the total number of negative examples; FP means that the true category is a negative example and the predicted category is a positive example; FN means that the true category is a positive example and the predicted category is a negative example; Step 4-3: Select a part of the dataset Prediction_data in step 3-4 as the training set for regression prediction training, use a part of the dataset Prediction_data in step 3-4 as the test set, and use the linear function as the activation function; Step 4-4: Regression prediction uses a sliding time window method, taking the value of the next time point as the training label of the sample at the previous time point. The regression model can be based on the previous sequence in Prediction_data in step 3-4. Predict the predicted value at the next moment (t) The first t-1 data are fed into the model’s input layer in sequence as input data, and the predicted value at the next moment is Only depends on Set the output prediction value X of LSTM, AR, and RNN in the regression prediction model (L) , X (A) , X (R) , the weight of the predicted value is obtained by the following formula, where Represents the actual value at time t: Where, N represents the working condition, and the value range of N is 0 to 7; M represents the speed level, and the set speed range is 5 km / h to 80 km / h, and every 5 km / h represents a speed level, that is, the value range of M is 0 to 15; Step 5: Training phase: The classification model uses CrossEntropyLoss as the loss function, and the optimization algorithm uses adam. The regression prediction model uses mse as the loss function, and the optimization algorithm uses rmsprop. Step 6: When the loss converges to the minimum value, save the classification model and regression prediction model respectively; Step 7: Design a multi-model fusion algorithm; Step 7-1: Use the test set of Classify_data in step 3-3 as the input of the classification model, set the weights of the output values of SVC and LSTM, and then sum them up, and identify which driving condition it belongs to based on the summation result; Step 7-2: Select different regression prediction models in step 6 according to different driving conditions, and predict the test set data of Prediction_data in step 3-4; Step 8: Calculate the predicted value at the current moment With actual value The error e t ,The window error accumulation method is used to determine whether the car sensor data is attacked; Step 9: Manually set a threshold W 0 , select a time sliding window m, and calculate the cumulative error between the predicted value and the actual value in the current window And with W 0 Compare; if greater than W 0 , then the actual value at time t is determined to be abnormal data, that is, the car sensor is attacked; at the same time, the predicted value is used instead of the actual value to enter the next window sequence and input into the regression prediction model to participate in the calculation, thereby achieving the effect of defending against attacks.
2. The automobile sensor attack detection and defense method based on multi-model fusion as claimed in claim 1, Features: 30% of the dataset Classify_data in step 3-3 is used as the test set; in step 4-3, 70% of the dataset Prediction_data in step 3-4 is selected as the training set for regression prediction training, and 30% of the dataset Prediction_data in step 3-4 is used as the test set.
3. The automobile sensor attack detection and defense method based on multi-model fusion as claimed in claim 1, Features: In step 7-1, the weights of the output values of SVC and LSTM are set to 0.5 and then summed.
