  In recent years, there have been frequent incidents of foreign objects
intruding into railway and Airport runways. These objects can include
pedestrians, vehicles, animals, and debris. This paper introduces an improved
YOLOv5 architecture incorporating FasterNet and attention mechanisms to enhance
the detection of foreign objects on railways and Airport runways. This study
proposes a new dataset, AARFOD (Aero and Rail Foreign Object Detection), which
combines two public datasets for detecting foreign objects in aviation and
railway systems.The dataset aims to improve the recognition capabilities of
foreign object targets. Experimental results on this large dataset have
demonstrated significant performance improvements of the proposed model over
the baseline YOLOv5 model, reducing computational requirements.Improved YOLO
model shows a significant improvement in precision by 1.2%, recall rate by
1.0%, and<EMAIL_ADDRESS>by 0.6%, while<EMAIL_ADDRESS>remained unchanged. The parameters
were reduced by approximately 25.12%, and GFLOPs were reduced by about 10.63%.
In the ablation experiment, it is found that the FasterNet module can
significantly reduce the number of parameters of the model, and the reference
of the attention mechanism can slow down the performance loss caused by
lightweight.
