One Loss for All: Deep Hashing with a Single Cosine Similarity based Learning Objective

Jiun Tian Hoe, Kam Woh Ng, Tianyu Zhang, Chee Seng Chan, Yi-Zhe Song +1 more
9/29/2021
180 citations
cs.CVcs.LG

Official code: kamwoh/orthohash (99 stars, Python, BSD-3-Clause, last commit 2026-02-27).

Abstract

A deep hashing model typically has two main learning objectives: to make the learned binary hash codes discriminative and to minimize a quantization error. With further constraints such as bit balance and code orthogonality, it is not uncommon for existing models to employ a large number (>4) of losses.

Show full abstract

This leads to difficulties in model training and subsequently impedes their effectiveness. In this work, we propose a novel deep hashing model with only a single learning objective. Specifically, we show that maximizing the cosine similarity between the continuous codes and their corresponding binary orthogonal codes can ensure both hash code discriminativeness and quantization error minimization. Further, with this learning objective, code balancing can be achieved by simply using a Batch Normalization (BN) layer and multi-label classification is also straightforward with label smoothing. The result is an one-loss deep hashing model that removes all the hassles of tuning the weights of various losses. Importantly, extensive experiments show that our model is highly effective, outperforming the state-of-the-art multi-loss hashing models on three large-scale instance retrieval benchmarks, often by significant margins. Code is available at https://github.com/kamwoh/orthohash

View on arXivView PDF

Code Implementations(1)

kamwoh/orthohashOfficial100%
BSD-3-Clause

[NeurIPS 2021] Official implementation of the paper "One Loss for All: Deep Hashing with a Single Cosine Similarity based Learning Objective"

998Python, DockerfileSep 29, 20219 months agoBSD-3-Clause
cococosine-similaritydeep-hashingdeep-learninggldv2+14 more

Similar Papers

Cite this paper

@article{hoe2021loss,
  title  = {One Loss for All: Deep Hashing with a Single Cosine Similarity based Learning Objective},
  author = {Jiun Tian Hoe and Kam Woh Ng and Tianyu Zhang and Chee Seng Chan and Yi-Zhe Song and Tao Xiang},
  year   = {2021},
  eprint = {2109.14449},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.14449}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2109.14449.svg)](https://codeofpaper.com/paper/2109.14449)

Discussion