On the Learning Property of Logistic and Softmax Losses for Deep Neural Networks

Xiangrui Li, Xin Li, Deng Pan, Dongxiao Zhu

Abstract

In deep learning, Logistic Loss (LGL) and Softmax Loss (SML) are the standard choices for binary and multi-class classification, respectively. However, the theoretical reasons behind their performance differences, particularly under class imbalance, remain under-explored. This paper derives the mathematical relationship between class weights, sample sizes, and predicted probabilities at convergence. We identify a "multi-modality neglect" flaw in traditional one-vs-all LGL that limits its multi-class performance. To mitigate this, we propose an "in-negative class reweighted" logistic loss (LGL-INR) that dynamically focuses on "hard" non-target classes. Our experiments on benchmarks like FMNIST, KMNIST, and CIFAR10 demonstrate that LGL-INR consistently outperforms standard SML and LGL.

Introduction

While Logistic Loss (LGL) is theoretically robust for capturing internal data structures, it often falls short of Softmax Loss (SML) in multi-class applications. Practitioners frequently use class-wise reweighting to handle imbalance, but the underlying mechanics of how these weights shift decision boundaries are rarely quantified. This research addresses this gap by analyzing the gradient of the loss function at local minima to uncover the "why" behind loss function behavior.

Theoretical Analysis and Multi-Modality Neglect

The authors analyzed the necessary condition for convergence: the point where the gradient of the loss function equals zero. They derived a system of equations relating the expected probability of misclassifying class $i$ into class $j$ to the class weights ($\lambda$) and the number of samples ($N$).

A key finding is the "multi-modality neglect" problem in one-vs-all LGL. In this setup, all non-target classes are grouped into a single "negative" class. If one non-target class is highly similar to the target (a "hard" class) while others are distinct ("easy" classes), the averaging effect of LGL dilutes the signal from the hard class. This leads to a lack of competition between the target and its most confusing neighbors, resulting in lower accuracy compared to SML, which naturally forces competition between all pairs.

Proposed Solution: LGL-INR

To solve this, the authors introduced In-negative class reweighted LGL (LGL-INR). This method employs a two-level weighting system:

  1. Global Level: Balances the target class against the entire negative set to handle overall class imbalance.
  2. Local Level: Dynamically upweights "hard" sub-classes within the negative set using a softmax-based temperature parameter ($\beta$).

By increasing the weight of the most confusing non-target classes during training, LGL-INR forces the model to learn finer decision boundaries, effectively bridging the gap between LGL's structural capturing and SML's competitive nature.

Experimental Results

The proposed LGL-INR was evaluated on several standard image classification benchmarks, including FMNIST, KMNIST, and CIFAR10.

Testing accuracy on FMNIST and KMNIST datasets for LGL, SML, and LGL-INR variants.

As shown in the figure above, LGL-INR (with various $\beta$ values) consistently achieves higher testing accuracy and faster convergence than both standard LGL and SML. For instance, on the KMNIST dataset, LGL-INR reached an accuracy of 96.43%, significantly outperforming SML (95.13%) and LGL (94.37%). Similar gains were seen on CIFAR10, where LGL-INR reached 93.34% compared to SML's 91.11%.

The qualitative impact of LGL-INR is best observed through confusion matrix analysis.

Confusion matrices comparing LGL, SML, and LGL-INR, highlighting the reduction in misclassifications for difficult classes.

The confusion matrices reveal that LGL-INR specifically improves performance on the most difficult classes where standard LGL struggles due to the averaging effect. By focusing on hard negatives, the model reduces the off-diagonal counts (misclassifications) more effectively than SML, particularly for structurally complex datasets like KMNIST.

Conclusion

This work provides a quantitative tool to understand how loss functions and class weights interact. By identifying and fixing the multi-modality neglect in LGL, the authors have developed a more robust loss function for multi-class deep learning. Future research will explore sample-level reweighting to further refine model performance on individual difficult images.

Summary updated

BibTeX
@inproceedings{li2020learning,
  author = {Xiangrui Li and Xin Li and Deng Pan and Dongxiao Zhu},
  title = {{On the Learning Property of Logistic and Softmax Losses for Deep Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5907},
}
Figure