Basket-based Softmax

Qiang Meng, Xinqian Gu, Xiaqing Xu, Feng ZhouarXiv 2022

Abstract

Softmax-based losses have achieved state-of-the-art performances on various tasks such as face recognition and re-identification. However, these methods highly relied on clean datasets with global labels, which limits their usage in many real-world applications. An important reason is that merging and organizing datasets from various temporal and spatial scenarios is usually not realistic, as noisy labels can be introduced and exponential-increasing resources are required. To address this issue, we propose a novel mining-during-training strategy called Basket-based Softmax (BBS) as well as its parallel version to effectively train models on multiple datasets in an end-to-end fashion. Specifically, for each training sample, we simultaneously adopt similarity scores as the clue to mining negative classes from other datasets, and dynamically add them to assist the learning of discriminative features. Experimentally, we demonstrate the efficiency and superiority of the BBS on the tasks of face recognition and re-identification, with both simulated and real-world datasets.

Introduction

In computer vision tasks like face recognition and person re-identification (Re-ID), Softmax-based losses are the standard for learning to distinguish between vast numbers of identities. However, these methods typically require "clean" datasets where every image has a unique global ID. In real-world scenarios—such as surveillance or web-scale collections—data often arrives in "baskets" from different cameras, times, or locations.

Merging these baskets is challenging because the same identity may appear in multiple baskets with different local IDs. This creates the Multiple Baskets with Class Overlaps (MBCO) problem. Simple concatenation leads to "noisy labels" that confuse the model, while treating them as separate tasks limits the discriminative power of the learned features.

Methodology: Basket-based Softmax (BBS)

The core innovation is the Basket-based Softmax (BBS) algorithm, which allows training on overlapping datasets without global labels.

Dynamic Negative Mining

Instead of restricting comparisons to classes within a sample's own basket, BBS dynamically mines negative classes from other baskets during training. For a sample $i$ in Basket $m$, the algorithm calculates similarity scores against class centers in all other baskets. It identifies classes that are least similar to the current sample and includes them as guaranteed negatives in the Softmax calculation. Conversely, classes that are too similar are ignored, as they likely represent the same identity with a different local ID.

The BBS mechanism: an embedding is compared against class centers from multiple baskets, with a selection process to identify valid negatives.

Parallel BBS

To handle large-scale datasets with millions of identities, the authors developed a parallel version of BBS. This version distributes class centers across multiple GPUs and uses an approximation strategy for local mining to minimize memory and communication overhead, significantly increasing training throughput.

Experimental Results

The researchers evaluated BBS on face recognition (MS1MV2) and person Re-ID (Market-1501) tasks.

Robustness to Identity Overlap

A critical finding is BBS's stability under high identity overlap. In simulations where identities overlapped between baskets by up to 100%, standard baselines suffered catastrophic performance degradation. In contrast, BBS maintained high accuracy, even outperforming the best baseline by over 20% on the IJB-B benchmark at 100% overlap.

Performance comparison (TAR@FAR=1e-4) against varying percentages of identity overlap. BBS remains stable while baselines drop sharply.

Efficiency and Scalability

Parallel BBS demonstrated excellent scalability, handling up to 1 million classes across 8 GPUs. It achieved a training speed three times faster than the non-parallel version while maintaining a manageable GPU memory footprint.

Conclusion

Basket-based Softmax provides a practical solution for training large-scale recognition systems on "messy" real-world data. By dynamically mining negatives across datasets, it bridges the gap between curated academic benchmarks and the realities of distributed data collection. Future work may explore pseudo-labeling to actively merge overlapping identities rather than simply ignoring them.

Summary updated

BibTeX
@misc{meng2022basket,
  author = {Qiang Meng and Xinqian Gu and Xiaqing Xu and Feng Zhou},
  title = {{Basket-based Softmax}},
  year = {2022},
  eprint = {2201.09308},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.09308},
}
Figure