Batch-in-Batch: a new adversarial training framework for initial perturbation and sample selection

Yinting Wu, Pai Peng, Bo Cai, Le LiComplex 2024

Adversarial training (AT) is the gold standard for defending deep neural networks against malicious "noise" designed to fool them. However, it often feels like a game of whack-a-mole: you fix one vulnerability, and the model develops "catastrophic overfitting," becoming robust to one specific attack while remaining fragile to everything else.

A new paper, "Batch-in-Batch: a new adversarial training framework for initial perturbation and sample selection," proposes a clever way to break this cycle by rethinking how we generate and select the data we use for training.

TL;DR

The Batch-in-Batch (BB) framework improves adversarial robustness by generating multiple diverse perturbations in parallel using a space-filling "tuned Latin Hypercube Sampling" (tLHS) method. By selectively training only on the most "useful" (misclassified) adversarial samples, BB achieves significant robustness gains—up to 13% on SVHN—without the massive computational slowdown typically expected from parallel processing.

What Problem Does This Paper Address?

Adversarial training is computationally expensive and finicky. Standard methods usually start by adding a bit of random uniform noise to an image and then using gradients to "push" that image toward a version that fools the model.

The authors identify two major inefficiencies in this process:

  1. Naive Initialization: Most methods use simple uniform distributions for initial noise. This often fails to explore the "loss landscape" effectively, meaning the resulting adversarial samples aren't diverse enough to provide strong regularization.
  2. Indiscriminate Training: Current frameworks use every adversarial sample generated for training. The authors argue that some samples are redundant or even harmful. If a model already correctly classifies an adversarial version of an image, training on it again might lead to overconfidence and "catastrophic overfitting" (CO).

Methods

The Batch-in-Batch (BB) framework introduces three key components:

  • Parallel Duplication ($m$ copies): Instead of one adversarial version per image, BB creates $m$ copies of the input batch.
  • Tuned Latin Hypercube Sampling (tLHS): Instead of random uniform noise, BB uses tLHS to ensure that the initial perturbations for these $m$ copies are spread out evenly across the available space. Think of it as "filling the room" with sensors rather than throwing $m$ darts at a wall and hoping they land in different spots.
  • Sample Selection Strategies: After generating adversarial samples, BB doesn't use them all. They test three strategies:
  • Checkpoint Selection (CP): Picks the misclassified sample closest to the original image.
  • Greedy Selection (GS): Only trains on samples that the model currently misclassifies.
  • Balanced Greedy (BG): A mix of clean images and misclassified adversarial samples to balance standard accuracy with robustness.

Datasets

The authors evaluated their framework on three standard computer vision benchmarks:

  • CIFAR-10
  • SVHN (Street View House Numbers)
  • CIFAR-100

They tested these across two popular architectures: PreActResNet18 and WideResNet28-10.

Key Insights and Ideas

  • Diversity is a Defense: By using tLHS, the framework provides "richer gradient information." This forces the model to learn a smoother loss landscape, making it harder for attackers to find a "blind spot."
  • Less is More: The Greedy Selection (GS) strategy acts as a form of "datum-wise early stopping." If the model can already handle an adversarial attack on a specific image, it stops training on it. This prevents the model from becoming "overconfident" or "assertive," which the authors show leads to better generalization.
  • Efficiency Paradox: You might think duplicating the batch $m$ times would make training $m$ times slower. However, because the selection strategies filter out many samples, the final training batch is often much smaller than $m \times$ the original. This makes the framework surprisingly cost-effective.

Key Results

The BB framework consistently outperformed baseline adversarial training methods (like N-FGSM and PGD-10):

  • Massive Gains on SVHN: On the SVHN dataset with a WideResNet28-10 backbone, BB(GS)-N-FGSM achieved a 13.34% improvement in adversarial accuracy (55.37% vs 42.03%) over the standard N-FGSM baseline.
  • Smoother Landscapes: Visualizations of the loss surfaces (the "terrain" the model navigates during training) showed that BB-trained models have much flatter, more linear landscapes compared to the jagged, "craggy" surfaces of baseline models.
  • Reduced Overconfidence: The authors measured the cross-entropy between predictions and uniform distributions, finding that BB models are significantly less "assertive" (overconfident), which correlates with better robustness.

Limitations and Future Work

While the results are impressive, the authors note a few hurdles:

  • Dataset Scarcity: The Greedy Selection strategy struggled on CIFAR-100. Because there are fewer samples per class, filtering out too many samples might prevent the model from learning enough features.
  • Hyperparameter Sensitivity: The performance can vary based on the attack radius ($\epsilon$) and the specific architecture used.
  • Rudimentary Filtering: The current selection strategies are relatively simple. The authors suggest that future research should explore more sophisticated ways to evaluate the "utility" of a specific training sample.

In short, Batch-in-Batch shows that by being more "picky" about which adversarial examples we train on—and more deliberate about how we find them—we can build significantly more robust AI.

Summary updated

Abstract

Adversarial training methods commonly generate initial perturbations that are independent across epochs, and obtain subsequent adversarial training samples without selection. Consequently, such methods may limit thorough probing of the vicinity around the original samples and possibly lead to unnecessary or even detrimental training. In this work, a simple yet effective training framework, called Batch-in-Batch (BB), is proposed to refine adversarial training from these two perspectives. The framework jointly generates m sets of initial perturbations for each original sample, seeking to provide high quality adversarial samples by fully exploring the vicinity. Then, it incorporates a sample selection procedure to prioritize training on higher-quality adversarial samples. Through extensive experiments on three benchmark datasets with two network architectures in both single-step (Noise-Fast Gradient Sign Method, N-FGSM) and multi-step (Projected Gradient Descent, PGD) scenarios, models trained within the BB framework consistently demonstrate superior adversarial accuracy across various adversarial settings, notably achieving an improvement of more than 13% on the SVHN dataset with an attack radius of 8/255 compared to N-FGSM. The analysis further demonstrates the efficiency and mechanisms of the proposed initial perturbation design and sample selection strategies. Finally, results concerning training time indicate that the BB framework is computational-effective, even with a relatively large m.
BibTeX
@inproceedings{wu2024batch,
  author = {Yinting Wu and Pai Peng and Bo Cai and Le Li},
  title = {{Batch-in-Batch: a new adversarial training framework for initial perturbation and sample selection}},
  booktitle = {Complex},
  year = {2024},
}
Figure