Code Monkey home page Code Monkey logo

dadh's Introduction

Deep Adversarial Discrete Hashing for Cross-Modal Retrieval

Introduction

This is the source code of ICMR 2020 paper "Deep Adversarial Discrete Hashing for Cross-Modal Retrieval".

Requirements

  • Python 3.7.2
  • Pytorch 1.6.0
  • torchvision 0.7.0
  • CUDA 10.1 and cuDNN 7.6.4
##Install required libraries##
pip install -r requirements.txt

Train

##before train##
python -m visdom.server
##custom train##
python main.py train [--flag DATASET] [--batch_size BATCH_SIZE] [--lr LR]
                     [--valid_freq FRQ] [--bit CODE_LENGTH] [--lamb LAMBDA]
                     [--alpha ALPHA] [--gamma GAMMA] [--beta BETA] [--mu MU]
                     [--margin MARGIN] [--max_epoch MAX_ITER] [--vis_env VIS_ENV]
                     [--device DEVICE] [--dropout DROPOUT]


optional arguments:
  --flag DATASET        Dataset name.('mir' or 'nus')
  --batch_size BATCH_SIZE
                        Batch size.(default: 128)
  --lr LR               Learning rate.(default: 5e-5)
  --valid_freq FRQ      Valid frequency.(default: 1)
  --bit CODE_LENGTH
                        Binary hash code length.(default: 16,32,64)
  --lamb LAMBDA         Hyper-parameter.(default: 1)
  --alpha ALPHA         Hyper-parameter.(default: 10)
  --gamma GAMMA         Hyper-parameter.(default: 1)
  --beta BETA           Hyper-parameter.(default: 1)
  --mu MU               Hyper-parameter.(default: 1e-5)
  --margin MARGIN       Hyper-parameter.(default: 0.4)
  --max_epoch MAX_ITER  Number of iterations.(default: 300)
  --vis_env VIS_ENV     Visdom environment name.(default: 'main')
  --device DEVICE       If use gpu.(default: 'cuda:0')
  --dropout DROPOUT     If use dropout.(default: False)
  
##use our settings##
bash run_mir.sh CODE_LENGTH
bash run_nus.sh CODE_LENGTH

Test

##test##
python main.py test [--flag DATASET] [--bit CODE_LENGTH]

Datasets

Note: We extracted 4096-d features of the images in the datasets using CNN-F pre-trained on ImageNet.

Note

Our codes were modified from the implementation of "Adversary Guided Asymmetric Hashing for Cross-Modal Retrieval", written by Wen Gu. Please cite the two papers (AGAH and DADH) when you use the codes.

Citing DADH & AGAH

@inproceedings{Bai2020,
  author={Cong Bai, Chao Zeng, Qing Ma, Jinglin Zhang and Shengyong Chen.},
  booktitle={Proceedings of the 2020 on International Conference on Multimedia Retrieval},
  pages={525-531},
  title={Deep Adversarial Discrete Hashing for Cross-Modal Retrieval},
  year={2020},
}
@inproceedings{Gu2019,
author = {Gu, Wen and Gu, Xiaoyan and Gu, Jingzi and Li, Bo and Xiong, Zhi and Wang, Weiping},
booktitle = {Proceedings of the ACM International Conference on Multimedia Retrieval},
pages = {159--167},
title = {{Adversary guided asymmetric hashing for cross-modal retrieval}},
year = {2019}
}

dadh's People

Contributors

flyfish7 avatar

Watchers

 avatar  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.