In the current social environment, UAV detection technology has various applications in various fields, such as agricultural management, urban planning, and security monitoring. However, there are still problems, such as difficult localization and low accuracy in the UAV small target detection field. In this paper, for the problem of UAV small target detection, the characteristics of YOLOv7 model are sorted out and improved from several aspects, and the AED-YOLOv7 model is constructed. Aiming at the problem that multi-scale feature fusion in the model is prone to feature loss, this paper uses the FAM module, which reduces the spatial location variability of information between multiple scales and strengthens the feature fusion capability. This paper introduces the EMA module, which learns effective channel descriptions, generates better pixel-level attention for advanced feature mapping, and groups channel dimensions into multiple sub-features so that spatial semantic features are evenly distributed in each feature group. In this paper, we use Decoupled Head to process the classification and regression tasks separately, which can be better adapted to the needs of different tasks. Finally, this paper uses the EIoU Loss function to minimize the difference between the width and height of the target frame and the Anchor while retaining the beneficial properties of the CIoU Loss, which produces faster convergence and better localization results. On the VisDrone2019 benchmark, compared to the performance of YOLOv7, the AP50 of AED-YOLOv7 is improved by 3.5% and APS by 3.2%.