Foreign object detection on airport runways plays a vital role in the safe takeoff and landing of aircraft. However, the existing detection algorithms have the phenomenon of missed detection and false detection under different lighting and weather runway environments. Therefore, a YOLOv5 foreign object detection algorithm suitable for all-weather airport runway environment is proposed. Aiming at the problem of a certain degree of feature loss in the pooling process of the original network, a cross-stage local spatial pyramid pooling module is designed, which can adaptively extract deep feature semantic information and enhance the multi-scale representation ability of the network; a hybrid attention module is introduced in the feature fusion part, and the channel and spatial feature weights are redistributed to strengthen the feature difference between foreign objects and irrelevant background elements; in view of the fact that small foreign objects are difficult to identify and locate, resulting in missed detection, a multi-scale positioning loss function is designed, and the detection ability of small targets is improved by adding similarity measurement; the optimized training strategy is used to train the MS-FOD dataset. Experimental results show that the improved algorithm achieves 95.83%mAP and Recall, which are respectively improved 94.31% by and 15.69% compared with the original YOLOv5 3.68% , and the detection speed is 68 frames /s , which meets the needs of real-time foreign object detection. The effectiveness of the proposed algorithm for foreign object detection on airport runways is effectively verified.