Official pytorch implementation of the paper:
- Deep Polarized Network for Supervised Learning of Accurate Binary Hashing Codes (IJCAI 2020)
Released on July 7, 2021
https://github.com/swuxyj/DeepHash-pytorch/blob/master/DPN.py
python main.py
Run python main.py --help
to check what hyperparameters to run with. All the hyperparameters are the default parameters to get the performance in the paper.
python val.py -l /path/to/logdir -m 0 # normal
python val.py -l /path/to/logdir -m 1 # ternary
You may refer to this repo (https://github.com/swuxyj/DeepHash-pytorch) to download the datasets. I was using the same dataset format as HashNet.
Dataset sample: https://raw.githubusercontent.com/swuxyj/DeepHash-pytorch/master/data/imagenet/test.txt
I have found some tricks to further improve the mAP score.
If you shuffle the order of database before calculate_mAP
, you might get 1~2% improvement in mAP.
It is because many items with same hamming distance will not be sorted properly, hence it will affect the mAP calculation.
Run with --reg 0.001
might help to improve mAP a little bit.
Run with --centroid-method O
might help to improve mAP by 1~2%.
The original code base is the private asset of Webank. This repo is a re-implementation of the paper, therefore the performance you computed from this repo might not be exactly the same as the paper (but should be quite close with only +-1% difference)
Suggestions and opinions on this work (both positive and negative) are greatly welcomed. Please contact the authors by sending an email to lixinfan at webank.com
or kamwoh at gmail.com
or cs.chan at um.edu.my
.
The project is open source under BSD-3 license (see the LICENSE
file).
©2020 Webank and University of Malaya.