Piecewise supervised deep hashing for image retrieval

  • Yannuan Li
  • Lin WanEmail author
  • Ting Fu
  • Weijun Hu


In this paper, we propose a novel hash code generation method based on convolutional neural network (CNN), called the piecewise supervised deep hashing (PSDH) method to directly use a latent layer data and the output layer result of the classification network to generate a two-segment hash code for every input image. The first part of the hash code is the class information hash code, and the second part is the feature message hash code. The method we proposed is a point-wise approach and it is easy to implement and works very well for image retrieval. In particular, it performs excellently in the search of pictures with similar features. The more similar the images are in terms of color and geometric information and so on, the better it will rank above the search results. Compared with the hashing method proposed so far, we keep the whole hashing code search method, and put forward a piecewise hashing code search method. Experiments on three public datasets demonstrate the superior performance of PSDH over several state-of-art methods.


CNN Supervise Hash Image retrieval 



  1. 1.
    Andoni A, Indyk P (2006) Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions. FOCS, IEEE Comput Soc: 459–468Google Scholar
  2. 2.
    Andoni A, Razenshteyn I (2015) Optimal data-dependent hashing for approximate near neighbors. STOC, Full version at
  3. 3.
    Datar M, Immorlica N, Indyk P, Mirrokni VS (2004) Locality-sensitive hashing scheme based on p-stable distributions. Sym Comput Geomet: 253–262Google Scholar
  4. 4.
    Eakins J, Graham M (1999) Content-based image retrieval, Technical Report, University of Northumbria at NewcastleGoogle Scholar
  5. 5.
    Gionis A, Indyk P, Motwani R (1999) Similarity search in high dimensions via hashing. In M. P. Atkinson, M. E. Orlowska, P. Valduriez, S. B. Zdonik, and M. L. Brodie, editors, VLDB'99, Proceedings of 25th International Conference on Very Large Data Bases, September 7–10, 1999, Edinburgh, Scotland, UK, pages 518–529. Morgan Kaufmann, 6Google Scholar
  6. 6.
    Gong Y, Lazebnik S (2011) Iterative quantization: a procrustean approach to learning binary codes. Proc CVPR: 817–824Google Scholar
  7. 7.
    Guo Y, Zhao X, Ding G, Han J (2018) On trivial solution and high correlation problems in deep supervised hashing. Proc Thirty-Second AAAI Conf Artif Intell, New Orleans, Louisiana, USA, February 2–7, 2018, 2018. [Online]. Available:
  8. 8.
    Jiang Q-Y, Li W-J (2015) Scalable graph hashing with feature transformation. Proc Int Joint Conf Artif IntellGoogle Scholar
  9. 9.
    Kang W-C, Li W-J, Zhou Z-H (2016) Column sampling based discrete supervised hashing. AAAIGoogle Scholar
  10. 10.
    Kong W, Li W-J (2012) Isotropic hashing. NIPS: 1655–1663Google Scholar
  11. 11.
    Krizhevsky A, Sutskever I, Hinton GE (2012) Imagenet classification with deep convolutional neural networks. Adv Neural Inform Process Syst: 1097–1105Google Scholar
  12. 12.
    Kulis B, Darrell T (2009) Learning to hash with binary reconstructive embeddings. NIPS 22Google Scholar
  13. 13.
    Lai H, Pan Y, Liu Y, Yan S (2015) Simultaneous feature learning and hash coding with deep neural networks. Proc IEEE Conf Comput Vis Pattern Recogn: 3270–3278Google Scholar
  14. 14.
    Li W-J, Wang S, Kang W-C (2016) Feature learning based deep supervised hashing with pairwise labels. IJCAIGoogle Scholar
  15. 15.
    Li J, Wu Y, Zhao J, Lu K (2016) Multi-manifold sparse graph embedding for multi-modal image classification. Neurocomputing 173:501–510CrossRefGoogle Scholar
  16. 16.
    Li J, Zhao J, Lu K (2016) Joint feature selection and structure preservation for domain adaptation. IjCAIGoogle Scholar
  17. 17.
    Li J, Wu Y, Zhao J, Lu K (2017) Low-rank discriminant embedding for multiview learning. IEEE Trans Cybernet 47(11):3516–3529CrossRefGoogle Scholar
  18. 18.
    Li J., Lu K, Huang Z, Zhu L, Shen HT.: (2018) Transfer independently together: a generalized framework for domain adaptation. IEEE TCYBGoogle Scholar
  19. 19.
    Lin K, Yang H-F, Hsiao J-H, Chu-Song Chen (2015) Deep learning of binary hash codes for fast image retrieval. CVPR Workshops: 27–35Google Scholar
  20. 20.
    Liong VE, Lu J, Wang G, Moulin P, Zhou J (2015) Deep hashing for compact binary codes learning. Proc IEEE Conf Comput Vis Pattern Recogn: 2475–2483Google Scholar
  21. 21.
    Liu Y, Zhang D, Lu G, Ma W-Y (2007) A survey of content-based image retrieval with high-level semantics. Pattern Recogn 40(1):262–282CrossRefGoogle Scholar
  22. 22.
    Liu W, Wang J, Ji R, Jiang Y-G, Chang S-F (2012) Supervised hashing with kernels. CVPR: 2074–2081Google Scholar
  23. 23.
    Liu W, Mu C, Kumar S, Chang S-F (2014) Discrete graph hashing, in advances in neural information processing systems. MIT Press, Cambridge, pp 3419–3427Google Scholar
  24. 24.
    Liu H, Ji R, Wu Y, Liu W (2016) Towards optimal binary code learning via ordinal embedding. Proc AAAI Conf Artif Intell: 674–685Google Scholar
  25. 25.
    Liu H, Wang R, Shan S, Chen X (2016) Deep supervised hashing for fast image retrieval. CVPR: 2064–2072Google Scholar
  26. 26.
    Lu X, Song L, Xie R, Yang X, Zhang W (2017) Deep binary representation for efficient image retrieval. Adv MultimedGoogle Scholar
  27. 27.
    Luo X, Nie L, He X, Wu Y, Zhen-Duo C, Xu X-S (2018) Fast scalable supervised hashing. In SIGIRGoogle Scholar
  28. 28.
    Nie L, Yan S, Wang M, Hong R, Chua T-S (2012) Harvesting visual concepts for image search with complex queries. Multimed: 59–68Google Scholar
  29. 29.
    Nie LN, Wang M, Zha Z, Chua T-S (2012) Oracle in image search: a content-based approach to performance prediction. TOISGoogle Scholar
  30. 30.
    Norouzi M, Fleet DJ (2011) Minimal loss hashing for compact binary codes. ICML: 353–360Google Scholar
  31. 31.
    Shen F et al (2017) Asymmetric binary coding for image search. IEEE Trans Multimed 19(19):2022–2032CrossRefGoogle Scholar
  32. 32.
    Shen F, Gao X, Liu L, Yang Y, Shen H (2017) Deep asymmetric pairwise hashing. ACM MMGoogle Scholar
  33. 33.
    Simonyan K, Zisserman A (2014) Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556Google Scholar
  34. 34.
    Smeulders A, Worring M, Santini S, Gupta A, Jain R (2000) Content-based image retrieval at the end of early years. IEEE Trans Pattern Anal Mach Intel 22:1349–1380CrossRefGoogle Scholar
  35. 35.
    Wan J, Wang D, Hoi SCH, Wu P, Zhu J, Zhang Y, Li J (2014) Deep learning for content-based image retrieval: a comprehensive study. ACM Multimed: 157–166Google Scholar
  36. 36.
    Wang D, Huang H, Lu C, Feng B-S, Nie L, Wen G, Mao X-L (2017) Supervised deep hashing for hierarchical labeled data. arXiv preprintarXiv:1704.02088Google Scholar
  37. 37.
    Weiss Y, Torralba A, Fergus R (2008) Spectral hashing. NIPSGoogle Scholar
  38. 38.
    Xia R, Pan Y, Lai H, Liu C, Yan S (2014) Supervised hashing for image retrieval via image representation learning, Proc. AAAI: 2156–2162Google Scholar
  39. 39.
    Xie L, Shen J, Zhu L (2016) Online cross-modal hashing for Web image retrieval, Proc AAAI Conf Artif Intell, pp. 294–300Google Scholar
  40. 40.
    Xie L, Shen J, Han J, Zhu L, Shao L (2017) Dynamic multi-view hashing for online image retrieval. Int Joint Conf Artif Intell: 3133–3139Google Scholar
  41. 41.
    Zeiler MD, Fergus R (2014) Visualizing and understanding convolutional networks. CoRR, abs/1311.2901, 2013. Published in Proc. ECCVGoogle Scholar
  42. 42.
    Zheng F, Shao L (2016) Learning cross-view binary identities for fast person re-identification. Int Joint Conf Artif IntellGoogle Scholar
  43. 43.
    Zheng F, Tang Y, Shao L (2016) Hetero-manifold regularization for cross-modal hashing. IEEE Trans Pattern Anal Mach IntellGoogle Scholar
  44. 44.
    Zhu H, Long M, Wang J, Cao Y (2016) Deep hashing network for efficient similarity retrieval. AAAIGoogle Scholar
  45. 45.
    Zhu L, Huang Z, Chang X, Song J, Shen HT (2017) Exploring consistent preferences: discrete hashing with pair-exemplar for scalable landmark search. Proc ACM Int Conf Multimed (MM): 726–734Google Scholar
  46. 46.
    Zhu L, Huang Z, Liu X et al (2017) Discrete multi-modal hashing with canonical views for robust mobile landmark search. IEEE Trans Multimed 19(9):2066–2079CrossRefGoogle Scholar
  47. 47.
    Zhu L, Huang Z, Li Z et al (2018) Exploring auxiliary context: discretesemantic transfer hashing for scalable image retrieval. IEEE Trans Neural Netw Learn Syst 99:1–13. CrossRefGoogle Scholar
  48. 48.
    Zhuang B, Lin G, Shen C, Reid ID (2016) Fast training of triplet-based deep binary embedding networks. CVPR: 5955–5964Google Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  1. 1.School of Computer Science and TechnologyHuazhong University of Science and TechnologyWuhanChina
  2. 2.China School of Software EngineeringHuazhong University of Science and TechnologyWuhanChina

Personalised recommendations