Abstract
The Switchable Representation Learning Framework with Self-compatibility (SFSC) addresses the challenge of deploying visual search models across heterogeneous hardware environments. By training a single network that can be deployed as multiple sub-models of varying capacities, SFSC ensures that features extracted by different versions of the model remain compatible within a shared metric space. This "many-to-many" compatibility allows for efficient asymmetric retrieval, where low-power edge devices can query high-performance cloud galleries without retraining or feature translation.
Introduction
In modern visual search applications, such as person or vehicle re-identification, systems often operate across a spectrum of hardware, ranging from high-performance cloud servers to resource-constrained mobile devices and smart cameras. Traditionally, this presents a significant deployment challenge. Using a single small model across all platforms sacrifices the accuracy potential of powerful servers, while deploying a large model is impossible on edge devices. Conversely, training separate models for each device type leads to feature incompatibility; a representation generated by a mobile-optimized model cannot be directly compared to one from a server-side model.
Existing research into compatible learning has primarily focused on one-to-one compatibility, typically ensuring a new model is backward-compatible with a single legacy model. SFSC extends this paradigm to many-to-many compatibility, enabling a family of sub-models to coexist and interact seamlessly.
Methodology
The SFSC framework is built upon three core technical innovations designed to manage the complexities of multi-capacity model training and feature alignment.
1. Switchable Neural Network Construction
Instead of training multiple independent networks, SFSC utilizes a single "super-network" from which sub-models are derived via channel pruning. For instance, a 0.25× sub-model is constructed by utilizing only 25% of the original layer widths. To account for the varying data distributions encountered by sub-models of different sizes, the framework maintains independent Batch Normalization (BN) layers for each sub-model while sharing the primary weights.
2. Uncertainty-based Compatible Loss
Training a suite of sub-models simultaneously is framed as a multi-task learning problem. A common issue in such setups is that smaller, lower-capacity models often converge faster and generate larger gradients, which can dominate the optimization process and lead to suboptimal performance for larger models. SFSC employs Evidential Deep Learning to estimate the predictive uncertainty of each sub-model. This uncertainty is then used to dynamically weight the loss functions, preventing any single sub-model from disproportionately influencing the training trajectory.
3. Gradient Projection
Beyond balancing gradient magnitudes, SFSC addresses potential conflicts in gradient directions between sub-models. If two sub-models produce gradients that point in opposing directions, a "gradient surgery" technique is applied. The gradients are projected onto orthogonal planes to identify a common descent direction that benefits the entire model family, ensuring that the optimization of one sub-model does not come at the expense of another.
Experimental Results
The framework was rigorously evaluated on three industry-standard benchmarks: Market-1501, MSMT17 (person re-identification), and VeRi-776 (vehicle re-identification).
Performance Gains
SFSC demonstrated significant improvements in retrieval accuracy, with mean Average Precision (mAP) increasing by 6% to 8% compared to standard unified models across all datasets. Notably, SFSC consistently outperformed existing compatible learning baselines. On the Market-1501 dataset using a ResNet-18 backbone, the smallest SFSC sub-model (0.25×) achieved a 69.43% mAP, significantly higher than the 55.55% achieved by Backward-Compatible Training (BCT).
Architectural Robustness and Asymmetric Retrieval
The effectiveness of SFSC is not limited to ResNet architectures; it also showed strong performance on mobile-centric backbones like MobileNet V2 and ShuffleNet. A key practical advantage of SFSC is its support for asymmetric retrieval. Experimental results indicate that querying a gallery of high-quality features (from a 1.0× model) using a lightweight 0.25× model yields accuracy nearly identical to using the 1.0× model for both, providing a massive efficiency gain for edge-to-cloud search systems.
Conclusion and Future Work
SFSC provides a robust solution for deploying flexible, self-compatible visual search systems across diverse hardware. By treating sub-models as tasks and employing uncertainty-based balancing and gradient projection, the framework achieves superior accuracy and cross-model compatibility.
Future research may explore reducing the training overhead associated with multi-sub-model gradient calculation. Additionally, extending the framework beyond channel pruning to support more diverse architectural switches (e.g., between CNNs and Transformers) and enabling continuous, rather than discrete, model scaling would further enhance its versatility.
Summary updated