###### Abstract  
Generative adversarial networks (GANs) create images by pitting a generator (\(G\)) against a discriminator (\(D\)) network, aiming to find a balance between the networks. However, achieving this balance is difficult because \(G\) is trained based on just one value representing \(D\)'s prediction, and only \(D\) can access image features. We introduce a novel approach for training GANs using explainable artificial intelligence (XAI) to enhance the quality and diversity of generated images in histopathological datasets. We leverage XAI to extract feature information from \(D\) and incorporate it into \(G\) via the loss function, a unique strategy not previously explored in this context. We demonstrate that this approach enriches the training with relevant information and promotes improved quality and more variability in the artificial images, decreasing the FID by up to 32.7% compared to traditional methods. In the data augmentation task, these images improve the classification accuracy of Transformer models by up to 3.81% compared to models without data augmentation and up to 3.01% compared to traditional GAN data augmentation. The Saliency method provides \(G\) with the most informative feature information. Overall, our work highlights the potential of XAI for enhancing GAN training and suggests avenues for further exploration in this field. g 2024 14 8125 10.3390/app14188125 10.390/app14188125 10. Training representation learning methods, particularly advanced architectures like neural networks and transformers, can be challenging because they require a large amount of labeled data. Many real application contexts, including the medical context, suffer from low availability of labeled images and adverse conditions, such as class imbalance and a lack of standardization in dimensions and formats [3; 4]. These facts compromise adequate training and may cause overfitting. One way to address these problems is by utilizing automatic data generation methods, such as generative adversarial networks (GANs) [5; 6]. GANs allow the generation of synthetic images through competitive training between two neural networks, the generator (\(G\)) and the discriminator (\(D\)) [5]. During training, \(G\) tries to generate images that resemble authentic data, while \(D\) tries to classify correctly whether the images are original or generated. The adversarial training strategy is based on game theory, in which the objective is to reach the Nash equilibrium [7], where neither \(G\) nor \(D\) can unilaterally improve their outcomes. This situation occurs when \(G\) generates images that are so realistic that \(D\) cannot reliably determine if an image is real or fake. At this point, \(G\) has learned to produce data that effectively fools the discriminator [8]. Data augmentation through GANs is particularly important in small medical image datasets because it helps to address the issue of overfitting, where models become too tailored to the limited training data and fail to generalize well to new, unseen cases. By generating a wider variety of images, GANs create a more representative training set, which can lead to more robust and accurate models. However, training GANs is challenging due to issues related to backpropagation, particularly in how \(G\)'s weights are updated. During backpropagation, the gradients of \(G\) are derived from \(D\)'s predictions, but \(G\) has no information on how the images' features contribute to the classification. Because of this, adversarial training tends to be an unbalanced game where \(D\) generally has the advantage over \(G\)[9; 10]. Consequently, \(D\) tends to assign higher scores to original images during training, and \(G\) fails to fool \(D\) even after the model converges [8; 9]. Studies in the literature traditionally aimed to improve GAN training by modifying the discriminator. For instance, in DCGAN, the first GAN proposal with convolutional layers, the authors used batch normalization and leaky ReLU activations between \(D\)'s intermediate layers to make it more stable [11].