Abstract
We tackle the problem of visual search under resource constraints. Existing systems use the same embedding model to compute representations (embeddings) for the query and gallery images. Such systems inherently face a hard accuracy-efficiency trade-off: the embedding model needs to be large enough to ensure high accuracy, yet small enough to enable query-embedding computation on resource-constrained platforms. This trade-off could be mitigated if gallery embeddings are generated from a large model and query embeddings are extracted using a compact model. The key to building such a system is to ensure representation compatibility between the query and gallery models. In this paper, we address two forms of compatibility: One enforced by modifying the parameters of each model that computes the embeddings. The other by modifying the architectures that compute the embeddings, leading to compatibility-aware neural architecture search (CMP-NAS). We test CMP-NAS on challenging retrieval tasks for fashion images (DeepFashion2), and face images (IJB-C). Compared to ordinary (homogeneous) visual search using the largest embedding model (paragon), CMP-NAS achieves 80-fold and 23-fold cost reduction while maintaining accuracy within 0.3% and 1.6% of the paragon on DeepFashion2 and IJB-C respectively.
Introduction
Traditional visual search systems rely on a homogeneous setup, where the same embedding model processes both the gallery (database) and the query images. This architecture forces a difficult compromise: using a large, accurate model like ResNet-101 ensures high retrieval performance but is computationally prohibitive for real-time queries on mobile or edge devices. Conversely, using a lightweight model like MobileNet enables efficiency but at a significant cost to accuracy.
We propose Heterogeneous Visual Search (HVS), which decouples the gallery and query models. In this paradigm, a massive "Paragon" model indexes the gallery offline, while a compact "Student" model processes queries on-device. The primary challenge is ensuring compatibility—ensuring that embeddings from different architectures reside in a shared, comparable space.
Methodology
Our approach addresses compatibility through two primary mechanisms:
Weight-level Compatibility via BCT
We employ Backward-Compatible Training (BCT). Rather than training the query model in isolation, we optimize it to align its embeddings with the pre-existing classifier of the gallery model. This "backward compatibility" ensures that the compact model learns a representation space that is directly comparable to the larger model's space.
Architecture-level Compatibility (CMP-NAS)
We observe that standard Neural Architecture Search (NAS) often fails in HVS because an architecture optimized for standalone performance may not be the most compatible with a fixed gallery model. We introduce Compatibility-aware Neural Architecture Search (CMP-NAS). Using a search space based on ShuffleNetV2, we employ a specialized reward function that prioritizes asymmetric accuracy—the performance of the small query model when searched against the large gallery model—rather than its standalone (homogeneous) accuracy.
Experimental Results
We evaluated CMP-NAS on two large-scale benchmarks: IJB-C for face retrieval and DeepFashion2 for fashion retrieval.
As shown in the figure above, CMP-NAS establishes a new Pareto front for the accuracy-efficiency trade-off. On the IJB-C task, it achieves a 23-fold reduction in query FLOPs with only a 1.6% drop in accuracy compared to the ResNet-101 paragon. On DeepFashion2, the results are even more striking, achieving an 80-fold cost reduction while maintaining accuracy within 0.3% of the paragon.
Conclusion
Heterogeneous Visual Search offers a practical path toward high-performance, low-latency search systems. By combining weight-level alignment with compatibility-aware architecture search, CMP-NAS effectively bridges the gap between massive server-side models and efficient edge-side models. Future work will explore multi-model compatibility and joint optimization of both gallery and query architectures.
Summary updated