In recent years, heightened governmental emphasis has resulted in a marked decrease in the accident rate of tailings ponds in China. However, the safety situation remains critical, particularly in terms of the investigation of hidden dangers. This study aims to explore the intelligent identification of tailings ponds hazards to enhance the safety supervision. In this study, an improved ant colony algorithm was proposed for planning unmanned aerial vehicle (UAV) aerial photography paths. A comprehensive dataset of typical tailings ponds hazards was constructed through on-site UAV aerial photography and subsequently used to train the YOLOv5 algorithm model, enabling accurate identification of mountain damage and drainage well blockages around tailings ponds. The feasibility of obtaining initial coordinates from CAD drawings of tailings ponds was demonstrated by a real case study, which confirms the reliability of the improved ant colony algorithm in UAV aerial photography path planning task. The hazard identification model for tailings ponds attained a precision rate exceeding 90%, with a mean average precision (mAP) above 80%, thereby demonstrating the model’s effectiveness in detecting typical tailings ponds hazards.