Adversarial Metric Learning

Shuo Chen, Chen Gong, Jian Yang, Xiang Li, Yang Wei, Jun Li

Abstract

Traditional metric learning methods often suffer from distribution bias, failing to generalize to ambiguous "edge cases" in real-world data. This paper proposes Adversarial Metric Learning (AML), a framework that incorporates synthetically generated difficult examples into the training process. By solving a bi-level optimization problem, AML "stress-tests" the distance metric against adversarial pairs, leading to significantly improved robustness and state-of-the-art performance across classification and verification benchmarks.

Introduction: Addressing Distribution Bias

Metric learning aims to find a mathematical distance metric that brings similar items closer together and pushes dissimilar items further apart. However, a common pitfall is distribution bias: training sets are often "cleaner" than the messy data encountered in deployment. Real-world test data frequently contains "ambiguous pairs"—examples that sit right on the edge of being similar or dissimilar.

Conceptual illustration of adversarial pairs (Π) generated to mimic ambiguous real-world data.

Without exposure to these edge cases during training, a learned metric may fail to generalize. AML bridges this gap by automatically generating "hard" adversarial pairs that mimic these ambiguous scenarios, providing the model with "synthetic experience" before it encounters real-world noise.

Methods: The Adversarial Framework

The core of AML is a two-stage adversarial game formulated as a bi-level optimization problem, contrasting sharply with traditional approaches.

Comparison between Traditional Metric Learning and the proposed Adversarial Metric Learning framework.
  1. The Confusion Stage: The algorithm searches for adversarial pairs ($\Pi$) in the local neighborhood of the original training data. These pairs are specifically designed to maximize the current metric's loss, effectively finding the "worst-case" examples that the model currently finds most confusing.
  2. The Distinguishment Stage: The model then updates the Mahalanobis metric ($M$) to minimize loss on both the original training pairs ($X$) and these new, difficult adversarial pairs ($\Pi$).

To ensure computational efficiency and stability, the authors derived a closed-form solution for the optimal adversarial pairs. This allows them to collapse a complex alternating game into a single, unconstrained optimization problem that is guaranteed to converge, avoiding the training instability often associated with GANs.

Key Results and Evaluation

AML consistently outperformed representative state-of-the-art methods (such as GMML, LMNN, and DRIFT) across a diverse range of benchmarks:

  • Classification: On the MNIST dataset, AML achieved a classification error of 10.5%, significantly lower than GMML (12.0%). It secured the top performance in 5 out of 7 UCI datasets.
  • Verification (AUC): AML showed a clear lead in Area Under the Curve (AUC) scores on face verification tasks (PubFig: 0.907; LFW: 0.877) and image patch matching (MVS: 0.753).
  • Visual Proof: In synthetic tests, while traditional metrics failed to separate overlapping classes in the test set, AML successfully grouped similar items and separated dissimilar ones by "learning" from the adversarial points placed in the overlap zones.

Conclusion

Adversarial Metric Learning provides a robust framework for distance metric learning by anticipating difficult test cases. By integrating adversarial "stress-testing" into the training loop via a stable bi-level optimization, AML achieves superior generalization. While the current formulation focuses on linear Mahalanobis metrics, the authors suggest that applying this adversarial logic to deep neural network-based metric learning is a promising next step for handling even more complex data relationships.

Summary updated

BibTeX
@inproceedings{chen2018adversarial,
  author = {Shuo Chen and Chen Gong and Jian Yang and Xiang Li and Yang Wei and Jun Li},
  title = {{Adversarial Metric Learning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.24963/ijcai.2018/279},
}
Figure