BinGAN: Learning Compact Binary Descriptors with a Regularized GAN

Maciej Zieba, Piotr Semberecki, Tarek El-Gaaly, Tomasz Trzcinski

Abstract

BinGAN bridges the performance gap between supervised and unsupervised image descriptors by training a Generative Adversarial Network (GAN) with two novel regularization terms. By "distilling" the rich structural information from high-dimensional intermediate layers into a compact, binarized penultimate layer, BinGAN achieves state-of-the-art results in unsupervised image matching and retrieval.

Introduction

In computer vision, representing images as "descriptors"—compact vectors that allow computers to quickly match similar images or retrieve them from a database—is a fundamental task. Binary descriptors (strings of 1s and 0s) are the gold standard for efficiency because they require minimal memory and can be compared using lightning-fast bitwise operations.

The challenge is that while supervised methods (which use labeled data) produce excellent descriptors, unsupervised methods (which learn from raw images) usually lag far behind in accuracy. Previous unsupervised deep learning approaches often struggled with "quantization loss"—the information lost when converting continuous neural network activations into hard binary bits. BinGAN aims to solve this by better utilizing the internal "knowledge" of a GAN's discriminator.

Methods

The authors leverage the architecture of a GAN, specifically focusing on the Discriminator ($D$). While $D$ is usually trained just to distinguish real images from fake ones, its internal layers naturally learn to extract highly discriminative features. BinGAN introduces a specialized training regime for $D$:

  1. Distance Matching Regularizer (DMR): The authors take a high-dimensional intermediate layer (which contains rich structural information) and a low-dimensional deeper layer (the intended compact descriptor). The DMR forces the low-dimensional layer to mimic the relationships (Hamming distances) found in the high-dimensional layer. If two images are "close" in the high-dimensional space, they must stay "close" in the binary space.
  2. Adjusted Binarization Representation Entropy (BRE): To ensure the binary bits are actually useful, they need to be diverse (high entropy). The authors use a regularizer that encourages individual bits to be 0 or 1 with equal probability and minimizes correlation between bits. Crucially, they weight this entropy based on the high-dimensional distances, focusing the "diversity push" on pairs of vectors that aren't already correlated.
  3. Soft Quantization: Since backpropagation through a hard "sign" function (which turns numbers into -1 or 1) is not possible, they use a softsign proxy during training to allow gradients to flow while still encouraging the model toward binary outputs.

Key Insights

  • The Discriminator as a Teacher: Instead of just using the final layer of a network, BinGAN treats the high-dimensional intermediate layers as a "teacher" that guides the "student" (the compact binary layer) to preserve structural similarity.
  • Distance Preservation over Value Preservation: Most hashing methods try to minimize the error of the binary values themselves. BinGAN argues that it is more important to preserve the relative distances between samples across the network's layers.
  • Weighted Entropy: Not all pairs of images need to be pushed apart equally. By weighting the entropy loss using information from the high-dimensional space, the model avoids wasting "capacity" trying to decorrelate images that are fundamentally similar.

Datasets and Key Results

The model was evaluated on two standard benchmarks: the Brown Dataset (gray-scale image patches used to test local image matching) and CIFAR-10 (tiny color images used to evaluate image retrieval performance).

BinGAN significantly outperformed existing unsupervised methods across both tasks:

  • Image Retrieval (CIFAR-10): On 16-bit codes, BinGAN achieved a 30.05% mean Average Precision (mAP), a massive jump over the previous state-of-the-art unsupervised method, DBD-MQ (21.53%).
Retrieval mAP on CIFAR-10
  • Image Matching (Brown): BinGAN achieved the lowest False Positive Rate (FPR@95%) among unsupervised descriptors. For example, on the Liberty/Yosemite test split, it reached 25.76% FPR, outperforming SIFT (36.27%) and DeepBit (32.06%).
Matching FPR@95% on Brown Dataset
  • Ablation Success: The authors also demonstrated that using both DMR and BRE is essential; removing either one leads to a significant drop in descriptor quality.

Limitations and Future Work

  • Gap to Supervised Methods: While BinGAN narrows the gap, it still doesn't quite reach the performance of top-tier supervised models (like L2-Net), which benefit from explicit "same/different" labels during training.
  • Training Complexity: Like all GANs, training can be sensitive to hyperparameters, though the authors provide fixed values that worked across their tests.
  • Future Directions: The authors suggest that the generative side of BinGAN (the Generator) could be used to create "synthetic" training pairs for semi-supervised learning, potentially closing the gap to supervised methods even further.

Summary updated

BibTeX
@inproceedings{zieba2018bingan,
  author = {Maciej Zieba and Piotr Semberecki and Tarek El-Gaaly and Tomasz Trzcinski},
  title = {{BinGAN: Learning Compact Binary Descriptors with a Regularized GAN}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=rkbAALbd-r},
}
Figure