Skip to main content
QUICK REVIEW

[Paper Review] Ternary Hashing

Chang Liu, Lixin Fan|arXiv (Cornell University)|Mar 16, 2021
Advanced Image and Video Retrieval Techniques4 citations
TL;DR

This paper proposes Ternary Hashing, a novel deep learning method that uses ternary codes (+1, 0, -1) instead of binary codes to reduce neighborhood ambiguity in approximate nearest neighbor search. By introducing a double-threshold strategy and modeling ternary Hamming distance using Łukasiewicz and Kleene logic, the method increases the expected distance between positive and negative samples, achieving improved retrieval accuracy on CIFAR-10, NUS-WIDE, and ImageNet100 benchmarks.

ABSTRACT

This paper proposes a novel ternary hash encoding for learning to hash methods, which provides a principled more efficient coding scheme with performances better than those of the state-of-the-art binary hashing counterparts. Two kinds of axiomatic ternary logic, Kleene logic and Łukasiewicz logic are adopted to calculate the Ternary Hamming Distance (THD) for both the learning/encoding and testing/querying phases. Our work demonstrates that, with an efficient implementation of ternary logic on standard binary machines, the proposed ternary hashing is compared favorably to the binary hashing methods with consistent improvements of retrieval mean average precision (mAP) ranging from 1\% to 5.9\% as shown in CIFAR10, NUS-WIDE and ImageNet100 datasets.

Motivation & Objective

  • To reduce neighborhood ambiguity in hash-based retrieval by moving beyond binary hashing.
  • To improve the separation between positive and negative sample distances in Hamming space.
  • To design a differentiable, end-to-end trainable hashing framework using ternary codes.
  • To empirically validate the superiority of ternary hashing over existing binary hashing methods.
  • To introduce a novel objective function based on ternary Hamming distance expectations for inter- and intra-class similarity.

Proposed method

  • Proposes a ternary Hamming distance (THD) using Łukasiewicz and Kleene logic to model similarity between trits in {+1, 0, -1}.
  • Defines the expected ternary Hamming distance between two sets of samples using probability distributions over ternary codes.
  • Introduces a double-threshold search algorithm to optimize thresholds that maximize inter-class and minimize intra-class expected distances.
  • Uses a differentiable objective function based on the expectation of ternary Hamming distances across all class pairs.
  • Applies the method to deep neural networks with end-to-end training using SGD and Adam optimizers.
  • Employs a probabilistic framework where P_T, P_U, P_F represent the probabilities of assigning +1, 0, -1 to a code.

Experimental results

Research questions

  • RQ1Can ternary hashing reduce neighborhood ambiguity compared to binary hashing in retrieval tasks?
  • RQ2How does the expected ternary Hamming distance between positive and negative samples compare to binary hashing?
  • RQ3What is the optimal threshold configuration for mapping real-valued outputs to ternary codes?
  • RQ4Does using ternary codes with a logic-based distance measure improve retrieval performance on standard benchmarks?
  • RQ5How does the proposed objective function based on ternary Hamming distance expectations affect model convergence and accuracy?

Key findings

  • Ternary hashing reduces neighborhood ambiguity by increasing the expected Hamming distance between positive and negative samples, as shown in Figure 3(b).
  • The use of an UNKNOWN state (0) in ternary codes reduces overlap between positive and negative distance distributions, improving retrieval reliability.
  • The proposed method achieves better retrieval performance than six existing binary hashing baselines on CIFAR-10, NUS-WIDE, and ImageNet100.
  • The double-threshold search algorithm successfully identifies optimal thresholds that maximize the objective function based on expected ternary Hamming distances.
  • The expected ternary Hamming distance under Łukasiewicz and Kleene logic models provides a more nuanced measure of similarity than binary Hamming distance.
  • Empirical results show that ternary codes with proper thresholding lead to a significant shift in Hamming distance distributions—positive samples move left, negative right—reducing overlap.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.