Unsupervised and Supervised Visual Codes with Restricted Boltzmann Machines

Hanlin Goh, Nicolas Thome, Matthieu Cord, Joo-Hwee Lim

Abstract

Traditional image classification pipelines often rely on computationally expensive sparse coding to map local descriptors to visual vocabularies. This paper proposes an alternative using Restricted Boltzmann Machines (RBMs) enhanced with a novel dual-regularization scheme and supervised fine-tuning. The resulting model achieves state-of-the-art accuracy on benchmarks like Caltech-101 and 15-Scenes while performing inference 200 times faster than traditional sparse coding methods.

Introduction

In the standard "Bag of Words" (BoW) framework for computer vision, images are represented by local descriptors such as SIFT. A critical step in this pipeline is "coding" — the process of mapping these descriptors onto a pre-learned vocabulary of visual words. Historically, researchers faced a trade-off between the speed of hard assignment (K-means) and the high accuracy of sparse coding. While sparse coding is expressive, it requires solving a complex optimization problem for every local feature during inference, making it a significant bottleneck for real-time applications.

Methodology: RBM-based Visual Coding

The authors propose using Restricted Boltzmann Machines (RBMs) to bridge the gap between speed and accuracy. Unlike sparse coding, which acts primarily as a decoder, an RBM functions as an encoder-decoder pair. Once the RBM is trained, the encoding process — mapping a feature to its code — is a simple, fast feed-forward pass consisting of matrix multiplication and a non-linear activation.

The proposed pipeline: from local feature extraction to category labeling, highlighting the unsupervised RBM learning and supervised fine-tuning stages.

Sparse and Selective Regularization

To ensure the RBM learns a discriminative codebook, the authors introduced a dual-regularization objective. Standard RBMs often produce redundant or "noisy" codes. The proposed regularization forces the model to be:

  1. Sparse: Only a few visual words are active for any given input feature.
  2. Selective: Each visual word responds only to a specific subset of features.

This is achieved through a rank-based transformation that reshapes the activation distribution to match a desired sparse target, ensuring that each visual word carves out its own unique niche in the feature space.

Visualization of the target probability distribution used to enforce sparsity during the RBM training process.

Supervised Fine-Tuning

While the initial codebook is learned in an unsupervised manner, the authors add a second phase of supervised fine-tuning. Using backpropagation, the model leverages category labels to adjust the visual words, making them more effective for the final classification task. This "nudges" the visual words to be more discriminative.

Experimental Results

The model was evaluated on the Caltech-101 and 15-Scenes datasets. Key findings include:

  • Accuracy: The method achieved 78.9% on Caltech-101 and 86.0% on 15-Scenes, matching or exceeding contemporary sparse coding and deep learning baselines.
  • Efficiency: By avoiding iterative optimization at test time, the RBM approach is approximately 200 times faster than Sparse Coding Spatial Pyramid Matching (ScSPM).
  • Compactness: High performance was maintained even with relatively small codebooks (1024 words), compared to the 4096 words often required by other methods to reach similar accuracy.

Conclusion

This work demonstrates that RBMs, when properly regularized and fine-tuned, offer a powerful and efficient alternative to traditional coding schemes in computer vision. By moving the computational burden from inference to training, the approach enables high-performance image classification at a fraction of the temporal cost. Future work may explore more sophisticated pooling methods and improved label propagation for local patches to further boost performance.

Summary updated

BibTeX
@inproceedings{goh2012unsupervised,
  author = {Hanlin Goh and Nicolas Thome and Matthieu Cord and Joo-Hwee Lim},
  title = {{Unsupervised and Supervised Visual Codes with Restricted Boltzmann Machines}},
  booktitle = {European Conference on Computer Vision},
  year = {2012},
  doi = {10.1007/978-3-642-33715-4\_22},
}
Figure