# AI-Driven Safety and Security for UAVs: From Machine Learning to Large Language Models
## 3 AI for UAV Safety
### UAV Sensor Spoofing Detection  
Detecting sensor spoofing is a fundamental step in ensuring UAV safety after physical security design and battery safety. UAV sensor systems, such as GPS, IMUs, and vision sensors, are essential for modern applications but are susceptible to spoofing and jamming attacks. Hostile forces or malicious users can fake or disrupt signals, causing UAVs to deviate from their intended course, miss their targets, or crash, jeopardizing mission success and personnel safety. GPS spoofing is a common sensor spoofing attack, as illustrated in Figure 9. Traditional GPS spoofing detection and identification schemes rely on signal strength detection, frequency analysis, and theoretical relationships between sensors [125]. Nevertheless, in  
Figure 8: LLMs in UAV battery safety management. complex environments, a single sensor may not provide a sufficient amount of reliable data and may fail because of inherent sensor defects. DL-based algorithms with CNNs or LSTM can be applied to improve detection accuracy [126]. RL and DRL models can optimize sensor fusion strategies by effectively combining data from multiple sensors such as accelerometers, gyroscopes, magnetometers, GPSs, and barometers [127; 128] to improve detection accuracy. Additionally, combining neural networks with Kalman filtering can adaptively enhance the defensive abilities of a UAV positioning system against spoofing signals [129]. These DL-based algorithms effectively detect GPS spoofing by analyzing features such as complex signal patterns and position deviations [22] or by comparing the differences between theoretical path and actual path losses [130]. Moreover, these algorithms can be combined with malicious process detection techniques [130] to enable real-time monitoring of the safety posture and threat scenarios of UAV cluster end devices [131]. By incorporating transfer learning and DL, existing knowledge and data can be effectively leveraged to improve model generalizability and adaptability [132], improve detection and defensive abilities in practical applications, and facilitate the safe operation of UAVs. Moreover, signal features such as jitter [133], Doppler frequency, and carrier-to-noise density ratios have been incorporated into model training [125] to detect spoofed GPS signals more effectively. However, GPS signals are transmitted unencrypted and unauthenticated, increasing their vulnerability and sensitivity to adversarial attacks [134]. Currently, publicly available datasets of GPS signal spoofing attacks are scarce, costly to acquire [128; 132], difficult to collect [133], cover only a few types of sensor data [127] and spoofing scenarios [125], have difficulty adequately representing the relationships among data [135], and still have a large space for generation and completion, which limits the size and quality of datasets [132; 136]. In the future, databases will be needed for different types of spoofing devices in multipath environments and various flights. In addition, a database needs to be built for different types of spoofers in multipath environments and various flight conditions to obtain sufficient data and improve model performance [137]. Moreover, the standards and accuracy of UAV flight trajectory classification require enhancement. During the annotation process, existing trajectory validation methods are limited to binary classification, categorizing trajectories as correct and incorrect. Therefore, some incorrect trajectories may be labeled as correct [138]. Algorithm performance will be further degraded in the face of overly complex  
Figure 9: GPS spoofing attack. or nonfixed flight routes [139], and even if the best model can achieve 95% accuracy, false alarms, missed alarms, and omissions may occur, affecting the detection and identification of GPS spoofing [140]. For sensor data spoofing, an Aero-LLM framework was introduced [141] to deploy different types of LLMs in onboard systems, edge servers, and the cloud to achieve dynamic task allocation and cooperative work.