BAGEL: Backdoor Attacks against Federated Contrastive Learning

Yao Huang, Kongyang Chen, Jiannong Cao, Jiaxing Shen, Shaowei Wang, Yun Peng, Weilong Peng, Kechao CaiarXiv 2023 · DOI · arXiv

Introduction

Federated Learning (FL) has emerged as a powerful paradigm for training machine learning models on distributed data while preserving user privacy. However, traditional FL relies on labeled data, which is often scarce in real-world scenarios. Federated Contrastive Learning (FCL) addresses this by enabling clients to collaboratively train a task-agnostic global encoder using self-supervised learning on unlabeled data. This encoder then serves as a general-purpose feature extractor for various downstream tasks.

While FL is known to be susceptible to backdoor attacks, FCL introduces unique challenges for adversaries. This paper presents BAGEL, the first systematic study of backdoor attacks against FCL, demonstrating that even without labels or knowledge of specific downstream tasks, malicious actors can effectively compromise the system.

The Vulnerability of Task-Agnostic Encoders

Traditional backdoor attacks typically involve flipping labels in a poisoned dataset to force a model to misclassify specific triggered inputs. In FCL, this approach fails for two primary reasons:

  1. Lack of Labels: FCL operates on unlabeled data, making label-flipping impossible.
  2. Task Agnosticism: The global encoder is trained to be a general feature extractor. The attacker may not know which specific downstream tasks (e.g., digit recognition vs. traffic sign classification) will eventually utilize the encoder.

BAGEL overcomes these hurdles by targeting the feature representation space directly rather than the final classification layer.

The BAGEL Attack Methodology

The core idea behind BAGEL is to manipulate the encoder's latent space. The attacker selects a target class from a potential downstream task and obtains a few "reference" images of that class. During local training, the malicious client embeds a visual trigger (e.g., a small patch) into their unlabeled data.

The BAGEL framework illustrates how a malicious client injects a backdoor into the global encoder, which then propagates to multiple downstream tasks.

The attacker modifies the contrastive loss function to minimize the distance between the feature embeddings of these triggered images and the embeddings of the reference images. When the server aggregates these poisoned updates, the global encoder learns to map any input containing the trigger to the feature space of the target class. Consequently, any downstream model built upon this encoder will misclassify triggered inputs as the target class.

Attack Strategies: Centralized vs. Decentralized

The authors explore two primary attack configurations:

  • Centralized Attack: Multiple malicious clients collude to target the same downstream task and class. While effective, the high similarity between their model updates makes them vulnerable to detection by defenses like FoolsGold.
  • Decentralized Attack: Each malicious client targets a different downstream task or class independently.
Comparison between centralized and decentralized attack strategies and their impact on the representation space.

The decentralized approach is particularly insidious. Because each attacker pushes the model in a different direction in the feature space, their updates appear distinct and "benign" to similarity-based defenses. This allows the attack to bypass state-of-the-art federated learning protections while still successfully poisoning the global model for multiple tasks.

Experimental Results

The effectiveness of BAGEL was evaluated across several standard datasets, including SVHN, CIFAR10, and GTSRB. Key findings include:

  • High Success Rates: In multi-shot scenarios, decentralized attacks achieved Attack Success Rates (ASR) exceeding 95% on CIFAR10 and GTSRB.
  • Robustness to Data Distribution: The attacks remained highly effective even in non-IID (Independent and Identically Distributed) settings, where benign clients have significantly different data distributions.
  • Stealth and Defense Evasion: While the centralized attack was thwarted by the FoolsGold defense, the decentralized variant maintained its high ASR, effectively "hiding" among benign updates.
  • Impact of Attacker Data: The attack's potency increases when the adversary uses diverse, high-quality local data (like ImageNet32) that shares structural features with the target downstream tasks.

Conclusion

BAGEL demonstrates a critical security flaw in Federated Contrastive Learning. By shifting the attack surface from labels to the feature representation space, adversaries can inject "Trojan Horse" backdoors into foundational encoders that compromise future, unknown downstream tasks. The success of decentralized strategies further highlights the need for new defense mechanisms that go beyond simple update-similarity checks to protect the integrity of self-supervised federated systems.

Summary updated

Abstract

Federated Contrastive Learning (FCL) is an emerging privacy-preserving paradigm in distributed learning for unlabeled data. In FCL, distributed parties collaboratively learn a global encoder with unlabeled data, and the global encoder could be widely used as a feature extractor to build models for many downstream tasks. However, FCL is also vulnerable to many security threats (e.g., backdoor attacks) due to its distributed nature, which are seldom investigated in existing solutions. In this paper, we study the backdoor attack against FCL as a pioneer research, to illustrate how backdoor attacks on distributed local clients act on downstream tasks. Specifically, in our system, malicious clients can successfully inject a backdoor into the global encoder by uploading poisoned local updates, thus downstream models built with this global encoder will also inherit the backdoor. We also investigate how to inject backdoors into multiple downstream models, in terms of two different backdoor attacks, namely the \textit{centralized attack} and the \textit{decentralized attack}. Experiment results show that both the centralized and the decentralized attacks can inject backdoors into downstream models effectively with high attack success rates. Finally, we evaluate two defense methods against our proposed backdoor attacks in FCL, which indicates that the decentralized backdoor attack is more stealthy and harder to defend.
BibTeX
@misc{huang2023bagel,
  author = {Yao Huang and Kongyang Chen and Jiannong Cao and Jiaxing Shen and Shaowei Wang and Yun Peng and Weilong Peng and Kechao Cai},
  title = {{BAGEL: Backdoor Attacks against Federated Contrastive Learning}},
  year = {2023},
  eprint = {2311.16113},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.16113},
}
Figure