The primary objective of this paper is to address the shortcomings of existing algorithms in the context of UAV-based object detection. The paper introduces SFD-YOLOv8, a lightweight algorithm based on YOLOv8n, with the aim of enhancing detection performance while maintaining a streamlined architecture. The innovation of SFD-YOLOv8 is characterised by its incorporation of several pioneering modules, including the Dilation-wise Residual (DWR) attention module and the FasterBlock module. The modules have been designed to optimise feature extraction and improve model efficiency. The paper also discusses the challenges associated with low accuracy in small target detection and high model complexity in UAV applications. It emphasises the necessity for efficient models capable of accurately identifying small targets with limited computational resources, a balance that existing algorithms frequently fail to achieve. The paper's contributions can be summarised as follows. Firstly, it proposes SFD-YOLOv8, a novel lightweight algorithm tailored for UAV applications. Secondly, it introduces the Dilation-wise Residual (DWR) attention module and FasterBlock module to optimise feature extraction and improve model efficiency. Thirdly, it presents the FocalEloU-Loss function, which significantly enhances detection accuracy by refining bounding box predictions. Finally, the Std detection layer is integrated into YOLOv8n, thereby enhancing the model's ability to accurately detect small targets. Experimental results demonstrate that SFD-YOLOv8 reduces parameters by 16.95% compared to YOLOv8n. On the VisDrone2019 dataset, it achieves 2.50% improvement in mAP@0.5 and a 1.40% increase in mAP@0.5-0.95.SFD-YOLOv8 demonstrates superior accuracy in comparison to other leading detection models, making it well-suited for real-time detection requirements.