Abstract
Model adaptation tackles the distribution shift problem with a pre-trained model instead of raw data, which has become a popular paradigm due to its great privacy protection. Existing methods always assume adapting to a clean target domain, overlooking the security risks of unlabeled samples. This paper for the first time explores the potential trojan attacks on model adaptation launched by well-designed poisoning target data. Concretely, we provide two trigger patterns with two poisoning strategies for different prior knowledge owned by attackers. These attacks achieve a high success rate while maintaining the normal performance on clean samples in the test stage. To defend against such backdoor injection, we propose a plug-and-play method named DiffAdapt, which can be seamlessly integrated with existing adaptation algorithms. Experiments across commonly used benchmarks and adaptation methods demonstrate the effectiveness of DiffAdapt. We hope this work will shed light on the safety of transfer learning with unlabeled data.
Introduction
Deep learning models often encounter performance degradation when deployed in a target domain that differs from their training (source) domain—a phenomenon known as distribution shift. Source-free model adaptation has emerged as a privacy-preserving solution, allowing users to update pre-trained models using only unlabeled data from the target domain without accessing sensitive source data.
However, this paradigm relies on the critical assumption that the unlabeled target data is benign. This research challenges this assumption by demonstrating that a malicious data provider can inject "trojans" or backdoors into the model during the adaptation process. By poisoning a small fraction of the unlabeled set, an attacker can force the model to learn a hidden association between a trigger (e.g., a specific pattern or logo) and a target class, while maintaining standard performance on clean data.
Trojan Attacks on Model Adaptation
The authors introduce a framework for poisoning unlabeled data using two distinct trigger types:
- Blended Trigger: A simple, non-optimized approach where a fixed pattern (e.g., a "Hello Kitty" image) is overlaid onto target samples.
- Optimization-based Trigger: A more sophisticated adversarial perturbation designed to maximize the model's misclassification towards a target label, making the attack harder to detect.
Since the target data is unlabeled, attackers employ two poisoning strategies based on their available knowledge:
- Ground-truth (GT) Strategy: If the attacker has access to labels, they poison samples belonging to the target class.
- Pseudo-label (PL) Strategy: If labels are unavailable, the attacker uses a zero-shot model like CLIP to identify high-confidence samples of the target class for poisoning.
DIFFADAPT: A Robust Defense
To counter these vulnerabilities, the researchers propose DIFFADAPT, a plug-and-play defense mechanism that can be integrated with popular adaptation algorithms like SHOT or NRC. The core insight behind DIFFADAPT is that poisoned samples are "over-determined"—they contain both legitimate semantic features and malicious trigger features. Consequently, these samples exhibit significantly lower sensitivity to random noise compared to clean samples.
The DIFFADAPT workflow consists of three stages:
- Direct Adaptation: A "risky" model is initially trained on the potentially poisoned target data.
- Weight Assignment: Random Gaussian noise is added to the data. The risky model's output variance is measured; samples with low variance (low sensitivity) are flagged as suspicious and assigned lower weights.
- Secure Adaptation: The model is retrained from scratch (or the original source weights) using the calculated weights, effectively filtering out the influence of poisoned samples.
Experimental Results
The effectiveness of both the attacks and the DIFFADAPT defense was evaluated on standard benchmarks: Office, OfficeHome, and miniDomainNet.
Attack Success
The proposed attacks proved highly effective. On the OfficeHome dataset, the Blended trigger achieved an Attack Success Rate (ASR) exceeding 80%, while the drop in Clean Accuracy (ACC) was typically less than 1%.
Defense Performance
DIFFADAPT successfully neutralized these threats across various adaptation methods. For instance, on the Office dataset using the SHOT algorithm, DIFFADAPT reduced the ASR of perturbation-based attacks from 81.6% to 15.4%. Crucially, this defense maintains high clean accuracy, with performance drops often limited to less than 2%.
Conclusion
This work highlights a significant security gap in unsupervised model adaptation. By demonstrating that unlabeled data can be a vector for trojan attacks, the authors underscore the need for robust verification in transfer learning. DIFFADAPT provides an effective, algorithm-agnostic defense that leverages noise sensitivity to distinguish between benign and malicious samples, paving the way for more secure model deployment in the wild.
Summary updated