AutoSampling: Search for Effective Data Sampling Schedules

Ming Sun, Haoxuan Dou, Baopu Li, Junjie Yan, Wanli Ouyang, Lei Cui

Data sampling plays a pivotal role in training deep learning models. By default, most models are trained by sampling data uniformly. However, not all images are equally informative at every stage of training. While "smart" sampling methods exist—such as hard example mining—they typically rely on human-designed proxies like image features or loss values to decide what to show the model next.

These proxies have limitations. For instance, two visually similar images might yield similar losses, leading a proxy-based sampler to redundantly oversample both. The ideal solution is to optimize the sampling schedule directly. The challenge? It is a massive, high-dimensional optimization problem. For a dataset like ImageNet, there are over a million parameters to tune (one for every image), making standard hyper-parameter optimization tools prohibitively expensive.

To solve this, researchers introduce AutoSampling, a novel framework that automatically learns optimal data sampling schedules—the specific order and frequency in which training data is presented to a model.

The AutoSampling Methodology

AutoSampling adapts Population-Based Training (PBT) to the data sampling domain, bypassing the need for human-designed heuristics. The process alternates between two main phases:

  1. Multi-Exploitation (Searching in Data Space): A population of "child" models is trained in parallel. Crucially, instead of waiting for an entire epoch to evaluate performance, AutoSampling uses shortened exploitation cycles of just 20–80 mini-batches. The best-performing sub-schedule is recorded, and its model weights are cloned across the rest of the population to keep all models on the most promising path.
  2. Exploration (Searching in Distribution Space): The algorithm estimates a global sampling distribution based on the most successful schedules from the exploitation phase. To prevent the model from getting stuck or ignoring data entirely, it applies "Distribution Smoothing" (using log-scaling and mixing with a uniform distribution) before perturbing it to generate new, diverse schedules for the next round.
Overview of the AutoSampling cycle, showing the transition from local data search to global distribution estimation.

Key Insights

Evaluating the method on standard computer vision benchmarks (CIFAR-10, CIFAR-100, and ImageNet) revealed several fascinating properties of optimal data sampling:

  • Short Cycles are Key: Unlike global hyper-parameters (like learning rate) that need long horizons to show impact, data value can be reflected in very short training intervals. This frequent feedback is what makes high-dimensional search tractable.
  • Dynamic Over Static: The "optimal" distribution is not fixed. The set of images the model finds useful changes drastically between the beginning and the end of training.
  • Beyond Loss-Based Mining: Interestingly, the learned sampling frequency does not strongly correlate with loss values. This suggests AutoSampling finds complex data relationships that simple hard example mining misses.
  • Cross-Architecture Generalization: A sampling schedule learned on a smaller model (like ResNet-18) can be successfully transferred to train a larger model (like ResNet-50). This implies the schedule captures intrinsic properties of the dataset itself, rather than just the quirks of a specific architecture.

Performance and Qualitative Findings

AutoSampling consistently outperformed uniform sampling and existing state-of-the-art non-uniform samplers, boosting Top-1 accuracy by up to 2.85% on CIFAR-10, 2.19% on CIFAR-100, and 2.83% on ImageNet.

Qualitative inspections of the learned schedules provided intuitive results. When examining the "high probability" images (those the sampler chose most often), they tended to be more obscure, visually complex, or difficult to recognize. Conversely, "low probability" images were often clear, prototypical examples, or sometimes low-quality "noisy" data that might actually hinder training if oversampled.

Examples of images with low (green border) vs. high (red border) sampling probability. High-probability images are often more visually complex or obscure.

Limitations and Future Work

The primary drawback of AutoSampling is its computational cost. Because it relies on PBT, it requires training a population (e.g., 20–80 workers) simultaneously to find the schedule. While the resulting schedule can be saved and reused to train other models cheaply, the initial search phase is resource-intensive.

Future work may focus on making this search more efficient, potentially by developing algorithms that can determine data value more quickly based on intrinsic properties without requiring a full population-based run.

Summary updated

BibTeX
@inproceedings{sun2021autosampling,
  author = {Ming Sun and Haoxuan Dou and Baopu Li and Junjie Yan and Wanli Ouyang and Lei Cui},
  title = {{AutoSampling: Search for Effective Data Sampling Schedules}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=t6aQJ0HuIcpg},
}
Figure