RepMet: Representative-Based Metric Learning for Classification and Few-Shot Object Detection.

Leonid Karlinsky, Joseph Shtok, Sivan Harary, Eli Schwartz, Amit Aides, Rogério Schmidt Feris, Raja Giryes, Alexander M. Bronstein · DOI

TL;DR

This paper introduces RepMet, a novel metric learning approach that jointly learns feature extractors, embedding spaces, and multi-modal class representations. This unified training allows RepMet to achieve state-of-the-art results in fine-grained classification and, crucially, enables effective few-shot object detection by adapting its learned representations to new categories with minimal examples.

What Problem Does This Paper Address?

Deep learning models excel at tasks like image classification and object detection when trained on large datasets. However, many real-world applications face the "few-shot learning" challenge, where only a handful of examples are available for new categories. While significant progress has been made in few-shot classification, few-shot object detection remains a particularly difficult problem. This is because detectors need to not only classify objects but also accurately localize them, and existing few-shot methods struggle with the unbalanced foreground-background ratios and the need for robust, adaptable feature representations. This paper aims to bridge this gap by proposing a unified metric learning framework that can handle both classification and few-shot object detection effectively.

Methods

The core of RepMet is a novel Distance Metric Learning (DML) approach that simultaneously learns three key components:

  1. Backbone Network: The feature extractor (e.g., InceptionV3, FPN).
  2. Embedding Space: A lower-dimensional space where features are mapped for comparison.
  3. Multi-modal Class Representatives: Instead of a single prototype per class, RepMet models each class distribution with a mixture of modes (peaks). The centers of these modes serve as "representatives" for the class.

This joint, end-to-end training process is a key innovation. For classification, RepMet uses a cross-entropy loss and a margin-based loss to ensure correct classification and separation between classes. For few-shot object detection, RepMet replaces the standard classification head of a detector (like Faster R-CNN) with its DML subnet. When encountering new categories during testing, the representatives are updated using the few available examples, allowing the detector to adapt without extensive retraining.

Datasets

The paper evaluates RepMet on several standard datasets for fine-grained classification:

  • Stanford Dogs
  • Oxford-IIIT Pet
  • Oxford 102 Flowers
  • ImageNet Attributes

For few-shot object detection, the authors use:

  • ImageNet-LOC dataset. They introduce a new episodic benchmark for few-shot object detection based on ImageNet-LOC, which consists of multiple random episodes (training/testing splits) to better simulate real-world few-shot scenarios and provide a more robust evaluation. This differs from previous benchmarks that often used a single episode.

Key Insights and Ideas

  • Joint Training is Crucial: The paper strongly emphasizes that simultaneously learning the embedding space and the class representatives (modes) is essential for performance, especially in few-shot detection. Separately training these components leads to significantly worse results.
  • Multi-modal Class Representation: Modeling classes with multiple modes (peaks) in the embedding space, rather than a single centroid, allows for more flexible and robust representation of intra-class variations.
  • Adaptable Representatives for Few-Shot Detection: The ability to update class representatives using just a few examples from new categories is the key to RepMet's success in few-shot object detection. This allows the model to generalize to unseen classes without needing to retrain the entire detector.
  • Episodic Benchmark for Detection: The introduction of an episodic benchmark for few-shot object detection is a significant contribution, providing a more standardized and realistic evaluation methodology for this challenging task.

Key Results

  • Classification: RepMet achieves state-of-the-art results on several fine-grained classification datasets, outperforming existing DML methods like Magnet Loss. For example, on the Stanford Dogs dataset, RepMet achieved an error rate of 13.7%, significantly lower than the previous best of 24.0%.
  • Few-Shot Object Detection: RepMet achieves superior performance on the ImageNet-LOC dataset compared to strong baselines, including a fine-tuned detector and a DML-based detector with an externally trained embedding. On the challenging 50-way, 1-shot detection task, RepMet achieved an mAP of 19.2%, compared to 41.3% for a baseline fine-tuned detector.
  • Robustness: The paper demonstrates that RepMet is more robust to hyperparameter changes (like the number of modes) compared to methods that rely on iterative clustering steps.

Limitations and Future Work

  • Fixed Number of Modes: The current implementation uses a fixed number of modes (K) per class. Learning optimal K or making it adaptive is suggested as a future direction.
  • Mixture Coefficients and Covariance: The paper currently uses an approximation for class posteriors by taking the maximum over modes and does not explicitly learn mixture coefficients or mode covariances. Predicting these as a function of the input is proposed as a future extension.
  • RPN Integration: While RepMet uses a class-agnostic RPN, the authors suggest that integrating their DML classifier into the RPN itself could further improve sensitivity to new categories and handle challenging cases.
  • Background Handling: While RepMet handles background, further improvements in rejecting background ROIs, especially in few-shot scenarios, could be beneficial.

Summary updated

BibTeX
@inproceedings{karlinsky2019repmet,
  author = {Leonid Karlinsky and Joseph Shtok and Sivan Harary and Eli Schwartz and Amit Aides and Rogério Schmidt Feris and Raja Giryes and Alexander M. Bronstein},
  title = {{RepMet: Representative-Based Metric Learning for Classification and Few-Shot Object Detection.}},
  booktitle = {CVPR},
  year = {2019},
  doi = {10.1109/cvpr.2019.00534},
}
Figure