Due to its particularity, the aerial images of transmission lines collected by UAVs often have complex and changeable backgrounds, and the detection targets have problems such as different scales and partial occlusions, which may easily lead to false detections and missed detections in the detection process. From the perspective of feature fusion, this paper proposes a transmission line fitting detection method based on the attention feature fusion YOLOv5 model. First, the AFF-Transformer module with self-attention mechanism is introduced into the backbone extraction network to better capture global information and context information, and improve the network. Feature extraction capability. Second, by using channel spatial attention, key information loss during feature fusion is avoided. Finally, the two-way weighted feature fusion mechanism is used to make the model more effectively fuse the shallow features and deep features, which effectively alleviates the problems of false detection and missed detection in the dense state. Through experiments on the data set of self-built transmission line fittings, the results show that the method proposed in this paper improves the accuracy rate by 2.7% and the model recall rate by 1.5% based on the original YOLOv5 model. Problems such as false detection have been better improved.