Abstract
Traditional Bag-of-Words (BoW) models for action recognition often suffer from two primary limitations: the use of unsupervised clustering for vocabulary generation and the high computational cost of non-linear SVM kernels. This paper presents a Recurrent Neural Network (RNN) architecture that is mathematically equivalent to the BoW pipeline. By framing BoW as a differentiable network, the authors enable end-to-end discriminative training and the integration of explicit feature maps for kernel approximation. Experimental results on benchmarks like HMDB-51 and UCF101 demonstrate that this model not only outperforms standard BoW baselines by 5-6% but also offers significant computational advantages over traditional SVM-based approaches.
Introduction
The "Bag-of-Words" model has long been a staple in computer vision, particularly for action recognition. The standard workflow involves clustering local features into a visual vocabulary, generating histograms of word occurrences, and classifying these histograms using a Support Vector Machine (SVM) with a non-linear kernel. However, this pipeline is often suboptimal because the vocabulary is learned in an unsupervised manner (e.g., via k-means), failing to leverage class labels during feature aggregation. Furthermore, the quadratic complexity of non-linear SVMs makes them difficult to scale to modern, large-scale video datasets.
Methods: Mapping BoW to a Neural Network
The authors propose a "Bag-of-Words Equivalent RNN" where each component of the traditional pipeline is represented as a specific neural network layer.
- Vocabulary Layer: A single-layer network with a softmax activation is shown to be equivalent to the posterior distribution of a Gaussian Mixture Model, effectively performing soft-assignment of features to visual words.
- Histogramming (Recurrent) Layer: To aggregate these assignments over time, a recurrent layer is used. By setting the recurrent weights to an identity matrix ($\mathbf{I}$) and omitting biases, the layer accumulates word probabilities across the entire video sequence.
- Kernel Layer: To replace the external non-linear SVM, the authors incorporate "explicit feature maps" ($\psi$) directly into the network. These layers mathematically approximate kernels like $\chi^2$ or Hellinger, allowing for non-linear classification within a linear framework.
Because the entire architecture is differentiable, the "visual words" in the vocabulary layer can be updated via backpropagation to maximize classification accuracy, transforming the generative vocabulary into a discriminative one.
Key Insights: Discriminative Vocabularies
A significant finding of this work is the difference between vocabularies learned via k-means versus those learned through discriminative training in the RNN.
As shown in the figure above, k-means tends to spread probability mass relatively evenly across the vocabulary. In contrast, the RNN learns a "prior" where the mass is concentrated on a small subset of highly discriminative visual words. This results in sharper, more informative histograms that facilitate easier classification.
Additionally, the use of an identity matrix for recurrent weights ensures that error signals remain constant over time, making the model highly memory-efficient and capable of processing very long video sequences without the vanishing gradient problems typical of standard RNNs.
Experimental Results
The model was evaluated on several action recognition benchmarks, including HMDB-51 and UCF101, as well as image classification datasets like Caltech-101. Key findings include:
- Accuracy Gains: The RNN model consistently outperformed the k-means BoW baseline, showing improvements of 5% to 6% on major video datasets.
- Computational Efficiency: By utilizing explicit feature maps instead of traditional non-linear SVMs, the training process on UCF101 was approximately six times faster.
- Robustness: The system maintained high performance even when input features were subsampled by up to 90%, highlighting its efficiency in feature-heavy environments.
Conclusion
By bridging the gap between classic Bag-of-Words models and modern deep learning, this research provides a powerful framework for discriminative feature aggregation. While the current model relies on pre-computed local features, its success suggests that similar BoW-inspired layers could serve as effective pooling mechanisms for end-to-end CNN architectures in the future.
Summary updated