# AI-Driven Safety and Security for UAVs: From Machine Learning to Large Language Models
## 3 AI for UAV Safety
### UAV Collision Avoidance and Path Planning  
UAV collision avoidance is a challenging problem that becomes even more difficult in dynamic environments with multiple UAV deployments and dynamic obstacles detected by sensors. Collision avoidance systems range from simple warnings provided to UAV controllers for manual intervention to partially or fully autonomous control systems to prevent collisions. Collision avoidance techniques can be categorized into two parts: dynamic obstacle detection and path planning. Global path planning focuses on determining the optimal route while considering the entire environment. In contrast, local path planning is performed locally in response to environmental changes, and collision avoidance algorithms are executed accordingly [143]. In dynamic obstacle detection and tracking, UAVs fly autonomously in complex and changing environments. Therefore, accurately sensing and avoiding dynamic obstacles is the key to ensuring their safe operation, as illustrated in Figure 10. However, traditional techniques have limitations in dealing with dynamic environments and moving obstacles [57; 144; 145], especially in complex urban environments. In these environments, UAVs have a limited understanding of complex environments, making it challenging to recognize and track dynamic obstacles accurately. Lightweight DL architectures such as the YOLO-Fastest [146] and RGB-D [147] real-time detection frameworks with multidetector fusion can fully leverage the depth information and color image data provided by RGB-D cameras, improving detection accuracy and real-time performance. Moreover, by combining RGB-D cameras with Kalman filtering [146; 148] and decentralized gradient optimization [145], the system can more accurately estimate the position and speed of obstacles, thus improving the detection accuracy of small and high-speed obstacles and realizing clustered collision avoidance. Particle maps [149] simultaneously represent static and dynamic obstacles, enabling the construction of a dynamic map model. Thus, UAVs have stronger autonomous navigation and obstacle avoidance capabilities in complex environments, providing strong support for their widespread adoption. In UAV path planning, the MADER framework [150] is adopted to generate dynamic, safe trajectories through polyhedral collision constraints and MINVO basis functions to avoid collisions effectively. B-spline gradient optimization [151] combines obstacle prediction trajectories and significantly improves the real-time performance of path planning by optimizing the smoothing of trajectories and dynamic adaptability. RL approaches have made notable progress in UAV path planning. RRT* [152] accelerates online path searches through offline training and can quickly adapt to dynamic environment changes. Many algorithms have demonstrated strong performance in rural or indoor environments [119]. Most methods consider motion blur [146] and can avoid fast-moving spheres. Nevertheless, they do not consider the effect of lighting conditions on sensing. Therefore, the direct application of these algorithms in large-scale complex environments such as those with different lighting conditions is difficult, resulting in poor algorithm generalizability [153]. Moreover, tracking may be lost when obstacles obstruct the camera's line of sight [146], enter blind zones [148], or appear suddenly [154], or when the screen is overexposed. While dynamic maps provide high-precision environmental information, they also encounter challenges in computational efficiency [149]. In addition, most of the current AI processing solutions lack a mechanism to address hardware failures [154], which may lead to complete system paralysis in the event of hardware failure, seriously affecting the flight safety of UAVs. LLMs have been innovatively applied in UAV collision avoidance and path planning. In terms of dynamic obstacle avoidance, in 2024, [PERSON] et al.