Protecting Model Adaptation from Trojans in the Unlabeled Data

Lijun Sheng, Jian Liang, Ran He, Zilei Wang, Tieniu Tan

TL;DR

This paper introduces a novel backdoor attack targeting model adaptation techniques that use unlabeled target data. To combat this, they propose DIFFADAPT, a plug-and-play defense mechanism that effectively mitigates these attacks without sacrificing performance on clean data.

What Problem Does This Paper Address?

Deep learning models often suffer from "distribution shift," where their performance degrades when applied to data from a different domain than they were trained on. Domain adaptation aims to bridge this gap. A recent trend, "model adaptation," further enhances privacy by allowing adaptation using only a pre-trained source model, without direct access to the source data. This is particularly useful when source data is sensitive.

However, this reliance on unlabeled target data introduces a new security vulnerability: backdoor attacks. While traditional backdoor attacks embed malicious triggers into labeled data, adapting these attacks to unlabeled data is challenging because it's harder to establish a direct link between a trigger and a target class. This paper is the first to explore and demonstrate the effectiveness of such unsupervised backdoor attacks on model adaptation.

Methods

The authors first propose a method for injecting backdoors into model adaptation. This involves two key components:

  • Trigger Design:
    • Non-optimization-based trigger: They utilize the "Hello Kitty" pattern from the Blended attack, which is visually distinct but can be blended into images to create a subtle trigger.
  • Optimization-based trigger: They generate adversarial perturbations tailored to the target class, aiming to create a trigger that is effective and less detectable.
  • Data Poisoning Strategy:
    • Ground-truth-based: If the attacker has access to the true labels of the target data, they simply select samples belonging to the target class to poison.
  • Pseudo-label-based: If ground truth labels are unavailable, attackers use a pre-trained source model (like CLIP) to infer pseudo-labels and then select samples predicted to belong to the target class.

To defend against these attacks, they introduce DIFFADAPT. The core idea is to assign lower weights to potentially poisoned samples during the adaptation process. This is achieved by:

  1. Training a "risky" target model using a standard model adaptation algorithm on the (potentially poisoned) unlabeled target data.
  2. Calculating the distance between the output predictions of this risky model on original and perturbed versions of each unlabeled sample. Samples that are less sensitive to perturbation (i.e., show little change) are considered potentially poisoned.
  3. Assigning weights to samples based on this distance, averaged per pseudo-label.
  4. Retraining the target model using the adaptation algorithm with these re-weighted samples, effectively downplaying the influence of poisoned data.

DIFFADAPT is designed to be a "plug-and-play" solution, meaning it can be integrated with existing model adaptation algorithms without requiring significant modifications to their architecture or loss functions.

Datasets

The experiments were conducted on three commonly used model adaptation benchmarks:

  • Office: A dataset with 31 categories across three domains (Amazon, DSLR, Webcam). For experiments, they used a subset of tasks to avoid issues with small domain sizes.
  • OfficeHome: A larger dataset with 65 categories across four domains (Art, Clipart, Product, Real World).
  • miniDomainNet: A subset of the DomainNet dataset, chosen for its challenging nature with imbalanced classes and four domains (Clipart, Painting, Real, Sketch).

Key Insights and Ideas

  • Unsupervised Backdoors are Feasible: The paper demonstrates that it's possible to launch effective backdoor attacks on model adaptation even when only unlabeled target data is available, challenging the assumption that such attacks require labeled data.
  • Trigger Sensitivity is Key: The defense mechanism DIFFADAPT leverages the observation that poisoned samples, due to their dual nature (semantic features + trigger), are less sensitive to random noise perturbations compared to clean samples.
  • Plug-and-Play Defense: DIFFADAPT's design as a flexible, algorithm-agnostic defense is a significant practical advantage, allowing easy integration into existing adaptation pipelines.
  • Trade-off Between Attack and Defense: The authors show that while attacks can achieve high success rates with minimal impact on clean accuracy, the defense mechanism successfully reduces attack success rates while only incurring a small drop in clean accuracy.

Key Results

  • Attack Effectiveness: The proposed attack methods (Blended and perturbation triggers with both poisoning strategies) achieved high Attack Success Rates (ASR) across various datasets and adaptation algorithms. For example, on OfficeHome, the Blended trigger achieved an average ASR of 80.8% on SHOT and 86.9% on NRC.
  • Attack Concealment: The attacks maintained high clean accuracy, with only a small decrease (e.g., 0.6% on Office for Blended trigger).
  • DIFFADAPT Efficacy: DIFFADAPT significantly reduced ASR scores. On the Office dataset with the perturbation trigger, DIFFADAPT reduced ASR from 81.6% to 15.4% for SHOT and from 57.6% to 6.0% for NRC, while only causing a minor drop in clean accuracy (around 2.2%).
  • Versatility: The attack framework was shown to be effective across different backbone architectures (VGG, ViT, ConvNext, MobileNet, ResNet101).

Limitations and Future Work

  • Limited Task Scope: The current work focuses on classification tasks. Future work could explore more complex tasks and adaptation algorithms, especially those with more sophisticated optimization strategies that might make backdoor injection harder.
  • Computational Cost: DIFFADAPT requires training an initial "risky" model and then retraining, effectively doubling the computational cost compared to direct adaptation.
  • Defense Improvement: While DIFFADAPT is effective, the authors note that in some challenging cases (e.g., OfficeHome with Blended trigger), its performance was slightly surpassed by other baseline defenses (like FP), suggesting room for improvement.

The authors suggest future work could address these limitations to enhance the versatility and efficiency of their framework.

Summary updated

BibTeX
@inproceedings{sheng2025protecting,
  author = {Lijun Sheng and Jian Liang and Ran He and Zilei Wang and Tieniu Tan},
  title = {{Protecting Model Adaptation from Trojans in the Unlabeled Data}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i19.34250},
}
Figure