Skip to main content
QUICK REVIEW

[Paper Review] Softmax Dissection: Towards Understanding Intra- and Inter-class Objective for Embedding Learning

Lanqing He, Zhongdao Wang|arXiv (Cornell University)|Aug 4, 2019
Face recognition and analysisComputer Science27 references5 citations
TL;DR

This paper proposes D-Softmax, a disentangled loss that separates intra-class and inter-class objectives in embedding learning, enabling independent optimization. By decoupling these objectives and introducing sampling-based variants (D-Softmax-B and D-Softmax-K), it achieves up to 64× faster training on massive-scale data with minimal performance drop, outperforming existing acceleration methods in both speed and accuracy.

ABSTRACT

The softmax loss and its variants are widely used as objectives for embedding learning, especially in applications like face recognition. However, the intra- and inter-class objectives in the softmax loss are entangled, therefore a well-optimized inter-class objective leads to relaxation on the intra-class objective, and vice versa. In this paper, we propose to dissect the softmax loss into independent intra- and inter-class objective (D-Softmax). With D-Softmax as objective, we can have a clear understanding of both the intra- and inter-class objective, therefore it is straightforward to tune each part to the best state. Furthermore, we find the computation of the inter-class objective is redundant and propose two sampling-based variants of D-Softmax to reduce the computation cost. Training with regular-scale data, experiments in face verification show D-Softmax is favorably comparable to existing losses such as SphereFace and ArcFace. Training with massive-scale data, experiments show the fast variants of D-Softmax significantly accelerates the training process (such as 64x) with only a minor sacrifice in performance, outperforming existing acceleration methods of softmax in terms of both performance and efficiency.

Motivation & Objective

  • To address the entanglement between intra-class and inter-class objectives in standard softmax loss, which hinders optimal optimization of both simultaneously.
  • To decouple the intra-class objective (pulling positive samples together) from the inter-class objective (pushing class centers apart), enabling independent and rigorous optimization.
  • To reduce computational cost in large-scale training by identifying redundancy in inter-class computation and proposing efficient sampling strategies.
  • To develop fast, scalable variants of D-Softmax that maintain high performance while significantly accelerating training on datasets with hundreds of thousands of classes.

Proposed method

  • D-Softmax dissects the standard softmax loss into two independent components: an intra-class objective that enforces feature compactness within the same class using the positive class weight.
  • The inter-class objective maintains large angular or margin-based separation between different class centers, independent of intra-class compactness.
  • The method introduces two sampling-based variants: D-Softmax-B samples negative classes from the current mini-batch, and D-Softmax-K samples from a fixed pool of negative classes.
  • By sampling only a subset of negative classes, the inter-class computation cost is drastically reduced while preserving the optimization stability of the intra-class objective.
  • The disentangled structure ensures that even when inter-class optimization is relaxed via sampling, the intra-class constraint remains strict and effective.
  • The framework is compatible with existing margin-based losses like ArcFace and can be applied to any softmax-based embedding learning system.

Experimental results

Research questions

  • RQ1How does entanglement between intra-class and inter-class objectives in standard softmax loss affect optimization and generalization in embedding learning?
  • RQ2Can the intra- and inter-class objectives be decoupled to allow independent and more effective optimization?
  • RQ3Is the computation of the inter-class objective in softmax truly necessary for all negative classes, or is it redundant in practice?
  • RQ4Can sampling-based approximations of the inter-class objective maintain performance while enabling significant speedups in large-scale training?
  • RQ5Can a disentangled loss like D-Softmax outperform both full-softmax and existing sampling-based methods in terms of both accuracy and training efficiency?

Key findings

  • D-Softmax achieves performance comparable to state-of-the-art losses like ArcFace on regular-scale face recognition datasets, with no degradation in accuracy.
  • On massive-scale data (757K classes), D-Softmax-B and D-Softmax-K achieve up to 64× faster training compared to full softmax, with only a minor performance drop.
  • D-Softmax-K outperforms random sampling baselines (Rand-Softmax, Rand-ArcFace) by 0.53–0.55% on LFW accuracy at a 1/64 sampling rate.
  • D-Softmax-K surpasses HF-Softmax in both accuracy and speed, despite HF-Softmax using approximate nearest neighbor sampling, due to the disentangled intra-class constraint.
  • The full D-Softmax loss outperforms all sampling-based variants and even matches or exceeds the performance of full softmax on large-scale datasets, demonstrating the effectiveness of disentanglement.
  • The training time for D-Softmax-K is as low as 0.20s per forward-backward pass (comparable to Rand-Softmax), while maintaining significantly better accuracy than other sampling methods.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.