This repository contains the official PyTorch implementation of our paper: "CDMA: Query-Efficient Black-box Attack to Deep Neural Networks with Conditional Diffusion Models".
If you think this work or our codes are useful for your research, please cite our paper via:
@article{liu2024boosting,
title={Boosting Black-box Attack to Deep Neural Networks with Conditional Diffusion Models},
author={Liu, Renyang and Zhou, Wei and Zhang, Tianwei and Chen, Kangjie and Zhao, Jun and Lam, Kwok-Yan},
journal={IEEE Transactions on Information Forensics and Security},
year={2024},
volume={19},
pages={5207--5219},
publisher={IEEE}
}
To run this code, ensure you have the following packages installed:
torch>=1.7.0
torchvision>=0.8.1
tqdm>=4.31.1
pillow>=7.0.0
matplotlib>=3.2.2
numpy>=1.18.1
Installation of these packages can be achieved through pip:
bash pip install torch torchvision tqdm pillow matplotlib numpy
Download the pre-trained weights for the victim models and CDMA from GoogleDrive. After downloading, unzip the file into the root directory of this project.
bash scripts/attack.sh
bash scripts/attack_T.sh
This project is licensed under the MIT License - see the LICENSE file for details.
The implementation extends the functionality of the Palette-Image-to-Image-Diffusion-Models GitHub repository. Thanks for their excellent works!