Fried Binary Embedding for High-Dimensional Visual Features

Weixiang Hong, Junsong Yuan, Sreyasee Das Bhattacharjee

Fried Binary Embedding for High-Dimensional Visual Features

In the domain of large-scale image retrieval, high-dimensional vectors—such as 4096-D features extracted from Deep Neural Networks—are typically converted into binary strings. This process enables efficient storage and rapid searching using Hamming distance. While researchers traditionally favored compact codes (e.g., 128 or 256 bits) for their low computational cost, recent evidence suggests that "long codes" (where the bit length $b$ is close to the feature dimension $d$) offer significantly higher accuracy. For example, a 4096-bit code can achieve ~82% accuracy, whereas a 256-bit code may only reach ~51%.

However, generating long codes presents two major challenges: the $O(d^2)$ computational complexity of dense matrix-vector multiplication and the high risk of overfitting due to the millions of parameters involved in the projection matrix.

Methodology: The Fastfood Transform

Fried Binary Embedding (FBE) addresses these issues by replacing the standard dense projection matrix with a product of structured matrices based on an adaptive Fastfood transform:

$$R = SHG\Pi HB$$

In this structure, $H$ represents a Walsh-Hadamard matrix, which allows for fast transforms with $O(d \log d)$ complexity. The learnable parameters are restricted to diagonal matrices ($S, G, B$), drastically reducing the model's footprint. For a 4096-D feature, FBE requires only ~12,000 parameters—just 0.1% of the ~16.7 million parameters required by traditional methods like Iterative Quantization (ITQ).

The Overfitting Paradox

A key insight of FBE is the "Overfitting Paradox." In high-dimensional hashing, minimizing "quantization loss" (how well the binary code fits the original data) does not always lead to better retrieval performance. Dense methods like ITQ often overfit the training data, resulting in lower accuracy (mAP) on new data even as their training loss decreases. FBE’s structured approach acts as a natural regularizer, preventing this memorization and ensuring better generalization.

mAP vs. Iteration: FBE demonstrates superior generalization and higher mAP compared to ITQ in high-dimensional settings.

Key Results and Efficiency

FBE was evaluated across multiple benchmarks, including DNN-4096 and VLAD-25600. The results confirm that FBE consistently outperforms state-of-the-art methods in long-bit scenarios while maintaining high efficiency.

Performance on DNN-4096: (a) mAP vs. bits and (b) Encoding time vs. bits. FBE maintains high accuracy and log-linear scaling.
  • Accuracy: On the DNN-4096 dataset, FBE outperformed ITQ, Circulant Binary Embedding (CBE), and Sparse Projection (SP) as bit length increased.
  • Speed: FBE maintains log-linear complexity, making long-bit encoding feasible even on resource-constrained devices like mobile phones.
  • Retrieval: On the Holidays+1M dataset, FBE achieved a mAP of 49.3%, nearly matching the performance of the original raw features at a fraction of the storage cost.

Conclusion

Fried Binary Embedding demonstrates that structural constraints on projection matrices are a benefit, not a compromise. By reducing complexity to $O(d \log d)$ and providing inherent regularization, FBE enables the practical use of highly accurate long binary codes for high-dimensional visual data.

Summary updated

BibTeX
@inproceedings{hong2017fried,
  author = {Weixiang Hong and Junsong Yuan and Sreyasee Das Bhattacharjee},
  title = {{Fried Binary Embedding for High-Dimensional Visual Features}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  doi = {10.1109/cvpr.2017.659},
}
Figure