CN113255725B - Automobile sensor attack detection and repair method based on two-stage LSTM - Google Patents

Automobile sensor attack detection and repair method based on two-stage LSTM Download PDF

Info

Publication number
CN113255725B
CN113255725B CN202110422459.0A CN202110422459A CN113255725B CN 113255725 B CN113255725 B CN 113255725B CN 202110422459 A CN202110422459 A CN 202110422459A CN 113255725 B CN113255725 B CN 113255725B
Authority
CN
China
Prior art keywords
data
value
automobile
rlstm
attack
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110422459.0A
Other languages
Chinese (zh)
Other versions
CN113255725A (en
Inventor
洪榛
周磊强
李雄
刘涛
朱琦
陈焕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN202110422459.0A priority Critical patent/CN113255725B/en
Publication of CN113255725A publication Critical patent/CN113255725A/en
Application granted granted Critical
Publication of CN113255725B publication Critical patent/CN113255725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2433Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Steering Control In Accordance With Driving Conditions (AREA)

Abstract

According to the two-stage LSTM method, various steering conditions of an automobile are marked according to the intensity of steering wheel angle change, characteristic extraction is carried out by using a CLSTM (classification model), the current steering condition of the automobile is accurately identified, the corresponding RLSTM (regression model) is selected independently according to the difference of the steering conditions to predict, an error threshold is set, the difference between a predicted value and an observed value at the current moment is compared, and if the difference between the predicted value and the observed value is higher than the error threshold, the predicted value is replaced by the observed value and fed back to the automobile model.

Description

Automobile sensor attack detection and repair method based on two-stage LSTM
Technical Field
The invention belongs to the technical field of machine learning, and relates to a two-stage LSTM-based automobile sensor attack detection and repair method.
Background
The method for automatically and efficiently detecting the attack on the automobile is a powerful way for guaranteeing the safe driving of the automobile, and the attack detection on the automobile safety problem at home and abroad is mostly applied to a CAN bus at present, and mainly comprises a traditional method and a machine learning-based method, wherein the two methods have the stage of extracting the characteristics. While the conventional method generally sets a threshold for detecting attacks manually according to different attack categories, the machine learning method automatically learns the malicious attack pattern from the data set based on a given model. Now, with the wide application of deep learning in image recognition and voice recognition, the learning potential of a deep learning model in a given data set is widely focused, so that many technicians apply the deep learning method to attack detection of automobile safety problems, and a good effect is achieved, but at present, few people refine the deep learning method to attack detection of automobile sensors.
The LSTM (long-short term memory network) can well process classification and regression problems, and the reason for better performance in time sequence data is that the LSTM (long-short term memory network) has global processing and memory function increased compared with a common RNN (recurrent neural network), so that long-short term dependence problems can be better processed; in addition, the LSTM can autonomously handle related problems according to the type of input data, handle classification problems if the input data is classified data, and handle regression problems if the input data is numerical data. Based on these characteristics, LSTM is widely used in many scenes of modern society.
Disclosure of Invention
The existing LSTM has better effects on solving the problems of classification and regression, but two functions cannot be realized in one model framework at the same time, and in order to overcome the defects of the prior art, the invention provides an automobile sensor attack detection and restoration method based on the two-stage LSTM.
The technical scheme adopted for solving the technical problems is as follows:
a two-stage LSTM-based automobile sensor attack detection and repair method comprises the following steps:
step 1: collecting data through joint simulation of Carsim and Simulink simulation software, collecting data of a plurality of sensors of the automobile under different steering conditions to form a data set, selecting the plurality of sensors as yaw rate AVz, lateral acceleration Ay and steering wheel angle Steer_SW, and preprocessing the data set;
step 2: selecting and dividing a data set;
step 3: training by a two-stage LSTM;
step 4: the training stage CLSTM uses cross EntropyLoss as a loss function, the optimization algorithm selects adam, the RLSTM uses mse as a loss function, and the optimization algorithm selects rmsprop;
step 5: when the loss function meets the optimal condition, respectively storing the CLSTM and the RLSTM, and respectively naming the RLSTM as 0, 1 and 2 … n according to different steering degrees of the automobile;
step 6: designing a two-stage LSTM selection algorithm;
step 7: after model prediction is completed, calculating an observation valueAnd the actual value +.>Error e of (2) t Judging whether the data is the attacked automobile sensor data or not by utilizing a window error accumulation method;
step 8: manually set a threshold value W 0 Selecting a time sliding window m, and calculating the error accumulation of the predicted value and the observed value under the current windowWill W 0 And->Comparing if it is greater than threshold value W 0 Judging the observed value at the time t as an abnormal value, and if the observed value is judged to be abnormal, entering the predicted value at the current time into a next window sequence instead of the observed value, and inputting the predicted value into the RLSTM to participate in calculation;
step 9: at the moment that the automobile sensor value is attacked, the predicted value of the RLSTM is substituted for the observed value to enter an automobile control unit for closed-loop operation, so that the aim of eliminating the attack is fulfilled.
Further, in the step 1, the data set is preprocessed as follows:
step 1-1: checking whether the data set has a missing value or not, and supplementing the missing value;
step 1-2: the data set relates to complex automobile steering conditions, and three automobile sensor data are obtained through the difference of steering wheel angles Steer_SW: the yaw rate AVz, the lateral acceleration Ay and the steering wheel turning angle Steer_SW respectively mark 'snakelike' as 0, lane change as 1 and right angle turning as 2 according to different steering conditions of the automobile, and the labels and other characteristic attributes are stored separately;
step 1-3: normalizing the data, and normalizing the data in the data set according to the following formula:
wherein X is * Represents normalized data, X represents data before normalization, X min Representing the minimum value, X, of a certain sensor of the automobile in the current data sequence max Representing the maximum value of a certain sensor in the car in the current data sequence.
Still further, the procedure of step 2 is as follows:
step 2-1: setting extremely short sensor data as classification samples at the beginning of automobile running under the condition of various steering acquired in the step 1;
step 2-2: introducing a data segmentation algorithm, carrying out equidistant segmentation processing on the data set, and expanding the sample volume of the data set;
step 2-3: repeating the step 2-2, combining all the divided data into a large sample, and naming the large sample as a classification sample data set classification_data;
step 2-4: all the data sets of the yaw rate AVz collected in step 1 are individually stored and named detection_data, which is a Detection sample data set.
In the step 3, the training process by the two-stage LSTM is as follows:
step 3-1: the two-stage LSTM comprises a CLSTM and an RLSTM, 70% of the data set classification_data in the step 2-3 is selected as a training set to be imported into the CLSTM for training, 30% of the data set classification_data in the step 2-3 is used as a test set, and a softmax function is used as an activation function;
step 3-2: LSTM differs from RNN in that its hidden layer incorporates a gating mechanism consisting essentially of forgetting gate, memory gate, output gate, gating function f, and an update of cell state t The control of which information needs to be forgotten at the last moment is based on the state values of the cell units at the last moment (0 and 1, where 0 means forget and 1 means hold). Memory gate i t For controlling the input information, judging whether memory is needed, and outputting gate o t Output information is confirmed based on cell status (0 and 1, where 0 indicates that no information is allowed to pass, and 1 indicates that operation passes).
Step 3-3: classifying by using a sigmoid function, wherein an evaluation index of classification Accuracy is represented by Accurcry and error_rate:
in the formula, TP represents that the real class is a positive example, and the predicted class is a positive example; FP represents that the true class is negative and the predicted class is positive; FN represents that the true category is a positive example and the predicted category is a negative example; TN represents the real class as the negative example, the predicted class as the negative example, P represents the total number of positive examples, and N represents the total number of negative examples;
step 3-4: selecting 70% of the data set detection_data in the step 2-4 as a training set to be imported into the RLSTM for training, using 30% of the data set detection_data in the step 2-4 as a test set, and using a linear function as an activation function;
step 3-5: RLSTM employs sliding time windowsMouth way, taking the value of the next time point as the training label of the sample of the last time point, giving the previous small segment sequence in the detection_data in the steps 2-4The predictive model can learn the predicted value +.>The previous t-1 data is sequentially sent into an input layer of the model as input data, and the last data of the sequence in the window is used as a desired label to optimize the prediction error of the model; formally, one predictive model is represented as an approximate simulation of a function:
in the method, in the process of the invention,the map satisfies the timing constraint that the predicted value at the next instant is only related to the observed value at the previous instant, i.e +.>Depends only on +.>
In the step 6, the two-stage LSTM selection algorithm is as follows;
step 6-1: taking the test set of classification_data in the step 2-3 as the input of the CLSTM;
step 6-2: and (3) selecting different RLSTMs according to different model names in the step (5), and predicting the test set data of the detection_data in the step (2-4).
Preferably: in the step 3-1, the input layer in the classification model CLSTM is 3 neurons, the output is 2 neurons, and the hidden layer is 32 neurons.
Preferably: in the step 3-4, the regression model RLSTM has 4 layers of network, 10 neurons are input, namely, the sliding window is 10, 1 neuron is output, 2 hidden layers are arranged, 50 neurons are arranged in the first layer, and 100 neurons are arranged in the second layer.
Preferably: in the step 7, the mentioned attack type is a high-amplitude acoustic wave attack, specifically, the resonance effect generated by Gao Zhenfu acoustic waves and the MEMS gyroscope causes the MEMS gyroscope to generate abnormal output and causes the automobile sensor to generate abnormal data.
Preferably: in the step 9, the effect of repairing the predicted value instead of the observed value can be represented from the value of an automobile sensor, and can also be represented in the actual steering of the automobile through an automobile closed-loop control algorithm.
In the invention, data are collected through the joint simulation of a Carsim and Simulink simulation software, the data are preprocessed, the dimension reduction and the feature extraction are carried out on complex driving scenes of the automobile by using a CLSTM (classification model), the single-dimensional automobile sensor data are trained by using an RLSTM (regression model), when the loss functions of the two models meet the conditions, the training is terminated, the respective models are saved, the trained models are tested on a test set by using a two-stage LSTM selection algorithm, the data of whether the current sensor data are attacked or not is judged by using a window accumulated error method after the prediction is finished, and the observed value of the sensor data at the attacked part of the automobile is replaced by a predicted value to enter an automobile control unit for closed-loop operation, so that the aim of eliminating the attack is achieved.
The beneficial effects of the invention are mainly shown in the following steps: 1. the application of the deep learning technology to attack detection of the automobile sensor is probably first proposed in the invention; 2. compared with a single LSTM, the invention provides a two-stage LSTM attack detection method, which improves the attack detection success rate of the automobile sensor in a complex scene; 3. the invention proposes an effective repair method when an automotive sensor is attacked.
Drawings
FIG. 1 is a flow chart of a two-stage LSTM based automotive sensor attack detection and remediation method;
FIG. 2 is a schematic diagram of a sliding time window;
FIG. 3 is a schematic diagram of a prediction replacement mechanism;
FIG. 4 is a graph of an identification accuracy confusion matrix;
fig. 5 is a diagram of a two-stage LSTM based method for detecting and repairing an automobile sensor attack, wherein (a) is Predicted label l and (b) is Predicted label l and is 0.7s long.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1 to 5, a two-stage LSTM-based method for detecting and repairing an attack of an automotive sensor, as shown in fig. 1, includes data preprocessing, selection and segmentation of a data set, two-stage LSTM model training, two-stage LSTM model selection, and attack repair, and the method includes the following steps:
step 1: the method comprises the steps of acquiring a plurality of sensor data of an automobile under different steering conditions to form a data set, wherein the plurality of sensors are selected as AVz (yaw rate), ay (lateral acceleration) and Steer_SW (steering wheel angle), and preprocessing the data set, wherein the process is as follows:
step 1-1: the data set relates to complex automobile steering conditions, such as 'snaking', lane changing, right angle turning and the like, and the invention is three-category, so three automobile sensor data are mainly obtained through the difference of Steer_SW (steering wheel) angles: AVz (yaw rate), ay (lateral acceleration), steer_sw (steering wheel angle) are respectively marked with "serpentine" as 0, lane change as 1, and quarter turn as 2 according to the steering conditions of the vehicle. Separate storage of tags and other characteristic attributes
Step 1-2: because the numerical properties of each sensor of the automobile have larger magnitude differences, the machine learning model is often poor in performance, and in order to better and faster allow the model to converge, the data needs to be normalized, and the data in the data set is normalized according to the following formula:
wherein X is * Represents normalized data, X represents data before normalization, X min Representing the minimum value, X, of a certain sensor of the automobile in the current data sequence max Representing the maximum value of a certain sensor in the automobile in the current data sequence;
step 2: the selection and segmentation of the data set is as follows:
step 2-1: taking the sensor data of the extremely short time (0.3 s or 0.7 s) at the beginning of the running of the automobile under the various steering conditions acquired in the step 1 as a classification sample;
step 2-2: introducing a data segmentation algorithm, carrying out equidistant segmentation processing on the data set, and expanding the sample volume of the data set;
step 2-3: repeating the step 2-2, combining all the divided data into a large sample, and naming the large sample as a classification sample data set classification_data;
step 2-4: independently storing all data sets of the sensor data AVz (yaw rate) acquired in the step 1, and naming the data sets as detection_data of Detection sample data;
step 3: training is performed by a two-stage LSTM (long short term memory network) as follows:
step 3-1: the two-stage LSTM comprises a CLSTM (classification model) and an RLSTM (regression model), 70% of the data set classification_data in the step 2-3 is selected as a training set to be imported into the CLSTM for training, 30% of the data set classification_data in the step 2-3 is used as a test set, a softmax function is used as an activation function, 3 neurons are input in the CLSTM, 2 neurons are output, and 32 neurons are hidden;
step 3-2: LSTM differs from RNN in that its hidden layer incorporates a gating mechanism consisting essentially of forgetting gate, memory gate, output gate, gating function f, and an update of cell state t Controlling which information needs to be forgotten at the previous moment according to the state values (0 and 1, wherein 0 represents forgetting and 1 represents reservation) of the cell unit at the previous moment, and memorizing the gate i t Used for controlling input information, judging whether memory is needed,output door o t Validating the output information based on the cell status (0 and 1, wherein 0 indicates that no information is allowed to pass, 1 indicates that operation passes);
step 3-3: classifying by a sigmoid function, wherein the evaluation index of classification Accuracy is represented by Accuracy and error_rate:
in the formula, TP represents that the real class is a positive example, and the predicted class is a positive example; FP represents that the true class is negative and the predicted class is positive; FN represents that the true category is a positive example and the predicted category is a negative example; TN represents the real class as the negative example, the predicted class as the negative example, P represents the total number of positive examples, and N represents the total number of negative examples;
step 3-4: 70% of the data set detection_data in the step 2-4 is selected as a training set to be imported into the RLSTM for training, 30% of the data set detection_data in the step 2-4 is used as a test set, a linear function is used as an activation function, and a 4-layer network exists in the RLSTM. The input is 10 neurons (sliding window is 10), the output is 1 neuron, 2 hidden layers are arranged, the first layer is 50 neurons, and the second layer is 100 neurons.
Step 3-5: the RLSTM adopts a sliding time window mode, takes the value of the next time point as a training label of the sample of the last time point, and gives the previous small segment sequence in the detection_data in the steps 2-4The predictive model can learn the predicted value +.>The t-1 data before being fed into the input layer of the model as input data in turn according to the windowThe last data of the sequence is used as a desired label for optimizing the prediction error of the model, and formally, one prediction model can be expressed as an approximate simulation of the function:
in the method, in the process of the invention,the map satisfies the timing constraint that the predicted value at the next instant is only related to the observed value at the previous instant, i.e +.>Depends only on +.>
Step 4: the training stage CLSTM uses cross EntropyLoss as a loss function, the optimization algorithm selects adam, the RLSTM uses mse as a loss function, and the optimization algorithm selects rmsprop;
step 5: when the loss function meets the optimal condition, respectively storing the CLSTM and the RLSTM, and respectively naming the RLSTM as 0, 1 and 2 … n according to different steering degrees of the automobile;
step 6: the two-stage LSTM selection algorithm is designed as follows:
step 6-1: taking the test set of classification_data in the step 2-3 as the input of the CLSTM;
step 6-2: selecting different RLSTMs according to different model names in the step 5, and predicting the test set data of the detection_data in the step 2-4;
step 7: after model prediction is completed, calculating an observation valueAnd the actual value +.>Error e of (2) t By usingJudging whether the data is the attacked automobile sensor data or not by a window error accumulation method, wherein the attack type is that a high-frequency sound wave and a MEMS gyroscope are utilized to generate a resonance effect to attack the sound wave generated by the automobile sensor;
step 8: manually set a threshold value W 0 Selecting a time sliding window m, and calculating the error accumulation of the predicted value and the observed value under the current windowWill W 0 And->Comparing if it is greater than threshold value W 0 Judging the observed value at the time t as an abnormal value, and if the observed value is judged to be abnormal, entering the predicted value at the current time into a next window sequence instead of the observed value, and inputting the predicted value into the RLSTM to participate in calculation;
step 9: at the moment that the automobile sensor value is attacked, the predicted value of the RLSTM is substituted for the observed value to enter an automobile control unit for closed-loop operation, so that the aim of eliminating the attack is fulfilled.
Compared with the traditional machine learning method, the method is more complex, but has better attack adherence effect, certain repairing effect and certain practicability.
What has been described above is a preferred embodiment of the present invention, and it should be noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the invention.

Claims (6)

1. An attack detection and repair method for an automobile sensor based on a two-stage LSTM, which is characterized by comprising the following steps:
step 1: collecting data through joint simulation of Carsim and Simulink simulation software, collecting data of a plurality of sensors of the automobile under different steering conditions to form a data set, selecting the plurality of sensors as yaw rate AVz, lateral acceleration Ay and steering wheel angle Steer_SW, and preprocessing the data set;
step 2: selecting and dividing a data set;
step 3: training by a two-stage LSTM;
step 4: the training stage CLSTM uses cross EntropyLoss as a loss function, the optimization algorithm selects adam, the RLSTM uses mse as a loss function, and the optimization algorithm selects rmsprop;
step 5: when the loss function meets the optimal condition, respectively storing the CLSTM and the RLSTM, and respectively naming the RLSTM as 0, 1 and 2 … n according to different steering degrees of the automobile;
step 6: designing a two-stage LSTM selection algorithm;
step 7: after model prediction is completed, calculating an observation valueAnd the actual value +.>Error e of (2) t Judging whether the data is the attacked automobile sensor data or not by utilizing a window error accumulation method;
step 8: manually set a threshold value W 0 Selecting a time sliding window m, and calculating the error accumulation of the predicted value and the observed value under the current windowWill W 0 And->Comparing if it is greater than threshold value W 0 Judging the observed value at the time t as an abnormal value, and if the observed value is judged to be abnormal, entering the predicted value at the current time into a next window sequence instead of the observed value, and inputting the predicted value into the RLSTM to participate in calculation;
step 9: at the moment that the value of the automobile sensor is attacked, the predicted value of the RLSTM is substituted for the observed value to enter an automobile control unit for closed-loop operation, so that the aim of eliminating the attack is fulfilled;
the process of the step 2 is as follows:
step 2-1: setting extremely short sensor data as classification samples at the beginning of automobile running under the condition of various steering acquired in the step 1;
step 2-2: introducing a data segmentation algorithm, carrying out equidistant segmentation processing on the data set, and expanding the sample volume of the data set;
step 2-3: repeating the step 2-2, combining all the divided data into a large sample, and naming the large sample as a classification sample data set classification_data;
step 2-4: independently storing all data sets of the yaw rate AVz acquired in the step 1, and naming the data sets as detection_data of Detection sample data sets;
in the step 3, the training process by the two-stage LSTM is as follows:
step 3-1: the two-stage LSTM comprises a CLSTM and an RLSTM, 70% of the data set classification_data in the step 2-3 is selected as a training set to be imported into the CLSTM for training, 30% of the data set classification_data in the step 2-3 is used as a test set, and a softmax function is used as an activation function;
step 3-2: LSTM differs from RNN in that its hidden layer incorporates a gating mechanism including a forget gate, a memory gate, an output gate, a gating function f, and an update of cell state t Controlling the information to be forgotten at the last moment according to the state value of the cell unit at the last moment, wherein the state value 0 represents forgetting and the state value 1 represents reservation; memory gate i t For controlling the input information, judging whether memory is needed, and outputting gate o t Confirming output information based on the cell state, wherein 0 indicates that the information is not allowed to pass and 1 indicates that the operation passes;
step 3-3: classifying by using a sigmoid function, wherein an evaluation index of classification Accuracy is represented by Accurcry and error_rate:
in the formula, TP represents that the real class is a positive example, and the predicted class is a positive example; FP represents that the true class is negative and the predicted class is positive; FN represents that the true category is a positive example and the predicted category is a negative example; TN represents the real class as the negative example, the predicted class as the negative example, P represents the total number of positive examples, and N represents the total number of negative examples;
step 3-4: selecting 70% of the data set detection_data in the step 2-4 as a training set to be imported into the RLSTM for training, using 30% of the data set detection_data in the step 2-4 as a test set, and using a linear function as an activation function;
step 3-5: the RLSTM adopts a sliding time window mode, takes the value of the next time point as a training label of the sample of the last time point, and gives the previous small segment sequence in the detection_data in the steps 2-4The predictive model can learn the predicted value +.>The previous t-1 data is sequentially sent into an input layer of the model as input data, and the last data of the sequence in the window is used as a desired label to optimize the prediction error of the model; formally, one predictive model is represented as an approximate simulation of the function f:
in the method, in the process of the invention,the map satisfying the timing constraint, the predicted value at the next instant being related only to the observed value at the previous instant, i.e/>Depends only on +.>
In the step 6, the two-stage LSTM selection algorithm is as follows;
step 6-1: taking the test set of classification_data in the step 2-3 as the input of the CLSTM;
step 6-2: and (3) selecting different RLSTMs according to different model names in the step (5), and predicting the test set data of the detection_data in the step (2-4).
2. The method for detecting and repairing an attack on an automotive sensor based on a two-stage LSTM according to claim 1, wherein in step 1, the data set is preprocessed as follows:
step 1-1: checking whether the data set has a missing value or not, and supplementing the missing value;
step 1-2: the data set relates to complex automobile steering conditions, and three automobile sensor data are obtained through the difference of steering wheel angles Steer_SW: the yaw rate AVz, the lateral acceleration Ay and the steering wheel turning angle Steer_SW respectively mark 'snakelike' as 0, lane change as 1 and right angle turning as 2 according to different steering conditions of the automobile, and the labels and other characteristic attributes are stored separately;
step 1-3: normalizing the data, and normalizing the data in the data set according to the following formula:
wherein X is * Represents normalized data, X represents data before normalization, X min Representing the minimum value, X, of a certain sensor of the automobile in the current data sequence max Representing the current data sequence of a certain sensor of an automobileMaximum value in column.
3. The method for detecting and repairing an attack on an automotive sensor based on a two-stage LSTM according to claim 1, wherein in the step 3-1, the input layer in the classification model CLSTM is 3 neurons, the output is 2 neurons, and the hidden layer is 32 neurons.
4. The method for detecting and repairing an attack on an automobile sensor based on a two-stage LSTM according to claim 1, wherein in the step 3-4, there are 4 layers of networks in the regression model RLSTM, the input is 10 neurons, i.e. the sliding window is 10, the output is 1 neuron, 2 hidden layers are set, the first layer is 50 neurons, and the second layer is 100 neurons.
5. The method for detecting and repairing the attack of the automotive sensor based on the two-stage LSTM according to claim 1 or 2, wherein in the step 7, the attack type is a high-amplitude acoustic wave attack, in particular, the resonance effect generated by the Gao Zhenfu acoustic wave and the MEMS gyroscope causes the MEMS gyroscope to generate abnormal output and causes the automotive sensor to generate abnormal data.
6. The method for detecting and repairing the attack of the automobile sensor based on the two-stage LSTM according to claim 1 or 2, wherein in the step 9, the effect of repairing the predicted value instead of the observed value can be represented from the values of the automobile sensor, and can be also represented in the actual steering of the automobile through an automobile closed-loop control algorithm.
CN202110422459.0A 2021-04-20 2021-04-20 Automobile sensor attack detection and repair method based on two-stage LSTM Active CN113255725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110422459.0A CN113255725B (en) 2021-04-20 2021-04-20 Automobile sensor attack detection and repair method based on two-stage LSTM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110422459.0A CN113255725B (en) 2021-04-20 2021-04-20 Automobile sensor attack detection and repair method based on two-stage LSTM

Publications (2)

Publication Number Publication Date
CN113255725A CN113255725A (en) 2021-08-13
CN113255725B true CN113255725B (en) 2024-03-22

Family

ID=77221138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110422459.0A Active CN113255725B (en) 2021-04-20 2021-04-20 Automobile sensor attack detection and repair method based on two-stage LSTM

Country Status (1)

Country Link
CN (1) CN113255725B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111447212A (en) * 2020-03-24 2020-07-24 哈尔滨工程大学 Method for generating and detecting APT (advanced persistent threat) attack sequence based on GAN (generic antigen network)
CN112364697A (en) * 2020-10-14 2021-02-12 陕西师范大学 Electroencephalogram emotion recognition method based on R-LSTM model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220058240A9 (en) * 2019-08-27 2022-02-24 Nec Laboratories America, Inc. Unsupervised multivariate time series trend detection for group behavior analysis

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111447212A (en) * 2020-03-24 2020-07-24 哈尔滨工程大学 Method for generating and detecting APT (advanced persistent threat) attack sequence based on GAN (generic antigen network)
CN112364697A (en) * 2020-10-14 2021-02-12 陕西师范大学 Electroencephalogram emotion recognition method based on R-LSTM model

Also Published As

Publication number Publication date
CN113255725A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN106971194B (en) Driving intention recognition method based on improved HMM and SVM double-layer algorithm
Tang et al. Driver lane change intention recognition of intelligent vehicle based on long short-term memory network
LU102710B1 (en) Input validation method for neural network model by crossing-layer dissection
CN110163069B (en) Lane line detection method for driving assistance
US20190332935A1 (en) System and method for siamese instance search tracker with a recurrent neural network
CN111738337B (en) Driver distraction state detection and identification method in mixed traffic environment
CN112257850A (en) Vehicle track prediction method based on generation countermeasure network
CN112668779B (en) Front vehicle motion state prediction method based on self-adaptive Gaussian process
CN111114556A (en) Lane change intention identification method based on LSTM under multi-source exponential weighting loss
CN114418298A (en) Charging load probability prediction system and method based on non-invasive detection
CN110910531B (en) Rapid pavement friction coefficient detection method based on vehicle-mounted OBD information
EP4145345A1 (en) Data annotation method and device, and fine granularity identification method and device
CN111783943B (en) LSTM neural network-based driver braking strength prediction method
CN114926825A (en) Vehicle driving behavior detection method based on space-time feature fusion
CN115496384A (en) Monitoring management method and device for industrial equipment and computer equipment
CN116985793B (en) Automatic driving safety control system and method based on deep learning algorithm
CN112435466B (en) Method and system for predicting take-over time of CACC vehicle changing into traditional vehicle under mixed traffic flow environment
EP3640857A1 (en) Method, vehicle, system, and storage medium for indicating anomalous vehicle scenario using encoder network and discriminator network intermediate layer activation
CN113255725B (en) Automobile sensor attack detection and repair method based on two-stage LSTM
CN111160089B (en) Track prediction system and method based on different vehicle types
CN116946183A (en) Commercial vehicle driving behavior prediction method considering driving capability and vehicle equipment
CN112232226A (en) Method and system for detecting target object through discriminant model
CN116151472A (en) Electric automobile short-term energy consumption prediction method based on Internet of vehicles data mining
Sun et al. Vision-based traffic conflict detection using trajectory learning and prediction
Lim et al. Temporal early exiting with confidence calibration for driver identification based on driving sensing data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant