Pruning Convolutional Neural Networks for Image Instance Retrieval

Gaurav Manek, Jie Lin, Vijay Chandrasekhar, Lingyu Duan, Sateesh Giduthuri, Xiaoli Li, Tomaso A. PoggioarXiv 2017

Abstract

Convolutional Neural Networks (CNNs) are the state-of-the-art for image instance retrieval, yet their substantial model size poses significant challenges for deployment on mobile and edge devices. This paper investigates the redundancy within these models and proposes a two-stage pipeline of magnitude-based pruning followed by triplet-loss fine-tuning. Our results demonstrate that retrieval models can be compressed by up to 5× with minimal loss in accuracy. We find that simple magnitude-based pruning consistently outperforms more complex data-dependent heuristics and that redundancy is disproportionately located in the higher layers of the network.

Introduction

While CNNs excel at finding specific objects or scenes in large databases, they carry a heavy computational "tax" in the form of model size, often exceeding hundreds of megabytes. Most existing literature on network pruning focuses on image classification tasks. However, image retrieval is distinct; it relies on feature maps extracted from intermediate convolutional layers rather than final softmax outputs. This study explores whether pruning strategies can be effectively adapted to maintain the quality of image descriptors while significantly reducing model footprint.

Methodology

The authors propose a two-stage approach: a pruning phase to remove redundant weights and a fine-tuning phase to recover performance.

Pruning Heuristics and Pooling

Four pruning heuristics were evaluated to determine which edges to remove:

  1. Heuristic 1 (Magnitude): Removes weights with the smallest absolute values (data-independent).
  2. Heuristic 2 (Taylor Expansion): Uses gradients to estimate the impact of weight removal on the loss function.
  3. Heuristics 3 & 4 (Activation-based): Prunes based on the mean or variance of node activations.

To aggregate the pruned feature maps into a single descriptor, the study compared Square-root pooling (SQP) and Regional-Maximum Activations of Convolutions (R-MAC).

Comparison of the four pruning heuristics (H1-H4) across benchmark datasets.

Triplet-based Fine-tuning

Pruning typically causes an immediate drop in Mean Average Precision (MAP). To counteract this, the remaining weights are fine-tuned using a triplet loss function on the 3D-Landmarks dataset. This stage is critical for restoring the discriminative power of the compressed network by ensuring query images remain close to positive matches in the feature space.

Experimental Results

The methodology was tested on four standard benchmarks: INRIA Holidays, Oxford5k, Paris6k, and UKbench.

Compression and Performance Trade-offs

A primary insight is that the simplest method—magnitude-based pruning (Heuristic 1)—consistently yields the best performance. As illustrated in the figure below, networks can be pruned by 50% (2× compression) with almost no impact on retrieval accuracy even before fine-tuning. When combined with triplet-loss fine-tuning, the models achieve a 5× compression rate (retaining only 20% of weights) while maintaining high MAP.

Layer Sensitivity and Domain Bias

The study found that lower layers are highly sensitive to pruning, whereas higher layers are extremely redundant and can sometimes be pruned to 8% of their original size. Additionally, the choice of fine-tuning data introduces a domain gap: fine-tuning on landmark data significantly improved performance on building-centric datasets (Oxford5k, Paris6k) but led to a slight performance decrease on object-centric datasets (UKbench).

Conclusion

This research confirms that CNNs for image retrieval are highly redundant, particularly in their deeper layers. A combination of simple magnitude pruning and domain-specific fine-tuning allows for a 5× reduction in model size. Future work will investigate the performance threshold below 20% remaining weights, where retrieval accuracy typically begins to collapse.

Summary updated

BibTeX
@misc{manek2017pruning,
  author = {Gaurav Manek and Jie Lin and Vijay Chandrasekhar and Lingyu Duan and Sateesh Giduthuri and Xiaoli Li and Tomaso A. Poggio},
  title = {{Pruning Convolutional Neural Networks for Image Instance Retrieval}},
  year = {2017},
  eprint = {1707.05455},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.05455},
}
Figure