The problem of multiple targets, occlusions, small targets, and a complex background in insulator images make it difficult for conventional image processing algorithms to guarantee detection accuracy. An insulator defect detection algorithm based on the Deep Convolution Network and Multi-head Attention Mechanism was proposed in this paper. Firstly, based on You Only Look Once (YOLO)-v5, the Multi-head Attention Mechanism (MHAM) is proposed to obtain rich contextual information in insulator images and improve the accuracy of defect detection. Secondly, Multi-Scale Spatial Pyramid Pooling (MSPP) module is proposed to enhance the efficiency of target recognition at different scales. Thirdly, the SimOTA algorithm is used to improve the traditional Label Allocation Strategy to improve the accuracy of target box detection. Finally, the PIOU, Focal Loss, and Balanced Cross-Entropy functions are used to improve the Loss Function of the model to address the problem of unbalanced samples and to improve the accuracy of algorithm. By using insulator images of 750kV transmission lines in Qinghai and Henan to produce the datasets and compared the proposed algorithm with the current mainstream target detection algorithms. Compared with the traditional YOLO-v5, mAP of the algorithm in this paper is improved by 8.82%, the Precision is improved by 14.62%, and Recall is improved by 11.80%.