Abstract
Knowing the similarity between sets of data has a number of positive implications in training an effective model, such as assisting an informed selection out of known datasets favorable to model transfer or data augmentation problems with an unknown dataset. Common practices to estimate the similarity between data include comparing in the original sample space, comparing in the embedding space from a model performing a certain task, or fine-tuning a pretrained model with different datasets and evaluating the performance changes therefrom. However, these practices would suffer from shallow comparisons, task-specific biases, or extensive time and computations required to perform comparisons. We present SimEx, a new method for early prediction of inter-dataset similarity using a set of pretrained autoencoders each of which is dedicated to reconstructing a specific part of known data. Specifically, our method takes unknown data samples as input to those pretrained autoencoders, and evaluate the difference between the reconstructed output samples against their original input samples. Our intuition is that, the more similarity exists between the unknown data samples and the part of known data that an autoencoder was trained with, the better chances there could be that this autoencoder makes use of its trained knowledge, reconstructing output samples closer to the originals. We demonstrate that our method achieves more than 10x speed-up in predicting inter-dataset similarity compared to common similarity-estimating practices. We also demonstrate that the inter-dataset similarity estimated by our method is well-correlated with common practices and outperforms the baselines approaches of comparing at sample- or embedding-spaces, without newly training anything at the comparison time.
Introduction
In modern machine learning, researchers are often "data rich but information poor." When starting a new project with a small or messy dataset, common strategies include transfer learning (leveraging a model pretrained on a large dataset) or data augmentation (incorporating similar samples from other sources). However, choosing the optimal source dataset is often a "trial-and-error" process that is computationally expensive and slow.
SimEx (Similarity Express) addresses this by providing a task-agnostic, computationally efficient framework for early prediction of dataset similarity. By using a "fleet" of specialized autoencoders, SimEx identifies the best candidates for transfer learning over 10x faster than traditional fine-tuning methods.
Methodology
The core of SimEx is the use of Reconstruction Error as a proxy for similarity. The framework operates in two distinct phases: Pre-training and Comparison.
- The Fleet (Pre-training): A set of autoencoders is trained, where each model $\mathcal{A}(Y_i)$ is dedicated to a specific known dataset or a specific class within a dataset ($Y_i$).
- The Test (Comparison): When a new, unknown dataset $X$ arrives, it is passed through every autoencoder in the fleet. The framework evaluates the aggregated difference $\Delta(X|Y_i)$ between the input samples $x_i$ and their reconstructed counterparts $\hat{x}_i$.
Crucially, SimEx requires zero training at the time of comparison; it only requires a single forward pass through the pretrained fleet, making it significantly faster than methods requiring fine-tuning.
Intuition: Similarity via Reconstruction
The intuition behind SimEx is that an autoencoder learns the underlying structural manifold of its training data. If an autoencoder trained on "Handwritten Digits" can reconstruct a new set of images with very low error, those images likely share underlying structural features with digits. Conversely, if the error is high, the datasets are dissimilar.
To measure this error, the authors evaluate two loss functions: Mean Squared Error (MSE) for pixel-wise differences and Inverted Structural Similarity (iSSIM), which focuses on structural patterns like luminance and contrast, making the metric more robust to noise.
Experimental Results
The authors validated SimEx using five MNIST-variant datasets (Standard, Rotated, Background-image, Fashion, and EMNIST-Letters) to simulate various domain shifts. Key findings include:
- Significant Speedup: SimEx achieved a 10x to 100x speedup compared to the baseline of fine-tuning a classifier. A pair-wise comparison took approximately 2.1 seconds, whereas the fastest transfer learning baseline required 22 seconds.
- High Correlation: Similarity rankings produced by SimEx showed a high Spearman’s rank correlation (up to 1.0) with actual accuracy gains observed in transfer learning tasks.
- Task-Agnosticism: Because autoencoders are unsupervised, they learn the "essence" of the data distribution without being tied to specific classification tasks, making the similarity metric more universal than embedding-based approaches.
Conclusion and Future Work
SimEx demonstrates that even modest reconstruction quality is sufficient to discern relative similarity between datasets, allowing for early stopping during fleet pre-training to save resources. While highly effective on low-resolution grayscale data, future work will explore scaling the "fleet" approach to high-resolution color images and complex video data, as well as refining normalization techniques to ensure comparable error offsets across diverse reference datasets.
Summary updated