EDGS-YOLOv8 is an improved lightweight UAV detection model based on YOLOv8, designed to enhance detection accuracy and efficiency. The model incorporates several key improvements: a modified neck structure with ghost convolution to reduce model size and computational overhead, an efficient multi-scale attention mechanism (EMA) to enhance feature extraction and robustness, and a DDetect detection head using deformable convolution (DCNv2) to improve local detail capture and detection accuracy. These enhancements allow EDGS-YOLOv8 to achieve a higher mAP (97.1) on the DUT Anti-UAV dataset while maintaining a compact model size of 4.23 MB. The model also performs well on other datasets, including Det-Fly and VisDrone2019, demonstrating improved accuracy and efficiency in detecting small UAV targets. The study highlights the importance of balancing model size, accuracy, and real-time performance in UAV detection, and EDGS-YOLOv8 shows significant improvements in these aspects compared to the YOLOv8 baseline. The model's effectiveness is validated through extensive experiments and visual comparisons, confirming its superiority in detecting small UAVs in complex environments.EDGS-YOLOv8 is an improved lightweight UAV detection model based on YOLOv8, designed to enhance detection accuracy and efficiency. The model incorporates several key improvements: a modified neck structure with ghost convolution to reduce model size and computational overhead, an efficient multi-scale attention mechanism (EMA) to enhance feature extraction and robustness, and a DDetect detection head using deformable convolution (DCNv2) to improve local detail capture and detection accuracy. These enhancements allow EDGS-YOLOv8 to achieve a higher mAP (97.1) on the DUT Anti-UAV dataset while maintaining a compact model size of 4.23 MB. The model also performs well on other datasets, including Det-Fly and VisDrone2019, demonstrating improved accuracy and efficiency in detecting small UAV targets. The study highlights the importance of balancing model size, accuracy, and real-time performance in UAV detection, and EDGS-YOLOv8 shows significant improvements in these aspects compared to the YOLOv8 baseline. The model's effectiveness is validated through extensive experiments and visual comparisons, confirming its superiority in detecting small UAVs in complex environments.