Skip to main content
QUICK REVIEW

[Paper Review] PolyLoss: A Polynomial Expansion Perspective of Classification Loss Functions

Zhaoqi Leng, Mingxing Tan|arXiv (Cornell University)|Apr 26, 2022
Advanced Neural Network ApplicationsComputer Science84 citations
TL;DR

PolyLoss presents a polynomial-expansion framework to design classification losses, showing that simple leading-coefficient tuning (Poly-1) consistently improves over cross-entropy and focal loss across image classification, detection, segmentation, and 3D detection tasks.

ABSTRACT

Cross-entropy loss and focal loss are the most common choices when training deep neural networks for classification problems. Generally speaking, however, a good loss function can take on much more flexible forms, and should be tailored for different tasks and datasets. Motivated by how functions can be approximated via Taylor expansion, we propose a simple framework, named PolyLoss, to view and design loss functions as a linear combination of polynomial functions. Our PolyLoss allows the importance of different polynomial bases to be easily adjusted depending on the targeting tasks and datasets, while naturally subsuming the aforementioned cross-entropy loss and focal loss as special cases. Extensive experimental results show that the optimal choice within the PolyLoss is indeed dependent on the task and dataset. Simply by introducing one extra hyperparameter and adding one line of code, our Poly-1 formulation outperforms the cross-entropy loss and focal loss on 2D image classification, instance segmentation, object detection, and 3D object detection tasks, sometimes by a large margin.

Motivation & Objective

  • Motivate loss function design as a polynomial expansion to unify and extend CE and focal losses.
  • Introduce PolyLoss as a linear combination of polynomial bases (1-P_t)^j to tailor to tasks/datasets.
  • Show that adjusting polynomial coefficients, especially the leading term, yields practical gains with minimal code changes.
  • Demonstrate empirical improvements across 2D image classification, instance segmentation, 3D object detection, and multi-task setups.

Proposed method

  • Represent CE and focal losses as infinite sums of polynomial bases in (1 - P_t).
  • Propose PolyLoss: L = sum_j alpha_j (1 - P_t)^j with nonnegative alpha_j.
  • Show CE corresponds to alpha_j = 1/j; focal loss corresponds to a horizontal shift in coefficients by gamma.
  • Propose simple Poly-1 loss: L_Poly-1 = -log(P_t) + epsilon_1 (1 - P_t) with a single tunable epsilon_1.
  • Conduct a targeted grid search over epsilon_1 (a single extra line of code) to improve performance.
  • Evaluate on ImageNet-1K/21K, COCO, and Waymo Open Dataset across multiple models.

Experimental results

Research questions

  • RQ1Can a polynomial-expansion view of classification losses unify CE and focal loss under PolyLoss?
  • RQ2Does vertically adjusting leading polynomial coefficients (especially the first term) yield better task/dataset performance with minimal hyperparameter burden?
  • RQ3How does PolyLoss perform across diverse tasks (2D/3D detection, segmentation, and large-scale classification) compared to CE and focal loss?
  • RQ4What insights can be drawn about loss design for imbalanced datasets from the PolyLoss framework?

Key findings

  • PolyLoss with the simple Poly-1 formulation yields improvements over cross-entropy and focal loss across tasks: ImageNet-1K +0.4% (87.2 vs 86.8), ImageNet-21K +0.6% (46.4 vs 45.8), COCO detection/segmentation +0.4% (87.2 vs 86.8), and Waymo 3D detection +2.5% (49.7 vs 47.2).
  • Across multiple models and tasks, Poly-1 consistently improves performance, with gains including +0.6, +0.4, +2.5, +2.1, +0.4, +0.7, +0.5, +0.8 over respective baselines (CE or focal).
  • The leading polynomial term (1 - P_t) contributes a large portion of the gradient during training, and tuning its coefficient significantly boosts accuracy.
  • For imbalanced ImageNet-21K, positive epsilon on the first polynomial increases prediction confidence and accuracy, while for COCO-based detection, negative epsilon can reduce overconfident predictions and improve metrics.
  • PolyLoss achieves speed/efficiency parity with larger models (e.g., EfficientNetV2) and can approach or exceed CE/focal performance with minimal code changes.

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.