Abstract
Metric learning algorithms often fail when class distributions are highly skewed, as majority class pairs dominate the optimization process. We present Imbalanced Metric Learning (IML), which addresses this by decomposing the loss function into four label-specific components with equal weighting. This approach ensures that the minority class has a fair influence on the learned distance metric. Empirical evaluations across 22 datasets demonstrate that IML significantly outperforms standard methods in F1-measure, particularly as imbalance increases.
Introduction
In many real-world domains, such as fraud detection or medical diagnosis, the class of interest is often the minority. Standard metric learning algorithms, which typically learn a Mahalanobis distance, treat all pairs of points equally. Consequently, the learned metric becomes biased toward the majority class, often leading to poor performance on the minority class despite high overall accuracy.
The Accuracy Mirage
A key contribution of this research is highlighting the "accuracy trap" in imbalanced learning. As class imbalance increases, standard algorithms like LMNN and ITML may show stable or even improving accuracy while their F1-measure—a more accurate reflection of minority class performance—collapses. This phenomenon is visualized in Figure 1, where the divergence between accuracy and F1-measure becomes stark as the percentage of positive examples drops.
Imbalanced Metric Learning (IML)
The proposed IML algorithm modifies the standard metric learning objective by splitting constraints into four distinct sets based on class labels:
- Sim+ / Sim-: Similarity constraints for positive and negative pairs, respectively.
- Dis+ / Dis-: Dissimilarity constraints anchored at positive and negative points, respectively.
By weighting each of these four sets equally (assigning a weight of $1/(4 \times |set|)$ to each), IML prevents the majority class from overwhelming the optimization. This ensures that the geometric transformations learned by the algorithm respect the structure of the minority class, pulling similar points together and pushing dissimilar ones apart regardless of their class frequency.
Results and Discussion
The researchers tested IML on 22 datasets from the UCI and Keel repositories. IML achieved a superior average F1-measure of 72.1% and an average rank of 1.48, significantly outperforming GMML (70.8%, rank 2.96) and other baselines. The algorithm also demonstrated remarkable robustness in synthetic experiments where the minority class was reduced to just 1% of the total data, showing a much more gradual performance degradation than traditional methods.
Conclusion
IML offers a robust solution for metric learning in imbalanced settings by enforcing "geometric fairness" through balanced loss components. By escaping the accuracy trap, it provides a more reliable tool for critical applications like anomaly detection and medical diagnosis. Future work will explore non-linear extensions and native multi-class formulations.
Summary updated