In order to improve the image quality of a specific class of crack images, as well as to solve the problems of insufficient size of the number of crack datasets and small number of complex crack images, a crack image generation model based on DCGAN (Deep Convolutional Generative Adversarial Network, DCGAN) is proposed, which has superior training stability and convergence speed. The experimental results show that DCGAN can generate a large number of real crack images with complex backgrounds more reliably than traditional image augmentation methods, effectively solving the problem of lack of crack images in special cases and greatly reducing the cost of crack image acquisition tasks.