Skip to main content
Log in

Hadamard Matrix Guided Online Hashing

  • Published:
International Journal of Computer Vision Aims and scope Submit manuscript

Abstract

Online image hashing has attracted increasing research attention recently, which receives large-scale data in a streaming manner to update the hash functions on-the-fly. Its key challenge lies in the difficulty of balancing the learning timeliness and model accuracy. To this end, most works follow a supervised setting, i.e., using class labels to boost the hashing performance, which defects in two aspects: first, strong constraints, e.g., orthogonal or similarity preserving, are used, which however are typically relaxed and lead to large accuracy drops. Second, large amounts of training batches are required to learn the up-to-date hash functions, which largely increase the learning complexity. To handle the above challenges, a novel supervised online hashing scheme termed Hadamard Matrix Guided Online Hashing (HMOH) is proposed in this paper. Our key innovation lies in introducing Hadamard matrix, which is an orthogonal binary matrix built via Sylvester method. In particular, to release the need of strong constraints, we regard each column of Hadamard matrix as the target code for each class label, which by nature satisfies several desired properties of hashing codes. To accelerate the online training, LSH is first adopted to align the lengths of target code and to-be-learned binary code. We then treat the learning of hash functions as a set of binary classification problems to fit the assigned target code. Finally, extensive experiments on four widely-used benchmarks demonstrate the superior accuracy and efficiency of HMOH over various state-of-the-art methods. Codes can be available at https://github.com/lmbxmu/mycode.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28
Fig. 29
Fig. 30
Fig. 31

Similar content being viewed by others

Notes

  1. Our test with 32-bit on CIFAR-10 shows that classification has less averaged quantization error of 2.861 than regression of 4.543.

  2. Take the Places205 dataset as an example: There are in total 205 categories. According to Eq. 10, \(r^* = 256\) for the code length r varying from 8 to 128.

  3. When \(r^* = r\), we set \(\tilde{{\mathbf {W}}}\) as an identity matrix and the above equation still holds.

  4. Since it is just a matrix-addition operation at each stage.

  5. \({\tilde{W}}\) is a random matrix that need not be optimized. When \(r=r^*\), we set \({\tilde{W}}\) as an identity matrix

References

  • Babenko, B., Yang, MH., & Belongie, S. (2009). A family of online boosting algorithms. In International conference on computer vision (ICCV Workshops) (pp. 1346–1353).

  • Cakir, F., & Sclaroff, S. (2015). Adaptive hashing for fast similarity search. In International conference on computer vision (ICCV) (pp. 1044–1052).

  • Cakir, F., Bargal, S. A., & Sclaroff, S. (2017a). Online supervised hashing. Computer Vision and Image Understanding (CVIU), 156, 162–173.

    Article  Google Scholar 

  • Cakir, F., He, K., Adel Bargal, S., & Sclaroff, S. (2017b). Mihash: Online hashing with mutual information. In International conference on computer vision (ICCV) (pp. 437–445).

  • Chen, X., King, I., & Lyu, MR. (2017). Frosh: Faster online sketching hashing. In The conference on uncertainty in intelligence.

  • Chua, T. S., Tang, J., Hong, R., Li, H., Luo, Z., & Zheng, Y. (2009). Nus-wide: A real-world web image database from national university of Singapore. In International conference on image and video retrieval (CIVR) (pp. 1–9).

  • Cover, T. M., & Thomas, J. A. (2012). Elements of information theory. Hoboken: Wiley.

    MATH  Google Scholar 

  • Crammer, K., Dekel, O., Keshet, J., Shalev-Shwartz, S., & Singer, Y. (2006). Online passive–aggressive algorithms. Journal of Machine Learning Research (JMLR), 7, 551–585.

    MathSciNet  MATH  Google Scholar 

  • Datar, M., Immorlica, N., Indyk, P., & Mirrokni, VS. (2004). Locality-sensitive hashing scheme based on p-stable distributions. In Symposium on computational geometry (SoCG) (pp. 253–262).

  • Deng, C., Yang, E., Liu, T., Li, J., Liu, W., & Tao, D. (2019). Unsupervised semantic-preserving adversarial hashing for image search. IEEE Transactions on Image Processing (TIP), 28, 4032–4044.

    Article  MathSciNet  Google Scholar 

  • Deng, J., Dong, W., Socher, R., Li, L. J., Li, K., & Fei-Fei, L. (2009). Imagenet: A large-scale hierarchical image database. In Computer vision and pattern recognition (CVPR) (pp. 248–255).

  • Freund, Y., & Schapire, R. E. (1999). Large margin classification using the perceptron algorithm. Machine Learning (ML), 37, 277–296.

    Article  Google Scholar 

  • Gionis, A., Indyk, P., Motwani, R., et al. (1999). Similarity search in high dimensions via hashing. Very Large Data Bases Conferences (VLDB), 99, 518–529.

    Google Scholar 

  • Goldberg, K. (1966). Hadamard matrices of order cube plus one. Transactions of the American Mathematical Society (AMS), 17, 744–746.

    MathSciNet  MATH  Google Scholar 

  • Gong, Y., Lazebnik, S., Gordo, A., & Perronnin, F. (2012). Iterative quantization: A procrustean approach to learning binary codes for large-scale image retrieval. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 35, 2916–2929.

    Article  Google Scholar 

  • Gui, J., Liu, T., Sun, Z., Tao, D., & Tan, T. (2017). Fast supervised discrete hashing. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 40, 490–496.

    Article  Google Scholar 

  • Horadam, K. J. (2012). Hadamard matrices and their applications. Princeton: Princeton University Press.

    MATH  Google Scholar 

  • Huang, L. K., Yang, Q., & Zheng, W. S. (2013). Online hashing. In International Joint Conference on Artificial Intelligence (IJCAI) (pp. 1422–1428).

  • Huang, L. K., Yang, Q., & Zheng, W. S. (2017). Online hashing. IEEE Transactions on Neural Networks and Learning Systems (TNNLS), 29, 2309–2322.

    Article  MathSciNet  Google Scholar 

  • Jiang, J., & Tu, Z. (2009). Efficient scale space auto-context for image segmentation and labeling. In Computer vision and pattern recognition (CVPR) (pp. 1810–1817).

  • Kittler, J., Ghaderi, R., Windeatt, T., & Matas, J. (2001). Face verification using error correcting output codes. Computer Vision and Pattern Recognition (CVPR), 21, 1163–1169.

    MATH  Google Scholar 

  • Krizhevsky, A., & Hinton, G. (2009). Learning multiple layers of features from tiny images (p. 1) . Technical Reports on Computer Science Department: University of Toronto.

  • Krizhevsky, A., & Sutskever, I., & Hinton, GE. (2012). Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (NeurIPS) (pp. 1097–1105).

  • LeCun, Y., Bottou, L., Bengio, Y., & Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86, 2278–2324.

    Article  Google Scholar 

  • Leng, C., Wu, J., Cheng, J., Bai, X., & Lu, H. (2015). Online sketching hashing. In Computer vision and pattern recognition (pp. 2503–2511).

  • Liberty, E. (2013). Simple and deterministic matrix sketching. In ACM SIGKDD international conference on knowledge discovery and data mining (pp. 581–588).

  • Lin, M., Ji, R., Liu, H., & Wu, Y. (2018). Supervised online hashing via hadamard codebook learning. In ACM international conference on multimedia (ACM MM) (pp. 1635–1643).

  • Lin, M., Ji, R., Liu, H., Sun, X., Wu, Y., & Wu, Y. (2019). Towards optimal discrete online hashing with balanced similarity. In The AAAI conference on artificial intelligence (AAAI) (pp. 8722–8729).

  • Liu, H., Lin, M., Zhang, S., Wu, Y., Huang, F., & Ji, R. (2018). Dense auto-encoder hashing for robust cross-modality retrieval. In ACM international conference on multimedia (ACM MM) (pp. 1589–1597).

  • Liu, W., Wang, J., Ji, R., Jiang, Y. G., & Chang, S. F. (2012). Supervised hashing with kernels. In Computer vision and pattern recognition (CVPR) (pp. 2074–2081).

  • Liu, W., Mu, C., Kumar, S., & Chang, S. F. (2014). Discrete graph hashing. In Advances in neural information processing systems (NeurIPS) (pp. 3419–3427).

  • Lu, Y., Dhillon, P., Foster, D. P., & Ungar, L. (2013). Faster ridge regression via the subsampled randomized hadamard transform. In Advances in neural information processing systems (NeurIPS) (pp. 369–377).

  • Norouzi, M., & Blei, D. M. (2011). Minimal loss hashing for compact binary codes. In International conference on machine learning (ICML).

  • Novikoff, A. B. (1963). On convergence proofs for perceptrons. Technical reports on Stanford Research Inst, Menlo Park, CA.

  • Ockwig, N. W., Delgado-Friedrichs, O., O’Keeffe, M., & Yaghi, O. M. (2005). Reticular chemistry: Occurrence and taxonomy of nets and grammar for the design of frameworks. Accounts of Chemical Research, 38, 176–182.

    Article  Google Scholar 

  • Paley, R. E. (1933). On orthogonal matrices. Journal of Mathematics and Physics, 12, 311–320.

    Article  Google Scholar 

  • Peterson, W. W., Peterson, W., Weldon, E., & Weldon, E. (1972). Error-correcting codes. Cambridge: MIT Press.

    MATH  Google Scholar 

  • Sablayrolles, A., Douze, M., Usunier, N., & Jégou, H. (2017). How should we evaluate supervised hashing? In International conference on acoustics, speech and signal processing (ICASSP) (pp. 1732–1736)

  • Schapire, R. E. (1997). Using output codes to boost multiclass learning problems. International Conference on Machine Learning (ICML), 97, 313–321.

    Google Scholar 

  • Shen, F., Shen, C., Liu, W., & Tao Shen, H. (2015). Supervised discrete hashing. In Computer vision and pattern recognition (pp. 37–45).

  • Simonyan, K., & Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556.

  • Sylvester, J. J. (1867). Lx. thoughts on inverse orthogonal matrices, simultaneous signsuccessions, and tessellated pavements in two or more colours, with applications to newton’s rule, ornamental tile-work, and the theory of numbers. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 34, 461–475.

    Article  Google Scholar 

  • Wang, J., Kumar, S., & Chang, S. F. (2010). Semi-supervised hashing for scalable image retrieval. In Computer vision and pattern recognition (CVPR) (pp. 3424–3431).

  • Wang, J., Zhang, T., Sebe, N., Shen, H. T., et al. (2017). A survey on learning to hash. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 40, 769–790.

    Article  Google Scholar 

  • Weiss, Y., Torralba, A., & Fergus, R. (2009). Spectral hashing. In Advances in neural information processing systems (NeurIPS) (pp. 1753–1760).

  • Williamson, J., et al. (1944). Hadamard’s determinant theorem and the sum of four squares. Duke Mathematical Journal, 11, 65–81.

    Article  MathSciNet  Google Scholar 

  • Yang, E., Deng, C., Li, C., Liu, W., Li, J., & Tao, D. (2018). Shared predictive cross-modal deep quantization. IEEE Transactions on Neural Networks and Learning Systems, 29, 5292–5303.

    Article  Google Scholar 

  • Zhao, B., & Xing, E. P. (2013). Sparse output coding for large-scale visual recognition. In Computer vision and pattern recognition (CVPR) (pp. 3350–3357).

  • Zhou, B., Lapedriza, A., Xiao, J., Torralba, A., & Oliva, A. (2014a). Learning deep features for scene recognition using places database. In Advances in neural information processing systems (NeurIPS) (pp. 487–495).

  • Zhou, J., Ding, G., & Guo, Y. (2014b). Latent semantic sparse hashing for cross-modal similarity search. In International ACM SIGIR conference on research and development in information retrieval (pp. 415–424).

Download references

Acknowledgements

This work is supported by the Nature Science Foundation of China (Nos. U1705262, 61772443, 61572410, 61802324 and 61702136) and National Key R&D Program (Nos. 2017YFC0113000 and 2016YFB1001503).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rongrong Ji.

Additional information

Communicated by Li Liu, Matti Pietikäinen, Jie Qin, Jie Chen, Wanli Ouyang, Luc Van Gool.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lin, M., Ji, R., Liu, H. et al. Hadamard Matrix Guided Online Hashing. Int J Comput Vis 128, 2279–2306 (2020). https://doi.org/10.1007/s11263-020-01332-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11263-020-01332-z

Keywords

Navigation