Detecting small objects in Unmanned Aerial Vehicle (UAV) images is pivotal for a multitude of applications. Given the high-altitude perspective of UAVs, the images they capture often feature intricate backgrounds, pronounced object heterogeneity, and a plethora of sparsely situated small targets. These characteristics pose significant challenges to conventional detection algorithms. In response, we introduce an enhanced YOLOv7-based technique specifically tailored for small object detection in UAV images. Our approach adds more layers dedicated to small object detection and leverages the Bi-directional Feature Pyramid Network (BiFPN) to extract features across diverse scales. Furthermore, we enhance the detection heads by standardizing channel configurations and incorporate attention mechanisms through the dynamic head framework (DyHead). This allows the model to adaptively modify the detection head structure, catering to varying scales, tasks, and features. Preliminary results on the VisDrone2019 dataset indicate that our method surpasses existing state-of-the-art algorithms in UAV-based small object detection.