PengBoXiangShang / deep-mihash

Code for papers "Hashing with Mutual Information" (TPAMI 2019) and "Hashing with Binary Matrix Pursuit" (ECCV 2018)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hashing with Mutual Information

This repository contains the MATLAB implementation of the following paper:

Hashing with Mutual Information,
Fatih Cakir*, Kun He*, Sarah Adel Bargal, and Stan Sclaroff. TPAMI 2019 (PDF, arXiv)

If you use this code in your research, please cite:

@inproceedings{Cakir_deep_mihash,
  author    = {Fatih Cakir and Kun He and Sarah Adel Bargal and Stan Sclaroff},
  title     = {Hashing with Mutual Information},
  booktitle = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year      = {2019},
}

⚠️ The hbmp branch contains the implementation of the following paper:

Hashing with Binary Matrix Pursuit,
Fatih Cakir, Kun He, and Stan Sclaroff. ECCV 2018 (conference page, arXiv)

If you use this code in your research, please cite:

@InProceedings{Cakir_2018_ECCV,
author = {Cakir, Fatih and He, Kun and Sclaroff, Stan},
title = {Hashing with Binary Matrix Pursuit},
booktitle = {The European Conference on Computer Vision (ECCV)},
year = {2018}
}

Setup

  • Install or symlink MatConvNet at ./matconvnet (for training CNNs)
  • Install or symlink VLFeat at ./vlfeat
  • Download necessary datasets to ./cachedir/data/ Note: Large file ~35GB
  • Download necessary model files to ./cachedir/models/
  • Create ./cachedir/results/ folder to hold experimental data
  • In the root folder, run startup.m

⚠️ Follow the setup instructions for HBMP in the hbmp branch.

Example Commands

  • The main functions for experimenting are demo_imagenet.m (for the ImageNet100 benchmark) and demo_AP.m (for other benchmarks such as CIFAR-10 and NUSWIDE).
  • The main arguments can be found in get_opts.m.
  • Below are examples commands to replicate some of the results in the paper. Please refer to Section 5 of the paper and get_opts.m for experimental setting and parameter details. A MATLAB diary will be saved to the corresponding experimental folder.
    • CIFAR-1 32 bits:
      • demo_AP('cifar',32,'vggf','split',1,'nbins',32,'sigmf', [1 0],'lr', 1e-3,'lrstep',50,'epoch',100,'obj','mi','testInterval',10, 'batchSize', 256, 'metrics', 'AP')
      • Diary. Achieves 0.78-0.79 mAP at 100 epochs.
    • CIFAR-2 32 bits:
      • demo_AP('cifar',32,'vggf','split',2,'nbins',12,'sigmf', [30 0],'lr', 2e-3,'lrstep',50,'epoch',100,'obj','mi','testInterval',10, 'batchSize', 256, 'metrics', 'AP')
      • Diary. Achieves 0.93-0.94 mAP at 100 epochs.
    • NUSWIDE-1 32 bits :
      • demo_AP('nus',32,'vggf_ft','split',1, 'nbins',16,'sigmf', [1 0],'lr', 0.05,'lrstep',50, 'epoch',120,'obj','mi','testInterval',10, 'batchSize', 250, 'metrics', {'AP','AP@5000', 'AP@50000'})
      • Diary. Achieves 0.82-0.83 mAP@5K at 120 epochs.
    • NUSWIDE-2 32 bits :
      • demo_AP('nus',32,'vggf_ft','split',2, 'nbins',16,'sigmf', [1 0],'lr', 0.01,'lrstep',50, 'epoch',100,'obj','mi','testInterval',5, 'batchSize', 250, 'metrics', {'AP','AP@5000', 'AP@50000'})
      • Diary. Achieves 0.81-0.82 mAP@50K at 100 epochs.
    • ImageNet100 48 bits:
      • demo_imagenet(48, 'alexnet_ft', 'split', 1 , 'nbins', 16, 'lr', 0.1, 'lrdecay', 0.05, 'lrmult', 0.01, 'lrstep', 100, 'nbins', 16, 'sigmf', [10 0], 'testInterval', 25, 'metrics', {'AP', 'AP@1000'}, 'epoch', 125)
      • Diary. Achieves 0.68-0.69 mAP@1K at 125 epochs.

License

MIT License, see LICENSE

Contact

For questions and comments, feel free to contact: fcakirs@gmail.com

Notes

  • This implementation extends MIHash, and is specifically designed for deep learning experiments. Special thanks to Kun and Sarah.

About

Code for papers "Hashing with Mutual Information" (TPAMI 2019) and "Hashing with Binary Matrix Pursuit" (ECCV 2018)

License:Other


Languages

Language:MATLAB 100.0%