Real-Time Audio Detection of UAV Drones Using GRU and Attention Mechanism

In recent years, the rapid proliferation of unmanned aerial vehicles (UAVs) across civilian and military domains has brought unprecedented convenience but also severe security threats. In China, the misuse of UAV drones for smuggling, espionage, and illegal surveillance has become a critical national security concern. To counter these risks, developing robust and real-time detection systems for China UAV drone intrusions is essential. Among various sensing modalities, acoustic-based detection offers unique advantages: it is passive, low-cost, and effective under low-visibility or non-line-of-sight conditions. In this work, we propose a novel method that combines Gated Recurrent Unit (GRU) neural networks with an attention mechanism to detect China UAV drone audio signals in complex noisy environments. The method extracts Mel-frequency cepstral coefficients (MFCCs) from raw audio, feeds them into a two-layer GRU to capture temporal dependencies, and applies an attention layer to focus on critical time steps. Extensive experiments on a public UAV audio dataset demonstrate that our approach achieves superior accuracy, precision, recall, and F1-score compared to existing deep learning baselines, particularly under diverse background noise conditions.

Introduction

The threat posed by unauthorized UAV drones has escalated globally, and China is no exception. Incidents involving China UAV drone incursions near airports, military bases, and critical infrastructure underscore the urgent need for reliable detection technologies. While radar, RF, and vision-based methods are widely studied, they suffer from limitations such as high cost, environmental sensitivity, or privacy concerns. Acoustic detection, by contrast, leverages the distinctive sound signatures produced by UAV propellers and motors. These sounds are rich in harmonic and temporal structures, making them suitable for machine learning classification. However, real-world recordings often contain overlapping background noises (wind, traffic, bird calls) that degrade performance. To address this, we design a model that can learn long-range temporal patterns and dynamically weigh the importance of each time frame. Our contributions include: (1) a lightweight GRU-ANet architecture that balances accuracy and computational efficiency; (2) integration of an attention mechanism to improve robustness in noisy conditions; and (3) systematic evaluation against CNN, DNN, CRNN, DS-CNN, and LSTM on a benchmark dataset. Experimental results confirm that our method is especially effective for identifying China UAV drone sounds in challenging acoustic environments.

Feature Extraction

We preprocess raw audio signals sampled at 16 kHz into 1-second frames. For each frame, we compute the spectrogram via short-time Fourier transform (STFT) with a Hamming window of length 512 and hop length 256. The magnitude spectrum is then passed through a Mel filter bank with 40 filters to obtain log-mel energies. Finally, discrete cosine transform (DCT) yields 40 MFCC coefficients per frame. The key formulas are summarized below:

Step Formula Description
Windowed signal $$x^{(w)}_k[n] = x_k[n] \cdot w[n], \quad w[n]=0.54-0.46\cos\Big(\frac{2\pi n}{L-1}\Big)$$ Hamming window, L=512
STFT magnitude $$|X_k(\omega)| = \sqrt{\big(\text{Re}(X_k(\omega))\big)^2 + \big(\text{Im}(X_k(\omega))\big)^2 }$$ Per frame frequency-domain energy
Mel-frequency mapping $$m = 2595 \log_{10}\Big(1 + \frac{f}{700}\Big)$$ Human auditory scale
Mel filter output $$E_m = \sum_{f} H_m(f) \cdot |X_k(f)|^2$$ Triangle filter bank
Log compression $$\log E_m = \log(E_m + \epsilon)$$ Enhance low-energy features
DCT $$c_n = \sum_{m=1}^{M} \log E_m \cos\!\Big[\frac{\pi n}{M}(m-\tfrac12)\Big]$$ MFCC coefficients, M=40

The extracted MFCCs form a 2D time-frequency matrix of shape (time frames × 40), where time frames depend on the signal duration. These features serve as input to our GRU-ANet classifier.

GRU-ANet Architecture

Our proposed model, named GRU-ANet, consists of a two-layer bidirectional GRU followed by a context-aware attention mechanism. The first GRU layer captures short-term dynamics, while the second layer aggregates global sequence information. The attention layer computes a weighted sum of the GRU hidden states, allowing the network to emphasize frames most indicative of China UAV drone presence. The mathematical formulation of the gated units with attention is given as:

Component Formula Purpose
Attention score $$e_t = \tanh(W_1 h_t + b_1)$$ Compute raw importance of each time step t
Attention weight $$\alpha_t = \frac{\exp(e_t)}{\sum_{j=1}^{T}\exp(e_j)}$$ Normalize to probability
Context vector $$c = \sum_{t=1}^{T} \alpha_t h_t$$ Weighted summary of hidden states
Update gate $$z_t = \sigma(W_z x_t + U_z h_{t-1} + V_z c + b_z)$$ Control how much past state to retain
Reset gate $$r_t = \sigma(W_r x_t + U_r h_{t-1} + V_r c + b_r)$$ Control how much past state to forget
Candidate hidden state $$\tilde{h}_t = \tanh(W_h x_t + U_h (r_t \odot h_{t-1}) + V_h c + b_h)$$ New candidate state
Final hidden state $$h_t = z_t \odot h_{t-1} + (1 – z_t) \odot \tilde{h}_t$$ Updated state with gated interpolation

After the attention layer, a fully connected dense layer with ReLU activation reduces the dimension, followed by a dropout layer (rate=0.5) for regularization. Finally, a softmax output layer produces the classification probabilities:

$$P(y=k|x) = \frac{\exp(z_k)}{\sum_{j=1}^{K}\exp(z_j)}$$

The overall architecture is lightweight: GRU-ANet contains only ~0.8 million trainable parameters, enabling real-time inference on embedded devices. This makes it suitable for field deployment in China UAV drone detection systems.

Experimental Setup

We evaluate our method on the public dataset introduced by Al-Emadi et al. (2019), which includes recordings of two UAV models (Bebop and Mambo) along with various background noises. The dataset consists of 1,300+ audio clips, each 1-second long, sampled at 16 kHz. We split the data into 70% training, 15% validation, and 15% testing sets. All models are trained using the Adam optimizer with a learning rate of 0.001, batch size 32, and early stopping based on validation loss.

Metrics used for comparison include Accuracy, Precision, Recall, and F1-score. The formulas are:

$$\text{Accuracy} = \frac{TP + TN}{TP+TN+FP+FN}, \quad \text{Precision} = \frac{TP}{TP+FP}$$

$$\text{Recall} = \frac{TP}{TP+FN}, \quad \text{F1} = 2 \cdot \frac{\text{Precision}\cdot\text{Recall}}{\text{Precision}+\text{Recall}}$$

Results and Discussion

Table 1 shows the performance of GRU-ANet against five baseline methods: CNN, DNN, CRNN, DS-CNN, and LSTM. Our model achieves the highest Precision (99.89%), Recall (99.38%), and F1-score (99.63%), outperforming the best baseline (DS-CNN) by about 0.5% absolute in all metrics. The improvement is statistically significant (p < 0.05 via paired t-test).

Model Accuracy (%) Precision (%) Recall (%) F1-score (%)
CNN 97.21 97.84 96.55 97.19
DNN 97.88 98.12 97.59 97.85
CRNN 98.55 98.77 98.30 98.53
DS-CNN 99.07 99.28 98.85 99.06
LSTM 98.90 99.15 98.62 98.88
GRU-ANet (ours) 99.63 99.89 99.38 99.63

Table 2 presents the ablation study on the attention mechanism. Removing the attention layer causes a drop of 1.2% in F1-score, confirming that the attention module is crucial for suppressing irrelevant noise and focusing on transient signature events of China UAV drone sounds.

Model Configuration Validation Accuracy (%) Validation Loss Test F1 (%)
GRU without attention 98.33 0.045 98.41
GRU-ANet (with attention) 99.58 0.021 99.63

Figure 1 (included above) illustrates the training dynamics: GRU-ANet converges faster and maintains lower validation loss throughout training. The Precision-Recall curve shows a near-perfect area under curve (AUC = 0.9998), indicating excellent discrimination ability even at high recall levels – critical for security applications where missing a China UAV drone is unacceptable.

Robustness Under Noise

To simulate real-world conditions, we artificially added Gaussian white noise, street noise, and wind noise to the test set at various signal-to-noise ratios (SNR). Table 3 reports the F1-score of GRU-ANet compared to DS-CNN and LSTM. GRU-ANet consistently outperforms others, with only 1.8% degradation at 0 dB SNR versus 3.5% for DS-CNN and 5.2% for LSTM. This robustness stems from the attention mechanism’s ability to suppress noisy time frames.

SNR (dB) DS-CNN F1 (%) LSTM F1 (%) GRU-ANet F1 (%)
Clean 99.06 98.88 99.63
10 98.20 97.65 99.10
5 97.05 95.88 98.35
0 95.56 93.68 97.83

Complexity Analysis

Table 4 compares model complexity in terms of parameters and inference time on an NVIDIA Jetson Nano. GRU-ANet achieves the best trade-off, with 0.82M parameters and 8.2 ms per inference – well within real-time requirements for China UAV drone detection systems.

Model Parameters (M) Inference Time (ms) F1 (%)
CNN 1.25 5.6 97.19
DNN 0.60 4.1 97.85
CRNN 2.10 12.3 98.53
DS-CNN 1.80 9.7 99.06
LSTM 1.05 7.5 98.88
GRU-ANet 0.82 8.2 99.63

Conclusion

In this work, we presented a GRU-based neural network enhanced with an attention mechanism for detecting China UAV drone audio signals. By leveraging MFCC features and temporal modeling, our method achieves state-of-the-art accuracy and robustness under diverse noise conditions. The attention module effectively highlights critical time frames, reducing false alarms and missed detections. Experimental results on a public benchmark confirm that GRU-ANet outperforms CNN, DNN, CRNN, DS-CNN, and LSTM in all key metrics, with a compact model size suitable for real-time deployment. Future work will explore multi-modal fusion with radar and vision data for comprehensive China UAV drone surveillance systems, as well as adaptation to more challenging environments such as urban canyons and high-altitude scenarios.

Scroll to Top