Bolt defects are very likely to cause abnormal or even faulty transmission lines, but a large amount of defect data is difficult to obtain. This paper applies the generated confrontation network to the generation of defective bolt images. This paper applies the generative adversarial network to the generation of defective bolt images. Regarding the problem of poor image quality, random sample generation, slow model convergence, etc. during the generation, a bolt image generation method based on improved Deep Convolutional Generative Adversarial Networks(DCGAN) is proposed. Firstly, the relativistic average discriminator and gradient penalty are added to the loss function, which balances the ability of the generator and the discriminator, and improves the convergence speed and image quality of the model. Then, the attention mechanism is introduced in the generator and the discriminator, the pixel features of the long distance in the picture are obtained, which improves the diversity of the defect sample. Experimental results verify the effectiveness of the algorithm and achieve the amplification of the defect samples.