Partial FC: Training 10 Million Identities on a Single Machine

Xiang An, Xuhan Zhu, Yang Xiao, Lan Wu, Ming Zhang, Yuan Gao, Bin Qin, Debing Zhang, Ying Fu

Abstract

Training face recognition models with millions of identities presents significant challenges due to the linear scaling of the softmax loss function's memory and computational requirements. Partial FC addresses these bottlenecks through a distributed sampling algorithm called Positive Plus Randomly Negative (PPRN). By sampling only 10% of negative classes, Partial FC achieves state-of-the-art accuracy while significantly reducing memory usage and increasing training speed. This approach enables training with 10 million identities on a single machine and scales to 100 million identities across a cluster.

Introduction

In deep face recognition, increasing the number of identities in the training set is a proven method for improving model performance. However, standard training utilizes the softmax loss function, which requires a weight matrix $W$ that grows linearly with the number of classes $C$. As $C$ reaches the millions, researchers encounter the "memory wall": the weight matrix and the resulting logits (prediction scores) exceed GPU memory capacity. Furthermore, calculating scores for millions of classes in every iteration introduces massive computational overhead.

The Partial FC Method

The core innovation of Partial FC is the Positive Plus Randomly Negative (PPRN) sampling strategy. Instead of performing a full softmax calculation over all $C$ classes, the algorithm selects all positive classes (those present in the current mini-batch) and a small, randomly sampled subset of negative classes.

Comparison of (a) traditional hash forest calculation and (b) the proposed Partial FC sampling strategy.

As shown in Figure 1, previous methods like hash forests attempted to find active classes with $O(\log n)$ complexity, which still introduced significant lag. Partial FC simplifies this to an $O(1)$ sampling process. In a distributed setting, each GPU stores a partition of the weight matrix and independently samples negatives from its local subset, ensuring load balancing and efficiency.

Key Insights: The 10% Rule

A critical finding of this research is that the specific choice of negative classes becomes less important as training progresses. The authors demonstrate that training with only 10% of randomly sampled negative classes results in no loss of accuracy compared to using 100% of the classes.

Training convergence (CA_pcc) across different sampling rates (0.1, 0.5, 1.0), demonstrating that 10% sampling maintains accuracy.

Figure 6 illustrates that the convergence behavior for a 10% sampling rate (0.1) is nearly identical to that of full softmax (1.0). This suggests that the optimization direction provided by negative classes is highly redundant, allowing for extreme sparsity without sacrificing the model's ability to learn a discriminative embedding space.

Performance and Scalability

Partial FC significantly improves training throughput and memory efficiency:

  • Throughput: On 64 GPUs, Partial FC achieved 12,600 images/second for 10 million identities, nearly 3x faster than standard model parallel implementations.
  • Memory Efficiency: By reducing the number of logits stored, GPU memory usage was lowered from over 10GB to approximately 6.7GB for a 10-million identity task, preventing Out-of-Memory (OOM) errors.
  • Benchmark Results: Models trained on the new Glint360K dataset (17M images, 360K identities) using Partial FC achieved a True Acceptance Rate (TAR) of 0.972 on the IJB-C benchmark, outperforming existing state-of-the-art methods.

Conclusion

Partial FC breaks the scaling limits of large-scale face recognition. By proving that a small fraction of negative samples is sufficient for convergence, the authors provide a practical path toward training models with tens or even hundreds of millions of identities. Future work may explore the lower bounds of sampling sparsity and address I/O bottlenecks when weight matrices must be stored in system RAM.

Summary updated

BibTeX
@misc{an2020partial,
  author = {Xiang An and Xuhan Zhu and Yang Xiao and Lan Wu and Ming Zhang and Yuan Gao and Bin Qin and Debing Zhang and Ying Fu},
  title = {{Partial FC: Training 10 Million Identities on a Single Machine}},
  year = {2020},
  eprint = {2010.05222},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.05222},
}
Figure