On-the-Fly Data Augmentation via Gradient-Guided and Sample-Aware Influence Estimation

Suorong Yang, Jie Zong, Lihang Wang, Ziheng Qin, Hai Gan, Pengfei Zhou, Kai Wang, Yang You, Furao Shen · Submission to ICLR 2026 · Rejected

TL;DR

Most data augmentation techniques apply fixed or random transformations uniformly across all training images, ignoring how individual sample difficulty shifts over training epochs. SADA (Sample-Aware Dynamic Augmentation) estimates each sample's alignment with the model's optimization trajectory on the fly—assigning stronger augmentations to stable, well-learned samples and milder augmentations to volatile, uncertain ones—achieving competitive accuracy gains across diverse architectures with negligible computational overhead.

What Problem Does This Paper Address?

Data augmentation (DA) is essential for regularizing deep neural networks, but standard pipelines—whether heuristic (Cutout, Mixup, RandAugment) or automated (AutoAugment)—treat all data equally throughout the training cycle.

In reality, learning dynamics are heterogeneous:

  • Easy samples are fitted quickly and benefit from aggressive perturbations to prevent feature memorization and redundancy.
  • Challenging or ambiguous samples continue to fluctuate; heavy transformations can corrupt critical semantic cues, causing noisy gradients and degraded convergence.

Prior attempts to build sample-adaptive augmentations typically require expensive bi-level optimization, reinforcement learning controllers, or auxiliary teacher models. This paper asks: Can we adapt augmentation strength per-sample on the fly using internal optimization signals without sacrificing computational efficiency?

Methods

The authors introduce SADA, a plug-and-play module that dynamically modulates augmentation magnitudes based on sample learning dynamics:

Loss Difference across Epochs  ──►  Sliding Window Variance Vt(x)  ──►  EMA Smoothing V(x)  ──►  Augmentation Strength s(x)
(Taylor approximation of grad proj)      (measures training instability)      (stable influence metric)      (low variance = strong DA)
  1. Gradient-Guided Influence Estimation: SADA measures a sample's instantaneous contribution to model optimization by projecting its gradient $g_t(x_i)$ onto the accumulated parameter update trajectory $(\theta_{t-1} - \theta_t)$.
  2. First-Order Taylor Approximation: Rather than tracking full parameter updates and gradient inner products, the authors approximate the projection using the step-to-step loss difference. For classification, this simplifies to the KL-divergence between consecutive epoch predictions: $$\Delta \ell_{t-1}^n \approx f_{\theta_t}(x_i)^\top \log \left( \frac{f_{\theta_t}(x_i)}{f_{\theta_{t-1}}(x_i)} \right)$$ This formulation captures the sample's trajectory alignment during the standard forward pass with almost zero extra compute.

  3. Temporal Variance & Dynamic Strength: SADA computes the variance $\mathcal{V}_t(x_i)$ of these loss differences over a short sliding window ($L \in [5, 10]$ epochs) smoothed by an exponential moving average (EMA, $\beta = 0.9$):

  4. Low variance (stable influence): The sample is consistently contributing in a predictable direction $\rightarrow$ assign higher augmentation strength $s(x_i)$ to increase data diversity.
  5. High variance (unstable influence): The sample oscillates or remains hard $\rightarrow$ assign lower augmentation strength to preserve semantic fidelity.

Datasets

The authors evaluate SADA across multiple computer vision settings without dataset-specific policy tuning (no new benchmarks were introduced):

  • Standard Image Classification: CIFAR-10, CIFAR-100, Tiny-ImageNet, and ImageNet-1k.
  • Fine-Grained Recognition: Oxford Flowers, Oxford-IIIT Pets, FGVC-Aircraft, and Stanford Cars.
  • Long-Tailed / Imbalanced Recognition: ImageNet-LT and Places-LT.
  • Transfer Learning Benchmarks: Pretraining on CIFAR-100 / Tiny-ImageNet and fine-tuning on CIFAR-10.

Key Insights and Ideas

  • Variance as an Indicator of Semantic Risk: Counter-intuitively, the most "consistently learned" examples are safe candidates for aggressive distortions, while samples with high gradient variance risk having their class-defining features destroyed if heavily augmented.
  • Theoretical Backing via Rademacher Complexity: The authors show that the model's generalization gap is bounded by a term proportional to $\frac{1}{n}\sqrt{\sum_i \alpha_i s_i^2}$, where $\alpha_i$ is sample sensitivity and $s_i$ is augmentation magnitude. Solving this via KKT water-filling confirms that optimal generalization requires assigning smaller magnitudes to high-sensitivity/high-variance samples.
  • Efficiency via Local Memory: By relying purely on temporal output differences across a local window rather than meta-networks or gradient-inversion loops, SADA avoids the steep wall-clock costs that plague most adaptive DA literature.

Key Results

  • Large-Scale ImageNet-1k: SADA achieves 78.4% top-1 accuracy on ResNet-50—matching heavily optimized frameworks like MADAug (78.5%) while training >2× faster than MADAug and >4× faster than TeachAugment (adding only +1.8% wall-clock time over vanilla training).
  • Vision Transformers (ViT): Consistently improves ViT baselines on ImageNet-1k across scales without architectural alterations: ViT-B (+1.08%), ViT-L (+0.54%), and ViT-H (+0.97%).
  • Fine-Grained Classification: Substantial improvements where preserving delicate discriminative features matters most: Oxford Flowers jumped from 89.47% to 98.04% (+8.57%), and Stanford Cars improved from 82.13% to 91.89% (+9.76%).
  • Long-Tailed Robustness: On Places-LT under an open-set evaluation protocol, SADA boosts the F-measure from 46.4% to 50.4% (+4.0%) without requiring re-sampling or cost-sensitive loss adjustments.

Limitations and Future Work

  • Memory Overhead for Local History: Storing historical prediction differences requires keeping a sliding window cache per training instance, which scales linearly with the dataset size $N$ (though footprint per sample is small).
  • Domain Scope: SADA is currently validated only on supervised image classification. Extending dynamic gradient-guided augmentation to dense prediction tasks (object detection, segmentation) and generative models remains unexplored.

Summary updated

BibTeX
@misc{yang2025fly,
  author = {Suorong Yang and Jie Zong and Lihang Wang and Ziheng Qin and Hai Gan and Pengfei Zhou and Kai Wang and Yang You and Furao Shen},
  title = {{On-the-Fly Data Augmentation via Gradient-Guided and Sample-Aware Influence Estimation}},
  year = {2025},
  eprint = {2510.00434},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.00434},
}
Figure