To ensure the timely detection of safety hazards in transmission lines and to enhance accurately the detection of insulator defects in complicated environments, this study proposes a 3D attention-focused pure convolutional target detection algorithm (CMYOLOv7) based on you only look once v7 (YOLOv7) for defect detection on insulators in complicated environments. Firstly, to address the incapacity of focusing on the target in the backbone feature extraction networks, this study proposes a focused pure convolutional feature extraction module (ConvSimCB) to enhance the extraction and focus capability on insulator defect features. Secondly, to solve the problem of loss of key detail feature information caused by maximum pooling in spatial pyramid pooling module (SPPCSPC), this study proposes a mixed spatial pyramid pooling module (MIXPCSPC) to retain abundant image texture detail information and increase accuracy in detection of tiny insulator defects. Finally, a lightweight generic upsampling operator (CARAFE) is introduced to enhance the feature map resolution to address image distortion caused by the Nearest Neighbor Method of upsampling. This study proposed CMYOLOv7 achieves 98.37% precision, 90.59% recall, 95.68% mean average precision (MAP), and 94% F1 score, higher than YOLOv7 by 0.61%, 8.64%, 5.41%, and 5%.