###### Abstract  
The drone industry has opened its market to ordinary people, making drones prevalent in daily life. However, safety and security issues have been raised as the number of accidents rises (e.g., losing control and colliding with people or invading secured properties). For safety and security purposes, observers and surveillance systems must be aware of UAVs invading aerial spaces. This paper introduces a UAV tracking system with ROI-based video coding capabilities that can efficiently encode videos with a dynamic coding rate. The proposed system initially uses deep learning-based UAV detection to locate the UAV and determine the ROI surrounding the detected UAVs. Afterward, the ROI is tracked using optical flow, which is relatively light in computational load. Furthermore, our devised module for effective compression, XROI-DCT, is applied to non-ROI regions, so a different coding rate is applied depending on the region during encoding. The proposed UAV tracking system is implemented and evaluated by utilizing videos from YouTube, Kaggle, and a video of 3 DR Solo2 taken by the authors. The evaluation verifies that the proposed system can detect and track UAVs significantly faster than YOLOv7 and efficiently encode a video, compressing 70% of the video based on the ROI. Additionally, it can successfully identify the UAV model with a high accuracy of 0.9869 ROC-AUC score. UAV; object detection; object classification; video encoding +
Footnote †: journal: MedicalIncidences involving UAVs flying into restricted aerial zones are increasing along with the total number of incidences. To prevent such incidents, detecting and tracking the object--in this case, a UAV--reliably and accurately would be the first essential step. Early works were primarily focused on enhancing the detection and tracking accuracy under constrained environments by employing classical computer vision techniques such as background subtraction and global/local contrast [5]. As the field progressed, more sophisticated approaches were introduced, leveraging the power of artificial intelligence and machine learning. These approaches have been utilized in many other UAV-related areas, such as topology control [6] and location-based routing [7]. Notably, algorithms like Kalman and particle filters were adapted for dynamic and uncertain environments to improve tracking robustness [8]. In recent studies, integrated deep learning algorithms, such as convolutional neural network (CNN) [9], are adopted to autonomously learn from vast amounts of data, significantly improving the detection of UAVs against varied backgrounds and during challenging conditions. Furthermore, real-time object detection, such as YOLO (You Only Look Once) [10], has revolutionized the field by reducing latency and increasing object recognition accuracy in videos. This feature is indispensable in scenarios where speed and accuracy are crucial, such as monitoring fast-moving targets or navigating through rapidly changing environments, making it highly suitable for UAV surveillance and tracking. In this paper, a UAV surveillance and tracking system with a suitable video coding system for limited resource devices is introduced. The proposed system is based on the region-of-interest (ROI) video coding technique and adopts object tracking to classify and track ROI. Efficient ROI management is attained by using YOLOv7 [11] for setting ROI based on object detection with deep neural network and optical flow [12] for tracking ROI. Video coding alone is a power-consuming process. Moreover, such deep learning tasks and image processing for small devices can be overwhelming due to limited resources and lack of GPU [13]. For capturing a moving object in a 30 frame-per-second or above video [14], object detection becomes a power-consuming algorithm. Applying UAV detection and video coding on every frame is unsuitable for such devices.