To tackle the complex issue of open-environment object detection in railway catenaries, characterized by diverse foreign object categories and varying operational scenarios, a foreign object detection method for railway catenaries based on an improved DINO model is proposed. Firstly, by leveraging the image characteristics of foreign object in railway catenaries, the EfficientNet network is employed to replace the ResNet backbone in the original model, further enhancing the Convolutional Block Attention Module (CBAM). Additionally, the neck structure incorporates the enhanced Weighted Bidirectional Feature Pyramid Network (BiFPN) to improve the model’s focus on critical features and enhance detection performance. Secondly, various data augmentation techniques, such as mosaic data augmentation and environmental disturbances, are employed to process the input image data, enriching the features of the sample data. Finally, the application of foreign object detection in railway catenaries is realized through a railway artificial intelligence platform. The results indicate that the proposed method excels in performance, achieving a mean Average Precision of 89. 87%, outperforming YOLOv5, DETR and the original DINO by 6. 40%, 7. 31% and 5. 75%, respectively. This method meets the requirements for accurate, rapid, and intelligent identification of foreign objects on railway lines, offering vital technical support for the detection of foreign objects in catenaries. © 2024 Chinese Academy of Railway Sciences. All rights reserved.