Most of the commercially deployed unmanned mining systems use LiDAR and radar as sensors， which is difficult to identify object types， especially for distant objects. This affects the subsequent correct decision-making， as well as the safety and overall efficiency of the unmanned system. To solve these problems， this paper collects mine data from different scenes and proposes an image object detection algorithm based on YOLOv5S. The algorithm mainly improves in the following three aspects. Firstly， the sampling ability of the model is optimized by using different padding strategies and spatial attention modules. Secondly， it decouples the head prediction branches and makes each branch focus on its own task. Finally， the loss function is optimized to couple localization and classi-fication so as to realize the joint optimization of localization and classification tasks. Experiments show that the above three methods can improve the AP of YOLOv5S from 49.9% to 58.9% with real-time performance and realize object recognition in daytime and night scenes with different scales.