Abstract
Learning discriminative deep feature embeddings by using million-scale in-the-wild datasets and margin-based softmax loss is the current state-of-the-art approach for face recognition. However, the memory and computing cost of the Fully Connected (FC) layer linearly scales up to the number of identities in the training set. Besides, the large-scale training data inevitably suffers from inter-class conflict and long-tailed distribution. In this paper, we propose a sparsely updating variant of the FC layer, named Partial FC (PFC). In each iteration, positive class centers and a random subset of negative class centers are selected to compute the margin-based softmax loss. All class centers are still maintained throughout the whole training process, but only a subset is selected and updated in each iteration. Therefore, the computing requirement, the probability of inter-class conflict, and the frequency of passive update on tail class centers, are dramatically reduced. Extensive experiments across different training data and backbones confirm the effectiveness, robustness and efficiency of the proposed PFC.
Introduction
In the world of deep face recognition, the gold standard involves training on massive "in-the-wild" datasets using margin-based softmax losses. However, two major hurdles stand in the way of scaling up:
- The Scaling Wall: The Fully Connected (FC) layer—where the model compares a face feature to every known identity—scales linearly with the number of identities. When you have millions of people in your training set, the memory and compute requirements can easily exceed the capacity of even the most powerful GPUs.
- Data Pollution: Large-scale datasets are often scraped from the web and automatically cleaned. This leads to inter-class conflict (the same person appearing under two different labels) and a long-tailed distribution (a few celebrities have thousands of photos, while most people have only two or three). In a standard setup, these "noisy" labels and the constant "passive" updates to rare classes confuse the model and degrade performance.
Methods: Partial FC (PFC)
The authors propose Partial FC (PFC), a sparsely updating variant of the standard FC layer. Instead of calculating the similarity between a face feature and all class centers in every iteration, PFC always picks the "positive" center (the correct label) but only selects a random subset of "negative" centers (the wrong labels).
To make this work across multiple GPUs, face features are gathered, and a specific "memory buffer" is set on each GPU. Positive centers are pulled in based on the labels in the current batch, and the rest of the buffer is filled with randomly sampled negative centers from the CPU. The authors also found that because PFC reduces the frequency of updates, they could implement a simple threshold filter. If a "negative" center is too similar to the current face feature (e.g., a cosine similarity > 0.4), it’s likely a mislabeled duplicate and can be ignored to prevent "gradient confusion."
Key Results
Extensive experiments across different training data and backbones (e.g. CNN and ViT) confirm the effectiveness, robustness and efficiency of the proposed PFC.
- Massive Speedup: Using a 10% sampling ratio (PFC-0.1) on a ResNet100 backbone, the system can train 10 million identities 5x faster than traditional model-parallel solutions.
- Memory Savings: PFC consumes less than half the GPU memory of the baseline, allowing for larger batch sizes on the same hardware.
- State-of-the-Art Accuracy: Despite seeing fewer negative samples, PFC achieved 98.00% on IJB-C and 97.85% on MFR-all, breaking previous records.
- Superior Robustness: In synthetic "Conflict" tests, the baseline FC performance tanked to ~80% accuracy due to label noise, while PFC maintained a high accuracy of over 91%.
Conclusion
Partial FC addresses the computational and data quality challenges of large-scale face recognition. By sub-sampling negative classes, it not only reduces resource consumption but also acts as a regularizer against noisy labels and stabilizes training for tail classes. While PFC excels on high-quality datasets, the authors note that there is a limit to the "partialness"; if the sampling ratio drops too low (e.g., below 1%), accuracy begins to decline as inter-class interaction becomes insufficient.
Summary updated