# Welding Image Data Augmentation Method Based on LRGAN Model
## 1 Introduction
ACGAN (auxiliary classifier generative adversarial network), which incorporates an auxiliary classifier, and DCGAN (deep convolutional generative adversarial network), which employs a deep convolutional architecture, have made groundbreaking advances in image feature representation and generation quality, respectively [12; 13]. These improved models, through different technical approaches, have progressively narrowed the distribution gap between generated images and real samples, providing strong support for data augmentation in the field of welding quality inspection. [PERSON], [PERSON], and other researchers have concluded the following through their study and analysis:  
On the one hand, cross-entropy has limitations when measuring the distribution differences between non-overlapping data, which is a major cause of the instability in the training of the original GAN. To address this issue, [PERSON] et al. [14] proposed using the Wasserstein distance to measure the difference between the distribution of generated data and real data, tightly coupling the objective function with the quality of generated samples. Subsequently, [PERSON] et al. [15] introduced the addition of a gradient penalty term to the Wasserstein distance, further improving the stability of the discriminator's training. Later, [PERSON] [16] conducted research on constrained optimization of the training results of WGAN. However, WGAN requires the discriminator to have Lipschitz continuity, which is typically ensured through weight clipping, and the pruning operation in WGAN can disrupt the structure of the discriminator's weight matrix, leading to slower convergence rates for WGAN [17]. On the other hand, when the pixel value distributions of the generated and real images do not overlap or the overlapping region is negligible, the discriminator model can still experience gradient vanishing during training, leading to instability. To address this issue,Solomon [PERSON] and [PERSON] [18] proposed the Kullback-Leibler divergence (KL divergence) to measure the consistency between the distributions of real and generated data. However, merely measuring the consistency between the distributions of real and generated data without enforcing a directional constraint or convergence constraint does not effectively address the gradient vanishing issue. In reference [19], a repulsion term was added to the network's loss function, which evaluates the sample overlap rate during model training, thereby alleviating the gradient vanishing problem. Inspired by this, the design of an improved loss function does not involve the Wasserstein distance and does not require weight clipping or gradient penalty. Given the decision penalty mechanism of the least squares loss function, even if fake samples are correctly classified, the least squares loss still penalizes them and pulls them toward the decision boundary. This characteristic has been thoroughly confirmed in references [20; 21]. In reference [20], [PERSON] et al. proposed a weighted least squares method for a twin support vector machine to solve the problems of noise sample sensitivity and large classification gap leading to unstable training. In reference [21], [PERSON] et al. solved the imbalance problem between normal bottle cap samples and defective bottle cap samples by semi-supervised anomaly detection (GANomaly network) when detecting defects. However, the image reconstruction effect was poor, so they proposed improving the image reconstruction of the GANomaly network based on cross-attention and least squares loss function. Therefore, this paper incorporates the least squares loss function into the KL divergence. This design not only avoids the issues caused by weight clipping, such as the destruction of the discriminator's weight matrix structure and slow convergence but also alleviates the problem of slow loss reduction.