Detection of Adversarial Supports in Few-shot Classifiers Using Feature Preserving Autoencoders and Self-Similarity

Yi Xiang Marcus Tan, Penny Chong, Jiamei Sun, Yuval Elovici, Alexander BinderarXiv 2020 · OpenReview

Abstract

Few-shot classifiers excel under limited training samples, making them useful in applications with sparsely user-provided labels. Their unique relative prediction setup offers opportunities for novel attacks, such as targeting support sets required to categorise unseen test samples, which are not available in other machine learning setups. In this work, we propose a detection strategy to identify adversarial support sets, aimed at destroying the understanding of a few-shot classifier for a certain class. We achieve this by introducing the concept of self-similarity of a support set and by employing filtering of supports. Our method is attack-agnostic, and we are the first to explore adversarial detection for support sets of few-shot classifiers to the best of our knowledge. Our evaluation of the miniImagenet (MI) and CUB datasets exhibits good attack detection performance despite conceptual simplicity, showing high AUROC scores. We show that self-similarity and filtering for adversarial detection can be paired with other filtering functions, constituting a generalisable concept.

Introduction

In standard deep learning, models are trained on massive datasets and then frozen. In Few-Shot Learning (FSL), however, the model is designed to adapt to new, unseen classes using just a few examples, called a support set. While most adversarial research focuses on "fooling" a model with a single perturbed test image, this work identifies a more systemic threat: adversarial support attacks.

An attacker could insert subtly perturbed images into a support set. Because the classifier relies entirely on these few images to define a new category, poisoning the support set causes the model to misclassify all future queries of that class. Existing defenses like adversarial training often fail here because FSL models must generalize to entirely new data distributions they weren't trained on, and the small sample size (1–5 images) precludes traditional statistical anomaly detection.

Methodology

The proposed detection strategy is based on two core concepts: Self-Similarity and Filtering with Feature-space Preserving Autoencoders (FPA).

  1. Self-Similarity: A clean support set should be internally consistent. The authors test this by randomly splitting a support set into an "auxiliary support" and an "auxiliary query." If the set is clean, the model should easily recognize the auxiliary query using the auxiliary support. If it is adversarial, this internal "logic" breaks down.
  2. Feature-space Preserving Autoencoders (FPA): To detect the subtle noise of an adversarial attack, the authors pass support images through a filter. Standard autoencoders were found ineffective. Instead, the FPA is trained to reconstruct images while specifically preserving the features used by the few-shot classifier's backbone (e.g., a ResNet).
The proposed detection strategy calculates an adversarial score by measuring the difference in model output when using original versus filtered support sets.

The system calculates an adversarial score ($U_{adv}$) by measuring the $L_1$ norm difference in the model's raw logit outputs when using the original support set versus the filtered one. If filtering causes a massive shift in the model's "opinion," the support set is flagged as adversarial.

Experimental Results

The researchers evaluated their method on two gold-standard few-shot benchmarks: miniImageNet (MI) for general object recognition and CUB for fine-grained bird species classification. The detector was tested against major attack types including PGD (Projected Gradient Descent) and CW-SGD.

Detection performance (AUROC) of the FPA method compared to Feature Squeezing (FeatS) and Gaussian Noise baselines.

Across both datasets and multiple classifier architectures (RelationNet and CAN), the FPA-based method achieved exceptional results:

  • High Accuracy: AUROC scores consistently ranged between 0.97 and 0.99.
  • Superiority over Baselines: The FPA significantly outperformed simpler filtering methods, such as adding Gaussian noise or using median filtering (Feature Squeezing).
  • Sensitivity: Measuring raw logits proved far more sensitive than checking for label flips, allowing the detector to catch "weak" attacks that merely degraded model confidence without yet changing the final classification.

Conclusion

This research demonstrates that self-similarity and feature-aware filtering are powerful, attack-agnostic tools for securing few-shot classifiers. By forcing the autoencoder to respect the classifier's feature space, the FPA effectively removes adversarial perturbations while maintaining the integrity of clean features. Future work may explore these signatures against "black-box" or query-only attacks where the attacker has limited model information.

Summary updated

Abstract

Few-shot classifiers excel under limited training samples, making them useful in applications with sparsely user-provided labels. Their unique relative prediction setup offers opportunities for novel attacks, such as targeting support sets required to categorise unseen test samples, which are not available in other machine learning setups. In this work, we propose a detection strategy to identify adversarial support sets, aimed at destroying the understanding of a few-shot classifier for a certain class. We achieve this by introducing the concept of self-similarity of a support set and by employing filtering of supports. Our method is attack-agnostic, and we are the first to explore adversarial detection for support sets of few-shot classifiers to the best of our knowledge. Our evaluation of the miniImagenet (MI) and CUB datasets exhibits good attack detection performance despite conceptual simplicity, showing high AUROC scores. We show that self-similarity and filtering for adversarial detection can be paired with other filtering functions, constituting a generalisable concept.
BibTeX
@misc{tan2020detection,
  author = {Yi Xiang Marcus Tan and Penny Chong and Jiamei Sun and Yuval Elovici and Alexander Binder},
  title = {{Detection of Adversarial Supports in Few-shot Classifiers Using Feature Preserving Autoencoders and Self-Similarity}},
  year = {2020},
  eprint = {2012.06330},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.06330},
}
Figure