Stochastic Covariance Compression

Matt J. Kusner, Nicholas I. Kolkin, Stephen Tyree, Kilian Q. WeinbergerarXiv 2014

Abstract

Covariance and histogram image descriptors provide an effective way to capture information about images. Both excel when used in combination with special purpose distance metrics. For covariance descriptors these metrics measure the distance along the non-Euclidean Riemannian manifold of symmetric positive definite matrices. For histogram descriptors the Earth Mover's distance measures the optimal transport between two histograms. Although more precise, these distance metrics are very expensive to compute, making them impractical in many applications, even for data sets of only a few thousand examples. In this paper we present two methods to compress the size of covariance and histogram datasets with only marginal increases in test error for k-nearest neighbor classification. Specifically, we show that we can reduce data sets to 16% and in some cases as little as 2% of their original size, while approximately matching the test error of kNN classification on the full training set. In fact, because the compressed set is learned in a supervised fashion, it sometimes even outperforms the full data set, while requiring only a fraction of the space and drastically reducing test-time computation.

Introduction

In computer vision, histograms (capturing feature distributions) and covariance matrices (capturing feature relationships) are highly effective descriptors. However, these descriptors require specialized, non-Euclidean distance metrics to be effective: the Earth Mover’s Distance (EMD) for histograms and Riemannian metrics for covariance matrices. These metrics are computationally expensive, often scaling at $O(d^3)$ or worse.

When applied to k-nearest neighbor (kNN) classification, every test image must be compared against the entire training set. For datasets of even moderate size, this becomes a significant bottleneck. This research addresses the "curse of computation" by transforming data compression into a supervised learning problem, creating a small set of optimized "artificial prototypes" that represent the original data well enough to maintain classification performance.

Methodology

The proposed methods, Stochastic Covariance Compression (SCC) and Stochastic Histogram Compression (SHC), move beyond simple random subsampling. Instead, they learn synthetic training sets through a supervised framework.

  1. Stochastic Neighborhoods: Inspired by Neighborhood Components Analysis (NCA), the authors define a "soft" kNN where the probability $p_{ij}$ of a test point $i$ selecting prototype $j$ as its neighbor is calculated. The objective is to minimize the KL-divergence between this soft neighborhood and an ideal distribution where points only identify neighbors of the same class.
  2. SCC (Covariance): To maintain the Symmetric Positive Definite (SPD) property of covariance matrices, optimization is performed via Cholesky decomposition. The Jensen-Bregman LogDet Divergence (JBLD) is utilized as a computationally efficient proxy for complex Riemannian distances.
  3. SHC (Histogram): To ensure learned histograms remain valid (non-negative and normalized), a softmax-like change of variables is used. The Sinkhorn Distance, a regularized version of EMD, is employed to accelerate computation during training.

Experimental Datasets

The efficacy of SCC and SHC was evaluated across a diverse array of benchmarks representing various computer vision challenges.

Sample images from the evaluation datasets, including ETH80 (objects), ETHZ (pedestrians), COIL20 (3D objects), FERET (faces), KTH-TIPS2b (textures), and SCENE15 (scenes).
  • Covariance Tasks: ETH80, ETHZ, FERET, RGB-D, SCENE15, and KTH-TIPS2b.
  • Histogram Tasks: COIL20, KYLBERG, and MPEG7.

Results and Discussion

The results demonstrate that synthetic prototypes can be more effective than raw training data. Because the compression is supervised, the algorithm naturally filters out "noisy" examples that might otherwise degrade kNN performance.

Key findings include:

  • High Compression Ratios: Reducing training sets to 16% of their original size resulted in negligible loss in accuracy. In extreme cases, datasets were compressed to just 2% of their original volume.
  • Computational Speedups: The 2% compression ratio yielded test-time speedups of 36x to 48x.
  • Performance Gains: On the SCENE15 and KTH datasets, the compressed 2% dataset actually outperformed the full 100% dataset, suggesting that the learned prototypes provide a more robust representation of class boundaries.
  • Superiority over Baselines: Both SCC and SHC consistently outperformed standard reduction techniques like random subsampling and Condensed Nearest Neighbor (CNN).

Conclusion

SCC and SHC provide a robust framework for making expensive distance metrics viable for real-time kNN classification. While the initial training (compression) phase requires a one-time computational investment, the resulting speedups at test time are transformative. Future work may involve GPU acceleration of the gradient-based optimization and extending these principles to other non-Euclidean data types.

Summary updated

BibTeX
@misc{kusner2014stochastic,
  author = {Matt J. Kusner and Nicholas I. Kolkin and Stephen Tyree and Kilian Q. Weinberger},
  title = {{Stochastic Covariance Compression}},
  year = {2014},
  eprint = {1412.1740},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1412.1740},
}
Figure