NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

NMF-KNN: Image Annotation Using Weighted Multi-view Non-negative Matrix Factorization

Mahdi M. Kalayeh, Haroon Idrees, Mubarak ShahCVPR 2014

Abstract

Real-world image databases like Flickr are characterized by the continuous addition of new images. Recent approaches for image annotation—assigning tags to images—suffer from two major drawbacks: models often require expensive relearning as new data arrives, and feature fusion is typically handled through ad-hoc methods. This paper presents a weighted extension of Multi-view Non-negative Matrix Factorization (NMF) to address these issues. By learning a query-specific generative model on the features and tags of nearest neighbors, the proposed NMF-KNN approach enforces consensus across different features. This naturally solves the feature fusion problem while weight matrices alleviate dataset imbalance. Being query-specific, the approach remains unaffected by the addition of new images or tags.

Introduction

The explosion of visual data on platforms like Flickr and Facebook presents a significant challenge for automatic image annotation. Traditional discriminative models, such as SVMs, often struggle with scalability; they become obsolete as new images and tags are introduced, necessitating frequent and costly retraining. Furthermore, images are typically represented by diverse feature sets (e.g., color histograms, GIST, SIFT), yet most systems combine these using simplistic averaging that ignores latent structural relationships. Finally, the "rare tag" problem—where common labels like "sky" dominate while descriptive but infrequent tags are ignored—remains a persistent hurdle.

NMF-KNN addresses these challenges by treating tags as a distinct "view" in a multi-view matrix factorization process. By enforcing a consensus between visual features and tags while specifically weighting rare labels, the framework achieves high performance without global model retraining.

Methodology: The NMF-KNN Framework

The NMF-KNN approach operates as a query-specific generative model, executing in three primary stages:

1. Neighborhood Selection

For a given query image, the system identifies its $N$ nearest neighbors in the database. This search is based on an average of distances across multiple visual feature spaces.

2. Weighted Multi-view NMF

This is the core of the framework. A joint Non-negative Matrix Factorization is performed on the features and tags of the selected neighbors.

  • Multi-view Integration: Tags are treated as an additional feature set or "view."
  • Consensus Constraint: The optimization process forces coefficient matrices (representing latent concepts) to be consistent across all views. This ensures that visual basis vectors (e.g., "furry texture") align with corresponding tag basis vectors (e.g., "dog").
  • Boosting Mechanism: Two weight matrices, $T$ and $W$, are introduced. $T$ penalizes errors on rare tags more heavily, while $W$ prioritizes training images containing those rare tags, mitigating class imbalance.
The NMF-KNN pipeline: from query image and feature extraction to nearest neighbor selection and weighted multi-view matrix factorization for tag prediction.

3. Tag Transfer

To annotate the query image, the system calculates its visual coefficients using the learned basis. These are then projected onto the tag basis to generate scores for potential labels.

Experimental Evaluation

The authors evaluated NMF-KNN on two standard benchmarks: Corel5K (5,000 images, 260 tags) and ESP Game (~20,000 images, 268 tags).

Key Results

  • Performance: On Corel5K, NMF-KNN achieved an F1 score of 45.2, significantly outperforming the previous state-of-the-art TagProp-σML (36.9). On the ESP Game dataset, it achieved a competitive F1 of 29.0.
  • Efficiency: The method reached these results using only 40 neighbors, compared to the 200 typically required by other KNN-based methods, demonstrating superior information efficiency.
  • Rare Tag Recognition: The boosting mechanism improved recall for the rarest tag categories by up to 3.7% without degrading performance on frequent tags.
Qualitative results of NMF-KNN on various images. Correct tags are shown in green, while incorrect ones are in red.

Discussion and Conclusion

The primary innovation of NMF-KNN lies in treating annotations as a feature matrix, allowing feature fusion to emerge naturally from the factorization process. By building models on-the-fly for each query, the system is inherently "online"—new data can be added to the database without any retraining.

While effective, the approach has limitations. Performing NMF iterations for every query increases "test time" latency compared to pre-trained classifiers. Future work may involve automating hyperparameter selection for visual versus tag views and exploring non-linear "kernelized" NMF to capture more complex relationships. Despite these challenges, NMF-KNN provides a robust, scalable solution for dynamic, real-world image annotation tasks.

Summary updated

BibTeX
@inproceedings{kalayeh2014nmf,
  author = {Mahdi M. Kalayeh and Haroon Idrees and Mubarak Shah},
  title = {{NMF-KNN: Image Annotation Using Weighted Multi-view Non-negative Matrix Factorization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2014},
  url = {https://openreview.net/forum?id=ryZm81GdZH},
}
Figure