In recent years, quadcopter unmanned aerial vehicles (UAVs) have gained widespread adoption across various sectors, including agriculture, surveillance, and logistics, due to their agility, simplicity, and cost-effectiveness. However, the reliance on sensor data, particularly from global navigation satellite systems (GNSS) and inertial measurement units (IMUs), makes quadcopters vulnerable to cyber-attacks, such as false data injection (FDI). These attacks can compromise the integrity of sensor measurements, leading to potential system failures or unauthorized control. Ensuring the security of quadcopter sensor systems is therefore critical for safe and reliable operations. In this paper, we address the challenge of detecting sensor attacks in quadcopters by proposing a novel approach that combines state estimation with deep learning techniques. Our method leverages the Extended Kalman Filter (EKF) for feature extraction from sensor data and employs a Deep Belief Network (DBN) to model the nonlinear relationships between extracted features and sensor states. This hybrid framework not only enhances detection accuracy but also improves real-time performance, making it suitable for dynamic quadcopter environments.

The core of our approach lies in integrating traditional state estimation methods with advanced machine learning models. The EKF provides robust state estimates by filtering noise and predicting system states, while the DBN, with its deep architecture, captures complex patterns indicative of attacks. We design two types of attack signals—random and ramp-based—to simulate realistic threat scenarios and evaluate our detector’s performance under these conditions. Furthermore, we introduce an adaptive EKF algorithm that dynamically adjusts measurement noise covariance upon attack detection, thereby enhancing the quadcopter’s resilience during prolonged attacks. Through extensive simulations, we demonstrate that our EKF-DBN detector outperforms conventional methods in terms of detection accuracy, false alarm rates, and computational efficiency. This work contributes to the broader field of quadcopter security by providing a scalable and effective solution for sensor attack detection.
System Modeling and Theoretical Foundations
To effectively detect sensor attacks in quadcopters, a comprehensive understanding of the system dynamics is essential. We model the quadcopter using Euler angles for attitude representation, where the roll ($\phi$), pitch ($\theta$), and yaw ($\psi$) angles define the orientation of the body frame relative to the global frame. The nonlinear dynamics of the quadcopter are derived under the assumptions of negligible air resistance and gyroscopic effects, leading to the following equations of motion:
$$ \ddot{p}_e = g e_3 – \frac{f}{m} R_{eb} e_3, $$
$$ \dot{\Theta} = W \cdot \omega_b, $$
$$ J \cdot \dot{\omega}_b = -\omega_b \times (J \cdot \omega_b) + \tau. $$
Here, $p_e = [p_{ex}, p_{ey}, p_{ez}]^T$ represents the position of the quadcopter’s center of mass in the global frame, $\Theta = [\phi, \theta, \psi]^T$ denotes the Euler angles, and $\omega_b = [\omega_{bx}, \omega_{by}, \omega_{bz}]^T$ is the angular velocity in the body frame. The total thrust from the propellers is $f$, and $\tau = [\tau_x, \tau_y, \tau_z]^T$ represents the moments generated. The matrix $R_{eb}$ transforms vectors from the body frame to the global frame, $W$ is the matrix relating Euler angle rates to body angular rates, and $J$ is the inertia matrix. The discrete-time state-space model is obtained using Euler integration with a time step $T = 0.01$ s:
$$ x_{k+1} = F(x_k, u_k) + w_k, $$
$$ y_k = H_k x_k + v_k. $$
In this model, $x_k$ encompasses the position, velocity, attitude, and angular rates; $u_k$ includes the control inputs; and $y_k$ is the sensor measurement vector. The process noise $w_k$ and measurement noise $v_k$ are zero-mean Gaussian with covariances $Q_w$ and $Q_v$, respectively. This formulation allows us to apply the EKF for state estimation, which is crucial for feature extraction in our attack detection framework.
Attack Modeling and Threat Analysis
Sensor attacks on quadcopters, particularly FDI attacks, aim to manipulate measurement data to deceive the control system. We model two types of attack signals to represent different attacker capabilities: random signals and ramp signals. The random attack is defined as $a_{ik} = U(m, n)$, where $U(m, n)$ is a uniform random variable in the interval $[m, n]$. The ramp attack is given by $a_{ik} = b \cdot (k – \Gamma)$, where $b$ is a scalar and $\Gamma$ is the attack initiation time. Under FDI attacks, the measurement equation becomes:
$$ y_k = \begin{cases}
H_k x_k + v_k & \text{if } k < \Gamma, \\
H_k x_k + v_k + G a_k & \text{if } k \geq \Gamma.
\end{cases} $$
Here, $G$ is a diagonal matrix indicating which sensors are under attack. For instance, if only GNSS sensors are targeted, specific elements of $G$ are set to 1. These attack models allow us to simulate scenarios where the quadcopter’s position estimates are gradually or abruptly deviated, leading to potential system failures. The impact of such attacks is significant, as demonstrated in our simulations, where even small biases can cause the quadcopter to drift from its intended path.
Extended Kalman Filter for State Estimation
The EKF serves as the backbone of our feature extraction process. It provides optimal state estimates by linearizing the nonlinear system dynamics around the current state estimate. The prediction and update steps of the EKF are as follows:
Prediction:
$$ \hat{x}_{k|k-1} = F(\hat{x}_{k-1|k-1}, u_{k-1}), $$
$$ P_{k|k-1} = \Phi_{k-1} P_{k-1|k-1} \Phi_{k-1}^T + Q_w, $$
$$ r_k = y_k – H_k \hat{x}_{k|k-1}. $$
Kalman Gain Calculation:
$$ K_k = P_{k|k-1} H_k^T (H_k P_{k|k-1} H_k^T + Q_v)^{-1}. $$
Update:
$$ \hat{x}_{k|k} = \hat{x}_{k|k-1} + K_k r_k, $$
$$ P_{k|k} = (I – K_k H_k^T) P_{k|k-1}. $$
Here, $\Phi_k$ is the Jacobian of $F$ with respect to $x$, and $r_k$ is the innovation sequence. The EKF’s ability to handle nonlinearities makes it suitable for quadcopter applications, where dynamics are inherently nonlinear. However, in the presence of attacks, the EKF estimates can become biased. To mitigate this, we later introduce an adaptive EKF that adjusts the measurement noise covariance based on attack detection results.
Deep Belief Network for Attack Detection
The DBN is a multilayer neural network composed of stacked Restricted Boltzmann Machines (RBMs), which can learn hierarchical representations of data. Each RBM consists of a visible layer and a hidden layer, trained using contrastive divergence (CD) to model the probability distribution of input data. The DBN training involves two phases: unsupervised pre-training of RBMs and supervised fine-tuning with a classification layer. This structure enables the DBN to capture complex patterns in sensor data that indicate attacks.
In our framework, the DBN maps features extracted from EKF innovations to sensor states (normal or under attack). The input to the DBN is constructed using sliding time windows of the innovation sequence $r_k$ or its Euclidean norm $\eta_k = r_k^T r_k$. For random attacks, we use $\eta_k$ over a window of size $M$, forming the detection vector $o_\eta \in \mathbb{R}^M$. For ramp attacks, we use the cumulative sum $\bar{r}_k$ over a window of size $N$, resulting in $o_r \in \mathbb{R}^{3N}$. These vectors serve as inputs to the DBN, which outputs a binary decision on attack presence.
The DBN architecture in our experiments consists of four RBMs, with layer sizes optimized based on the window size. For example, with $M=27$, the DBN has layers of sizes 27, 108, 54, and 27, followed by a sigmoid output layer. The training involves 2000 iterations of pre-training and 2500 iterations of fine-tuning, ensuring robust feature learning and classification.
Feature Extraction and Mapping
Feature extraction is critical for distinguishing between normal and attacked sensor data. We utilize the EKF’s innovation sequence $r_k$ to compute two types of features: the Euclidean norm $\eta_k$ and the cumulative sum $\bar{r}_k$. The Euclidean norm captures the magnitude of deviations between predicted and measured states, while the cumulative sum accounts for both magnitude and direction, making it sensitive to gradual attacks like ramps.
The mapping from these features to attack decisions is handled by the DBN. The nonlinear mapping capability of the DBN allows it to model complex relationships that traditional threshold-based methods might miss. We design separate DBN detectors for random and ramp attacks, each trained on corresponding feature vectors. The offline training algorithm involves dataset generation from simulations, where quadcopter flights under normal and attack conditions are used to create labeled examples. The online detection algorithm then applies the trained DBN to real-time data, triggering alerts when attacks are detected.
To quantify detection performance, we define the false alarm rate ($P_{FAR}$) and missed detection rate ($P_{MAR}$) as:
$$ P_{FAR} = \frac{T_{T<\Gamma}}{T_{T<\Gamma} + T_{\Gamma \leq T \leq \Gamma+t} + T_{T>\Gamma+t}}, $$
$$ P_{MAR} = \frac{T_{T>\Gamma+t}}{T_{T<\Gamma} + T_{\Gamma \leq T \leq \Gamma+t} + T_{T>\Gamma+t}}. $$
Here, $T$ is the detection time, $\Gamma$ is the actual attack time, and $t$ is the maximum allowed detection delay. These metrics are used to evaluate our detector against conventional methods.
Adaptive EKF for Enhanced Robustness
Prolonged sensor attacks can degrade the performance of the standard EKF. To address this, we integrate the attack detection results into an adaptive EKF framework. When an attack is detected, the adaptive EKF recalculates the measurement noise covariance matrix $Q_v$ using a scaling matrix $S_k$ derived from the innovation sequence:
$$ S_k = \left( \sum_{j=1}^N V_j r_{k-j} r_{k-j}^T – H_k P_{k|k-1} H_k^T \right) Q_v^{-1}, $$
$$ \hat{S}_k = \text{diag}(\hat{s}_1, \ldots, \hat{s}_9), \quad \hat{s}_i = \max(1, S_{ii}), $$
$$ K_k = P_{k|k-1} H_k^T (H_k P_{k|k-1} H_k^T + \hat{S}_k Q_v)^{-1}. $$
This adjustment reduces the influence of attacked sensors on state estimates, thereby maintaining estimation accuracy during attacks. The adaptive EKF is particularly effective for ramp attacks, where the gradual change in measurements might not trigger immediate detection but can accumulate over time.
Dataset Generation and Experimental Setup
We generate datasets for training and evaluation using MATLAB simulations of a quadcopter performing point-to-point navigation. The quadcopter parameters are listed in Table 1. Attacks are injected at $t=40$ s during an 80 s flight, with a time step of 0.01 s. We simulate both random and ramp attacks on GNSS sensors, resulting in two datasets: Dataset 1 for random attacks and Dataset 2 for ramp attacks. Each dataset includes the innovation sequence $r_k$ and corresponding feature vectors ($o_\eta$ or $o_r$), normalized for training efficiency.
| Parameter | Symbol | Value |
|---|---|---|
| Mass | $m$ | 1.2 kg |
| Arm Length | $l$ | 0.154 m |
| Moment of Inertia (x-axis) | $I_{xx}$ | 0.00864 kg·m² |
| Moment of Inertia (y-axis) | $I_{yy}$ | 0.00864 kg·m² |
| Moment of Inertia (z-axis) | $I_{zz}$ | 0.0620 kg·m² |
The DBN detectors are trained with varying window sizes ($M$ and $N$ from 18 to 27) to analyze the impact on detection performance and computational complexity. Training is conducted on a system with an Intel i5-12400 processor, and detection times are measured to assess real-time feasibility.
Performance Analysis and Results
We evaluate our EKF-DBN detector against traditional methods, including the $l_2$-norm detector, innovation sequence detection (ISD), and a deep neural network (DNN)-based detector. The $l_2$-norm detector uses a threshold of 0.0021, and the ISD uses a threshold of 14.35, both set at 99% confidence. The DNN structure is optimized for comparison. Detection results for random and ramp attacks are summarized in Table 2 and Table 3, respectively.
| Detector | Window Size | Accuracy (%) | False Alarm Rate (%) | Missed Detection Rate (%) |
|---|---|---|---|---|
| DBN1 | 18 | 90.18 | 9.28 | 0.54 |
| DBN2 | 21 | 88.16 | 11.14 | 0.70 |
| DBN3 | 24 | 96.30 | 2.08 | 1.62 |
| DBN4 | 27 | 97.24 | 0.58 | 2.18 |
| $l_2$-norm | – | 4.5 | 95.5 | N/A |
| ISD | – | 3.2 | 96.8 | N/A |
| DNN | 27 | 92.1 | 5.3 | 2.6 |
| Detector | Window Size | Accuracy (%) | False Alarm Rate (%) | Missed Detection Rate (%) |
|---|---|---|---|---|
| DBN5 | 18 | 68.96 | 0.00 | 31.04 |
| DBN6 | 21 | 92.78 | 5.04 | 2.18 |
| DBN7 | 24 | 90.38 | 7.86 | 1.76 |
| DBN8 | 27 | 94.52 | 4.02 | 1.46 |
| $l_2$-norm | – | 2.1 | 97.9 | N/A |
| ISD | – | 1.8 | 98.2 | N/A |
| DNN | 27 | 89.7 | 6.9 | 3.4 |
The results show that our DBN detectors achieve higher accuracy and lower false alarm rates compared to traditional methods. For random attacks, the best performance is with a window size of 27 (DBN4), achieving 97.24% accuracy. For ramp attacks, DBN8 (window size 27) reaches 94.52% accuracy. The $l_2$-norm and ISD detectors perform poorly, with accuracies below 5%, as they are sensitive to noise and unable to capture gradual attacks. The DNN detector shows improved performance but is outperformed by our DBN approach, particularly in reducing missed detections.
Computational complexity is analyzed based on training and detection times. As window size increases, training time grows from 2024.9 s to 7221.9 s, and detection time per sample increases from $1.60 \times 10^{-2}$ ms to $3.42 \times 10^{-2}$ ms. Despite this, the DBN detectors remain feasible for real-time applications due to their efficient forward propagation.
Adaptive EKF Performance Evaluation
We assess the adaptive EKF’s effectiveness by comparing state estimation errors under attack conditions. Figure 1 illustrates the position estimation errors for a quadcopter under random attacks (10-15 s). The adaptive EKF maintains lower errors compared to the standard EKF, as it adjusts the Kalman gain to reduce the impact of attacked sensors. Similarly, for ramp attacks, the adaptive EKF shows improved robustness, with errors converging faster after attack cessation. This demonstrates the value of integrating attack detection with state estimation for enhancing quadcopter security.
Conclusion and Future Work
In this paper, we presented a novel sensor attack detection framework for quadcopters that combines the EKF and DBN. Our approach effectively extracts features from sensor data using the EKF and models complex attack patterns with the DBN. The adaptive EKF further enhances system resilience by adapting to attack conditions. Simulation results confirm that our method outperforms existing techniques in detection accuracy and efficiency, making it a viable solution for securing quadcopter operations.
However, limitations exist, such as the lack of real-world deployment and the potential for advanced attacks to evade detection. Future work will focus on implementing the algorithm on physical quadcopter platforms and exploring countermeasures against sophisticated attack strategies. Additionally, we plan to extend the framework to multi-sensor fusion scenarios and investigate online learning techniques for adapting to evolving threats. By addressing these challenges, we aim to further advance the security and reliability of quadcopter systems in critical applications.
