Transductive Zero-Shot Hashing via Coarse-to-Fine Similarity Mining

Hanjiang Lai, Yan PanarXiv 2017

TL;DR

This paper introduces a transductive approach to zero-shot hashing that leverages unlabeled data to overcome the "projection domain shift" problem. By using a novel coarse-to-fine similarity mining strategy, the model learns to generate high-quality binary codes for images from classes it has never seen before, significantly outperforming existing methods.

What Problem Does This Paper Address?

Image retrieval at scale often relies on hashing: converting high-dimensional images into short binary codes. This allows for lightning-fast searches using Hamming distance (counting bit differences). However, traditional hashing requires labeled data for every category. Zero-Shot Hashing (ZSH) aims to learn hash functions for "novel" classes that have no labeled training samples, usually by bridging the gap through semantic embeddings like word vectors (e.g., "cat" and "dog" are close in word-vector space, so their hash codes should be too).

The major hurdle in ZSH is the projection domain shift. Models trained only on "seen" classes develop a bias; the visual features and hash functions they learn don't always generalize well to the different data distributions of "unseen" classes. This paper tackles this by moving to a transductive setting, where the model is allowed to see unlabeled images from the target classes during training to better adapt its representations.

Methods

The authors propose a deep architecture consisting of two main components:

  1. Shared Two-Stream Network: The model uses a two-stream architecture (based on AlexNet) where one stream processes labeled "seen" images and the other processes unlabeled images. Crucially, these streams share parameters, forcing the network to learn a common feature space for both domains.
  2. Coarse-to-Fine Similarity Mining: Since the target data is unlabeled, the model must "mine" its own supervision:
  3. Coarse Stage: The model treats this as a binary classification problem—distinguishing "seen" class images from "novel" ones. A novel cross-images selection layer greedily picks the most informative unlabeled images that are most likely to belong to novel classes.
  4. Fine Stage: For the images selected in the coarse stage, the model uses word2vec similarities between class names to transfer knowledge. If a novel image is semantically similar to a seen class (e.g., a "truck" image being similar to the "car" class), the model uses this to guide the learning of the hash codes.
Figure 1. Overview of the proposed deep architecture for the transductive zero-shot hashing. Our architecture is a two-streams network, in which the first stream operates on the labelled images of the seen classes while the second stream operates on the unlabelled images. The architecture firstly (A) encodes the images into the image representations via stacked convolutional and fully-connected layers. With this, it can obtain the common feature representations for both the source and target data. And then it (B) detects the most informative images from the large set of unlabeled images. We propose a greedy binary classification network with the proposed cross-images selection layer to achieve the goal. (C) is a fine similarity mining module to further finding the similarities among the informative images. It greedily selects the image which has the highest probability score come from a novel class, and then assigns the label of the image as its class. After that, a similarity-preserving loss function is conducted to learn the hash functions for both the source and target classes.

Finally, a similarity-preserving loss is applied to ensure that images identified as similar have a small Hamming distance between their binary codes, while dissimilar images are pushed apart.

Datasets

The researchers evaluated their method on three standard computer vision benchmarks:

  • ImageNet: A subset of 100 classes (90 seen, 10 novel).
  • Animals with Attributes (AwA): 50 animal species with 85 numeric attribute values per class (40 seen, 10 novel).
  • CIFAR-10: 10 classes of common objects (8 seen, 2 novel).

Key Insights and Ideas

  • Greedy Selection for End-to-End Training: The "cross-images selection layer" is a clever way to handle unlabeled data. By greedily selecting high-confidence samples during the forward pass and passing gradients only through those samples during backpropagation, the model can be trained end-to-end despite the lack of target labels.
  • Bridging the Distribution Gap: By including unlabeled target data in the training loop, the model naturally adjusts to the visual characteristics of the novel classes, effectively mitigating the domain shift that plagues inductive ZSH methods.
  • Semantic Transfer: The core "aha" moment is realizing that while we don't have labels for the target images, we do have the semantic relationships between class names (via word2vec). The model uses these relationships as a "proxy" for visual similarity.

Key Results

The proposed method, TZSH, showed dramatic improvements over state-of-the-art baselines:

  • AwA Dataset: TZSH achieved a Mean Average Precision (MAP) of 0.5442 (at 128 bits), compared to just 0.1432 for the best previous transductive baseline (DA-ZSH). This is a nearly 4x improvement.
  • CIFAR-10: On various target class pairs (like ship-truck), TZSH consistently outperformed baselines. For the ship-truck pair, it reached an MAP of 0.6828, while the best baseline reached 0.5529.
  • Scalability: As shown in Figure 4, TZSH maintains high precision and MAP across different bit lengths (16 to 128 bits), consistently staying well above competing methods like ZSH and SDH.
MAP and precision scores on ImageNet showing TZSH outperforming all baselines across different bit lengths.

Limitations and Future Work

  • Semantic Dependency: The "fine mining" stage relies heavily on the quality of the semantic embeddings (word vectors). If a novel class is completely unrelated to any seen classes in the semantic space, the similarity transfer might fail.
  • Multi-Label Retrieval: The current work focuses on single-label images. The authors note that extending this to multi-label scenarios—where an image might contain a "dog," a "car," and a "tree" simultaneously—is a promising direction for future research.
  • Seen Category Ratio: The performance is sensitive to the number of seen classes available. As shown in Figure 5, the model performs much better when it has more "seen" categories to learn from, as this provides a richer semantic base for knowledge transfer.
Graph showing how the number of seen classes impacts performance.

Summary updated

BibTeX
@misc{lai2017transductive,
  author = {Hanjiang Lai and Yan Pan},
  title = {{Transductive Zero-Shot Hashing via Coarse-to-Fine Similarity Mining}},
  year = {2017},
  eprint = {1711.02856},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.02856},
}
Figure