Few-Shot Transferable Robust Representation Learning via Bilevel Attacks

Hyeonjeong Ha, Minseon Kim, Sung Ju Hwang

TL;DR

Existing adversarial meta-learning models struggle to remain robust when exposed to novel, unseen domains because they focus on rapid task adaptation rather than learning robust, invariant feature representations. To solve this, the authors propose TROBA (Transferable RObust meta-learning via Bilevel Attack), which combines bilevel parameter augmentation with dynamic, self-supervised instance-wise attacks. TROBA significantly boosts robust few-shot accuracy across unseen domains—often beating previous baselines by more than 10–20% under PGD attacks—while preserving clean accuracy.

What Problem Does This Paper Address?

Adversarial training (AT) typically requires massive amounts of labeled data to make deep networks resilient against imperceptible perturbations. In contrast, few-shot meta-learning aims to adapt quickly using only a handful of examples per class. When researchers combine the two, existing adversarial meta-learning approaches (such as Adversarial Querying or RMAML) fail to generalize to unseen domains.

Prior approaches primarily update task-specific classifier heads while largely reusing backbone feature representations. As a result, the learned representations are not genuinely robust: adversarial examples from different classes overlap heavily in feature space, and the model collapses when faced with out-of-domain tasks.

Methods

TROBA introduces a self-supervised, representation-centric meta-learning framework centered around BOIL (Body Only Update in Inner Loop), which freezes the classifier head and only adapts the encoder feature extractor. Its core components include:

  • Bilevel Parameter Augmentation: For each sampled task, support images undergo two distinct stochastic transformations ($t_1, t_2$). The shared encoder is independently adapted via inner gradient steps on each augmented support set, producing two distinct view-adapted encoder parameter sets ($\theta_1^\tau, \theta_2^\tau$).
  • Dynamic Instance-Wise Attack: Instead of relying on standard class-label cross-entropy attacks, TROBA constructs an unsupervised, representation-level attack. Perturbations are crafted on the query set by maximizing the feature distance (cosine dissimilarity) between the two augmented views passed through their respective view-adapted encoders.
  • Self-Supervised Meta-Optimization: In the outer loop, the model minimizes a combined objective:
  • A TRADES loss (cross-entropy on clean samples plus Kullback–Leibler divergence between clean and adversarial logits) for each augmented view.
  • A self-supervised consistency loss that pulls the adversarial embeddings of both views close together, forcing the encoder to learn transformation-invariant, robust representations.

Datasets

The authors benchmarked TROBA on standard few-shot and transfer learning datasets (rescaled to $32 \times 32$):

  • Meta-Training Sets: CIFAR-FS and Mini-ImageNet (5-way 5-shot setup).
  • Few-Shot Unseen Domains: Tiered-ImageNet, CUB-200-2011, Stanford Cars, and Oxford 102 Flowers.
  • Transfer / Full Fine-Tuning Benchmarks: CIFAR-10, CIFAR-100, STL-10, and FGVC-Aircraft.
  • Robustness Benchmarks: Robustness was tested using $\ell_\infty$ Projected Gradient Descent (PGD-20, $\epsilon = 8/255$) and AutoAttack (AA). Robustness against common image corruptions was evaluated on CIFAR-10-C.

Key Insights and Ideas

  • Attacking features beats attacking labels for transfer: Class-wise attacks optimize against specific label boundaries that may not exist in an unseen domain. By contrast, instance-wise attacks perturb inputs to maximize divergence in latent space, serving as a stronger, label-agnostic regularizer.
  • View-specific parameter adaptation matters: Adapting separate encoder weights for each augmented view (parameter-level augmentation) produces more distinct intermediate representations than image augmentation alone, leading to richer multi-view invariance (confirmed via Centered Kernel Alignment analysis).
  • Smoother loss surfaces translate to better domain transfer: Visualizations reveal that TROBA produces significantly flatter and smoother adversarial loss landscapes around data points on out-of-domain tasks compared to prior meta-adversarial baselines.

Key Results

  • Unseen Domain Few-Shot Robustness: When meta-trained on CIFAR-FS and evaluated on unseen datasets under PGD-20 attacks, TROBA dramatically outperforms baselines:
  • Mini-ImageNet: 24.12% robust accuracy (vs. 3.32% for AQ and 6.65% for RMAML).
  • Tiered-ImageNet: 30.06% (vs. 5.05% for AQ and 9.30% for RMAML).
  • Flowers: 42.16% (vs. 11.03% for AQ and 10.79% for RMAML).
  • No Accuracy Trade-Off: TROBA achieves these gains while maintaining or improving clean test accuracy (e.g., 45.82% clean accuracy on Mini-ImageNet vs. 33.09% for AQ).
  • Competitiveness with Large-Data SSL: In a transfer setting where pre-trained encoders are fine-tuned on full datasets, TROBA (meta-trained on small data with 3-step bilevel attacks) achieves robustness comparable to self-supervised models (RoCL, ACL, BYORL) trained on the full CIFAR-100 dataset (e.g., 28.96% vs. 24.23–27.38% on STL-10 under AutoAttack).

Limitations and Future Work

  • Computational Complexity: Running bilevel inner loops combined with iterative PGD adversarial attacks per view introduces substantial training overhead. The authors had to reduce the attack iterations (e.g., to 3 steps) during several experiments to keep training tractable.
  • Sensitivity to Augmentation Types on Fine-Grained Data: Because the self-supervised objectives rely heavily on color-jitter augmentations, features can become color-invariant, slightly degrading performance on fine-grained datasets where color is critical (e.g., Flowers, CUB, Cars) when paired with existing SSL checkpoints.
  • Resolution Constraints: Meta-training was conducted on downsampled inputs ($32 \times 32$), leaving scalability to native high-resolution images as an open area for exploration.

Summary updated

BibTeX
@inproceedings{ha2023few,
  author = {Hyeonjeong Ha and Minseon Kim and Sung Ju Hwang},
  title = {{Few-Shot Transferable Robust Representation Learning via Bilevel Attacks}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=LLy2vm_p35C},
}

Loading related content...

Figure