Research on Anti-UAV PTZ Target Tracking System Based on the DAST-NanoTrack Algorithm

In recent years, the proliferation of consumer and industrial unmanned aerial vehicles (UAVs) has posed escalating threats to low-altitude security in sensitive areas such as confidential facilities, core office buildings, and restricted zones. Due to their small size, high maneuverability, and strong concealment, traditional manual security and fixed surveillance methods are often inadequate for proactive warning and continuous tracking. To address these challenges, this thesis focuses on the development of a high-precision and real-time Pan-Tilt-Zoom (PTZ) target tracking system deployed on the Rockchip RK3588 embedded platform. The work encompasses three major contributions: a lightweight UAV small-object detection algorithm named AAP2-YOLO, a robust tracking algorithm named DAST-NanoTrack, and a complete embedded PTZ tracking system integrated with a PID control strategy. Extensive experiments conducted on public datasets and real-world outdoor scenes demonstrate that the proposed system achieves stable and accurate locking of UAV targets while maintaining strict real-time compliance on embedded hardware.

1. Introduction

The widespread application of unmanned aerial vehicles (UAVs) in both civilian and military domains has brought unprecedented convenience, but also introduced severe security risks. Malicious UAV intrusions into restricted airspace have become increasingly frequent. Given the “low, slow, and small” characteristics of UAVs, traditional radar-based surveillance often fails to detect them in complex urban environments. Consequently, computer vision-based detection and tracking has emerged as a key technology for low-altitude defense systems.

The core challenge in building such systems lies in the trade-off between algorithmic accuracy and computational efficiency on edge devices. High-performance deep learning models demand significant computing resources, while resource-constrained embedded platforms struggle to meet real-time requirements. To overcome this dilemma, this thesis aims to design a lightweight yet accurate visual perception front-end, a robust temporal tracking module, and a tightly-coupled hardware-software control loop.

The remainder of this paper is organized as follows. Section 2 presents the improved UAV detection model AAP2-YOLO. Section 3 details the proposed DAST-NanoTrack tracking algorithm. Section 4 describes the embedded system design, including hardware topology, multi-thread processing, and PTZ control. Section 5 evaluates the system through real-world experiments. Section 6 concludes the paper and outlines future work.

2. Lightweight UAV Detection Model: AAP2-YOLO

2.1 Problem Statement

Detecting small unmanned aerial vehicle targets in complex backgrounds is a notoriously difficult task. The original YOLOv11 model, although efficient in general object detection, suffers from severe missed and false detections when applied to tiny UAV objects, which often occupy only a few dozen pixels in a high-resolution frame. The deep layers of the network tend to lose fine-grained spatial details, while the default P3–P5 detection heads are biased toward medium and large objects. To mitigate these issues, I propose the AAP2-YOLO model, which incorporates three key structural innovations: ADown modules for lossless down-sampling, an attentional scale sequence fusion (ASF) neck, and a dedicated small-object detection head at the P2 scale with the removal of the redundant P5 head.

2.2 Network Architecture

The overall architecture of the improved model is illustrated in the figure below. The backbone adopts ADown blocks to replace the original stride-2 convolutions. The neck is redesigned based on the ASF architecture, producing an ASF-SOD (Adaptive Spatial Fusion for Small Object Detection) structure that fuses features from P2, P3, and P4 levels while eliminating the P5 branch. This design concentrates computational resources on high-resolution feature maps, thereby preserving crucial spatial details for small target localization.

2.3 ADown Module for Feature Preservation

The ADown module replaces the conventional single-path down-sampling convolution with a dual-path processing scheme. Given an input feature map \(X\) with \(C\) channels, the module first splits it into two halves along the channel dimension. One half undergoes average pooling followed by a \(1\times1\) convolution, while the other half is processed by a \(3\times3\) convolution with stride 2. The two branches are then concatenated to produce the output:

$$X_{out} = \text{Concat}\left( \text{Conv}_{1\times1}(\text{AvgPool}(X_{1})), \ \text{Conv}_{3\times3}(X_{2}) \right)$$

where \(X_{1}, X_{2}\) are the two channel-split halves. This design preserves both high-frequency and low-frequency information, significantly reducing the loss of fine-grained details that are critical for detecting small unmanned aerial vehicle targets.

2.4 ASF-SOD Neck Structure

The ASF structure integrates a Scale Sequence Feature Fusion (SSFF) module and a Channel and Position Attention Mechanism (CPAM). The SSFF module builds a scale-space representation using Gaussian smoothing and then applies 3D convolutions to extract cross-scale features. Formally, given the multi-level features \(F_{2}, F_{3}, F_{4}\), the fusion process is described by:

$$F_{scal} = \sigma\left( \text{Conv3D}\left( \text{Stack}(F_{2}, F_{3}, F_{4}) \right) \right)$$

where \(\sigma(\cdot)\) is the activation function. Meanwhile, the TFE (Triple Feature Encoder) module processes features at different scales in parallel and aggregates them through concatenation and \(1\times1\) convolution. The CPAM module re-calibrates the fused features using efficient channel attention with adaptive kernel size:

$$k = \left| \frac{\log_2 C + \gamma}{\eta} \right|_{odd}$$

and position attention that encodes direction-aware spatial dependencies.

To further enhance small-object detection, I introduce an additional P2 detection head operating on a 4× down-sampled feature map. This head preserves the highest spatial resolution and is particularly sensitive to tiny objects. Concurrently, the P5 head, which targets large objects and consumes considerable computation, is removed to reduce redundant calculations and model complexity. The final neck produces three detection scales: P2, P3, and P4, all aligned with small and medium object sizes.

2.5 Experiments and Results

I evaluated the proposed AAP2-YOLO model on the DUT-Anti-UAV dataset, which contains 10,000 images of UAVs in diverse backgrounds. I also performed ablation studies to validate each component. The experimental setup employed an NVIDIA GeForce RTX 3090 GPU for training, with a batch size of 32 and 400 epochs. For inference speed evaluation, the CPU device was used. The following metrics are adopted: Precision (\(P\)), Recall (\(R\)), mean Average Precision (\(mAP\)), parameter count, and GFLOPs.

The ablation study results are summarized in the table below.

Method R P mAP@0.5 FPS Params (10^6) GFLOPs
Baseline (YOLOv11) 0.738 0.926 0.819 45 2.58 6.3
+ADown 0.752 0.916 0.827 45 2.24 5.5
+ASF 0.728 0.935 0.820 29 2.68 7.5
+ADown+ASF 0.757 0.918 0.834 26 2.33 6.2
+ASF+P2head (ASF-SOD) 0.846 0.956 0.908 21 2.00 10.3
Ours (Full) 0.854 0.961 0.909 23 1.66 9.4

As can be observed, adding ADown improves recall from 0.738 to 0.752, demonstrating its effectiveness in retaining fine details. The ASF neck increases precision to 0.935, reducing false positives through better feature fusion. The introduction of the P2 head brings the most dramatic improvement, boosting recall to 0.846 and precision to 0.956. The full model achieves the best balance, with a recall of 0.854 and a precision of 0.961, while only requiring 1.66M parameters and 9.4 GFLOPs. The model maintains a processing speed of 23 FPS on CPU, which is sufficient for real-time deployment on the RK3588 NPU.

I also conducted comparative experiments with other state-of-the-art detectors on both DUT-Anti-UAV and TIB-Net UAV datasets. The results are presented below.

Dataset Method R P mAP@0.5 FPS Params (10^6) GFLOPs
DUT-Anti-UAV YOLOv11n 0.738 0.926 0.819 45 2.58 6.3
YOLOv5n 0.740 0.932 0.819 13 2.50 7.1
YOLOv8s 0.777 0.928 0.855 5 11.1 28.4
YOLOv10n 0.524 0.827 0.890 12 2.30 6.5
YOLOv12n 0.509 0.816 0.900 40 2.50 5.8
YOLOv13s 0.762 0.925 0.840 9 9.00 20.0
Ours 0.854 0.961 0.909 23 1.66 9.4
TIB-Net UAV YOLOv11n 0.720 0.930 0.811 43 2.58 6.3
YOLOv10n 0.752 0.890 0.827 12 2.30 6.5
YOLOv13s 0.698 0.888 0.792 13 9.00 20.0
Ours 0.864 0.963 0.922 23 1.66 9.4

The proposed model consistently outperforms all baselines in terms of recall and precision while maintaining a compact parameter count. This high detection accuracy is the foundation for initializing the subsequent tracking module.

3. Robust Tracking Algorithm: DAST-NanoTrack

3.1 Limitations of NanoTrack

NanoTrack is a lightweight Siamese-based tracking algorithm that achieves excellent real-time performance on embedded devices. However, in practical anti-UAV applications, it suffers from three major drawbacks. First, it relies on a fixed local search region centered at the previous frame’s target position. When the unmanned aerial vehicle moves quickly or irregularities in its trajectory occur, the target can easily fall outside the search area, leading to track loss. Second, the fixed template used for matching cannot adapt to changes in target appearance, such as attitude variation or illumination shifts. Third, the tracker has no mechanism to recover from temporary occlusion or disappearance.

3.2 Proposed Improvements

To overcome these limitations, I propose DAST-NanoTrack (Dynamic Adaptive Search and Template NanoTrack), which introduces three key enhancements: Kalman filter-based search center prediction, an adaptive search strategy, and a confidence-gated dynamic template update mechanism.

3.2.1 Kalman Filter for Center Prediction

The state vector \(\mathbf{x}_t = [x_t, y_t, v_{x,t}, v_{y,t}]^{\mathsf{T}}\) represents the target’s center position and velocity in the image plane. The prediction stage is given by:

$$\mathbf{x}_{t|t-1} = \mathbf{E} \mathbf{x}_{t-1} + \mathbf{w}_{t-1}$$
$$\mathbf{P}_{t|t-1} = \mathbf{E} \mathbf{P}_{t-1} \mathbf{E}^{\mathsf{T}} + \mathbf{Q}$$

where \(\mathbf{E}\) is the state transition matrix. In my implementation, the time step \(\Delta t\) is set to 0.04 s (corresponding to a 25 FPS video sequence) and the matrix is:

$$\mathbf{E} = \begin{bmatrix} 1 & 0 & \Delta t & 0 \\ 0 & 1 & 0 & \Delta t \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$$

At frame \(t\), the observation \(\mathbf{o}_t = [x_{\text{obs}}, y_{\text{obs}}]^{\mathsf{T}}\) is the target position output by the NanoTrack network. The update stage computes the Kalman gain \(\mathbf{K}_t\) and corrected state:

$$\mathbf{K}_t = \mathbf{P}_{t|t-1} \mathbf{H}^{\mathsf{T}} (\mathbf{H} \mathbf{P}_{t|t-1} \mathbf{H}^{\mathsf{T}} + \mathbf{R})^{-1}$$
$$\mathbf{x}_t = \mathbf{x}_{t|t-1} + \mathbf{K}_t (\mathbf{o}_t – \mathbf{H} \mathbf{x}_{t|t-1})$$
$$\mathbf{P}_t = \mathbf{P}_{t|t-1} – \mathbf{K}_t \mathbf{H} \mathbf{P}_{t|t-1}$$

where \(\mathbf{H}\) is the observation matrix. The updated state vector provides the predicted center for the next frame’s search region, greatly reducing the chance of the target escaping the search window during rapid maneuvers.

3.2.2 Adaptive Search Strategy

Instead of always using a fixed local search region, I introduce a state-dependent switching mechanism. Let \(s_t\) denote the confidence score output by the tracking network. If \(s_t \ge \tau\), a local search centered at the Kalman-predicted location is performed. If \(s_t < \tau\), the tracker switches to a global search over the entire image to re-detect the target. The switching function is:

$$S_t = \begin{cases} \text{Local}, & s_t \ge \tau \\ \text{Global}, & s_t < \tau \end{cases}$$

where the threshold \(\tau\) is empirically set to 0.8 based on the on-device latency budget and target dynamics. This adaptive strategy preserves real-time efficiency during normal tracking while providing a recovery mechanism when the target is temporarily lost or undergoes abrupt motion.

3.2.3 Dynamic Template Update

The original NanoTrack keeps the template fixed, which degrades performance under appearance changes. I propose a confidence-gated update rule. Let \(F_z^{t-1}\) be the template feature at frame \(t-1\), and \(F_z^{t}\) be the feature extracted from the current estimated target region. The updated template is:

$$F_z^{t,\text{new}} = (1-\alpha) F_z^{t-1} + \alpha F_z^{t}$$

where \(\alpha\) is the update rate. To prevent template pollution, the update is only performed when the confidence \(s_t\) lies in the interval \([\tau_{\min}, \tau_{\max}]\). If \(s_t < \tau_{\min}\) (unreliable) or \(s_t > \tau_{\max}\) (target appearance has not changed), the previous template is retained. In practice, \(\tau_{\min} = 0.8\) and \(\tau_{\max} = 0.9\) are used. This gating ensures that only high-quality detections with moderate novelty contribute to the template, thereby balancing adaptability and stability.

3.3 Experimental Evaluation

I evaluated the proposed DAST-NanoTrack algorithm on the Anti-UAV dataset using the one-pass evaluation (OPE) protocol. The tracking network employs a ResNet-50 backbone, with template and search region sizes set to 127×127 and 255×255 pixels, respectively. The scale penalty is 0.16, the Hanning window weight is 0.32, and the learning rate for scale/position update is 0.55. All experiments were conducted on the same RK3588 platform to ensure a fair comparison.

The overall precision and success curves are compared against several baseline trackers. The quantitative comparison of key metrics is shown in the table below.

Algorithm Precision (%) Success Rate (%)
KCF 48.4 45.1
CSK 41.2 39.8
SiamFC 61.3 58.7
NanoTrack 59.2 54.1
DAST-NanoTrack (Ours) 72.2 74.9

Compared to the original NanoTrack, the precision improves by 12.98% and the success rate by 20.81%. These improvements are statistically significant and demonstrate the effectiveness of the proposed enhancements in challenging scenarios.

I further conducted qualitative comparisons in four adversarial situations: fast motion, complex background, occlusion and reappearance, and target appearance mutation. In all four cases, the original NanoTrack suffers from track loss or drift, while DAST-NanoTrack consistently maintains accurate localization. For example, when the target is briefly occluded and reappears, the adaptive global search successfully re-acquires the target. When the target rotates rapidly, the dynamic template update allows the tracker to follow the evolving appearance without losing lock.

4. Embedded System Design and Implementation

4.1 System Overview

To bridge the gap between algorithms and practical applications, I designed and implemented a complete PTZ target tracking system on the Rockchip RK3588 platform. The system consists of two main parts: the vision processing unit and the motion control unit. The vision processing unit runs the detection and tracking algorithms, while the motion control unit drives the pan-tilt motors to keep the target in the camera’s field of view.

The overall system architecture is depicted in the following figure, which illustrates the data flow from the camera through the RK3588 main board to the PTZ motor control board.

4.2 Hardware Platform and Communication

The RK3588 SoC integrates an 8-core CPU, a 6 TOPS NPU, an ISP, and rich I/O interfaces. The system uses a USB 3.0 camera to capture 1080p video at 30 FPS. Communication between the RK3588 and the PTZ motor controller is realized via RS232 at 115200 baud, with an ASCII-based command protocol. The motor controller is based on a closed-loop stepper driver with an incremental encoder, ensuring high positioning accuracy and no step-loss.

4.3 Multi-thread Parallel Processing

To maximize the use of the RK3588’s heterogeneous computing resources, I designed a multi-threaded software pipeline. Four threads operate concurrently: acquisition thread, detection thread, tracking thread, and control thread. They communicate through thread-safe queues and event flags. The structure is summarized below:

Thread Function Key API
Acquisition Read frames from USB camera V4L2, OpenCV VideoCapture
Detection Run AAP2-YOLO for global search RKNN API
Tracking Run DAST-NanoTrack for temporal localization RKNN API, Kalman filter
Control Generate PTZ velocity commands via PID Serial port write

This parallel architecture reduces end-to-end latency and prevents any single stage from blocking the whole pipeline.

4.4 Visual-to-Control Mapping and PID

The tracking thread outputs the target bounding box. The target center is computed as:

$$c_x = x + \frac{w}{2}, \quad c_y = y + \frac{h}{2}$$

The image error is then derived relative to the image center \((W/2, H/2)\):

$$e_x = c_x – \frac{W}{2}, \quad e_y = c_y – \frac{H}{2}$$

These errors drive the pan (horizontal) and tilt (vertical) axes. The PID controller generates velocity commands:

$$u_x(k) = K_p e_x(k) + K_i \sum_{i=0}^{k} e_x(i) + K_d [e_x(k) – e_x(k-1)]$$

where \(K_p\), \(K_i\), and \(K_d\) are tuned empirically using the trial-and-error method. A dead zone threshold \(\varepsilon\) is applied to filter small noise, and output saturation is used to limit the maximum angular velocity. The final control signal is sent to the motor controller, which converts the velocity command into pulse/direction signals for the stepper motors.

4.5 Model Conversion and Deployment

The PyTorch-trained models were first converted to ONNX format and then to RKNN format using the RKNN-Toolkit. INT8/FP16 mixed precision quantization was applied to reduce memory bandwidth and improve inference speed. The converted models run efficiently on the NPU, achieving a stable system frame rate of around 30 FPS in practice.

5. Real-World Experiments

5.1 Setup

I validated the complete system using physical UAV targets. Two DJI models were used: the DJI Mini 3 (weight 248 g) and the DJI Mavic 4 Pro (weight 1063 g). The tests were conducted outdoors in a complex urban environment with buildings, trees, and varying lighting conditions. The PTZ platform was mounted on a fixed tripod, and the RK3588 board was powered by a portable battery.

The key performance indicator was the percentage of frames in which the target center stayed within a certain central region of the image (5%, 10%, 15%, 20%). A higher percentage indicates better tracking precision and stability. The experiments were repeated at three horizontal distances: approximately 15 m, 45 m, and 85 m.

5.2 Results

First, I tested the maximum detectable distance. The system was able to maintain lock on the UAV at a slant range of approximately 128.8 m (height 80 m, horizontal distance 101 m), which demonstrates the excellent sensitivity of the detection and tracking algorithms.

The quantitative results for the three test distances are shown in the table below.

Distance (m) Central Region Size Frame Ratio (%)
15 5% 48.60
10% 59.41
15% 62.39
20% 70.20
45 5% 55.22
10% 60.11
15% 70.89
20% 76.28
85 5% 57.16
10% 66.78
15% 70.61
20% 77.27

At all distances, the system successfully concentrated the target within the central 20% region for more than 70% of the time. The tracking performance remained robust even at 85 m, where the target occupies very few pixels and background clutter is severe. The system also maintained a consistent frame rate of approximately 30 FPS throughout the tests, confirming the real-time capability of the embedded implementation.

Qualitative observations showed that the tracking box remained tightly attached to the UAV without drifting or losing lock in all sequences. The PID-based PTZ control produced smooth rotational movements without overshooting or oscillating. The dead-zone filter effectively suppressed jitter caused by image noise.

6. Conclusion and Future Work

This thesis presented a complete research and engineering effort to build a robust anti-unmanned aerial vehicle PTZ target tracking system on the Rockchip RK3588 embedded platform. Three main contributions were made. First, the AAP2-YOLO detection algorithm was proposed, which employs ADown modules, an ASF-SOD neck, and a P2 detection head. This model achieves a recall of 0.854 and a precision of 0.961 on the DUT-Anti-UAV dataset with only 1.66M parameters, significantly reducing both missed and false detections. Second, the DAST-NanoTrack tracking algorithm was developed by integrating Kalman filter prediction, adaptive search, and dynamic template updating. It improved the precision by 12.98% and the success rate by 20.81% over the original NanoTrack on the Anti-UAV benchmark. Third, the complete embedded system was implemented with a multi-threaded software architecture, a PID-based closed-loop motor control, and efficient RKNN model deployment. Real-world experiments confirmed that the system can stably lock onto small UAV targets at distances up to 85 m while maintaining a real-time frame rate of 30 FPS.

In future work, I plan to enhance the system’s robustness in adverse weather conditions by fusing infrared and visible light sensors. I also intend to extend the single-target tracker to a multi-target tracker to counter UAV swarm threats. Moreover, advanced control strategies such as model predictive control or active disturbance rejection control could be investigated to further improve the transient response of the PTZ platform during highly agile UAV maneuvers.

In summary, the proposed system provides a practical and effective solution for low-altitude anti-UAV security, demonstrating that a careful co-design of lightweight algorithms and embedded hardware can achieve both high precision and real-time performance in challenging real-world environments.

Scroll to Top