Data-Efficient Ranking Distillation for Image Retrieval

Zakaria Laskar, Juho Kannala

Abstract

Knowledge distillation (KD) is a standard technique for transferring knowledge from large, complex teacher models to compact, efficient student models. However, traditional KD methods often require massive labeled datasets and white-box access to the teacher's internal parameters. This paper introduces a data-efficient ranking distillation framework that enables training high-quality student models using only a small fraction of unlabeled data and black-box teacher outputs. By employing representation-level mixup and a listwise ranking loss, the proposed method achieves performance comparable to fully supervised models while using as few as 4,000 unlabeled images.

Introduction

In the field of image retrieval, state-of-the-art performance is typically achieved by large Convolutional Neural Networks (CNNs) that are too resource-intensive for real-time or mobile applications. While Knowledge Distillation (KD) can address this by training smaller models, it faces three major bottlenecks: extreme data hunger, the requirement for proprietary "white-box" teacher access, and high computational costs for generating pseudo-labels. This work addresses these challenges by proposing a method that works with black-box teachers and minimal unlabeled data.

Methods

The core of the proposed framework is Data-Efficient Ranking Distillation, which consists of three primary pillars:

1. Representation-Level Mixup

Standard mixup augmentation blends images, requiring a new teacher query for every synthetic sample. To minimize costs, the authors perform mixup in the final output representation space. By linearly interpolating feature vectors ($f_{ij} = \lambda f_i + (1-\lambda) f_j$), they can generate infinite synthetic training signals without additional teacher queries.

2. Similarity and Mixup Labeling

The teacher defines similarity through its output. Similarity Labeling (SL) uses a threshold to identify neighbors, while Mixup Labeling (ML) ensures that synthetic samples are treated as neighbors to the original samples' neighbors, providing a robust signal even in low-data regimes.

3. Listwise Ranking Loss

Instead of simple pair-wise comparisons, the authors utilize an Average Precision (AP) Loss. This treats distillation as a ranking problem, forcing the student to mimic the teacher’s entire sorted list of results for any given query.

Key Insights and Ideas

A major hurdle in low-data distillation is the "Empty Positive" problem, where small training batches may lack actual matches. Representation-level mixup solves this by synthetically creating positive samples in the feature space.

Ablation study showing the impact of representation-level mixup on small training sets.

As shown in the ablation study, the proposed augmentation significantly boosts performance when training data is scarce. For example, a ResNet34 student trained on 4,000 images improves from 50.8 mAP to 55.1 mAP on the ROxford5k "Medium" benchmark when augmentation is applied.

Key Results

The method demonstrates remarkable data efficiency. Student models trained on just 4,000 unlabeled images (approximately 3% of the full SfMFr dataset) match the performance of models trained with full supervision on 120,000 labeled images.

Performance comparison of student networks across different distillation settings and sample sizes.

Beyond accuracy, the student models offer substantial practical benefits. A MobileNetV2-based student (MVNetV2) achieves up to a 6x speedup at inference time compared to the ResNet101 teacher while maintaining competitive retrieval accuracy across standard benchmarks.

Conclusion

This work presents a robust framework for training compact image retrieval models under strict data and teacher access constraints. While a performance gap remains in specific post-processing scenarios like PCA-whitening, the method's efficiency and black-box compatibility make it highly suitable for real-world deployment. Future research may extend this approach to other metric learning tasks, such as face recognition or person re-identification.

Summary updated

BibTeX
@inproceedings{laskar2020data,
  author = {Zakaria Laskar and Juho Kannala},
  title = {{Data-Efficient Ranking Distillation for Image Retrieval}},
  booktitle = {ACCV},
  year = {2020},
  doi = {10.1007/978-3-030-69525-5\_28},
}
Figure