Learning Deep Local Features with Multiple Dynamic Attentions for Large-Scale Image Retrieval

Hui Wu, Min Wang, Wengang Zhou, Houqiang Li

Abstract

In large-scale image retrieval, identifying discriminative local features is critical for recognizing objects across varying conditions. Traditional attention-based methods often rely on a single attention map, which tends to focus only on the most prominent image regions, potentially overlooking subtle but highly descriptive details. This paper presents a framework using Multiple Dynamic Attentions (MDA) to capture a diverse array of local visual patterns. By employing multiple attention heads and a diversity-promoting loss function, the method forces the model to explore the "long tail" of discriminative features. Experimental results on the Revisited Oxford and Paris benchmarks demonstrate that MDA significantly outperforms previous state-of-the-art techniques, particularly in challenging retrieval scenarios.

Introduction

The core challenge of image retrieval lies in finding matches for a query object within a massive database despite changes in lighting, occlusion, or camera perspective. Deep learning approaches have shifted toward extracting "local features"—recognizable patches that characterize specific objects. While attention mechanisms have improved feature selection, most existing models generate only one attention map per image. This creates a bottleneck where smaller, discriminative details (e.g., specific architectural ornaments) are ignored in favor of the most dominant object.

Methodology

The proposed MDA architecture addresses this bottleneck through a multi-stage pipeline designed to decouple and highlight diverse semantic patterns.

  1. Feature Extraction and Channel Mapping: A ResNet50 backbone extracts base feature maps. These channels are then adaptively reorganized into multiple groups to decouple different semantic patterns, such as textures versus shapes.
  2. Dynamic Attention Heads: Each group feeds into a specialized module that generates a unique attention map. These modules are "dynamic," utilizing an indicator vector—a global summary of the feature group—to adaptively highlight spatial areas relevant to that specific image instance.
  3. Diversity Regularization: To prevent redundant focus, the authors utilize a loss function based on Hellinger distance. This mathematically penalizes overlap between different attention heads, forcing them to focus on distinct regions.
  4. Aggregation and Retrieval: During the testing phase, the system selects the top $n$ local features identified by these multiple maps and aggregates them using the ASMK (Binarized Aggregated Match Kernel) framework for efficient large-scale searching.
The testing pipeline: A query image is processed through multiple attention maps to detect local features, which are then aggregated via ASMK for retrieval from an inverted file index.

Key Insights and Visual Diversity

The primary innovation of MDA is the explicit pursuit of diversity. By penalizing redundancy, the model is forced to identify a broader spectrum of visual cues. Unlike static attention modules, the dynamic nature of the MDA module allows it to adapt to the unique content of every image.

Visual comparison of attention maps: (a) DELF and (b) HOW typically produce single, broad focus areas, whereas the proposed MDA (bottom four maps) captures a diverse set of distinct architectural details.

Experimental Results

The MDA approach achieved substantial performance gains on the "Revisited" Oxford (ROxf) and Paris (RPar) datasets:

  • Accuracy Gains: On the ROxf "Hard" protocol, MDA improved Mean Average Precision (mAP) by 5.7% over previous state-of-the-art local feature methods.
  • Scalability: When tested against the R1M dataset (1 million distractor images), MDA maintained its lead, outperforming the previous best method (HOW) by 6.4% mAP on the Hard protocol.
  • Efficiency: The model remains competitive even when reducing local feature dimensionality to 64, making it suitable for memory-constrained environments.

Conclusion and Future Work

The Multiple Dynamic Attentions framework successfully addresses the limitations of single-attention models by capturing a richer set of local features. Future research directions include integrating the visual codebook and quantization process into a single end-to-end trainable framework and developing multi-scale structures directly within the network architecture to reduce the computational overhead of image pyramids.

Summary updated

BibTeX
@inproceedings{wu2021learning,
  author = {Hui Wu and Min Wang and Wengang Zhou and Houqiang Li},
  title = {{Learning Deep Local Features with Multiple Dynamic Attentions for Large-Scale Image Retrieval}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01122},
}
Figure