Face Clustering: Representation and Pairwise Constraints

Yichun Shi, Charles Otto, Anil K. Jain

TL;DR

The authors introduce ConPaC (Conditional Pairwise Clustering), a novel face clustering algorithm that formulates identity grouping as a structured prediction problem using Conditional Random Fields (CRFs). By leveraging ResNet-based features and enforcing triplet consistency through Loopy Belief Propagation, ConPaC dynamically determines the number of clusters and outperforms traditional methods like k-means and spectral clustering on unconstrained datasets.

What Problem Does This Paper Address?

Grouping large collections of unlabeled face images by identity is critical for forensic investigations and large-scale image retrieval. However, real-world face data is "unconstrained"—featuring extreme poses, poor lighting, and low resolution.

Standard clustering algorithms often fail here for three reasons:

  1. Unknown Cluster Count: Most algorithms (like k-means) require the number of identities ($K$) as an input, which is rarely known in practice.
  2. Data Imbalance: Face datasets are often highly skewed, with some individuals having many images and others having only one.
  3. Non-Convexity: Identities in feature space don't always form neat, spherical "blobs," making centroid-based methods ineffective.

Methods

The researchers propose a two-stage pipeline: representation learning followed by a specialized clustering algorithm.

1. Representation Learning

They utilize Deep Residual Networks (ResNet) (50 and 101 layers) to extract 2048-dimensional feature vectors from aligned face images. The networks are trained on massive public datasets to ensure the features are robust to lighting and pose variations.

2. ConPaC Clustering

Instead of clustering points directly, ConPaC estimates an adjacency matrix $Y$, where each entry $Y_{ij}$ is a binary variable indicating if images $i$ and $j$ belong to the same person.

  • CRF Framework: The problem is modeled as a Conditional Random Field. The "unary potential" (the likelihood of two faces being the same) is derived from the cosine similarity of their ResNet features.
  • Triplet Consistency: To ensure the adjacency matrix represents a valid partition (i.e., it is transitive), the authors introduce a triplet interaction constraint. If face A is linked to B, and B is linked to C, then A must be linked to C.
  • Inference: They use a modified version of Loopy Belief Propagation (min-sum algorithm) to find the most probable adjacency matrix.
  • Scalability: To handle millions of images, they propose a $k$-NN variant that only considers the top $k$ most similar neighbors for each face, reducing complexity from $O(N^3)$ to near-linear $O(N \log N)$.
Face clustering workflow involving CNN feature extraction and CRF-based grouping.

Datasets

  • Training: CASIA-Webface (494k images) and VGG-Face (1.7M images).
  • Evaluation:
    • LFW (Labeled Faces in the Wild): A standard benchmark with limited pose variation.
  • IJB-B (IARPA Janus Benchmark-B): A much more challenging dataset containing video frames and faces in extreme poses that often break off-the-shelf detectors.

Key Insights and Ideas

  • Adjacency over Centroids: By focusing on the relationships between pairs rather than finding a central "average" face for an identity, the model handles arbitrary cluster shapes and sizes much better than k-means.
  • Transitivity is the Key: The "aha moment" is realizing that a valid clustering is mathematically equivalent to a transitive adjacency matrix. The triplet constraint (shown in the figure below) forces the local pairwise decisions to align into a global, consistent partition.
  • Semi-Supervised Synergy: The CRF framework makes it trivial to incorporate human feedback. If a user labels two faces as a "must-link," that information propagates through the graph during belief propagation, correcting other related pairs automatically.
Four cases of pairwise adjacency in a triplet; case (2) is inconsistent and forbidden by the model.

Key Results

  • Superior Accuracy: On the LFW dataset, ConPaC achieved a Pairwise F-measure of 0.965, significantly higher than k-means (0.346) and the previous state-of-the-art Rank-Order clustering (0.813).
  • Robustness to Noise: In experiments with 1 million distractor images, the $k$-NN variant maintained high performance, proving its viability for massive, real-world databases.
  • Dynamic Clustering: Unlike spectral clustering, which failed to retain similarities when the ground-truth $K$ was used, ConPaC successfully recovered the underlying structure without being told how many people were in the dataset.
Visualization showing how ConPaC (h) closely matches ground-truth adjacency (b) compared to k-means (c,d) or spectral clustering (e,f).

Limitations and Future Work

  • Representation Brittleness: As the number of identities grows into the thousands, the feature space becomes crowded. The authors noted that performance on IJB-B dropped as the subject count increased, suggesting that even deep ResNets have limits in discriminative power.
  • Future Directions: The authors suggest exploring more sophisticated "unary potentials" (perhaps using sub-networks to predict pairwise likelihoods) and further refining the $k$-NN variant to better incorporate semi-supervised constraints at scale.

Summary updated

BibTeX
@article{shi2018face,
  author = {Yichun Shi and Charles Otto and Anil K. Jain},
  title = {{Face Clustering: Representation and Pairwise Constraints}},
  journal = {IEEE Trans. Inf. Forensics Secur.},
  year = {2018},
  url = {https://openreview.net/forum?id=R687DZZ70L},
}
Figure