Manuscript Offprint

arXiv:2608.27502

Image Augmentation as Test Generation for Deep Learning-Based Image Retrieval Systems

Yehan De Silva, Anirudh Sridhar, Armin Lotfy, Nafiseh Kahani, Yvan Labiche, Ziyu Wang, Frank Ouyang, Clare Carty, Azalia Shamsaei

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yehan De Silva, Anirudh Sridhar, Armin Lotfy, Nafiseh Kahani, Yvan Labiche, Ziyu Wang, Frank Ouyang, Clare Carty, and Azalia Shamsaei

Abstract—Ensuring the reliability of deep learning-based image retrieval systems is a significant software engineering challenge, especially in safety-critical and high-stakes deployment scenarios. This paper presents a dual contribution: (1) a systematic literature review of augmentation and generation techniques used in articles published between 2020 and 2025, which resulted in the identification of 50 such techniques which we organized into a ten-category taxonomy, and (2) a large-scale empirical study that evaluates these techniques as candidate test generators for embedding-based image retrieval systems. Augmented images are embedded using Amazon Titan and OpenCLIP, and evaluated across four analytical dimensions: (1) embedding-space similarity, (2) embedding uncertainty measured via four estimators (dispersion, pairwise distance, Mahalanobis distance, and ensemble agreement), (3) semantic realism scored by LLaVA, and (4) retrieval failure rate. Experiments are performed on three datasets: CIFAR-10, ImageNet-1K, and a dataset from an industrial partner (March Networks), utilizing both the Amazon Titan Multimodal Embeddings G1 model and the OpenCLIP ViT-H/14 model pretrained on the LAION-2B dataset. Across all evaluated datasets and embedding models, and under the single severity level tested for each technique, weather simulation and SaSPA are the image augmentation/generation techniques that produce the highest embedding uncertainty and failure rates while maintaining a favorable balance between performance stability, visual realism, and augmentation effectiveness. The results we discuss are configuration-specific and may shift under milder or stronger perturbation settings. In contrast, GAN-based augmentation techniques are among the lowest in realism, indicating the presence of synthetic artifacts and perceptual inconsistencies that reduce their suitability to produce realistic test inputs. Overall, our findings provide practical guidelines for selecting augmentation techniques that maximize test diversity while preserving realistic image characteristics, thereby enabling the construction of more comprehensive and effective test suites for image retrieval systems while reducing the cost of manual data labeling through the use of metamorphic testing.

Index Terms—Test Generation, Image Retrieval, Embedding Models, Image Augmentation, Metamorphic Testing, Robustness Evaluation

1 INTRODUCTION

AI-based image search and retrieval systems are increasingly deployed in production environments where input conditions are far from ideal. In surveillance and security applications, cameras are mounted at varying angles, overhead, side-mounted, or oblique, and must operate under challenging environmental conditions including low light, rain, fog, and glare [1]. In industrial inspection and medical imaging, images may be degraded by sensor noise, motion blur, compression artifacts, or resolution loss [2], [3]. In all of these settings, the retrieval system is expected to return semantically correct results regardless of the quality or viewing conditions of the query image. Ensuring this property through manual testing is prohibitively expensive. The combinatorial space of environmental factors, camera perspectives, object dynamics, and image quality degradations is too large to enumerate by hand. An automated strategy is therefore needed to generate large and diverse query inputs; however, automatically judging whether the

retrieved results are correct raises an oracle problem. Metamorphic testing addresses this by defining an expected relation between related test inputs and their outputs, removing the need for a manually labelled oracle [4].

A scalable way to generate such tests is image augmentation — controlled image modifications that we refer to as augmentation techniques (or simply augmentations) throughout this manuscript. Applying transformations such as lighting changes, weather effects, noise, viewpoint shifts, partial occlusion, motion blur, and adversarial perturbations to a query image and submitting the result to the retrieval system probes its robustness across realistic deployment conditions without requiring manual labeling. This instantiated the metamorphic relation used in this study: because a semantics-preserving transformation should not change an image's category, the system should retrieve images of the same category for both the original and the augmented query, and any deviation is a detected fault. Not every transformation is a valid test generator, however. A useful augmentation must be strong enough to expose weaknesses yet preserve the image's semantic category. If it destroys that category, a resulting failure cannot be attributed to the model, whereas a transformation too weak to change anything yields only trivial tests.

Identifying which augmentation techniques are the most challenging to an AI-based system requires more than simply counting failures. Different techniques cause difficulty

Y. De Silva, A. Sridhar, A. Lotfy, N. Kahani, and Y. Labiche are with the Department of Systems and Computer Engineering, Carleton University, Ottawa, ON, Canada. E-mail: [YehandeSilva, AnirudhSridhar]@cmail.carleton.ca, [arminlotfy, nafisehahani, yvanlabiche]@cunet.carleton.ca. Z. Wang, F. Ouyang, C. Carty, and A. Shamsaei are with March Networks, Ottawa, ON, Canada. E-mail: [zwang, fouyang, ccarty, ashamsaei]@marchnetworks.com.

in different ways, and understanding why a model fails is as important as knowing that it fails. We therefore evaluate each technique — both the validity of the follow-up inputs it produces and its fault-exposure power — through four complementary metrics:

  • Retrieval failure count: how often the model retrieves an image from the wrong category for an augmented query, directly quantifying how frequently each technique causes a misclassification. Since a semantics-preserving technique should yield an image of the same category as the original, any retrieved image from a different category is a violation of the metamorphic relation and hence a detected fault.

  • Embedding similarity: the cosine similarity between the original and augmented image embeddings, revealing how much each augmentation displaces the model's internal representation of the image.

  • Embedding uncertainty: the stability of the model's representations under augmented inputs, assessed through four estimators: dispersion relative to the class centroid, pairwise distance between original and augmented embeddings, Mahalanobis distance from the embedding distribution, and agreement across an ensemble of k-nearest neighbor (KNN) classifiers. High uncertainty indicates that the augmented images occupy ambiguous regions of the embedding space, exactly the conditions under which misclassification is most likely.

  • Semantic realism: the visual plausibility of the augmented images, scored by LLaVA [5], a multimodal large language model (LLM), against nine perceptual criteria including lighting consistency, texture integrity, and semantic coherence. This distinguishes augmentations that cause failures because they represent realistic hard cases from those that cause failures only because they produce unnatural, artifact-ridden images with no correspondence to real deployment scenarios.

Together, these metrics provide a complete profile of each augmentation technique from a testing perspective: how hard it is for the model, how the technique causes difficulty, and whether that difficulty reflects realistic deployment scenarios. These metrics directly operationalize the research questions defined in Section 5.1.

Despite the wide variety of augmentation techniques available, there is no systematic study that (a) catalogues the full landscape across all major categories and (b) evaluates them through this multi-dimensional testing lens to identify which augmentations are most challenging for embedding-based retrieval models. Existing surveys [6], [7] focus on training-time accuracy improvements and do not study augmentation in the context of automated robustness testing, embedding-space analysis, or semantic realism assessment. Consequently, it remains unclear which augmentation techniques preserve the semantic category while producing sufficiently challenging queries for retrieval evaluation. Fixed corruption benchmarks such as ImageNet-C [8] evaluate classifier robustness against a small set of predefined corruptions applied to a single model, whereas we catalogue the full augmentation landscape and assess each technique as a test generator for embedding-based retrieval, across

both open and closed models.

This gap motivated the present work. We make two complementary contributions. First, we conduct a systematic literature review (SLR) of image augmentation techniques published between 2020 and 2025, identifying 56 relevant papers from an initial pool of over 88 candidates and organizing the techniques they describe into a ten-category taxonomy spanning geometric transforms, photometric adjustments, noise injection, selection-based techniques, filtering operations, self-mixing, sample mixing, generative adversarial network (GAN)-based synthesis, diffusion-based generation, and adversarial perturbation. Second, we conduct a large-scale empirical study that applies each catalogued technique as a source of challenging test inputs for two embedding-based retrieval models, Amazon Titan and OpenCLIP, and evaluates it across the four metrics above on three datasets: CIFAR-10, ImageNet-1K, and a dataset from our industry partner, March Networks. We report a ranked comparison of all evaluated techniques across the four metrics, enabling practitioners to identify which augmentations offer the best trade-off between fault-exposure power and semantic realism for their specific deployment context.

The remainder of this manuscript is structured as follows. Section 2 describes the SLR protocol and the resulting taxonomy of augmentation techniques. Section 3 provides background for the remainder of the manuscript. Section 4 presents all identified augmentation techniques organized by category. Section 5 presents the empirical study design, embedding models, datasets, and evaluation metrics. Section 6 reports the experimental findings. Section 7 discusses threats to validity. Section 8 concludes the paper.

References (91)

  • Solving the imbalanced dataset problem in surveillance image blur classification
  • Deep image retrieval: Learning global representations for image search
  • Unifying deep local and global features for image search
  • Metamorphic testing: A review of challenges and opportunities
  • Visual instruction tuning
  • A survey on image data augmentation for deep learning
  • Data augmentation: A comprehensive survey of modern approaches
  • Benchmarking neural network robustness to common corruptions and perturbations (opens arXiv in a new tab)
  • Systematic literature reviews in software engineering—a systematic literature review
  • Denoising diffusion probabilistic models
  • Learning transferable visual models from natural language supervision
  • mixup: Beyond empirical risk minimization
  • The prisma 2020 statement: an updated guideline for reporting systematic reviews
  • An augmentation-aware theory for self-supervised contrastive learning
  • Revisiting the critical factors of augmentation-invariant representation learning (opens the publisher in a new tab)
  • Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases
  • What makes for good views for contrastive learning?
  • Improving transferability of representations via augmentation-aware self-supervision
  • Enhancing unsupervised sentence embeddings via knowledge-driven data augmentation and gaussian-decayed contrastive learning
  • Geometry of textual data augmentation: Insights from large language models
  • Rough-set-based color channel selection
  • Affine transformation
  • Affine transformations
  • Prentice-Hall, 2009
  • Imagenet classification with deep convolutional neural networks
  • A survey on vision transformer
  • Generative adversarial nets
  • Enhancing multimodal understanding with clip-based image-to-text transformation
  • Denoising diffusion implicit models
  • Unpaired image-to-image translation using cycle-consistent adversarial networks
  • Image data augmentation approaches: A comprehensive survey and future directions
  • Image data augmentation techniques for deep learning—a mirror review
  • Data augmentation in training deep learning models for medical image analysis
  • Enhancing performance of deep learning models with different data augmentation techniques: A survey
  • Regularizing deep neural networks by noise: Its interpretation and optimization
  • What is the best data augmentation for 3d brain tumor segmentation?
  • Dataset augmentation in feature space (opens arXiv in a new tab)
  • Data augmentation with Möbius transformations
  • An improved EfficientNetV2 for garbage classification (opens arXiv in a new tab)
  • Saliencymix: A saliency guided data augmentation strategy for better regularization
  • Image augmentation to improve construction resource detection using generative adversarial networks, cut-and-paste, and image transformation techniques
  • Unrealistic data augmentation improves the robustness of deep learning-based classification of dopamine transporter SPECT against variability between sites and between cameras
  • Augmix: A simple data processing method to improve robustness and uncertainty
  • Self-augmentation: Generalizing deep networks to unseen classes for few-shot learning
  • Salfmix: A novel single image-based data augmentation technique using a saliency map
  • Mixgen: A new multi-modal data augmentation
  • RobustMixGen: Data augmentation for enhancing robustness of vision-language models in the presence of distribution shift
  • CutMix: Regularization strategy to train strong classifiers with localizable features
  • Resizemix: Mixing data with preserved object information and true labels
  • Data augmentation using random image cropping and patching for deep CNNs
  • Keepaugmentation: A simple information-preserving data augmentation approach
  • Ipmix: Label-preserving data augmentation method for training robust classifiers
  • Unsupervised representation learning with deep convolutional generative adversarial networks
  • Improved classification for pneumonia detection using transfer learning with gan based synthetic image augmentation
  • A neural algorithm of artistic style (opens arXiv in a new tab)
  • Image-to-image translation with conditional adversarial networks
  • High-resolution image synthesis with latent diffusion models
  • Adding conditional control to text-to-image diffusion models
  • Cyclenet: Rethinking cycle consistency in text-guided diffusion for image manipulation
  • Diffusionclip: Text-guided diffusion models for robust image manipulation
  • Zero-shot image-to-image translation
  • Diffusemix: Label-preserving data augmentation with diffusion models
  • Scaling laws of synthetic images for model training... for now
  • Sdedit: Guided image synthesis and editing with stochastic differential equations (opens arXiv in a new tab)
  • Advancing fine-grained classification by structure and subject preserving augmentation
  • Effective data augmentation with diffusion models (opens arXiv in a new tab)
  • Diagen: Semantically diverse image augmentation with generative models for few-shot learning
  • Adversarial attacks on visual objects using the fast gradient sign method: Sma naqvi et al
  • The effectiveness of image augmentation in deep learning networks for detecting covid-19: A geometric transformation perspective
  • A review of medical image data augmentation tech-niques for deep learning applications
  • Data augmentation for brain-tumor segmentation: A review
  • A voting-based ensemble deep learning method focusing on image augmentation and preprocessing variations for tuberculosis detection
  • Springer Nature, 2020, vol. 186
  • Evaluation of impact of image augmentation techniques on two tasks: Window detection and window states detection
  • Improving retinal image quality using the contrast stretching, histogram equalization, and clahe methods with median filters
  • Exploring the effect of image enhancement techniques on covid-19 detection using chest x-ray images
  • Albumentations: fast and flexible image augmentations
  • Study on the germination rate of maize seeds based on improved yolov8n model
  • Random erasing data augmentation
  • Patch-wise augmentation for anomaly detection and localization
  • Adversarial Machine Learning at Scale
  • Attacking large language models with projected gradient descent (opens arXiv in a new tab)
  • Amazon Titan Image Generator, Multimodal Embeddings, and Text Models Are Now Available in Amazon Bedrock
  • Reproducible scaling laws for contrastive language-image learning
  • A simple framework for contrastive learning of visual representations
  • Learning multiple layers of features from tiny images
  • Imagenet: A large-scale hierarchical image database
  • Looking closer to the transferability between natural and medical images in deep learning
  • Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models
  • Style transfer dataset
  • Mllm-as-a-judge: Assessing multimodal llm-as-a-judge with vision-language benchmark