Attention-Based Ensemble for Deep Metric Learning

Wonsik Kim, Bhavya Goyal, Kunal Chawla, Jungmin Lee, Keunjoo KwonECCV 2018

Abstract

Deep Metric Learning (DML) focuses on learning embedding spaces where semantically similar images are clustered together. While ensemble methods typically enhance performance, they often suffer from high parameter counts and learner redundancy. This paper presents the Attention-based Ensemble (ABE) framework, which utilizes shared feature extraction and unique attention masks to force individual learners to focus on diverse image regions. Coupled with a novel divergence loss, ABE achieves state-of-the-art results on standard benchmarks while maintaining significantly higher parameter efficiency than traditional ensembles.

Introduction

Deep Metric Learning is fundamental to tasks like image retrieval and fine-grained recognition. The goal is to learn a mapping where the distance between embeddings reflects the semantic similarity of the input images. While ensemble techniques are a common strategy to boost accuracy, their effectiveness depends on the diversity of the constituent models. In DML, standard ensembles often converge to redundant solutions, where all models focus on the most prominent features of an object (such as the general shape of a car), missing the subtle details necessary for fine-grained discrimination.

The Attention-Based Ensemble (ABE) Framework

The proposed ABE-M architecture (where $M$ denotes the number of learners) addresses redundancy through a structured approach to feature extraction and attention.

Architecture

The model consists of three primary components:

  1. Shared Backbone ($S$): A spatial feature extractor shared across all learners to minimize memory footprint. In the authors' implementation using a GoogLeNet backbone, the attention modules branch off at the pool3 layer to balance spatial information with high-level features.
  2. Attention Modules ($A_m$): Each learner $m$ possesses a dedicated attention module that generates a "soft" spatial mask. These masks highlight different regions of the shared feature map, ensuring that different learners "look" at different parts of the image.
  3. Shared Embedding Function ($G$): After masking, features are processed by a shared global embedding function to produce the final learner-specific embedding.
Detailed architecture of the ABE framework showing the shared backbone, attention modules, and global embedding function.

Divergence Loss

To ensure that the attention modules do not collapse onto the same features, the authors introduce a Divergence Loss ($L_{div}$). Unlike standard DML losses that compare different images, the divergence loss operates on "self-pairs"—the same image processed by different learners in the ensemble. It penalizes similarity between these embeddings, incentivizing each learner to capture unique spatial information (e.g., one learner focusing on a car's wheels while another focuses on the roofline).

Conceptual visualization of the divergence loss pushing embeddings from different learners apart in the feature space.

Experimental Results

The ABE-M framework was evaluated on several fine-grained retrieval benchmarks, including CARS-196, CUB-200-2011, and Stanford Online Products (SOP).

  • State-of-the-Art Performance: ABE-M consistently outperformed existing methods. On CARS-196, it achieved a Recall@1 of 85.2% (93.0% on cropped images), a significant improvement over previous baselines like HDC and BIER. On CUB-200-2011, it reached 60.6% Recall@1.
  • Parameter Efficiency: By sharing the backbone and embedding head, an ABE-8 ensemble uses approximately 25% of the parameters required by a standard 8-head ensemble while delivering superior accuracy.
  • Ablation Studies: The authors found that without the divergence loss, attention masks eventually collapse and start looking at the same features, destroying the benefit of the ensemble and confirming the loss's role as the "secret sauce" of the architecture.

Conclusion

The Attention-based Ensemble (ABE) provides a robust mechanism for ensuring diversity in metric learning ensembles. By explicitly forcing learners to attend to different spatial regions through a combination of attention masks and divergence loss, the framework achieves high accuracy with low parameter overhead. While the model requires more FLOPs than a single network, its efficiency and performance make it a compelling choice for high-accuracy image retrieval tasks.

Summary updated

BibTeX
@inproceedings{kim2018attention,
  author = {Wonsik Kim and Bhavya Goyal and Kunal Chawla and Jungmin Lee and Keunjoo Kwon},
  title = {{Attention-Based Ensemble for Deep Metric Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01246-5\_45},
}
Figure