August 31, 2024
Scaling laws dictate that the performance of AI models is proportional to the amount of available data. Data augmentation is a promising solution to expanding the dataset size. Traditional approaches focused on augmentation using rotation, translation, and resizing. Recent approaches use generative AI models to improve dataset diversity. However, the generative methods struggle with issues such as subject corruption and the introduction of irrelevant artifacts. In this paper, we propose the Automated Generative Data Augmentation (AGA). The framework combines the utility of large language models (LLMs), diffusion models, and segmentation models to augment data. AGA preserves foreground authenticity while ensuring background diversity. Specific contributions include: i) segment and superclass based object extraction, ii) prompt diversity with combinatorial complexity using prompt decomposition, and iii) affine subject manipulation. We evaluate AGA against state-of-the-art (SOTA) techniques on three representative datasets, ImageNet, CUB and iWildCam. The experimental evaluation demonstrates an accuracy improvement of \(15.6\%\) and \(23.5\%\) for in and out-of-distribution data compared to baseline models respectively. There is also 64.3% improvement in SIC score compared to the baselines.
Deep learning models often struggle with domain adaptation when exposed to new conditions, such as attacks [1]–[3], changes in weather [4], [5], and geographic locations [6], [7]. This issue is particularly evident in applications like rare bird or animal species identification, where insufficient training data can hinder the model’s ability to generalize effectively [8]. Adding more training data from diverse domains can help alleviate this issue; however, collecting high-quality and relevant data is inherently costly [9].
Significant research efforts have been dedicated to traditional data augmentation approaches based on geometric modifications, including cropping, translations, and rotations [8]. The limitations of these techniques is that the subject features may be altered and the limited image diversity. On the other hand, the recent advancements within generative AI is providing new opportunities for data augmentation [8] using large language models (LLMs) [10], vision-language models (VLMs) [11], [12], image synthesis models [13], [14]. In particular, the ability to synthesize photo realistic images from natural language [15]–[17]. These models demonstrate exceptional performance on various tasks such as text-to-image generation [18], [19], image-to-image modification [20], [21], and image inpainting [22]. Recent work shows that large-scale diffusion models can be fine-tuned to generate augmented images for improving recognition tasks [19]. While fine-tuning image generation models for data augmentation is effective, their complexity and the need for replication across diverse datasets often make it impractical [23]. Methods for augmenting visually realistic images using text-guided techniques without model fine-tuning are proposed in [21], [23], [24]. However, our case study indicates that diffusion models struggle to augment fruitful training data from text prompts alone, often deviating from the intended subjects in the generated images.
In this paper, we propose the Automated Generative Data Augmentation framework called AGA to augment the training dataset to enhance fine-grained classification performance. Our method aims to alter the subjects minimally while introducing variability in the backgrounds during the augmentation process. AGA uses image segmentation to isolate subjects, a pre-trained LLM for varied background captions, Stable Diffusion for diverse background creation, and integrates subjects seamlessly with backgrounds. Automatic background image generation faces two main challenges. The first is creating diverse backgrounds without corrupting the foreground, a problem often overlooked by existing methods effectively addressed by the subject isolation technique of AGA . The other challenge is creating the right LLM prompt automatically. AGA solves this by including a prompt generation engine equipped with hierarchical instruction, spatial and temporal modality fixers. This engine automatically produces a diverse set of text prompts for the LLM while using a small library of sample instructions, which ultimately ensures the diversity in the generated backgrounds. This paper makes the following key contributions:
We introduce AGA , an innovative framework for data augmentation that focuses on diversifying backgrounds while preserving the subject of interest with various affine transformations, leading to robust and explainable classifiers.
AGA leverages large language and vision models to automatically create diverse training images, eliminating the need for manual user input or fine-tuning.
AGA improves the accuracy of fine-grained classification from \(78.4\%\) to \(93.6\)% on a reduced version of the ImageNet dataset.
The rest of the paper is organized as follows: Section 2 discusses related work, Section 3 motivates our work with a case study, Section 4 presents our methodology. The experimental results are discussed in Section 5 and finally, Section 6 concludes the paper with potential future work.
Image augmentation is a pivotal method for improving the performance and generalization ability of deep learning models. Early works often resort to geometric transformations such as flipping, cropping, and rotation, color space transformations, kernel filters [8]. Beyond simple manipulation, advanced techniques like Mixup [25] and CutMix [26] introduce advanced techniques such as mixing images to create new training examples and encourage the model to learn more robust representations. Additionally, automated augmentation methods such as RandAugment [27] randomly select and apply a sequence of transformations with varying magnitudes, eliminating the need for manual tuning of augmentation hyperparameters. However, these techniques often generate images which are not only visually unnatural [21] but also loses subject information.
With the advent of generative AI models, particularly diffusion models, image augmentation has witnessed a paradigm shift and these models are widely adopted in image generation [15], [18], [19], [21], [23]. Large-scale image-text datasets and models like CLIP [28] have enabled SOTA diffusion models to perform versatile tasks such as text-to-image generation, image-to-image transformation, and inpainting through text-guided prompts. Several studies have investigated how to enhance the classification accuracy using synthetic images generated by diffusion models [29], [30]. One study showed that it is possible to train a classifier for ImageNet solely using synthetic Data, leading to a performance improvement when applied to real-world tasks [31]. While another investigation demonstrates the effectiveness of fine-tuning Imagen [32] for data augmentation on ImageNet [19]. These fine-tuning based approaches face practical challenges due to complexity, cost, and dataset-specific requirements. Recent works utilize off-the-shelf diffusion models to diversify vision datasets without the need for fine-tuning [21], [23].
Methods for attribution analysis of neural networks that seek to explain an AI decision [33]–[38], [38], [39] can benefit from data sets where the background has been substantially altered. Methods from assurance analysis of AI systems [40]–[44] can greatly benefit from analysis of scenarios where the background has been replaced with diverse contexts. Methods for out-of-context object detection [45]–[47] and analysis of visual-language models [48] can readily benefit from the identification and diversification of image backgrounds. All of these methods can benefit from our approach of data augmentation using background diversification.
Recent works create synthetic images using either text-to-image [18] or image-to-image [20] methods, with text-guided image generation. Image-guided inpainting [22] also utilizes image modification to introduce diversity in the image data. However, these techniques significantly distort required subject information. To solve this issue and generate synthetic images without losing subject information, we propose AGA . This is an automatic segmentation-guided technique that utilizes recent object detection and segmentation models [49], [50] to augment data. AGA generates effective synthetic images while keeping foregrounds grounded with the original images.
Text-to-image, image-to-image, and inpainting are three key image augmentation techniques extensively utilized in recent image augmentation works. We conducted a case study of these methods for several datasets like ImageNet [51], CUB [52], and iWildCam [53], to understand their advantages and shortcomings. We discuss our observations using a representative image of a bird from the CUB data set, as illustrated in Figure 1.
It can be observed that text-to-image, while capable of generating a high diversity of images, often produces samples in which the subject is so drastically altered that even human observers struggle to identify it. We find in the figure that the identifying mark of the bird, the red ring around the neck, is missing in the augmented images, which would translate into failures for downstream tasks.
This type of augmentation frequently results in a significant loss of subject detail, akin to the image-to-text method. We see that the bird is very hard to spot in the augmented image, which might make the downstream object detection task tougher. The prairie chicken in the example appears to have been transformed into a parrot.
This method operates by modifying the image within a masked area based on a text prompt, yet this method can inadvertently corrupt the subject’s appearance. We see that the orange/red identifying ring misplaced in one of the augmented images, thus this method can corrupt the subject.
In contrast, our proposed approach does not add any artifacts to the subject image. It successfully generates augmented images with diverse backgrounds while preserving the authenticity of the subject as seen in the augmented images by AGA . This form of data augmentation has the potential to translate into better performance in terms of fine-grained classification, generalizability, and explainability. Our proposed approach is presented in the next section.
In this section, we present the methodology of the AGA framework. The input to the framework is an image and the corresponding class name. The output is an augmented image based on the provided inputs. The framework augments an image in three main steps: i) subject isolation through masked image generation, ii) the generation of domain-specific captions for diverse backgrounds, and iii) augmented image editing for combining the foreground and background. An overview of the AGA framework is shown in Figure 2.
This step deals with isolating the subject of an input image from its background. In general, such subject masks are not readily available beside the image and class name. Therefore, dense mask estimation models can be used to correctly generate pixel-level masks for subjects using the image and text (class name) only.
AGA includes Segment Anything Model (SAM) [49], one of the SOTA image segmentation tool, for this purpose. SAM is capable of segmenting the subject from an image based on some guiding inputs such as single or multiple point locations on an object, or the object’s bounding box, to create precise segmentation masks. As the training dataset usually does not include the point locations or bounding box for the subject, object detection models can be utilized to generate the boxes in this regard. Bounding boxes provide approximate spatial locations of objects of our interest in the image.
There are several SOTA object detection models available, like YOLO [54], GoundingDINO [50]. In AGA workflow, GroundingDINO model is used to generate bounding box due to its superior performance. Empirical analysis shows that for fine-grained text
prompts, GroundingDINO often fails to provide optimal bounding box results. For instance, when attempting to locate the bounding box for a specific bird class such as water ouzel, the hierarchical naming of the class text bird
proves more effective than the fine-grained class name. Therefore, AGA utilizes superclasses as text prompts to provide clearer input instructions to the GroundingDINO model for object bounding box creation.
The details of proposed mask generation process is shown in Figure 3. GroundingDINO generates the bounding box, indicated in red, for the subject of interest, which in this case is the spider. This bounding box is then feed to the SAM to guide itself to produce the segmentation mask. Once the mask is obtained, the masked image of the subject is created by combining the original image with the segmentation mask.
In the AGA pipeline, the generation of domain captions is a crucial task, as it directly influences the diversity of the background images produced. These captions are automatically generated through a two-step process using a prompt generation engine. Initially, the engine samples from three predefined sets: the instruction set (\(Ins\)), the background set (\(Bgr\)), and the temporal modality set (\(Temp\)) as the prompt fixers. The instruction set ensures the prompt begins with an appropriate command, the background set introduces spatial diversity, and the temporal set enriches the prompt with times of the day and seasons.
A SOTA LLM, Llama, is employed to transform these engineered prompts into detailed captions that guide the vision diffusion model in generating the background images. Furthermore, a list of words to avoid is incorporated to refine the output, ensuring the prompts remain focused and relevant. The words to avoid include the class names or subject of the image dataset to be augmented, as those subject might corrupt the background prompt. This structured approach ensures each dataset receives tailored prompts, enhancing the resulting image diversity, which is described in Figure 4. Moreover, each part of the prompt results in a combinatorial increase in diversity. This reduces the number of prompt samples that are required to be provided for each category of instructions.
In this step, utilizing the masked image obtained from Section 4.1 and the background caption prompt from Section 4.2, AGA generates a new image with an altered background. The caption prompt serves as the input for a large vision model, which is responsible for creating the background image. Among several text-to-image generation models available, such as DALL-E [55], Imagen [32], and Stable Diffusion [18], AGA employs the Stable Diffusion model for this purpose. Once we have both the masked image and the background image produced by the vision model, AGA proceeds to create the new augmented image. The merging technique used ensures that the background image fills all areas with the masked image, except where the subject is located. This method allows the subject to remain prominent against the newly generated background.
Additionally, to enhance diversity without altering the semantic content of the image, AGA applies traditional affine transformations to the masked image prior to merging. These transformations include flipping (f), rotating (\(\theta\)), and scaling (s) the subject. Figure 5 illustrates these image editing processes and the respective transformations, showcasing how they contribute to the diversity of the final augmented image while preserving its original meaning.
We implement the AGA framework in Python, utilizing open source APIs for machine learning models. The implementation runs on a machine equipped with an NVIDIA A100 graphics card. The following sections provide detailed descriptions of the dataset preparation, evaluation setup, and key findings.
We created a subset of the ImageNet [51] dataset, named ImageNet10, by randomly selecting \(10\) classes. This subset comprises \(13,046\) and \(500\) training and validation images across the following classes. We refer to this trainset as the original dataset and generate synthetic images from it using the AGA methodology. In subsequent discussions, models described as trained with augmented data refer to those trained using both the original and augmented datasets. Beside this ImageNet10 dataset, we utilize iWildCam [53] dataset, which contains a large collection of global camera trap images. Similarly, we extend our experiments to the CUB [52] dataset, a fine-grained classification set of \(200\) bird species from Flickr. We maintain the same data distribution ratio as in the previous work’[21] for train and test set to ensure a fair comparison. Detailed dataset descriptions are included in the supplementary materials.
We evaluate the AGA method across two main categories. First, we conduct an in-distribution evaluation of our pipeline using the ImageNet validation dataset for each model. Second, we assess the robustness of our augmentation method by evaluating it on out-of-distribution ImageNet data. For this we use the ImageNet variations: ImageNet-Sketch [56] and ImageNet-V2 [57] where ImageNet-Sketch is the sketch version and ImageNet-V2 is the reproduced version of ImageNet respectively. The CUB and iWildCam datasets are used to conduct a comparison study with the previous work [21]. We consider two types of models for our experiments: those trained with original image data and those trained with augmented image data. For comparison, we maintain baseline hyperparameters while augmenting the original training data with augmented data at various scales.
We also compare with other augmentation techniques from recent times: (1) MixUp [25], a data augmentation technique improves deep learning model generalization by creating virtual training examples through convex combinations of original data points and labels, to enhance model robustness and performance on unseen data. (2) CutMix [26], an approach that creates mixed samples by randomly slicing and combining patches from multiple training images to capture finer and more distinct features across localized regions. (3) RandAugment [27], simplifies data augmentation by reducing the search space for augmentation strategies, automating the selection of operations and magnitudes to enhance model performance and generalization while minimizing computational overhead. (4) ALIA [21] analyzes training images to identify diverse background captions, then uses this information to create variations of the images with different backgrounds and contexts. After that, it removes any images that are low-quality or corrupt the original information. In addition to these experiments, we include the results of explainability enhancements for machine learning models using AGA augmented data.
We employ ResNet variants 18, 50, 101, 152 as the classification models for training. We train these CNN models from scratch using PyTorch’s standard training script [58] which includes PyTorch’s default hyperparameter set [59]. AGA utilize a Llama-2-13B-GPTQ from Hugging-Face [60] to create background image caption prompts. These prompts are generated for each image using our prompt engineering method outlined in Section 4.2. Background images are then generated using the Stable Diffusion XL [13] text-to-image model from Hugging-Face, with default hyperparameters. The prompt generation engine operates with three distinct modality sets: an instruction, spatial, and temporal modality set size of \(3\), \(18\), and \(13\) respectively. Supplementary materials include additional training and hyperparameter descriptions.
The remainder of this section is organized, as follows: We first evaluate the effectiveness of AGA on fine-grained image classification in Section 5.1. Next, the generalizability is evaluated in Section 5.2. Lastly, the impact on the explainability is evaluated in Section 5.3. Supplementary materials contain additional evaluation results.
| Model | In-Distribution | Out-of-Distribution | |||||||
| ImageNet10-Val | ImageNet-V2 | ImageNet-S | |||||||
| Baseline | \(\Delta\) | Baseline | \(\Delta\) | Baseline | \(\Delta\) | ||||
| ResNet-18 | 88.8% | 93.4% | 4.6 | 78.43% | 89.21% | 10.78 | 33.46% | 47.75% | 14.29 |
| ResNet-50 | 86.8% | 94.6% | 7.8 | 81.37% | 85.29% | 3.92 | 27.78% | 50.09% | 22.31 |
| ResNet-101 | 78.4% | 93.6% | 15.6 | 65.69% | 89.22% | 23.53 | 28.77% | 46.77% | 18.0 |
| ResNet-152 | 81.6% | 93.8% | 12.2 | 72.55% | 88.24% | 15.69 | 27.98% | 46.57% | 18.59 |
Accuracy vs. Degree of Data Augmentation: We first evaluate the improvement in classification accuracy with respect to the amount of data augmentation in Figure 6. The figure shows the classification accuracy of a ResNet-50 and a ResNet-101 model on the ImageNet10 dataset. It can be observed that the classification accuracy rapidly improves for data augmentation in the range of 1X to 3X. After that, there are still average improvements but not as significant. In contrast to prior work by Azizi et al. [19], which reported performance degradation in ResNet-50 classification accuracy when the size of augmented data exceeded four times the original dataset. The results indicate that with AGA, the performance of both ResNet-50 and ResNet-101 models increases with the scale of synthetic data augmentation. Specifically, we scale up to ten times the original size of the ImageNet10 dataset, which contains approximately \(13,000\) images. As illustrated in Figure 6, validation accuracy trends upwards as the dataset size increases, without the performance degradation observed in the prior study. This suggests that AGA does not compromise baseline performance, even at high augmentation scales.
Comparison with SOTA: We now turn our attention to comparing the performance of AGA with previous approaches to data augmentation on the ImageNet10, iWild, and CUB data sets, which is shown in Figure 8. The figure shows the performance of AGA with data augmentation up to 3X, MixUP [25], CutMix [26], RandAug [27],and ALIA [21]. Recall that former three methods are traditional data augmentation methods while the latter is based on generative AI. We only show results of RandAug and ALIA on iWild and CUB because the source code cannot easily be executed on ImageNet10 dataset.
Figure 7 displays samples of images generated by AGA for ImageNet10. The figure shows that AGA successfully augments the input image with diverse backgrounds while preserving the properties of the foreground subject. We compare four ResNet models validation accuracy when the models are trained with (1) real images and (2) augmented dataset at various scales. Figure 8 reports validation results of the respective models for AGA, along with CutMix and MixUp on the ImageNet10 chart. While CutMix, MixUp, and the baseline rely solely on original ImageNet10 images, our study extends to include augmented data up to two times the original dataset size (denoted as 1X to 2X). All models are evaluated using the same original ImageNet validation dataset. Our findings indicate that AGA consistently outperforms both the baseline and other augmentation techniques across all tested scales.
Following this, we compare the performance of AGA with other augmentation techniques such as CutMix, MixUp, and ALIA on the CUB and iWild datasets. Using AGA , we generate synthetic images at various scales for these datasets and adhere to the same training methodology described in ALIA’s scripts for a direct comparison. Figure 8 displays the validation performances on iWildCam, with our method surpassing all others at twice the augmentation scale. In addition to that, Figure 8 also depicts AGA outperforming competing approaches in CUB for both +1X and +2X augmentation scales.
| Metric | Model | In-Distribution | Out-of-Distribution | ||||
| ImageNet10-Val | ImageNet-V2 | ImageNet-S | |||||
| Baseline | AGA | Baseline | AGA | Baseline | AGA | ||
| AIC(\(\uparrow\)) | ResNet-18 | \(0.717\) | \(\mathbf{0.764}\) | \(0.694\) | \(\mathbf{0.824}\) | \(\mathbf{0.576}\) | \(0.532\) |
| ResNet-50 | \(0.792\) | \(\mathbf{0.815}\) | \(0.779\) | \(\mathbf{0.799}\) | \(\mathbf{0.670}\) | \(0.539\) | |
| ResNet-101 | \(0.619\) | \(\mathbf{0.843}\) | \(0.682\) | \(\mathbf{0.798}\) | \(0.524\) | \(\mathbf{0.598}\) | |
| ResNet-152 | \(0.599\) | \(\mathbf{0.878}\) | \(0.560\) | \(\mathbf{0.865}\) | \(0.521\) | \(\mathbf{0.614}\) | |
| SIC(\(\uparrow\)) | ResNet-18 | \(0.745\) | \(\mathbf{0.816}\) | \(0.811\) | \(\mathbf{0.880}\) | \(\mathbf{0.681}\) | \(0.640\) |
| ResNet-50 | \(0.816\) | \(\mathbf{0.882}\) | \(0.792\) | \(\mathbf{0.877}\) | \(\mathbf{0.679}\) | \(0.639\) | |
| ResNet-101 | \(0.527\) | \(\mathbf{0.866}\) | \(0.579\) | \(\mathbf{0.795}\) | \(0.437\) | \(\mathbf{0.654}\) | |
| ResNet-152 | \(0.557\) | \(\mathbf{0.872}\) | \(0.541\) | \(\mathbf{0.860}\) | \(0.488\) | \(\mathbf{0.644}\) | |
| Insertion(\(\uparrow\)) | ResNet-18 | \(0.220\) | \(\mathbf{0.299}\) | \(0.202\) | \(\mathbf{0.271}\) | \(0.173\) | \(\mathbf{0.211}\) |
| ResNet-50 | \(0.235\) | \(\mathbf{0.320}\) | \(0.215\) | \(\mathbf{0.290}\) | \(0.190\) | \(\mathbf{0.248}\) | |
| ResNet-101 | \(0.115\) | \(\mathbf{0.443}\) | \(0.115\) | \(\mathbf{0.386}\) | \(0.120\) | \(\mathbf{0.291}\) | |
| ResNet-152 | \(0.128\) | \(\mathbf{0.446}\) | \(0.120\) | \(\mathbf{0.406}\) | \(0.131\) | \(\mathbf{0.294}\) | |
Machine learning models typically struggle with out-of-distribution data, but models trained with AGA-augmented data show commendable performance in such cases. We assess our image augmentation method on ImageNet-Sketch and ImageNet-V2 datasets, training the CNN models with both original images and a combination of original and augmented images. For evaluation, we adhere to the same validation dataset across all models. The ImageNet-Val dataset is used for in-distribution testing, while validation data from ImageNet-Sketch and ImageNet-V2 are used for out-of-distribution testing.
Our results are summarized in Table 1, which includes performance metrics for four ResNet models on both in-distribution and out-of-distribution data, with the specific gains over baseline models quantified as \(\Delta\) in the table. The table highlights up to \(15.6\)% improvements in accuracy for the ResNet-101 model for ImageNet10-Val when trained with AGA augmented data. We also see significant performance improvements for out-of-distributions, proving the fact that AGA augmented data increase generalizability of fine-grained classification models.
Figure 9: This figure shows the impact of the data augmentation on explainability using feature attributions computed using GradCam [61]. (a) images only correctly classified by the classifier trained using data augmentation. (b) images correctly classified by both the original model and the model trained with data augmentation. The model trained with only the original real data fails to identify the bird correctly and focuses on the scatter pixel region. However, it can be observed that even when both models provide the correct classification, the augmented model provides better attributions of the object. More visualization results are presented in supplementary material.. a — Baseline Model fails to identify samples correctly., b — Baseline & augmented models are correct.
Explainability is an increasingly critical aspect of AI, particularly in understanding how machine learning models make decisions. Our study explores the impact of subject-oriented data augmentation provided by AGA on model explainability. By enhancing image diversity through augmentation, we aim to develop more robust and interpretable classifiers. We train models on both the baseline ImageNet10 dataset and augmented data to compare performance. For visualizing how models focus on relevant areas within images, we employ GradCam [61], a tool that highlights significant regions influencing model decisions. In our findings, as shown in Figure 9, we compare models at the \(85^{th}\) epoch, trained solely on real ImageNet10 data and those trained on ImageNet10 augmented data. The model trained only on real data incorrectly classifies three specific images (Figure 9 (a)), whereas the model trained with AGA-augmented data correctly identifies these images. GradCam visualizations reveal that the baseline model often focuses on irrelevant pixels, whereas the AGA-trained model more accurately targets pixels within the subject area. This explains that the augmented data helps the model to learn correctly. Further comparisons using images correctly classified by both models (Figure 9 (b)) show that the AGA-augmented model more consistently identifies correct subject areas, underscoring the benefits of diverse training data for improved model accuracy and explainability.
Additionally, we conduct quantitative explainability analysis utilizing performance information curves (PICs) [62], which include two components: the softmax information curve (SIC) and the accuracy information curve (AIC). The PICs serve as a metric to assess model performance relative to the informational content (entropy) present in the input data. The SIC reflects the softmax value for the input’s original class, contributes to the model explainability assessment. Moreover, an insertion test [63] was also conducted to gauge model training performance across different methods. Table 2 presents the AIC, SIC, and insertion test outcomes for various ResNet model variants (18, 50, 101, and 152). It was observed that the AGA-augmented models generally exhibited improved performance across most cases, barring two instances in both AIC and SIC evaluations. This discrepancy can be attributed to the out-of-distribution nature of the ImageNet-V2 and ImageNet-Sketch datasets relative to the models trained on the ImageNet10 dataset and its augmented variant. The augmentation with additional data samples led to increased confusion in smaller models when determining the correct class, impacting their performance in certain scenarios.
We introduce AGA, a novel data augmentation method designed to address data scarcity in fine-grained image recognition. Our approach integrates image segmentation, automated background caption generation, and diffusion-based image synthesis to diversify backgrounds while maintaining the subject’s integrity, thus enhancing training datasets for improved fine-grained classification performance, especially in low-data situations. AGA reveals that additional generated data assists the deep learning model in concentrating on the expected subject regions, as evidenced by the Grad-CAM attribution method. The framework also demonstrates strong generalization on out-of-distribution data. AGA experiences compatibility issues concerning proper subjects and backgrounds, and occasionally produces visually inconsistent synthetic images by combining subjects with inappropriate backgrounds. This limitation underscores the potential for future research to explore new methods for generating images that maintain subject integrity while ensuring compatibility with backgrounds.
In this appendix, we provide supplementary technical details and experiments that could not fit within the main manuscript. We present detailed information about all reference datasets used, encompassing training and validation samples, in Section 7.1. All the information about the CNN model training procedure, as well as details about all the hyperparameters used during training and validation, is shown in Section 7.2. Lastly, we present qualitative visualization results, encompassing synthetic images generated by the AGA , GradCam visualization heatmaps for enhanced explainability, and UMAP plots depicting feature clusters to assess the quality of generated image features in Section 7.3.
In this section, we present additional details about all the representative datasets we used to evaluate our proposed method AGA . We use the ImageNet10 dataset, which is a subset of the original ImageNet dataset [51] with \(10\) different classes. These are chickadee (n01592084), water ouzel (n01601694), loggerhead (n01664065), box turtle (n01669191), garter snake (n01735189), sea snake (n01751748), black and gold garden spider (n01773157), tick (n01776313), ptarmigan (n01796340), prairie chicken (n01798484). We use the training and validation sets from ImageNet [51] for these 10 classes. We also utilize the iWildCam [53] dataset, which contains a large collection of global camera trap images of \(7\) different classes of background, elephant, impala, cattle, zebra, dik-dik, and giraffe, and the CUB [52] dataset, a fine-grained classification set of \(200\) bird species from Flickr. We maintain the same data distribution ratio as in the previous work [21] for the train and test sets to ensure a fair comparison. To show the robustness and generalization capability of our method, we additionally use two other datasets named ImageNet-Sketch [56] and ImageNet-V2 [57], where ImageNet-Sketch is the sketch version and ImageNet-V2 is the reproduced version of ImageNet. We utilize ImageNet-Sketch and ImageNet-V2 to validate the robustness of AGA against out-of-distribution samples. The number of training and validation images used for evaluation is presented in Table 3.
| Dataset Name | No. of Images | |
| Training | Validation | |
| ImageNet10 [51] | 13046 | 500 |
| iWildCam [53] | 6052 | 8483 |
| CUB [52] | 4994 | 5794 |
| ImageNet-Sketch [56] | - | 511 |
| ImageNet-V2 [57] | - | 102 |
Figure 10: Training loss, validation loss, and accuracy curve for the base model for real data samples and the AGA model for augmented datasamples of ImageNet 10. The training and validation losses exhibit downward trends for both the base and AGA model training, with the validation loss remaining relatively stable and not showing a significant upward trend. This indicates that the models are generalizing well to unseen data and do not show signs of overfitting.. a — Base model training, b — AGA model training
Our automatic image augmentation framework AGA starts by separating the main subjects in the image using segmentation methods. Then, it uses a large language model (LLM) to generate different captions of backgrounds. These captions are fed into a vision model like Stable Diffusion to create various backgrounds. In the end, AGA combines the separated subjects with the newly created backgrounds. We utilize a Llama-2-13B-GPTQ from Hugging-Face [60] to create background image captions and Stable Diffusion XL [13] text-to-image model to generate background image, with default hyperparameters.
After the generation of augmented images we evaluate the quality of the additional data samples using several CNN classifier models. We employ ResNet variants 18, 50, 101, 152 as the classification models for training. We train these CNN models from scratch using PyTorch’s standard training script [58] which includes PyTorch’s default hyperparameter set [59]. All the hyperparameter values used for CNN classifier training are presented in Table 4. We train all the classifier models multiple times and report the average performance. While training these CNN models, we carefully addressed the issue of overfitting. We often refer to the maximum classifier accuracy for any epoch by avoiding overfitting. We ensure this by using the training and validation loss. We train all the models in such a way that the difference between the training and validation loss is minimized. The training and validation losses of ImageNet10 training are presented in Figure 10, with real data shown in 10 (a) and augmented data in 10 (b). The x-axis represents the number of epochs, and the y-axis represents both accuracy and loss values. In both cases, the red vertical dashed line represents the epoch at which we achieve the maximum validation accuracy. We observe that both training and validation losses exhibit downward trends in Figure 10 for both base and AGA model training. No such scenario is detected where training loss keeps decreasing while validation loss starts to increase. The validation loss remains relatively stable and doesn’t show a significant upward trend. This indicates the model is generalizing well to unseen data and clearly shows no signs of overfitting.
| Model Parameter | ResNet-{18,50,101,152} |
|---|---|
| Epochs | 100 |
| Batch Size | 32 |
| Optimizer | Stochastic Gradient Descent (SGD) |
| Momentum | 0.9 |
| Learning Rate | 0.1 |
| Learning Rate Scheduler | StepLR |
| Learning Step Size | 30 |
| Gamma Parameter | 0.1 |
| Weight Decay | 1e-4 |
| Interpolation | Bilinear |
| Loss Function | CrossEntropyLoss |
We present additional synthetic images generated by AGA in Section 7.3.1. We also exhibit more GradCam visualization results to demonstrate the improved explainability of the classifier model trained with augmented data samples compared to one trained with only real samples in Section 7.3.2. Moreover, we display the CNN model-extracted features in a UMAP plot, showing feature clusters for different classes of real and augmented images in Section 7.3.3.
We present more generated images from real image with diverse backgrounds. Figure 11, 12 and 13 display multiples synthetic images generated by AGA using ImageNet10 and CUB traing image samples.
We present additional GradCam visualization results here to show the explanable capability of the base model and AGA model for ImageNet 10. The base model classifier is trained with only the real images of the ImageNet10 dataset, but the AGA model is trained with real images as well as augmented images generated by the AGA method.
We demonstrate several validation dataset samples of ImageNet10 that are misclassified by base model in Figure 14. On the other hand, the AGA model correctly classified these data samples, and the following GradCam visualizations reveal that the baseline model often focuses on irrelevant pixels, whereas the AGA-trained model more accurately targets pixels within the subject area.
We conducted an additional experiment to verify that additional synthetic images do not introduce irrelevant features. We utilize the last-layer feature outputs from the ResNet-50 model for both ImageNet10 real and AGA-augmented images. Each image yields 2048 features, which we use to plot feature clusters. We illustrate five distinct class clusters of ImageNet10 for both real and AGA-augmented images in Figure 15. The figure shows that additional generated images enhance cluster density without significantly increasing inter-cluster distances.


Figure 15: UMAP plot of feature clusters of five distinct classes of ImageNet10 dataset where features are extracted from last layer of ResNet-50 model..