# Adversarial Validation in Image Classification Datasets by Means of Cumulative Spectral Gradient
###### Abstract
Normalization methods, specifically CrossNorm and SelfNorm, have also been used to improve generalization under distribution changes; here, CrossNorm is responsible for exchanging the mean and variance (at the channel level) between feature maps to broaden the training distribution, and SelfNorm allows recalibration of statistics in order to bridge the gap between the training and test distributions [15]. Some authors have evaluated the use of data augmentation in the generalization process of a model, finding that it can be beneficial if such augmentation is focused on selectively randomizing spurious variations between domains [10]. To answer the second question, some proposals for detecting dataset shift have been made in the literature. Dimensionality reduction and two-sample testing have been combined into a practical process that requires pre-trained classifiers to detect distribution changes in machine learning systems [6]. Another approach uses GradNorm to detect OOD inputs using information extracted from gradient space. The general idea is based on the fact that the magnitude of gradients is larger for data from the same distribution than for OOD data [16]. Studies on specific types of distribution shift have also been performed, such as subpopulation shift, characterized by changes in the proportion of some subpopulations between training and deployment [17], or temporal shift of the dataset associated with changes over time in a given context [18]. From a machine learning perspective, assessing distributional shifts between training and test data can be approached by training a supervised model on the training data and subsequently evaluating its performance across datasets with varying distributions. Specifically, the model's predictive performance can be compared between a test dataset that mirrors the original training data distribution and one in which the distribution has demonstrably shifted. This methodology enables the detection and quantification of distributional changes, allowing for an analysis of how these shifts impact model performance and generalization [16]. In order to address the problem of data shift in data distribution, a collection of 12,868 sets of natural images classified into 410 classes has recently been made public. It is intended as a framework to facilitate the evaluation of methods or techniques to overcome data shift. This initiative is known as MetaShift, and its development takes into account the context of the image, to offer multiple subsets of each class in different scenarios. To differentiate these subsets, the authors have included a distance metric, on which they illustrate the values of this metric in the subsets given in MetaShift, but do not provide details of its implementation or resources that would allow replication of its application to other datasets [19]. Based on the above, the methods proposed to assess the degree of distribution shift in the data are characterized by a lack of global approaches to explain the differences between datasets in a human-understandable way [5], may require a high execution time, caused either by the computational cost of the methods used, or by the need to adjust and train supervised models to allow a preliminary classification, or they lack sufficient information to replicate their implementation in new problems or scenarios. Another alternative that could be used to identify differences in the distributions of the datasets is adversarial validation, which, to our knowledge, has not been explored in the context of computer vision. This approach, initially oriented towards structured (tabular) data [20; 21; 22], consists of configuring the two datasets (training and test) as a single labeled dataset, where the training data are labeled as the first class (e.g., class X) and the test data are defined as the other class (e.g., class Y). The idea of this method is to determine whether the two classes of this new dataset are easily separable or not.