Two Birds, One Stone: Jointly Learning Binary Code for Large-Scale Face Image Retrieval and Attributes Prediction

Yan Li, Ruiping Wang, Haomiao Liu, Huajie Jiang, Shiguang Shan, Xilin Chen

Abstract

This paper presents a multi-task hashing framework designed to simultaneously address large-scale face image retrieval and facial attribute prediction. By learning a single compact binary representation that optimizes for both identity discrimination and semantic attribute consistency, the proposed method achieves superior retrieval performance while providing human-interpretable features.

Introduction

In the era of web-scale data, searching for specific individuals across millions of images presents significant challenges. "Faces in the wild" exhibit extreme variations in lighting, pose, and expression, often causing intra-class variance to exceed inter-class variance. Furthermore, the massive scale of modern databases necessitates extremely compact representations to minimize storage costs and enable rapid matching.

While binary hashing is a standard solution for efficiency, traditional hash codes often function as "black boxes" lacking semantic meaning. This research addresses this gap by proposing a framework that learns a code capable of both identifying a person and describing their attributes (e.g., gender, age, accessories), effectively "killing two birds with one stone."

Methodology

The core of the approach is a joint learning framework that optimizes a linear hash function $f(x) = \text{sgn}(W^T x)$ subject to three primary constraints:

  1. Identity Discriminability ($E_{dis}$): Ensures images of the same individual are mapped to similar binary codes while maximizing the distance between different individuals in Hamming space.
  2. Code-Attribute Consistency ($E_{cons}$): Introduces a "bridge" matrix ($U$) that correlates specific bits with 14 manual facial attributes, embedding semantic information directly into the binary string.
  3. Code-Prediction Stability ($E_{stab}$): Utilizes a max-margin constraint to ensure the hash function generalizes effectively to unseen data.
The joint learning framework optimizes for identity discriminability and attribute consistency simultaneously.

The resulting non-convex objective function is solved using an iterative block coordinate descent algorithm, alternating between updates for the binary codes, the attribute bridge, and the projection matrix.

Experimental Setup

The researchers evaluated their framework using the CFW-60K dataset, a refined version of the Celebrity Faces on the Web dataset. This benchmark includes 60,000 images with verified identity labels and facial landmarks. A subset of 10,000 images across 500 subjects was annotated with 14 attributes by seven human annotators. Retrieval performance was tested on a database of 50,000 images with 2,500 queries.

Results and Discussion

The proposed method demonstrates significant improvements in both retrieval accuracy and attribute prediction efficiency.

Retrieval Performance

On the CFW-60K dataset, the method achieved a mean Average Precision (mAP) of 0.1979 with 256-bit codes. This outperforms several state-of-the-art hashing techniques, including KSH (0.1247) and SITQ (0.1846). The results validate the hypothesis that joint learning (mAP 0.1979) is superior to separate learning (mAP 0.1364), as identity and attributes provide complementary signals.

Precision-Recall curves on the CFW-60K dataset for 128-bit and 256-bit codes.

Attribute Prediction

Despite the primary focus on retrieval, the learned binary codes achieved high accuracy in attribute prediction (e.g., 94% for gender, 98% for glasses). Unlike traditional methods that require heavy classifiers, once the binary code is generated for retrieval, attribute prediction becomes a simple, nearly-instantaneous matrix multiplication.

Conclusion

The "Two Birds, One Stone" framework successfully integrates semantic interpretability with discriminative power in a compact binary format. By leveraging the synergy between identity and attributes, the model achieves a more stable and effective representation for large-scale face analysis. Future work may involve extending this framework to non-linear or deep learning-based hash functions and exploring its application in other domains, such as vehicle or product retrieval.

Summary updated

BibTeX
@inproceedings{li2015two,
  author = {Yan Li and Ruiping Wang and Haomiao Liu and Huajie Jiang and Shiguang Shan and Xilin Chen},
  title = {{Two Birds, One Stone: Jointly Learning Binary Code for Large-Scale Face Image Retrieval and Attributes Prediction}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2015},
  doi = {10.1109/iccv.2015.435},
}
Figure