Clustering based Contrastive Learning for Improving Face Representations

Vivek Sharma, Makarand Tapaswi, M. Saquib Sarfraz, Rainer Stiefelhagen · DOI

Abstract

A good clustering algorithm can discover natural groupings in data. These groupings, if used wisely, provide a form of weak supervision for learning representations. In this work, we present Clustering-based Contrastive Learning (CCL), a new clustering-based representation learning approach that uses labels obtained from clustering along with video constraints to learn discriminative face features. We demonstrate our method on the challenging task of learning representations for video face clustering. Through several ablation studies, we analyze the impact of creating pair-wise positive and negative labels from different sources. Experiments on three challenging video face clustering datasets: BBT-0101, BF-0502, and ACCIO show that CCL achieves a new state-of-the-art on all datasets.

Introduction

Deep learning has revolutionized face recognition, but training these models typically requires massive, manually curated datasets. In the context of video analysis—such as organizing all appearances of a character in a TV show—there is an abundance of data but very few labels. Existing self-supervised methods often rely on tracking (assuming faces in consecutive frames are the same person) or clustering that requires knowing the number of people ($K$) in advance. However, tracking can fail during fast motion or scene cuts, and $K$ is rarely known in real-world scenarios. The authors sought a way to learn discriminative face features that doesn't rely on tracking or a pre-defined number of clusters.

Methodology

The core of the CCL approach is a pipeline that turns unlabeled video into a training signal for a Siamese network.

Overview of the CCL pipeline, showing the transition from video detections to weak cluster labels and contrastive learning.

1. Initial Feature Extraction and Clustering

The process begins with "base" features from a standard CNN (VGG2Face) pre-trained on a large dataset. These features are then grouped using the First Neighbor Clustering Hierarchy (FINCH) algorithm. Unlike K-means, FINCH is parameter-free and doesn't need to know the number of clusters. It groups faces into many small, "high-purity" clusters, ensuring that faces within a cluster belong to the same person, even if one person is split across many clusters.

2. Generating Weak Labels

From these high-purity clusters, the system derives weak supervision:

  • Positive Pairs (PosC): Faces within the same cluster are treated as the same person.
  • Negative Pairs (NegC): Faces from clusters that are mathematically very distant are treated as different people.

3. Video Constraints (NVid) and Contrastive Learning

A clever "negative" constraint is added: if two faces appear in the same video frame simultaneously, they must be different people. This provides reliable "hard negatives." A shallow Multi-Layer Perceptron (MLP) is then trained on top of the CNN features using a Contrastive Loss, which pulls positive pairs closer together in the feature space and pushes negative pairs further apart.

Experimental Results

The authors evaluated CCL on three challenging video face-clustering benchmarks: BBT-0101 (The Big Bang Theory), BF-0502 (Buffy the Vampire Slayer), and ACCIO (Harry Potter). These datasets feature complex lighting, varied angles, and character aging.

Comparison of CCL against baseline and previous state-of-the-art methods on BBT and BF datasets.

As shown in the comparative analysis, CCL achieves a new state-of-the-art (SOTA) across all tested datasets, outperforming previous methods like TSiam and SSiam.

Dataset Base Features (VGG2) Previous SOTA CCL (Ours)
BBT-0101 94.00% 99.04% 99.56%
BF-0502 91.20% 92.46% 93.79%
ACCIO 79.90% 82.00% 83.40%

Note: Results are frame-level clustering accuracy.

The method is also computationally efficient; training the MLP on the BBT dataset takes less than 30 minutes on a single GPU.

Conclusion

CCL demonstrates that for weak supervision, it is better to have many small, perfect clusters than a few large, messy ones. By leveraging the global structure of the data via clustering and the simple rule of co-occurrence, CCL provides a robust way to learn face representations without manual labels. Future work may involve multimodal learning, incorporating audio or subtitle text to further refine the weak labels in complex cinematic environments.

Summary updated

BibTeX
@inproceedings{sharma2020clustering,
  author = {Vivek Sharma and Makarand Tapaswi and M. Saquib Sarfraz and Rainer Stiefelhagen},
  title = {{Clustering based Contrastive Learning for Improving Face Representations}},
  booktitle = {FG},
  year = {2020},
  doi = {10.1109/fg47880.2020.00011},
}
Figure