Skip to content

tianshuocong/TePA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎃TePA (IEEE S&P 2024)

arXiv PyTorch

This repository contains the PyTorch implementation of the paper "Test-Time Poisoning Attacks Against Test-Time Adaptation Models" by Tianshuo Cong, Xinlei He, Yun Shen, and Yang Zhang. In particular, we propose the first test-time poisoning attack against four mainstream test-time adaptation methods, including TTT, DUA, TENT, and RPL. Here is the workflow of TePA:

The workflow of TePA

Citation ☺️

Thanks for your interest in our paper, please feel free to leave a ⭐️ or cite us through:

@inproceedings{cong2024tepa,
  title={Test-Time Poisoning Attacks Against Test-Time Adaptation Models},
  author={Tianshuo Cong and Xinlei He and Yun Shen and Yang Zhang},
  booktitle={IEEE Symposium on Security and Privacy (S\&P)},
  year={2024}
}

Requirements 🔧

TePA depends on the following requirements:

Baseline 🎯

  • First, we should check the utility of the frozen target model, and the utility of the TTT (using clean i.i.d. samples), run the following code, and then we can get the results of Figure 4 and Table 1 of our paper.
python TTT/utility.py
python DUA/utility.py
python TENT/utility.py --cfg cfgs/tent_sgd.yaml
python RPL/utility.py --cfg cfgs/rpl_sgd.yaml 

Poison TTA-models 🦠

Algorithm-1 is implemented in TTA/poigen.py, here we use DIM as the transfer-based adversarial attack method. After generating poisoned samples by poigen.py, we upload the poisoned samples to target TTA-models through running:

python TTT/poison_ttt.py
python DUA/poison_dua.py
python TENT/poison_tent.py --cfg cfgs/tent_sgd.yaml
python RPL/poison_rpl.py --cfg cfgs/rpl_sgd.yaml 

Then, we can get the results of Figure 5-8.

The workflow of TePA

Dataset 💾

Please download the following datasets through the official website and

Models 🕸

You can download the checkpoints here:

Acknowledgements 🌻

Our code is built upon the public code of the TTT, TENT, and DUA.

About

[S&P'24] Test-Time Poisoning Attacks Against Test-Time Adaptation Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages