Deep Hashing with Triplet Labels and Unification Binary Code Selection for Fast Image Retrieval

  • Chang ZhouEmail author
  • Lai-Man Po
  • Mengyang Liu
  • Wilson Y. F. Yuen
  • Peter H. W. Wong
  • Hon-Tung Luk
  • Kin Wai Lau
  • Hok Kwan Cheung
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11295)


With the significant breakthrough of computer vision using convolutional neural networks, deep learning has been applied to image hashing algorithms for efficient image retrieval on large-scale datasets. Inspired by Deep Supervised Hashing (DSH) algorithm, we propose to use triplet loss function with an online training strategy that takes three images as training inputs to learn compact binary codes. A relaxed triplet loss function is designed to maximize the discriminability with consideration of the balance property of the output space. In addition, a novel unification binary code selection algorithm is also proposed to represent the scalable binary code in an efficient way, which can fix the problem of conventional deep hashing methods that generate different lengths of binary code by retraining. Experiments on two well-known datasets of CIFAR-10 and NUS-WIDE show that the proposed DSH with use of unification binary code selection can achieve promising performance as compared with conventional image hashing and CNN-based hashing algorithms.


Deep hashing Unification binary code selection Triplet loss 


  1. 1.
    Krizhevsky, A., Sutskever, I., Hinton, G.E.: ImageNet classification with deep convolutional neural networks. In: Advances in Neural Information Processing Systems, pp. 1097–1105 (2012)Google Scholar
  2. 2.
    Gionis, A., Indyk, P., Motwani, R.: Similarity search in high dimensions via hashing. In: VLDB, pp. 518–529 (1999)Google Scholar
  3. 3.
    Eakins, J., Graham, M.: Content-based image retrieval (1999)Google Scholar
  4. 4.
    Norouzi, M., Fleet, D.J.: Minimal loss hashing for compact binary codes. In: ICML 2011, pp. 353–360 (2011)Google Scholar
  5. 5.
    Liu, H., Wang, R., Shan, S., Chen, X.: Deep supervised hashing for fast image retrieval. In: IEEE Conference on Computer Vision and Pattern Recognition, pp. 2064–2072 (2016)Google Scholar
  6. 6.
    Li, W.-J., Wang, S., Kang, W.-C.: Feature learning based deep supervised hashing with pairwise labels. In: International Joint Conference on Artificial Intelligence (2016)Google Scholar
  7. 7.
    Wang, X., Shi, Y., Kitani, Kris M.: Deep supervised hashing with triplet labels. In: Lai, S.-H., Lepetit, V., Nishino, K., Sato, Y. (eds.) ACCV 2016. LNCS, vol. 10111, pp. 70–84. Springer, Cham (2017). Scholar
  8. 8.
    Lai, H., Pan, Y., Liu, Y., Yan, S.: Simultaneous feature learning and hash coding with deep neural networks. In: Computer Vision and Pattern Recognition, pp. 3270–3278 (2015)Google Scholar
  9. 9.
    Krizhevsky, A., Hinton, G.: Learning multiple layers of features from tiny images (2009)Google Scholar
  10. 10.
    Chua, T.S., Tang, J., Hong, R., Li, H., Luo, Z., Zheng, Y.: NUS-WIDE: a real-world web image database from national university of Singapore. In: Proceedings of the ACM International Conference on Image and Video Retrieval. ACM (2009)Google Scholar
  11. 11.
    Lin, K., Yang, H.-F., Hsiao, J.-H., Chen, C.-S.: Deep learning of binary hash codes for fast image retrieval. In: Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 27–35 (2015)Google Scholar
  12. 12.
    Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. In: ICLR (2015)Google Scholar
  13. 13.
    Weiss, Y., Torralba, A., Fergus, R.: Spectral hashing. In: Advances in Neural Information Processing Systems, pp. 1753–1760 (2008)Google Scholar
  14. 14.
    Gong, Y., Lazebnik, S.: Iterative quantization: a procrustean approach to learning binary codes. In: Computer Vision and Pattern Recognition (CVPR), pp. 817–824 (2011)Google Scholar
  15. 15.
    Xia, R., Pan, Y., Lai, H., Liu, C., Yan, S.: Supervised hashing for image retrieval via image representation learning. In: Twenty-Eighth AAAI Conference on Artificial Intelligence (2014)Google Scholar
  16. 16.
    Liu, W., Wang, J., Ji, R., Jiang, Y.-G., Chang, S.-F.: Supervised hashing with kernels. In Computer Vision and Pattern Recognition (CVPR) 2012, pp. 2074–2081 (2012)Google Scholar
  17. 17.
    Yang, H.-F., Lin, K., Chen. C.-S.: Supervised learning of semantics-preserving hash via deep convolutional neural networks. IEEE Trans. Pattern Anal. Mach. Intell. 40(2), 437–451 (2018)CrossRefGoogle Scholar
  18. 18.
    Paszke, A., et al.: Automatic differentiation in PyTorch (2017)Google Scholar
  19. 19.
    Kulis, B., Darrell, T.: Learning to hash with binary reconstructive embeddings. In: Advances in Neural Information Processing Systems, pp. 1042–1050 (2009)Google Scholar
  20. 20.
    Lowe, D.G.: Distinctive image features from scale-invariant keypoints. Int. J. Comput. Vis. 60(2), 91–110 (2004)MathSciNetCrossRefGoogle Scholar
  21. 21.
    Shen, F., Shen, C., Liu, W., Tao Shen, H.: Supervised discrete hashing. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 37–45 (2015)Google Scholar
  22. 22.
    Lin, G., et al.: Fast supervised hashing with decision trees for high-dimensional data. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (2014)Google Scholar
  23. 23.
    Kang, W.-C., Wu-Jun, L., Zhou, Z.-H.: Column sampling based discrete supervised hashing. In: AAAI, pp. 1230–1236 (2016)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Chang Zhou
    • 1
    Email author
  • Lai-Man Po
    • 1
  • Mengyang Liu
    • 1
  • Wilson Y. F. Yuen
    • 2
  • Peter H. W. Wong
    • 2
  • Hon-Tung Luk
    • 2
  • Kin Wai Lau
    • 2
  • Hok Kwan Cheung
    • 2
  1. 1.Department of Electronic EngineeringCity University of Hong KongKowloonHong Kong
  2. 2.TFI Digital Medial Limited, InnoCentreKowloonHong Kong

Personalised recommendations