## 5 Simulation Results
### A Comparison of the LSTM Model and the Proposed Approaches
The significant decrease in loss values indicated the efficiency of correctly predicting the class category of the GPS spoofing attack. The simulation results highlighted the effectiveness of the proposed Optimized LSTM-GA model in detecting GPS spoofing attacks on UAVs, showcasing improvements across multiple performance metrics. The proposed model achieved an accuracy of 93.12% and an F1 score of 93.39%, outperforming the Basic LSTM model. This enhancement showed the benefits of integrating the GA for hyperparameter optimization, enabling the model to better adapt to dynamic spoofing scenarios. The higher F1 score reflected a balanced performance in precision and recall, which is crucial for minimizing false positive and negative errors that could have serious operational consequences, such as navigation deviations, collisions, or security breaches. Additionally, the Optimized LSTM-GA model exhibited a significantly lower loss value (0.1078), indicating improved generalization and prediction performance. This reduction in loss is particularly critical for UAV operations, as even minor errors in GPS spoofing detection can lead to significant risks. Figure 11: Comparison of precision between all models. The model's ability to reliably distinguish between authentic and spoofed GPS signals, even in complex and dynamic environments, ensures safer and more secure UAV operations. Furthermore, the comparison of actual versus predicted values revealed that the Optimized LSTM-GA model aligned predictions more closely with actual values than the Basic LSTM model, which is essential for accurate navigation, collision avoidance, and overall operational security. The model also demonstrated exceptional robustness in detecting various types of GPS spoofing attacks, from simplistic to sophisticated methods, effectively  
Figure 12: Comparison of recall values between all models. Figure 13: Comparison of loss values between all models. identifying subtle anomalies in GPS signals under challenging conditions. This robustness stemmed from the GA's ability to optimize the LSTM's hyperparameters, allowing the model to capture intricate temporal patterns and adapt to evolving spoofing techniques. Consequently, it provided a reliable defense mechanism, ensuring the security and integrity of UAV operations. The model's adaptability to dynamic environments makes it suitable for real-time applications where UAVs are vulnerable to GPS spoofing attacks. Overall, these simulation results highlight the enhanced effectiveness of the Optimized LSTM-GA framework for GPS spoofing detection in UAVs. By incorporating a widened genetic search space, the model not only achieved higher accuracy and F1 scores but also demonstrated improved resilience to diverse spoofing techniques, from simplistic to sophisticated attacks. The reduction in both training and validation losses further validates the framework's capacity for generalization, especially critical in varied, real-world UAV mission profiles. Such robust performance translates into lower operational risks, e.g., fewer navigational errors or unauthorized UAV control takeovers and improved mission reliability. Nonetheless, deploying these architectures in live UAV environments will require careful consideration of computational overhead, latency, and power constraints, which are examined more fully in the subsequent Discussion.