Real-time Detection and Recovery Method for Drone Sensor Attacks Based on Machine Learning
By building a neural network to predict the next moment status of the drone sensor, detect and isolate the attacked sensors in real time, solving the problem of drone sensor attack recognition and recovery, and improving the security and defense capabilities of the drone.
Patent Information
- Application Number
- CN202310183698.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-03-01
AI Technical Summary
The prior art cannot effectively identify the type of drone sensor attack and carry out targeted defense, and cannot recover in time during sensor attack, resulting in damage to the safety of drone flight.
Machine learning technology is used to build a neural network, and by constructing a neural network individually for each sensor to predict the state of the next moment, detect sensor attacks in real time, and use predicted values to replace sensor measurements for control, isolate the attacked sensors and prevent further misleading.
It realizes rapid identification and isolation of drone sensor attacks, ensuring that drones can still fly normally when attacked, and improving drone's safety and defense capabilities.
Smart Images

Figure CN116151325B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of unmanned aerial vehicles (UAVs), and further relates to a method for real-time detection and recovery of UAV sensor attacks based on machine learning in the technical field of autonomous navigation UAVs. The present invention can be used to detect and recover attacked UAV sensors in real time during UAV flight, and improve the resistance of UAVs to sensor attacks during flight. Background Art
[0002] In order to make attacks on UAVs more concealed and difficult to defend, attackers have targeted the physical components of victim UAVs. Sensor attacks are different from attacks launched through UAV software and communication links. Sensor attacks generally interfere with sensor perception or damage the normal working state of sensors to carry out attacks. These attacks on UAV sensors bring new challenges because traditional computer security technologies cannot effectively cope with sensor attacks. And most of the existing defense schemes are implemented when there is sufficient computing power. Due to cost considerations for consumer UAVs, the sensors used are relatively low-end sensors. Therefore, for consumer UAVs to implement these defense schemes, additional computers need to be installed or they need to rely on remote hosts.
[0003] Nanjing University of Aeronautics and Astronautics disclosed a method for detecting attacks on quadrotor UAVs based on neural networks in its patent document "A Method for Detecting Attacks on Quadrotor UAVs Based on Neural Networks" (Application No.: CN202211023351.5, Publication No.: CN 115416860 A, Application Date: August 25, 2022). The implementation steps of this method are as follows: First, obtain the operation data of the quadrotor UAV under normal and concealed attacks. Second, use the normal data to train a feedforward neural network model with a specific number of layers, and use this model to detect concealed attacks to obtain the UAV channel information that is not affected by the attack. Then, for the above UAV channels that are not affected by the attack, use the normal UAV data to train an autoencoder model, and use the autoencoder to detect these channels. Finally, fuse the first-level feedforward neural network detector and the second-level autoencoder detector to obtain the final detection result. This method realizes the detection of concealed attacks on quadrotor UAVs. Compared with traditional attack detection methods based on models, this method can not only improve the recognition ability of concealed attacks but also detect new attack patterns online. However, this detection method still has two deficiencies: First, it cannot identify what kind of sensor attack the UAV has suffered. Identifying the types of sensor attacks can help find the weak points in UAV defense for targeted defense; Second, this method only supports detection and cannot effectively respond when the UAV is under sensor attack, and the attacker can still cause damage to the UAV through the attack.
[0004] Nanjing University of Aeronautics and Astronautics discloses a swarm UAV fault detection method based on LSTM and neighbor trust mechanism in its patent document "Swarm UAV Fault Detection Method Based on LSTM and Neighbor Trust Mechanism" (Application No.: CN 202210949550.2, Publication No.: CN115077594A, Application Date: August 9, 2022). The implementation steps of this method are as follows: a prediction model is constructed based on the LSTM network. Neighboring UAVs can predict the sensor output value at the next moment in real time according to the historical sensor data to obtain the state prediction value. Combining the state observation value, the neighboring detection result can be obtained, and the neighbor trust mechanism is added to comprehensively combine the neighboring detection result and the trust weight to obtain the final fault detection result. This method does not require complex linearization of the swarm UAV dynamics model, can effectively and quickly detect whether the swarm UAV has a sensor fault, effectively avoid the harm brought by the sensor fault to the entire cluster, and is very suitable for the scenario where it is difficult to linearize the swarm UAV dynamics model and there are multi-parameter couplings, providing a theoretical basis for effectively avoiding the harm caused by sensor faults to the swarm UAV. The application scenario of this detection method is mainly to prevent malfunctioning UAVs from affecting the normal flight of other UAVs in the swarm. However, the existing method still has the following deficiencies: it only deals with the situation where the UAV itself has a fault. When the UAV is under sensor attack, especially when a high-weight UAV is attacked, it will mislead multiple surrounding UAVs to make mistakes together. Summary of the Invention
[0005] The object of the present invention is to address the deficiencies of the above-mentioned existing technologies and propose a machine learning-based method for detecting and recovering from UAV sensor attacks during operation, which is used to solve the problems that UAV sensors are vulnerable to attacks, the detection method has excessive overhead, and it is impossible to provide targeted protection for the attacked sensors after detecting the sensor attack.
[0006] The idea for achieving the object of the present invention is as follows: The present invention adopts machine learning technology, which has the characteristic of associating the previous state and the next state of the UAV sensor and can quickly and effectively predict the state of the UAV at the next moment. The present invention constructs a neural network for each sensor separately to predict the state of the sensor at the next moment. By comparing the predicted value and the sensor measurement value, the UAV can quickly know the specific sensor under attack when under attack, isolate the attacked sensor in a timely manner, prevent the attacker from continuing to mislead or damage the sensor, and can use the predicted value of the neural network to replace the sensor measurement value to participate in the subsequent control operation of the UAV, enabling the UAV to fly normally for a period of time after being attacked.
[0007] The implementation steps of the present invention are as follows:
[0008] Step 1, construct a neural network:
[0009] Build a neural network composed of an input layer, a hidden layer, and an output layer connected in series; set the number of neurons in the input layer to 2, the number of neurons in the hidden layer to 4, and the number of neurons in the output layer to 1, and use the rectified linear unit (ReLU) as the activation function;
[0010] Step 2, generate the training set:
[0011] Obtain the sensor data log of the quadcopter flying for at least 5 minutes under normal conditions. Combine the drone's measured position vector information and the target position vector information in the 5-minute sensor data log to form training set 1; combine the drone's measured velocity vector information and the target velocity vector information in the 5-minute sensor data log to form training set 2; combine the drone's measured angular velocity vector information and the target angular velocity vector information in the 5-minute sensor data log to form training set 3; combine the drone's measured attitude information and the target attitude information in the 5-minute sensor data log to form training set 4;
[0012] Step 3, train the neural network:
[0013] Input each axis of data in training sets 1, 2, 3, and 4 into the neural network respectively. Use the gradient descent algorithm to update and iterate the parameters of each layer in the neural network until the objective function of each neural network converges, and obtain the trained drone position vector prediction neural network, drone velocity vector prediction neural network, drone angular velocity vector prediction neural network, and drone attitude prediction neural network respectively;
[0014] Step 4, predict the drone sensor data:
[0015] Input the target position vector information in the drone sensor data to be predicted, the position vector prediction information output by the previous round of the position vector prediction neural network, the target velocity vector information, the velocity vector prediction information output by the previous round of the velocity vector prediction neural network, the target angular velocity vector information, the angular velocity vector prediction information output by the previous round of the angular velocity vector prediction neural network, the target attitude information, and the attitude prediction information output by the previous round of the attitude prediction neural network into the trained drone position vector prediction neural network, drone velocity vector prediction neural network, drone angular velocity vector prediction neural network, and drone attitude prediction neural network respectively, and output the position vector prediction information, velocity vector prediction information, angular velocity vector prediction information, and attitude prediction information in the current drone sensor data;
[0016] Step 5, process the predicted velocity vector information:
[0017] Using the formula of the acceleration vector, convert the velocity vector predicted by the UAV velocity vector prediction neural network into an acceleration vector, and then use a low-pass filter to attenuate the high-frequency components therein;
[0018] Step 6, detect sensor attacks on the UAV during flight:
[0019] Step 6.1, if the cumulative error e i within a detection window Dw i is greater than the error threshold Err i , then increment the error count by 1;
[0020] Step 6.2, determine whether the current error count is greater than the error calculation threshold EC i . If so, it is considered that the sensor has been attacked. After sending an alarm to the ground station, execute Step 7. Otherwise, when a window time ends, set the current error count to 0 and then execute Step 6.1;
[0021] Step 7, recover the attacked UAV sensor:
[0022] Step 7.1, after replacing the sensor measurement value y i with the sensor prediction value x i output by the neural network, then determine whether the cumulative error e i within the detection window Dw i is less than the recovery threshold Re i . If so, increment the recovery count by 1 and then execute Step 7.2;
[0023] Step 7.2, determine whether the current recovery count is greater than the recovery count threshold RC i . If so, set the current recovery count to 0 and then execute Step 8. Otherwise, determine that the attack has not ended and continue to execute Step 7.1;
[0024] Step 8, determine that the attack on the sensor has stopped. Description of the Drawings
[0025] Figure 1 is a flowchart of the present invention.
[0026] Figure 2 is a schematic diagram of the use of the prediction neural network of the present invention. Detailed Embodiment
[0027] The present invention will be further described in detail below with reference to the drawings and embodiments.
[0028] Refer to Figure 1 for a further detailed description of the implementation steps of the embodiments of the present invention.
[0029] Step 1, construct a neural network.
[0030] Build a neural network composed of an input layer, a hidden layer, and an output layer connected in series; set the number of neurons in the input layer to 2, the number of neurons in the hidden layer to 4, and the number of neurons in the output layer to 1, and use the rectified linear unit ReLU as the activation function.
[0031] Step 2, generate the training set.
[0032] The UAV sensing log obtained in the embodiment of the present invention is a sensor data log obtained from 1 quadcopter UAV flying for at least 5 minutes under normal conditions, and the log includes sensor measurement information and target state information.
[0033] The specific contents included in the sensor measurement information and the target state information are shown in Table 1.
[0034] Table 1 Details of sensor measurement information and target state information
[0035] Sensor measurement information Target state information UAV position vector Target position vector UAV velocity vector Target velocity vector UAV angular velocity vector Target angular velocity vector UAV attitude Target attitude
[0036] Form the UAV measurement position vector information and the UAV target position vector information in the 5-minute sensor data log into training set 1.
[0037] Form the UAV measured velocity vector information and the UAV target velocity vector information in the 5-minute sensor data log into training set 2.
[0038] Form the UAV measured angular velocity vector information and the UAV target angular velocity vector information in the 5-minute sensor data log into training set 3.
[0039] Form the UAV measured attitude information and the UAV target attitude information in the 5-minute sensor data log into training set 4.
[0040] Step 3, train the neural network.
[0041] Input each axis of data in training set 1, training set 2, training set 3, and training set 4 into the neural network respectively, and use the gradient descent algorithm to update and iterate the parameters of each layer in the neural network until each objective function converges, and respectively obtain the trained UAV position vector prediction neural network, UAV velocity vector prediction neural network, UAV angular velocity vector prediction neural network, and UAV attitude prediction neural network.
[0042] Step 4, predict the UAV sensor data.
[0043] Refer to Figure 2, the target position vector information in the UAV sensor data to be predicted, the position vector prediction information output by the previous round of position vector prediction neural network, the target speed vector information, the speed vector prediction information output by the previous round of speed vector prediction neural network, the target angular velocity vector information, the angular velocity vector prediction information output by the previous round of angular velocity prediction neural network, the target attitude information, and the attitude prediction information output by the previous round of attitude prediction neural network are respectively input into the trained UAV position vector prediction neural network, UAV speed vector prediction neural network, UAV angular velocity prediction neural network, and UAV attitude prediction neural network to output the position vector prediction information, speed vector prediction information, angular velocity vector prediction information, and attitude prediction information in the current UAV sensor data.
[0044] The previous round mentioned above refers to the neural network prediction output of the previous time.
[0045] Step 5, process the predicted speed vector information.
[0046] Since the acceleration is measured by the accelerometer, it is necessary to convert the predicted speed vector into an acceleration vector.
[0047] Using the following formula for the acceleration vector, the converted acceleration vector is obtained, and then the high-frequency frequencies are attenuated by a low-pass filter to obtain the predicted value of each acceleration at each moment in the final predicted acceleration vector:
[0048]
[0049] Among them, a(t) represents the predicted value of the acceleration at the t-th moment, c k represents a constant coefficient, whose value is 1, v(t) represents the speed value at the t-th moment, Δt represents the time interval between two sampling samples, v(t - k·Δt) represents the speed separated from the t-th moment by k sampling times, k is the interval of equally spaced sampling points, k is usually set to be greater than 1, and in the embodiments of the present invention, its value is 1. [[ID=2))
[0050] Step 6, detect sensor attacks of the UAV during flight.
[0051] Compare the sensor prediction information x i output by the neural network with the sensor information y i measured by the UAV. When within a detection window Dw i , the cumulative error e i between x i and y i is greater than the error threshold Err i , the error count is incremented by 1. If the current error count is greater than the error calculation threshold EC iIf so, it is considered that the sensor s i has been attacked, an alarm is sent to the ground station, and an activation signal is sent to the recovery switch to activate the recovery of the attacked UAV sensor. Otherwise, when a window time ends, the current error count is set to 0.
[0052] The meanings corresponding to the values of i are shown in Table 2 below:
[0053] Table 2 Details of Calculated Values Related to Sensor Inspection
[0054]
[0055]
[0056] The detection windows Dw1, Dw2, Dw3, and Dw4 are respectively the maximum time displacements obtained during the process of aligning the position vector measured by the UAV and the position vector prediction information sequence, the maximum time displacements obtained during the process of aligning the acceleration vector and the acceleration vector prediction information sequence, the maximum time displacements obtained during the process of aligning the angular velocity vector and the angular velocity vector prediction information sequence, and the maximum time displacements obtained during the process of aligning the yaw angle and the yaw angle prediction information sequence.
[0057] The error calculation threshold EC i is at least 0.25 times that of Dw i , and the error threshold Err i is at least 1.1 times the maximum value of the cumulative error e i calculated during normal flight.
[0058] The cumulative error e i is obtained by the following formula:
[0059]
[0060] where e i represents the cumulative error, x i represents the predicted value output by the neural network, y i represents the sensor information measured by the UAV, Dw i represents the detection window size, and n represents the number of detections already made within the current detection window.
[0061] Step 7, recover the attacked UAV sensor in real time.
[0062] Step 7.1, when the sensor s i has been attacked and the recovery switch receives the start signal, the recovery is activated, and the predicted information x i output by the neural network is used to replace the sensor information y i measured by the UAV.
[0063] Step 7.2, take e i and compare it with Re i . If e i is less than Re i , then increment the recovery count by 1, and determine whether the recovery count is greater than the recovery count threshold RC i . If so, it is considered that the attack on the sensor s i has stopped, the recovery is over, and the drone continues to fly using the sensor information y i measured by the human-machine, return to Step 6. Otherwise, it is considered that the attack has not ended, the recovery continues, and return to Step 7.1.
[0064] The physical meaning corresponding to i is shown in Table 3:
[0065] Table 3 Details of Sensor Recovery Related Calculated Values
[0066] i <![CDATA[Sensor s i > <![CDATA[Re i > <![CDATA[RC i > 1 GPS Position vector recovery threshold Position vector recovery count threshold 2 Accelerometer Acceleration vector recovery threshold Acceleration vector recovery count threshold 3 Gyroscope Angular velocity vector recovery threshold Angular velocity vector recovery count threshold 4 Magnetometer Yaw angle recovery threshold Yaw angle recovery count threshold
[0067] The recovery count threshold RC i is at least 0.5 times that of Dw i , and the recovery threshold Re i is at least 0.5 times the sum of the maximum value of the cumulative error e i calculated during normal flight and the error threshold Err i .
Claims
1. A method for runtime detection and recovery of UAV sensor attacks based on machine learning, characterized in that, Calculate the cumulative error between the predicted values of the sensors and the measured values of the UAV, detect UAV sensor attacks in real time, isolate and recover the attacked sensors when sensor attacks are detected; the specific steps of the detection and recovery method are as follows: Step 1, construct a neural network: Build a neural network composed of an input layer, a hidden layer, and an output layer connected in series; set the number of neurons in the input layer to 2, the number of neurons in the hidden layer to 4, and the number of neurons in the output layer to 1, and use the rectified linear unit (ReLU) as the activation function; Step 2, generate a training set: Obtain the sensor data log of the quadcopter flying for at least 5 minutes under normal conditions, and form training set 1 from the UAV measured position vector information and the UAV target position vector information in the 5-minute sensor data log; Form training set 2 from the UAV measured velocity vector information and the UAV target velocity vector information in the 5-minute sensor data log; form training set 3 from the UAV measured angular velocity vector information and the UAV target angular velocity vector information in the 5-minute sensor data log; form training set 4 from the UAV measured attitude information and the UAV target attitude information in the 5-minute sensor data log; Step 3, train the neural network: Input each axis data in training set 1, training set 2, training set 3, and training set 4 into the neural network respectively, and use the gradient descent algorithm to update and iterate the parameters of each layer in the neural network until each neural network objective function converges, and obtain the trained UAV position vector prediction neural network, UAV velocity vector prediction neural network, UAV angular velocity vector prediction neural network, and UAV attitude prediction neural network respectively; Step 4, predict UAV sensor data: Input the target position vector information in the UAV sensor data to be predicted, the position vector prediction information output by the previous position vector prediction neural network, the target velocity vector information, the velocity vector prediction information output by the previous velocity vector prediction neural network, the target angular velocity vector information, the angular velocity vector prediction information output by the previous angular velocity vector prediction neural network, the target attitude information, and the attitude prediction information output by the previous attitude prediction neural network into the trained UAV position vector prediction neural network, UAV velocity vector prediction neural network, UAV angular velocity vector prediction neural network, and UAV attitude prediction neural network respectively, and output the position vector prediction information, velocity vector prediction information, angular velocity vector prediction information, and attitude prediction information in the current UAV sensor data; Step 5, process the predicted velocity vector information: Use the formula of the acceleration vector to convert the velocity vector predicted by the UAV velocity vector prediction neural network into an acceleration vector, and then use a low-pass filter to attenuate the high-frequency components therein; Step 6, detect UAV sensor attacks during flight: Step 6.1, if the cumulative error e i within a detection window Dw i is greater than the error threshold Err i , then increment the error count by 1; Step 6.2, determine whether the current error count is greater than the error calculation threshold EC i , if so, it is considered that the sensor is under attack. After sending an alarm to the ground station, execute Step 7. Otherwise, when a window time ends, set the current error count to 0 and then execute Step 6.1; Step 7, recover the attacked UAV sensors: Step 7.1, use the predicted sensor value x output by the neural network i to replace the sensor measurement value y i After that, determine the cumulative error e i within the detection window Dw i whether it is less than the recovery threshold Re i If so, increment the recovery count by 1 and then execute Step 7.2; Step 7.2, determine whether the current recovery count is greater than the recovery count threshold RC i , if so, set the current recovery count to 0 and then execute Step 8, otherwise, determine that the attack has not ended and continue to execute Step 7.1; Step 8, determine that the attack on the sensors has stopped.
2. The method for detecting and recovering drone sensor attacks during runtime based on machine learning according to claim 1, wherein The "previous round" mentioned in Step 4 refers to the output of the previous neural network prediction.
3. The method for detecting and recovering the operation of a drone sensor attack based on machine learning according to claim 1, wherein, The formula for converting the velocity vector predicted by the UAV velocity vector prediction neural network into an acceleration vector as described in step 5 is as follows: where a(t) represents the predicted value of acceleration at the t-th moment, c k represents a constant coefficient, v(t) represents the velocity value at the t-th moment, Δt represents the time interval between two sampling samples, v(t - k·Δt) represents the velocity at k sampling times away from the t-th moment, and k represents the interval of equally spaced sampling points.
4. The method for runtime detection and recovery of UAV sensor attacks based on machine learning according to claim 1, wherein The detection window Dw described in step 6.1 i refers to the maximum time displacement obtained during the process of aligning the sensor prediction information x output by the neural network with the sensor information y measured by the drone using the dynamic time warping algorithm; the error threshold Err i is 1.1 times the maximum value of the cumulative error e calculated during normal flight. i i i 5. The method for runtime detection and recovery of UAV sensor attacks based on machine learning according to claim 1, wherein The cumulative error e described in step 6.1 i is obtained by the following formula: Among them, e i represents the cumulative error, x i represents the sensor prediction value output by the neural network, y i represents the sensor measurement value measured by the drone, Dw i represents the detection window size, and n represents the number of detections that have been made within the current detection window.
6. The method for runtime detection and recovery of UAV sensor attacks based on machine learning according to claim 1, wherein The error calculation threshold EC described in step 6.2 i is Dw i multiplied by 0.25 7. The method for runtime detection and recovery of UAV sensor attacks based on machine learning according to claim 1, characterized in that, The recovery threshold Re described in step 7.1 i is the cumulative error e calculated during normal flight i which is 0.5 times the sum of the maximum value and the error threshold Err i .
8. The method for detecting and recovering the operation of an unmanned aerial vehicle sensor attack based on machine learning according to claim 1, wherein The counting threshold RC described in step 7.2 i takes the value of Dw i which is 0.5 times that of
Citation Information
Patent Citations
Swarm unmanned aerial vehicle fault detection method based on LSTM and neighbor trust mechanism
CN115077594A
Fault Detection Method for Swarm Drones Based on LSTM and Nearest Neighbor Trust Mechanism
CN115077594B
Four-rotor unmanned aerial vehicle attack detection method based on neural network
CN115416860A
Attack detection method based on automatic driving, terminal equipment and storage medium
CN115453589A
Elman neural network assisting tight-integrated navigation method without GNSS signals
US20210095965A1