Abstract:Facing the challenges of regulating unmanned aerial vehicles (UAV), and based on an YOLOv5-Lite improved model, this paper incorporates an exponential moving sample weight function that dynamically allocates loss function weights to the model during the training iteration. Through model computations, we achieve real-time UAV tracking using a two-degree-of-freedom servo platform. Furthermore, video capture, model calculations, and servo control are all performed locally on a Raspberry Pi 4B.The optimized model maintains the original model's parameter count while achieving a mAP@.5:.95 score of 70.2%, representing a 1.5% improvement over the baseline model. Real-time inference on the Raspberry Pi yields an average speed of 2.1 frames per second (FPS), demonstrating increased processing efficiency. Simultaneously, the Raspberry Pi controls a servo platform via the I2C protocol to track UAV targets, ensuring real-time dynamic monitoring of UAVs. This optimization enhances system reliability and offers superior practical value.