Unsupervised Data-Efficient Cross-Modal Retrieval with Global-Neighborhood Alignment Hashing

Runhao Li, Xiaoxu Ma, Zhenyu Weng, Yue Zhang, Guibo Luo, Huiping Zhuang, Zhiping Lin, Yap-Peng TanarXiv 2026 · DOI

TL;DR

Cross-modal hashing usually requires massive amounts of data to map images and text into a shared binary space for efficient retrieval. This paper introduces Global-Neighborhood Alignment Hashing (GNAH), a data-efficient method that extracts structural priors from foundation models like CLIP to train high-quality hashing functions using as few as 20 to 160 image-text pairs.

What Problem Does This Paper Address?

Cross-modal retrieval—such as searching for an image using a text query—relies heavily on Cross-Modal Hashing (CMH). CMH compresses high-dimensional data into compact binary codes (Hamming space) to enable lightning-fast search speeds and low memory footprints. While unsupervised CMH removes the need for manual labeling, existing methods still demand massive datasets to learn stable cross-modal mappings. In specialized or private domains (e.g., medical imaging), collecting thousands of well-aligned image-text pairs is impractical.

Recent approaches try to leverage pre-trained vision-language models like CLIP, but they typically treat them as simple feature extractors or focus purely on instance-to-instance alignment. When training data is scarce, strict instance-level matching leads to severe overfitting. The authors address a critical question: How can we fully exploit CLIP's pre-trained structural knowledge to achieve high-performance cross-modal retrieval under extreme data constraints?

Methods

GNAH moves away from simple instance-to-instance training, introducing a framework that preserves both global and local neighborhood structures from CLIP's continuous latent space into the discrete Hamming space.

Fig. 1: Framework of GNAH. Image and text features from CLIP are mapped into a Hamming space via modality-specific hash functions. Structural information is preserved through Prototype-Anchored Global Alignment for global semantics and Contrastive Stochastic Neighborhood Alignment for local neighborhood priors.

The core architecture consists of two main components:

  1. Prototype-Anchored Global Alignment (PAGA): To capture macro-level semantic layouts, GNAH uses K-means clustering on multi-modal features to discover global "prototypes" (semantic anchors). It then aligns the sample-to-prototype relationships between CLIP's latent space and the target Hamming space using KL divergence.
  2. Contrastive Stochastic Neighborhood Alignment (CSNA): To handle local structures without overfitting to exact pairs, CSNA estimates a neighborhood distribution (mean and variance) for each image-text pair. It samples perturbed representations from this distribution to train the hash functions via a contrastive loss, smoothing out sparse data gaps.

Additionally, the authors employ a Curriculum Learning strategy: the global alignment (PAGA) dominates early training to establish a stable structural foundation, then exponentially decays over epochs to let local refinement (CSNA) take over.

Datasets

The authors evaluated GNAH on three standard cross-modal retrieval benchmarks under simulated data-scarce regimes (using only 20, 40, 80, or 160 training pairs randomly sampled from the retrieval sets):

  • MIR Flickr
  • Pascal Sentence
  • NUS-WIDE

No new benchmarks were introduced, but the evaluation protocol strictly tests low-data efficiency.

Key Insights and Ideas

  • Prototypes as Noise Buffers: Moving from instance-to-instance matching to instance-to-prototype matching makes the model highly resilient to noise and data scarcity. Prototypes act as stable anchors that preserve global semantics.
  • Stochastic Neighborhoods Prevent Overfitting: Instead of forcing strict pairwise alignment on limited data, optimizing against a distribution of neighbors (via CSNA) acts as a powerful regularizer.
  • Global-to-Local Curriculum is Essential: As shown in their hyperparameter grid search, keeping global alignment active throughout the entire training run actually hurts performance because PAGA isn't a perfect modality aligner. Letting it fade out to prioritize local neighborhood alignment yields the best results.
Effect of global alignment weight (beta) and decay factor (gamma)

Key Results

  • Outperforming Unsupervised Baselines: GNAH consistently beat state-of-the-art unsupervised CMH methods (like UCCH and CAGAN) across all datasets. For example, on MIR Flickr at 32 bits with 80 training samples, GNAH achieved a mean Average Precision (mAP) of 0.686 for Image-to-Text (I2T) retrieval, outperforming the next-best method by 4.1%. On the challenging Pascal Sentence dataset, it outperformed competitors by up to 10%.
  • Beating Supervised Methods at Low Data Regimes: Remarkably, when trained on very few samples (20–80 pairs), the unsupervised GNAH outperformed fully supervised alternatives (DNPH and DSPH), which suffered heavily from overfitting due to data scarcity.
Retrieval performance across different sample sizes

Limitations and Future Work

The paper does not include a dedicated limitations section, but a few inherent constraints can be inferred:

  • Dependence on Foundation Models: GNAH relies heavily on the quality of the pre-trained foundation model (CLIP). If CLIP lacks a strong structural prior for a highly specialized domain, GNAH's performance might degrade.
  • Binarization Relaxation: Like most hashing methods, GNAH uses continuous relaxation during training to avoid NP-hard optimization, which introduces quantization errors when converting back to strict binary codes. Future work could explore direct discrete optimization under data-efficient constraints.

Summary updated

BibTeX
@misc{li2026unsupervised,
  author = {Runhao Li and Xiaoxu Ma and Zhenyu Weng and Yue Zhang and Guibo Luo and Huiping Zhuang and Zhiping Lin and Yap-Peng Tan},
  title = {{Unsupervised Data-Efficient Cross-Modal Retrieval with Global-Neighborhood Alignment Hashing}},
  year = {2026},
  eprint = {2606.31517},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.31517},
}
Figure