To address the challenges of balancing accuracy and speed, as well as the parameters and FLOPs in current insulator defect detection, we propose an enhanced insulator defect detection algorithm, ML-YOLOv5, based on the YOLOv5 network. The backbone module incorporates depthwise separable convolution, and the feature fusion C3 module is replaced with the improved C2f_DG module. Furthermore, we enhance the feature pyramid network (MFPN) and employ knowledge distillation using YOLOv5m as the teacher model. Experimental results demonstrate that this approach achieved a 46.9% reduction in parameter count and a 43.0% reduction in FLOPs, while maintaining an FPS of 63.6. It exhibited good accuracy and detection speed on both the CPLID and IDID datasets, making it suitable for real-time inspection of high-altitude insulator defects.