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

A Supervised Neural Autoregressive Topic Model for Simultaneous Image Classification and Annotation

Yin Zheng, Yu-Jin Zhang, Hugo LarochellearXiv 2013

Abstract

Topic modeling based on latent Dirichlet allocation (LDA) has been a framework of choice to perform scene recognition and annotation. Recently, a new type of topic model called the Document Neural Autoregressive Distribution Estimator (DocNADE) was proposed and demonstrated state-of-the-art performance for document modeling. In this work, we show how to successfully apply and extend this model to the context of visual scene modeling. Specifically, we propose SupDocNADE, a supervised extension of DocNADE, that increases the discriminative power of the hidden topic features by incorporating label information into the training objective of the model. We also describe how to leverage information about the spatial position of the visual words and how to embed additional image annotations, so as to simultaneously perform image classification and annotation. We test our model on the Scene15, LabelMe and UIUC-Sports datasets and show that it compares favorably to other topic models such as the supervised variant of LDA.

Introduction: Bridging the Gap in Visual Scene Modeling

In computer vision, machines are often tasked with two distinct but related objectives: classification (identifying the overall scene) and annotation (identifying specific objects within the scene). While these tasks are inherently linked—for instance, a "pedestrian" is more likely to appear in a "street" scene than on a "glacier"—they are frequently addressed as separate problems.

Historically, Latent Dirichlet Allocation (LDA) served as the standard for topic modeling in images, treating an image as a "bag of visual words" (quantized local features like SIFT). However, LDA faces significant challenges: inference is computationally expensive due to complex iterative approximations, and standard LDA is unsupervised, often struggling to balance data description with label prediction even in its supervised variant (sLDA).

This paper introduces SupDocNADE, a supervised neural topic model designed to handle both classification and annotation simultaneously and efficiently.

Methods: The SupDocNADE Architecture

The core of this work is an extension of DocNADE, a model that utilizes the probability chain rule to predict the next word in a document based on preceding words. SupDocNADE transforms this concept for visual scenes by treating an image as a document of visual words.

Architecture of the SupDocNADE model for joint image classification and annotation.

Key Extensions

The authors introduce three primary enhancements to the base DocNADE model to adapt it for supervised visual tasks:

  • Hybrid Objective Function: The model minimizes a weighted sum of classification error and word-prediction error. This hybrid approach allows the hidden "topic" features to be both descriptive of the image content and discriminative for the scene label. A hyperparameter ($\lambda$) is used to tune this balance.
  • Spatial Awareness: To overcome the limitations of the "bag-of-words" approach, images are divided into a $2 \times 2$ grid. A visual word's identity is combined with its grid location (e.g., "car in top-left"), preserving crucial spatial context.
  • Joint Annotation: Textual annotations (e.g., "sky", "tree") are treated as additional words in the document. During testing, the model computes the probability of these annotation words given the observed visual words.

Efficiency via Binary Word Trees

Predicting a word from a large vocabulary is computationally intensive. SupDocNADE addresses this by using a balanced binary tree for the output layer. Instead of a linear search through the vocabulary, the model learns a series of binary decisions to reach a specific word, reducing complexity to $O(\log K)$.

Experimental Setup and Datasets

The model was evaluated on three standard benchmarks:

  • Scene15: 4,485 images across 15 classes (e.g., office, kitchen), used primarily for classification.
  • LabelMe: 1,600 images across 8 classes with detailed user-provided annotations.
  • UIUC-Sports: 1,792 images of 8 sports (e.g., rowing, badminton) with annotations.

Key Results and Insights

  • Classification Performance: On Scene15, SupDocNADE achieved approximately 78% accuracy with 200 topics, significantly outperforming sLDA (~71%).
  • Annotation Accuracy: The model reached F-measures of 43.87% on LabelMe and 46.95% on UIUC-Sports, substantially beating sLDA's scores of 38.7% and 35.0%, respectively.
  • Generative Regularization and ReLU: The generative task of predicting visual words acts as a powerful regularizer, forcing hidden features to capture structural image data and preventing overfitting. Additionally, using Rectified Linear Units (ReLU) instead of traditional sigmoids provided a significant performance boost.
  • Spatial and Contextual Insights: The $2 \times 2$ spatial grid consistently improved performance, confirming that feature location is vital. Furthermore, the model learns intuitive associations; for a "Street" scene, it assigns high weights to annotations like "building" and "person walking."

Conclusion

SupDocNADE demonstrates that a neural autoregressive approach can effectively bridge the gap between image classification and annotation. While it may offer less direct interpretability than probabilistic models like LDA, its efficiency and superior performance on benchmark datasets make it a powerful tool for visual scene modeling. Future work may explore more granular spatial layouts and optimized tree structures for even larger vocabularies.

Summary updated

BibTeX
@misc{zheng2013supervised,
  author = {Yin Zheng and Yu-Jin Zhang and Hugo Larochelle},
  title = {{A Supervised Neural Autoregressive Topic Model for Simultaneous Image Classification and Annotation}},
  year = {2013},
  eprint = {1305.5306},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1305.5306},
}
Figure