Giter VIP home page Giter VIP logo

tifs23-saat's Introduction

Semantic-Aware Adversarial Training for Reliable Deep Hashing Retrieval

This is the PyTorch code of the SAAT paper, which has been accepted by IEEE TIFS.

Requirements

The code has been tested on PyTorch 1.10. To install the dependencies, run

pip install -r requirements.txt

Usage

Training Deep Hashing Models

For example, training a deep hashing model with 32 code length on the NUS-WIDE dataset.

python hashing.py --train --bit 32 --dataset NUS-WIDE

After training, the well-trained models will be saved to checkpoint folder. We can evaluate its retrieval performance through MAP metric.

python hashing.py --test --bit 32 --dataset NUS-WIDE

Adversarial Attack

The following code performs adversarial attack against the well-trained model.

  • attack_method: name of adversarial attack algorithm, e.g., mainstay (our proposed mainstay codes-based semantic-aware attack).
python attack.py --bit 32 --dataset NUS-WIDE --attack_method mainstay

Adversarial Training

The following code performs adversarial training for the pre-trained model to alleviate the effects caused by adversarial perturbations.

  • adv_method: name of adversarial training algorithm, e.g., saat (the proposed semantic-aware adversarial training).
python defense.py --bit 32 --dataset NUS-WIDE --adv_method saat

Then, we again verify the robustness of the model trained with adversarial training.

  • adv: load model after adversarial training.
  • attack_method: name of adversarial attack algorithm.
  • adv_method: name of adversarial training algorithm.
python attack.py --bit 32 --dataset NUS-WIDE --attack_method mainstay --adv --adv_method saat 

Results

Comparison with other attack algorithms

adversarial attck

Precision-Recall curves

pr curves

Comparison with other adversarial training methods

adversarial training

Cite

If you find this work is useful, please cite the following:

@ARTICLE{10189878,
  author={Yuan, Xu and Zhang, Zheng and Wang, Xunguang and Wu, Lin},
  journal={IEEE Transactions on Information Forensics and Security}, 
  title={Semantic-Aware Adversarial Training for Reliable Deep Hashing Retrieval}, 
  year={2023},
  volume={18},
  number={},
  pages={4681-4694},
  doi={10.1109/TIFS.2023.3297791}}

tifs23-saat's People

Contributors

xandery-geek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.