Catalogue of Tools & Metrics for Trustworthy AI

These tools and metrics are designed to help AI actors develop and use trustworthy AI systems and applications that respect human rights and are fair, transparent, explainable, robust, secure and safe.

ARML (Adversarially Robust Metric Learning) is a method for learning distance measures that are provably robust to adversarial attacks. It was presented in the paper "Provably Robust Metric Learning" at the 2020 Conference on Neural Information Processing Systems (NeurIPS). The repository provides the authors' implementation. Many machine learning systems classify data by measuring how close a new example is to known examples, as in nearest-neighbour classifiers. Metric learning trains the distance measure used for these comparisons, known as a Mahalanobis distance, to improve accuracy. However, a learned distance can be vulnerable to adversarial perturbations: small, deliberate changes to an input that cause it to be misclassified.

ARML addresses this weakness. It learns a distance measure that maximises the certified robustness of the classifier. This means the classifier's prediction is guaranteed not to change when an input is altered within a certain range. The method provides mathematical guarantees of robustness, rather than only testing against known attacks.

The code allows users to learn and save the robust distance measure. It then computes the smallest perturbation that would change a one-nearest-neighbour prediction. It also verifies the robustness of k-nearest-neighbour classifiers, and tests them against a practical black-box attack known as the Boundary attack. It compares ARML with established metric learning methods. The code is written in Python using PyTorch.

Auto-discovered on 2026-02-05 by OECD Catalogue Automation

About the metric





Usage rights:



Risk management stage(s):


Github stars:

  • 9

Github forks:

  • 1

Modify this metric

Partnership on AI

Disclaimer: The tools and metrics featured herein are solely those of the originating authors and are not vetted or endorsed by the OECD or its member countries. The Organisation cannot be held responsible for possible issues resulting from the posting of links to third parties' tools and metrics on this catalogue. More on the methodology can be found at https://oecd.ai/catalogue/faq.