Binary Coding in Stream

Mina Ghashami, Amirali AbdullaharXiv 2015 · OpenReview

Abstract

Big data is becoming ever more ubiquitous, ranging over massive video repositories, document corpuses, image sets and Internet routing history. Proximity search and clustering are two algorithmic primitives fundamental to data analysis, but suffer from the "curse of dimensionality" on these gigantic datasets. A popular attack for this problem is to convert object representations into short binary codewords, while approximately preserving near neighbor structure. However, there has been limited research on constructing codewords in the "streaming" or "online" settings often applicable to this scale of data, where one may only make a single pass over data too massive to fit in local memory. In this paper, we apply recent advances in matrix sketching techniques to construct binary codewords in both streaming and online setting. Our experimental results outperform several of the most popularly used algorithms, and we prove theoretical guarantees on performance in the streaming setting under mild assumptions on the data and randomness of the training set.

Introduction

As datasets scale to massive proportions, traditional proximity search and clustering methods face the "curse of dimensionality." Mapping high-dimensional data into short, similarity-preserving binary bitstrings (codewords) has emerged as a powerful solution, enabling efficient searches in Hamming space. However, most effective binary coding methods are batch-oriented, requiring the entire dataset to be available in memory to learn optimal mappings.

In many real-world applications, data arrives as a continuous stream too large to store locally. Existing online hashing methods often lack theoretical rigor or fail to capture the global structure of the data. This paper introduces Streaming Spectral Binary Coding (SSBC), a novel algorithm designed to generate similarity-preserving binary codes in a single pass over the data with minimal memory requirements.

Methodology: Streaming Spectral Binary Coding

SSBC adapts the framework of Spectral Hashing for the streaming setting by integrating advanced matrix sketching techniques. The core process involves:

  1. Affinity Modeling: The algorithm models similarity between data points using a Gaussian kernel, aiming to approximate the eigenvectors of a massive $N \times N$ affinity matrix.
  2. Frequent Directions (FD) Sketching: To avoid storing the full affinity matrix, SSBC maintains a compact "sketch" of the data using the Frequent Directions algorithm. As new data arrives, affinity vectors are buffered. Once full, the algorithm performs a Singular Value Decomposition (SVD), shrinking singular values to discard noise while retaining the most significant data directions.
  3. Code Generation: Binary codes are produced by projecting data points onto these learned principal directions and applying a sign function.
  4. Operational Modes: The algorithm supports both a streaming mode (outputting codes after processing the stream) and an online mode (generating codes immediately upon data arrival).

Experimental Evaluation

SSBC was evaluated against standard benchmarks, including Locality Sensitive Hashing (LSH), Spectral Hashing (SH), and Multidimensional Spectral Hashing (MDSH), across several datasets such as PAMAP (physical activity monitoring) and CBM (naval propulsion maintenance).

Performance comparison on the PAMAP dataset showing precision, recall, and mean average precision across different bit lengths.

As illustrated in Figure 1, SSBC (represented by green circles) consistently provides the highest precision and recall across various codeword lengths on the PAMAP dataset. Notably, SSBC often outperforms "exact" batch methods, suggesting that the matrix sketching process acts as a form of regularization that prevents overfitting to noise.

Performance comparison on the CBM dataset, demonstrating SSBC's superior precision and recall stability.

Results on the CBM dataset (Figure 2) further confirm these findings. SSBC maintains a stable performance edge as the number of bits increases from 20 to 50. A standout feature of SSBC is its precision-recall curve, which often forms a near 45-degree line, indicating a low false-positive rate even when returning a larger number of neighbors.

Key Insights and Theoretical Guarantees

  • Efficiency: SSBC operates with $O(n/\epsilon \text{ polylog } n)$ space and $O(d/\epsilon \text{ polylog } n)$ update time per point, making it suitable for high-speed streams.
  • Theoretical Bounds: The paper proves that SSBC provides a high-quality approximation of the affinity matrix under the assumptions of data sparsity and bounded doubling dimension.
  • Robustness: The algorithm's reliance on Frequent Directions sketching allows it to capture global data structures more effectively than previous online hashing methods.

Conclusion and Future Work

SSBC offers a memory-efficient and theoretically grounded approach to binary coding for massive data streams. While highly effective in unsupervised settings, future work could extend this sketching approach to semi-supervised hashing or adapt the algorithm to handle non-stationary streams where data distributions shift over time (concept drift).

Summary updated

Abstract

Big data is becoming ever more ubiquitous, ranging over massive video repositories, document corpuses, image sets and Internet routing history. Proximity search and clustering are two algorithmic primitives fundamental to data analysis, but suffer from the "curse of dimensionality" on these gigantic datasets. A popular attack for this problem is to convert object representations into short binary codewords, while approximately preserving near neighbor structure. However, there has been limited research on constructing codewords in the "streaming" or "online" settings often applicable to this scale of data, where one may only make a single pass over data too massive to fit in local memory. In this paper, we apply recent advances in matrix sketching techniques to construct binary codewords in both streaming and online setting. Our experimental results compete outperform several of the most popularly used algorithms, and we prove theoretical guarantees on performance in the streaming setting under mild assumptions on the data and randomness of the training set.
BibTeX
@misc{ghashami2015binary,
  author = {Mina Ghashami and Amirali Abdullah},
  title = {{Binary Coding in Stream}},
  year = {2015},
  eprint = {1503.06271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1503.06271},
}
Figure