Abstract:Gan (Generative Adversarial Network) is applied to the generation of defect samples for power inspection to solve the problem of insufficient defect samples. The current Gan-based technology of insulator defect sample generation has the following limitations: 1) A large number of defect samples are required for training and the number of generations is insufficient; 2) The quality of the generated samples is poor, the size is small, making it difficult to use for target detection neural network model training. To address the above limitations, a style transfer Tw_Cycle (A Target weighted Cycle consistent) Gan is proposed based on Starganv2. The network can use non-defective samples for training, and realize one-to-many defect sample generation based on non-defective samples. In order to ensure the semantics of defects remain unchanged, the Unet segmentation network is added, and the Roi_cyc loss and the Roi_mask loss are used to strengthen the constraint of the insulator target. Through qualitative and quantitative evaluation, Tw_Cycle Gan has achieved better results. In order to verify the validity of the generated samples, an experimental evaluation method for defect detection based on real samples is designed. The results show that the same Yolov3 target detection algorithm that uses synthetic defect samples to amplify training, the AP, increased by about 5% on average, Precision increased by about 4.6% on average, Recall increased by about 10% on average, and F1 increased on average by 0.083.