Online Metric Learning for Multi-Label Classification

Xiuwen Gong, Dong Yuan, Wei Bao

Introduction

In modern data-driven environments, such as social media tagging and real-time video surveillance, data arrives sequentially in a stream. Each instance in these streams often belongs to multiple categories simultaneously, a challenge known as multi-label classification. While offline methods for multi-label learning are well-established, they are impractical for massive or streaming datasets where data cannot be stored in its entirety. Existing online multi-label methods, such as OSML-ELM, frequently encounter two significant hurdles: they often ignore label dependencies (treating labels as independent entities) and lack theoretical rigor regarding loss function performance bounds.

This paper introduces a novel Online Metric Learning (OML) framework specifically designed to address these gaps. By projecting both instances and labels into a shared low-dimensional embedding space and enforcing a large-margin constraint, the OML algorithm effectively captures label correlations while maintaining the computational efficiency required for real-time applications.

Methodology

The core of the OML framework is the learning of a projection matrix that maps high-dimensional features ($x$) and label vectors ($y$) into a common, lower-dimensional embedding space.

Shared Embedding and Large Margin

Unlike traditional approaches that treat labels as static targets, OML treats them as points in a geometric space. The objective is to minimize the distance between an instance and its ground-truth label vector relative to any other possible label combination. Borrowing from Support Vector Machine (SVM) principles, the model enforces a "margin" between correct and incorrect label configurations. If the model's prediction falls within this margin or is incorrect, an update is triggered.

Efficient Optimization

To handle the velocity of streaming data, the authors derived a closed-form-like update rule. The optimization is formulated as a Lagrangian problem, solved using a cubic function approximation to determine the optimal step size ($\lambda$) rapidly. Once the metric is learned, a $k$-Nearest Neighbors ($k$NN) approach is integrated within the learned embedding space to perform final label predictions for unseen instances.

Experimental Evaluation

The OML algorithm was rigorously tested against state-of-the-art baselines, including OSML-ELM, OLANSGD, and standard $k$NN, across eight diverse benchmark datasets. These included text/social data (Enron, Slashdot), multimedia (Corel5k, Image, Scene, Emotions), and medical/acoustic data (FullMedical, Cal500). These datasets provided a wide range of feature dimensions and label densities to test the algorithm's versatility.

Figure 3: Hamming Loss on the FullMedical dataset, showing OML achieving the lowest error rate compared to baselines.

Results and Discussion

Across all evaluated datasets, OML consistently demonstrated superior performance in terms of both accuracy and error reduction. Key findings include:

  • Lower Error Rates: OML achieved the lowest Hamming Loss across the board, indicating a higher precision in individual label assignments. As seen in the FullMedical dataset (Figure 3), OML maintains a consistently low error rate as more data is processed.
  • Higher Accuracy Metrics: The algorithm outperformed competitors in Macro-F1, Micro-F1, and Example-F1 scores. On the Emotions dataset (Figure 4), OML showed a significant lead in Micro-F1, particularly as the percentage of processed data increased.
  • Stability and Theoretical Soundness: Unlike stochastic methods that exhibit high variance, OML’s performance improved steadily. Furthermore, the authors provided a mathematical proof of a cumulative loss upper bound, offering a theoretical guarantee that the model's total error over time is bounded relative to an optimal projection matrix.
Figure 4: Micro F1 score on the Emotions dataset, illustrating OML's superior accuracy as the dataset size increases.

Conclusion

The proposed Online Metric Learning framework represents a significant advancement in streaming multi-label classification. By treating labels as geometric points and learning a discriminative metric, OML successfully captures label dependencies that other online methods miss. While future work may address the computational bottleneck of $k$NN in extremely large memory settings or automate hyperparameter tuning, OML currently stands as a robust, theoretically grounded solution for real-time multi-label tasks.

Summary updated

BibTeX
@inproceedings{gong2020online,
  author = {Xiuwen Gong and Dong Yuan and Wei Bao},
  title = {{Online Metric Learning for Multi-Label Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5818},
}
Figure