Introduction
In the era of massive visual datasets, efficient image retrieval relies on hashing—the process of mapping high-dimensional image data into compact, searchable binary strings. While deep learning has significantly advanced feature extraction, current state-of-the-art models often operate as "black boxes." These models excel at identifying what objects are present in an image but frequently fail to encode where those objects are located. This lack of spatial awareness limits retrieval precision, especially when users require specific layouts or relative positioning. Furthermore, traditional neural hashing models are rigid; they cannot be easily adjusted to prioritize specific image regions or objects without computationally expensive retraining.
To address these challenges, we introduce NeuroHash, a neuro-symbolic framework that bridges the gap between the representational power of deep learning and the structured logic of Hyperdimensional Computing (HDC). By treating image components as symbolic entities, NeuroHash enables spatially-aware and highly customizable image retrieval.
The NeuroHash Framework
NeuroHash utilizes a multi-stage pipeline that integrates neural feature extraction with symbolic manipulation.
The process begins with Feature Extraction, where pre-trained models—specifically Detectron2 for object detection and DINOv2 for visual embeddings—identify objects and their precise coordinates. These visual features are then mapped into a high-dimensional space (typically 10,000 dimensions) using a Context-Aware HDC Encoder.
The core innovation lies in Spatial Encoding. Using HDC "binding" operations, the system links visual features with their (x, y) coordinates via positional hypervectors. This creates a mathematical representation that inherently preserves the image's spatial layout. Finally, all local and global features are combined into a single hypervector through Symbolic Bundling. This high-dimensional vector is then compressed into a compact bipolar hash (e.g., 64 bits) using Multilinear Hyperplane Hashing, optimized by specialized loss functions to preserve spatial relationships.
Spatial Intelligence and Customization
Unlike traditional hashing, NeuroHash allows for "on-the-fly" customization. Because the framework is symbolic, users can mathematically manipulate the query hash. By adjusting the weight ($\eta$) of a specific object's hypervector, the system can be instructed to "focus" on particular regions or objects during retrieval.
Furthermore, the system's spatial sensitivity is adjustable. By tuning a "length scale" parameter ($w$), NeuroHash can transition between "Strong-aware" retrieval (requiring precise coordinate alignment) and "Weak-aware" retrieval (allowing for more flexible positioning). This flexibility is illustrated in the comparison between spatial-aware retrieval and standard baseline methods, where the latter often fails to respect the relative positioning of subjects like surfers on a wave.
Experimental Results
The performance of NeuroHash was evaluated on standard benchmarks including CIFAR-10 and MS COCO.
- Retrieval Accuracy: On CIFAR-10, NeuroHash achieved a mean Average Precision (mAP) of 0.937 at 32 bits, outperforming existing methods like FSCH (0.912).
- Spatial Performance: On the MS COCO dataset, which provides ground-truth bounding boxes, NeuroHash demonstrated a significant improvement over "naïve" baselines (DINOv2 + standard hashing), showing gains of up to 13.14% in retrieval accuracy.
- Spatial Alignment: To quantify spatial awareness, we introduced the mAP@5Kr metric. Results confirmed that NeuroHash consistently retrieves images where objects maintain the same relative positions as the query image, a capability largely absent in traditional hashing techniques.
Conclusion and Future Work
NeuroHash represents a significant step toward more transparent and controllable image retrieval systems. By combining neural embeddings with the symbolic flexibility of HDC, it provides a robust solution for spatially-aware search.
However, the system's performance remains dependent on the accuracy of the underlying pre-trained object detectors. Future research will focus on reducing the computational overhead of generating high-dimensional hypervectors and extending the framework to incorporate temporal data for video retrieval.
Summary updated