Abstract
Dimension reduction and data quantization are two important methods for reducing data complexity. In this paper, we study the methodology of first reducing data dimension by random projection and then quantizing the projections to ternary or binary codes, which has been widely applied in classification. Usually, the quantization will seriously degrade the accuracy of classification due to high quantization errors. Interestingly, however, we observe that the quantization could provide comparable and often superior accuracy, as the data to be quantized are sparse features generated with common filters. Furthermore, this quantization property could be maintained in the random projections of sparse features, if both the features and random projection matrices are sufficiently sparse. By conducting extensive experiments, we validate and analyze this intriguing property.
Introduction
In large-scale machine learning, researchers frequently encounter the "curse of dimensionality." To make models deployable on resource-constrained devices, two primary strategies are employed: Dimension Reduction (reducing the length of feature vectors) and Quantization (reducing numerical precision, such as from 32-bit floats to 1-bit binary).
Traditionally, quantization is viewed as a necessary evil—a trade-off where accuracy is sacrificed for memory efficiency. This research investigates a specific pipeline: reducing dimensions via random projection followed by aggressive quantization into binary {0, 1} or ternary {0, ±1} codes. Contrary to conventional wisdom, we demonstrate that for sparse features, this extreme compression can actually act as a robust feature selector and noise filter, improving classification performance.
Methodology
The proposed pipeline consists of four distinct stages designed to leverage the inherent sparsity of modern data features:
- Sparse Feature Generation: Features are extracted using common filters such as Discrete Cosine Transform (DCT), Discrete Wavelet Transform (DWT), or the internal layers of Convolutional Neural Networks (CNNs). These methods naturally produce "heavy-tailed" distributions where the majority of values are near zero.
- Sparse Random Projection: To reduce dimensionality, features are multiplied by a random matrix. Crucially, the use of extremely sparse ternary matrices (often with only one non-zero element per column) ensures the resulting projections retain their sparse characteristics.
- Quantization:
- Ternary (TC): Elements with small magnitudes are zeroed out via thresholding, while remaining elements are set to +1 or -1.
- Binary (BC): Derived by taking the ternary code and zeroing out all negative entries.
- kNEC Classifier: We introduce the k-nearest exemplar-based classifier (kNEC). Unlike standard kNN, which identifies the k closest neighbors across the entire dataset, kNEC calculates similarity to a class by summing distances to the k nearest neighbors within that specific class.
Experimental Results
We validated our methodology on three standard benchmarks: YaleB (face images), CIFAR-10 (natural images via AlexNet features), and ImageNet (large-scale images via VGG16 features).
The Quantization Gain
The most striking finding is the "quantization gain." By zeroing out small elements—often representing noise or high-frequency gradients—and unifying the magnitude of significant elements, the process suppresses outliers and compacts intra-class distances. As shown in the performance table below, Ternary Codes (TC) and Binary Codes (BC) frequently outperform the original Real-valued Codes (RC).
Key observations from the results include:
- Superiority over Real Values: On the YaleB dataset, TC achieved nearly 100% accuracy, significantly outperforming the original RC which hovered around 97%.
- Binary vs. Ternary: In ImageNet, BC actually outperformed TC at lower sparsity ratios ($k/n \le 0.4$), suggesting that for certain high-dimensional data, the positive and negative components of sparse features carry redundant information.
- Classifier Performance: The proposed $k$NEC classifier consistently outperformed standard $k$NN and matched the performance of the more complex Local Subspace Classifier (LSC) while maintaining higher computational efficiency.
Discussion and Insights
Our analysis suggests that for classification tasks, the distribution of significant features is more critical than their exact energy or magnitude. This "sparse coding + exemplar matching" approach mirrors biological visual systems, which utilize Gabor-like sparse filters and cognitive exemplar recognition.
However, this gain is not universal. It requires a "Sparsity Requirement": both the data features and the projection matrices must be sparse. If a standard dense Gaussian random projection is used, the quantization gain typically disappears.
Conclusion and Future Work
While this study demonstrates the power of quantization as a feature enhancer, some challenges remain. The performance is sensitive to the threshold $\tau$ used for quantization, and an automated method for threshold selection is needed. Furthermore, while we provide an empirical explanation centered on noise reduction, the exact underlying mechanism of these "quantization networks" warrants further theoretical exploration, particularly their applicability to modern architectures like Vision Transformers (ViTs).
Summary updated