Supervised Deep Hashing for High-dimensional and Heterogeneous Case-based Reasoning

Qi Zhang, Liang Hu, Chongyang Shi, Ke Liu, Longbing CaoarXiv 2022

Abstract

Case-based Reasoning (CBR) on high-dimensional and heterogeneous data is a trending yet challenging and computationally expensive task in the real world. A promising approach is to obtain low-dimensional hash codes representing cases and perform a similarity retrieval of cases in Hamming space. However, previous methods based on data-independent hashing rely on random projections or manual construction, inapplicable to address specific data issues (e.g., high-dimensionality and heterogeneity) due to their insensitivity to data characteristics. To address these issues, this work introduces a novel deep hashing network to learn similarity-preserving compact hash codes for efficient case retrieval and proposes a deep-hashing-enabled CBR model HeCBR. Specifically, we introduce position embedding to represent heterogeneous features and utilize a multilinear interaction layer to obtain case embeddings, which effectively filtrates zero-valued features to tackle high-dimensionality and sparsity and captures inter-feature couplings. Then, we feed the case embeddings into fully-connected layers, and subsequently a hash layer generates hash codes with a quantization regularizer to control the quantization loss during relaxation. To cater to incremental learning of CBR, we further propose an adaptive learning strategy to update the hash function. Extensive experiments on public datasets show that HeCBR greatly reduces storage and significantly accelerates case retrieval. HeCBR achieves desirable performance compared with the state-of-the-art CBR methods and performs significantly better than hashing-based CBR methods in classification.

Introduction

Case-Based Reasoning (CBR) is a classic AI methodology where new problems are solved by retrieving and adapting solutions from similar past cases. However, modern datasets present significant hurdles: high-dimensionality, heterogeneity (mixed data types), and extreme sparsity. Traditional similarity measures like Euclidean distance become computationally prohibitive and less effective in these high-dimensional spaces.

While Locality-Sensitive Hashing (LSH) has been used to accelerate retrieval, its data-independent nature—relying on random projections—often fails to capture the complex, non-linear relationships inherent in real-world data. This paper introduces HeCBR, a framework that integrates a supervised deep hashing network into the CBR cycle to learn data-aware, similarity-preserving binary codes.

The HeCBR framework integrated into the classic Case-Based Reasoning (CBR) cycle.

Methodology: The Deep Hashing Network

The core of HeCBR is a deep hashing network designed to handle the "messiness" of real-world case data. The architecture follows a four-stage pipeline:

1. Feature Embedding

To address heterogeneity, the model employs position embeddings. Each feature is transformed into a unified distributional space where it is represented as the product of its "amplitude" (the raw value) and its "frequency" (a learned vector representing the feature's position/identity). This allows categorical and numerical data to be processed in a consistent manner.

2. Multiview Feature Interaction

Instead of standard dense layers, HeCBR utilizes a multilinear interaction layer based on CANDECOMP/PARAFAC (CP) factorization. This module captures complex "couplings" or interactions between multiple features. Crucially, it handles sparsity by ignoring zero-valued features during the summation process, maintaining efficiency even when input vectors are mostly empty.

Architecture of the deep hashing network, featuring position embeddings and multiview feature interaction.

3. Deep Hashing and Quantization

The resulting case embeddings pass through fully connected layers to a final hash layer. To ensure the network remains end-to-end trainable despite the non-differentiable nature of binary functions, the authors use continuous relaxation combined with a quantization regularizer. This forces the learned continuous values to converge toward binary outputs (-1 or 1).

4. Adaptive Incremental Learning

CBR systems are inherently dynamic. HeCBR includes an adaptive learning strategy to update the hash function as new cases are added to the case base, preventing the retrieval mechanism from becoming obsolete as the data distribution evolves.

Experimental Evaluation

The model was rigorously tested on eight diverse datasets, including Internet Advertisements (ADV), Protein structures (PT), and large-scale click-through data (Criteo).

Key Results

  • Efficiency: HeCBR achieved a massive reduction in retrieval time—between 41% and 78% compared to neural-network-based CBR (ANNCBR) and up to 84% compared to other structural CBR models (HCBR).
  • Accuracy: In classification tasks, HeCBR consistently outperformed other hashing-based methods (LSH, WTAH, FlyH) and remained competitive with or superior to non-hashing CBR baselines.
  • Storage: The use of compact 36-bit binary codes allows for significant data compression, enabling the management of millions of cases on standard hardware.

Conclusion

HeCBR demonstrates that for CBR to scale effectively, the hashing mechanism must be learned from the data's specific characteristics. By combining position embeddings with multilinear interaction layers, HeCBR successfully navigates the challenges of high-dimensionality and heterogeneity. While currently a supervised method requiring labeled similarity data, future iterations may explore unsupervised paradigms to further broaden its applicability across complex CBR tasks like automated decision support and planning.

Summary updated

BibTeX
@misc{zhang2022supervised,
  author = {Qi Zhang and Liang Hu and Chongyang Shi and Ke Liu and Longbing Cao},
  title = {{Supervised Deep Hashing for High-dimensional and Heterogeneous Case-based Reasoning}},
  year = {2022},
  eprint = {2206.14523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.14523},
}
Figure