Generalized Compression Dictionary Distance as Universal Similarity Measure

Andrey Bogomolov, Bruno Lepri, Fabio PianesiarXiv 2014

Abstract

We present a new similarity measure based on information theoretic measures which is superior than Normalized Compression Distance for clustering problems and inherits the useful properties of conditional Kolmogorov complexity. We show that Normalized Compression Dictionary Size and Normalized Compression Dictionary Entropy are computationally more efficient, as the need to perform the compression itself is eliminated. Also they scale linearly with exponential vector size growth and are content independent. We show that normalized compression dictionary distance is compressor independent, if limited to lossless compressors, which gives space for optimizations and implementation speed improvement for real-time and big data applications. The introduced measure is applicable for machine learning tasks of parameter-free unsupervised clustering, supervised learning such as classification and regression, feature selection, and is applicable for big data problems with order of magnitude speed increase.

Introduction

Measuring similarity between objects is a foundational challenge in machine learning. Traditional metrics, such as Euclidean distance (L2-norm) or Pearson correlation, typically require prior assumptions about the data's statistical distribution. Information theory offers a more universal approach via Kolmogorov complexity—the length of the shortest program required to generate a piece of data. While theoretically ideal, Kolmogorov complexity is uncomputable.

To address this, researchers previously developed Normalized Compression Distance (NCD), which uses real-world lossless compressors (like ZIP or GZIP) as a proxy. However, NCD is computationally expensive for large-scale data because it requires performing full compression multiple times for every pair of objects. Furthermore, NCD can be "blind" to certain structural nuances because it only evaluates the final compressed file size, ignoring the internal patterns discovered during the process.

Methodology

This paper introduces the Generalized Compression Dictionary Distance (GCDD). Instead of analyzing the final compressed output, GCDD focuses on the compression dictionary—the set of patterns and frequencies identified by algorithms like Lempel-Ziv-Welch (LZW) or Huffman coding during the compression process.

Key Technical Innovations

  • Functional Characteristics (Φ): GCDD utilizes functions of the dictionary (such as size or entropy) to generate n-dimensional feature vectors.
  • Algorithmic Efficiency: By relying on the dictionary generated during processing, the final step of writing compressed bits to disk is eliminated. The complexity is proportional to $O(k m_x \log m_y)$, where $m$ is the dictionary size, allowing linear scaling even as input data grows exponentially.
  • Compressor Independence: The measure remains consistent across different lossless compressors, facilitating hardware-specific optimizations for real-time applications.

Experimental Setup

The method was evaluated using the Synthetic Control Chart Time Series dataset from the UCI Machine Learning Repository. This dataset consists of 600 examples across six classes: Normal, Cyclic, Increasing Trend, Decreasing Trend, Upward Shift, and Downward Shift. It serves as a benchmark for a measure's ability to distinguish temporal patterns in noisy data.

Results and Discussion

Using multidimensional scaling (MDS) to visualize dissimilarity matrices, the authors demonstrated that GCDD groups time-series trends more effectively than traditional methods.

Comparison of dissimilarity matrix projections for GCDD, NCD, L2 norm, and Correlation.

As shown in Figure 2, GCDD provides a cleaner separation of classes on a hyperplane compared to the L2-norm or Pearson correlation. While NCD also performs well, GCDD achieves similar or better results with significantly lower computational overhead.

Furthermore, GCDD was compared against numerically intensive methods like Autocorrelation-based clustering. The compression-based approach provided comparable separation ability while being more applicable to big data contexts due to its speed.

Autocorrelation based dissimilarity matrix projection.

Conclusion and Future Work

GCDD represents a robust, parameter-free similarity measure that avoids the biases of human-defined features. It is content-independent, treating all data as byte arrays, which makes it truly universal. Future research will focus on extending the application of GCDD to 2D data, such as image processing, and exploring its integration as a feature representation layer within deep learning pipelines.

Summary updated

BibTeX
@misc{bogomolov2014generalized,
  author = {Andrey Bogomolov and Bruno Lepri and Fabio Pianesi},
  title = {{Generalized Compression Dictionary Distance as Universal Similarity Measure}},
  year = {2014},
  eprint = {1410.5792},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1410.5792},
}
Figure