Skip to content

BadEncoder: A backdoor attack against pretrained encoders in self-supervised learningBadEncoder: Backdoor Attacks to Pre-trained Encoders in Self-Supervised Learning

arXiv· arXiv:2108.00352· S&P 2022· Jinyuan Jia, Yupei Liu, Neil Zhenqiang Gong·Indexed by this site · 27 days ago· Originally publishedSelected AttacksSelectedAttention40

Quick read

Based on the paper's full text (AI-generated); refer to the original

AI summaryThe authors propose BadEncoder and claim it is the first backdoor attack against self-supervised learning, injecting a backdoor into a pretrained image encoder by solving an optimization problem so that downstream classifiers built on that encoder inherit the backdoor behavior. In experiments pretrained on CIFAR10 with STL10 as the target downstream task, the attack success rate reached 99.73%, and in most cases the downstream classifier's accuracy loss was within 1%; the attack requires only one or more reference images per target class, and the shadow dataset need not come from or share the distribution of the pretraining data. The paper also applies the attack to Google's image encoder pretrained on ImageNet and OpenAI's CLIP image encoder, achieving high attack success rates in both multi-shot and zero-shot classifier scenarios. Experiments show that Neural Cleanse and MNTD cannot detect the backdoored downstream classifiers, and the robustness guarantee provided by PatchGuard is also insufficient. The code is publicly available on GitHub (https://github.com/jjy1994/BadEncoder)。

Questions
Image encoders pretrained by self-supervised learning are reused by downstream tasks as feature extractors, but their security in adversarial scenarios has not been sufficiently studied. The authors point out that existing backdoor attacks require contaminating the training process of the downstream classifier, and are not applicable when the downstream data are unlabeled or the training process is trusted.
Methods
Proposes BadEncoder, the first backdoor attack against self-supervised learning: it only tampers with the pre-trained encoder, assuming the downstream training process is intact. The attack is formalized as an optimization problem, using a weighted sum of an effectiveness loss (making reference inputs' features close to those of shadow data with triggers, while keeping reference input features consistent with the clean encoder) and a utility loss (keeping clean input features unchanged), and gradient descent is used to generate a backdoored encoder from the clean encoder.
Experiments and results
Self-trained encoders on CIFAR10, STL10, GTSRB, and SVHN, with real-world cases on the Google ImageNet encoder and OpenAI CLIP; the authors report high attack success rates with downstream accuracy largely maintained (a drop of no more than 1% in most scenarios), and simultaneous attacks on multiple target classes and multiple downstream tasks are also effective. Neural Cleanse and MNTD (including their extension to encoders) cannot detect it, the certified accuracy provided by PatchGuard is 0, and defenses are insufficient.
Limitations and future work
The authors leave joint optimization of trigger location and pixel values as future work; they also list directions: extending the attack to self-supervised learning in other domains such as NLP and graphs, designing new defenses against this attack, and studying how to pretrain encoders so that downstream classifiers are more robust to traditional backdoor attacks.
Why it was selectedThe paper presents a backdoor injection method and experimental data for pretrained encoders in self-supervised learning, and shows that existing backdoor defenses struggle to detect this attack.

The paper presents a backdoor injection method and experimental data for pretrained encoders in self-supervised learning, and shows that existing backdoor defenses struggle to detect this attack.

Read originalS&P 2022