Self-explosion is a common defect of electronic insulators, which usually affects the safety of power transmission. Automatic inspection of insulators is time-saving and efficient. However, it is a detection problem on small object for detecting defects directly in aerial images, which has two parts, insulator positioning and defect detection. Since the insulator is long, the defect detection region obtained by positioning is long and narrow. Though YOLO network is an efficient model for defect dectection, it cannot achieve sufficient performance when the image is long and narrow. To solve this problem, YOLOX is modified by sliding window and CBAM in this paper. Firstly, a novel insulator dataset with long and narrow images was constructed. Secondly, a segmentation network based on sliding windows was utilized for dividing insulator image in the process of inference. Finally, CBAM is introduced into the YOLOX network to enhance defect features. Experiments demonstrate that the AP of the proposed method reaches 92.48% and the reasoning speed reaches 28FPS.