Why Size Matters: Feature Coding as Nystrom Sampling

Oriol Vinyals, Yangqing Jia, Trevor Darrell · OpenReview

Introduction

In classical computer vision and machine learning, a common pipeline involves "coding" raw data (like image patches) into a new representation using a dictionary, followed by a linear classifier. While researchers empirically knew that larger dictionaries (more "codebook" elements) generally led to better accuracy, there wasn't a clear theoretical model to predict this relationship.

This paper provides a theoretical framework for understanding why larger dictionaries improve performance. By reframing feature coding as a form of Nyström sampling, the authors derive mathematical bounds that explain why accuracy increases with dictionary size but eventually hits a point of diminishing returns (saturation).

Feature Coding as Nyström Sampling

The authors propose a novel view: feature coding is fundamentally an approximation of a kernel method.

  1. The "Ideal" Case: Imagine having infinite memory and compute to compare every data point to every other data point in a training set. This would create a massive "kernel matrix" representing all pairwise similarities.
  2. Nyström Sampling: Since computing the ideal kernel matrix is computationally impossible for large datasets, we use a subset of the data—a dictionary—to approximate it. This technique is known as Nyström sampling.
  3. The Approximation Bound: Using existing proofs from Nyström theory, the authors show that the error in approximating the "ideal" kernel matrix is bounded by a function of the dictionary size ($c$). Specifically, the error follows a trend of $O + Mc^{-1/4}$, where $M$ and $O$ are dataset-specific constants.

By treating the dictionary as a subsample of the training data, this error bound serves as a proxy to predict how classification accuracy will behave as the dictionary grows.

Empirical Validation and Key Insights

The researchers validated their model using three widely recognized benchmarks: CIFAR-10, TIMIT (acoustic-phonetic continuous speech recognition), and STL-10.

Predictive Power and Saturation

The $c^{-1/4}$ term in the approximation formula is a critical insight. It explains the "saturation" effect: why moving from a dictionary of 100 to 1,000 yields huge gains, but moving from 10,000 to 20,000 yields much smaller improvements. You need exponentially more data to achieve linear improvements in approximation quality.

Empirical accuracy and Nyström bounds on CIFAR and TIMIT datasets.

As seen in the results for CIFAR and TIMIT, the theoretical Nyström bound closely tracks the actual empirical accuracy. This predictive power allows researchers to run a few small-scale tests and accurately extrapolate the expected accuracy of a much larger, more expensive dictionary. Furthermore, because "flat" models (single-layer coding) eventually saturate, this provides a theoretical justification for "stacking" layers—a nod toward the necessity of deep learning architectures.

Overshooting (PDL)

The paper also introduces the idea of "overshooting"—starting with a very large dictionary and then pruning it down using smart sampling (like K-centers). This approach, referred to as Pruned Dictionary Learning (PDL), often yields better results than training a small dictionary from scratch.

Accuracy vs. Final Dictionary Size comparing K-means and PDL methods.

On datasets like STL-10, using the overshooting method consistently outperformed standard K-means. For example, starting with a dictionary 8x larger than the final target and pruning it led to a noticeable accuracy boost without increasing the final computational cost of classification.

Limitations and Future Directions

While the framework provides strong theoretical grounding, the authors note a few limitations:

  • The Accuracy Proxy: The formal mathematical link between the kernel matrix error (measured in Frobenius norm) and final classification accuracy isn't perfectly tight. Various factors make the model a lower bound rather than an exact prediction.
  • Linear Classifiers: The study focuses on pipelines using linear classifiers. The dynamics might change with non-linear classifiers or more complex end-to-end trained neural networks.
  • Pooling: Modern pipelines often include a "pooling" step to summarize features over a region. Future work should focus on "pooling-aware" dictionaries that account for this spatial integration.

Summary updated

BibTeX
@inproceedings{vinyals2013why,
  author = {Oriol Vinyals and Yangqing Jia and Trevor Darrell},
  title = {{Why Size Matters: Feature Coding as Nystrom Sampling}},
  booktitle = {International Conference on Learning Representations},
  year = {2013},
  url = {https://openreview.net/forum?id=DD2gbWiOgJDmY},
}
Figure