This is the code for "Targeted Transferable Attack against Deep Hashing Retrieval".
- python 3.8
- torch 1.10
- torchvision 0.11
- numpy 1.20
- We consider four previous targeted attack methods as our competitors: DHTA (P2P), THA, ProS_GAN and NAG.
- To evaluate the targeted transferability of different methods, we test the performance on five deep hashing methods, i.e., DPSH, HashNet, CSQ, DSDH and ADSH. Our implementations are modified based on DeepHash-pytorch.
data
contains the dataset files utilized in this paper.Hash
contains the implementations of five deep hashing methods.utils
contains all the tools used for training models.models
contains the implementations of our method.
You can easily train deep hashing models by replacing the path of data in the code, and then run
cd Hash
python DPSH.py
python HashNet.py
python CSQ.py
python DSDH.py
python ADSH.py
After setting the dataset and target model paths, you can generate anchor code by running
cd models
python IAO.py
Initialize the hyperparameters following our paper and then run
cd models
python TTA_GAN.py
To conduct model ensemble attack, you can run
cd models
python Ens.py
The codes are modified based on Wang et al. 2021.
If you find this work is useful, please cite the following:
@inproceedings{zhu2023targeted,
title={Targeted Transferable Attack against Deep Hashing Retrieval},
author={Zhu, Fei and Zhang, Wanqian and Wu, Dayan and Wang, Lin and Li, Bo and Wang, Weiping},
booktitle={Proceedings of the 5th ACM International Conference on Multimedia in Asia},
pages={1--7},
year={2023}
}