# VDCrackGAN: A Generative Adversarial Network with Transformer for Pavement Crack Data Augmentation
## 1 Introduction  
Cracks are the most prevalent type of pavement distress, representing an early stage of pavement degradation. If not repaired in time, they can rapidly evolve into more serious pavement distress, such as alligator cracks, looseness, or even potholes. Timely detection and repair of cracks are of great significance in preventing the deterioration of pavement damage and reducing pavement maintenance costs. Traditional crack detection relies heavily on visual inspection by engineering and technical personnel, which is subjective and inefficient [1]. In recent years, deep learning has achieved significant breakthroughs in the field of image recognition [2; 3]. Many scholars have successfully applied convolutional neural networks (CNNs) to crack detection, significantly enhancing the efficiency and accuracy of crack detection [4; 5]. However, deep learning methods are essentially data-driven approaches that require the support of a large amount of training sample data. In practice, it is difficult and expensive to collect and label pavement crack data, which results in a small-scale pavement crack dataset, thereby affecting the generalization ability and accuracy of the training model. In the case of insufficient training samples, it is necessary to investigate data augmentation methods specifically for crack detection. Traditional data augmentation methods, such as rotation, brightness change, random cropping, etc., are essentially transformations based on certain rules applied to the original image. The distribution of the generated images tends to be relatively homogeneous, so although the number of samples is increased, the improvement in sample quality is limited. Another approach to data augmentation is to generate data directly based on generative deep learning models, such as variational autoencoders (VAEs) [6] andgenerative adversarial networks (GANs) [7]. VAEs tend to learn the overall structure of the data, which has the advantage of relatively stable training, but the generated results may be overly smooth and less diverse. The advantage of GANs is that the generated results are usually clearer. However, due to the lack of a definite control mechanism in the generation process, the diversity of generated results is difficult to control, sometimes generating strange, unreasonable images, and the training is relatively unstable. [PERSON] et al. [8] put forward the VAE-GAN generative network, which integrates VAE and GAN model architecture, achieving good generative effectiveness. [PERSON] et al. [9] proposed the Swin transformer model, which is a transformer model based on the window attention mechanism that captures feature representations of different types and scales more flexibly and has been widely applied in computer vision. Inspired by these two works, this paper presents a generative network for pavement crack data augmentation named VD CrackGAN. The main contributions of this paper can be summarized as follows:  
1. Based on the idea of VAE-GAN, we propose a generative network for pavement crack data augmentation combining VAE and DCGAN [10]; network architecture was proposed, which integrates the advantages of VAE and DCGAN. 2. We introduce spectral normalization [11] to improve the training stability of the network and integrate the self-attention mechanism SwinTransformer into the CNN architecture to improve the generation quality of the generative network. 3. Compared with the original DCGAN, VD CrackGAN achieves significant performance improvements of 13.6% and 26.4% in the metrics of Inception Score (IS) and Frechet Inception Distance (FID), respectively. The rest of this paper is organized as follows: Section 2 reviews the previous work on data augmentation and generative adversarial network and its application in the field of crack detection. Then, in Section 3, we describe the network architecture, loss function, and model optimization method. Next, In Section 4, we conduct relevant verification experiments and ablation experiments and discuss our method.