In response to the problem of low detection accuracy caused by significant object scale variations and complex backgrounds in remote sensing images,an improved YOLOv7 object detection algorithm was designed.Firstly,in order to alleviate the interference of complex backgrounds on the detector,an attention-guided efficient layer aggregation network(ALAN)was designed to optimize the multi-path network to focus more on foreground objects,thereby reducing the impact of background.Secondly,in order to reduce the impact of significant object scale variations on detection accuracy,an attention multi-scale feature enhancement(AMSFE)module was designed to expand the receptive field of the backbone network output features,enhancing the network's feature representation ability for objects with substantial scale variations.Finally,a rotating bounding box loss function was introduced to obtain precise location information of objects in any orientation.The experimental results on the DIOR-R dataset demonstrated that the proposed algorithm achieved a mean average precision(mAP)of 64.51%,an improvement of 3.43%over the baseline original YOLOv7 algorithm.Furthermore,it outperformd other similar algorithms and was capable of handling object detection tasks in remote sensing images with multi-scale and complex backgrounds.