Skip to main content
QUICK REVIEW

[Paper Review] Jaccard Metric Losses: Optimizing the Jaccard Index with Soft Labels

Zifu Wang, Matthew B. Blaschko|arXiv (Cornell University)|Feb 11, 2023
Advanced Neural Network ApplicationsComputer Science14 citations
TL;DR

Jaccard Metric Losses (JMLs) extend soft-label compatibility to IoU-based losses, enabling label smoothing, knowledge distillation, and semi-supervised learning in semantic segmentation, and achieving consistent accuracy and calibration gains over cross-entropy across multiple datasets and architectures.

ABSTRACT

Intersection over Union (IoU) losses are surrogates that directly optimize the Jaccard index. Leveraging IoU losses as part of the loss function have demonstrated superior performance in semantic segmentation tasks compared to optimizing pixel-wise losses such as the cross-entropy loss alone. However, we identify a lack of flexibility in these losses to support vital training techniques like label smoothing, knowledge distillation, and semi-supervised learning, mainly due to their inability to process soft labels. To address this, we introduce Jaccard Metric Losses (JMLs), which are identical to the soft Jaccard loss in standard settings with hard labels but are fully compatible with soft labels. We apply JMLs to three prominent use cases of soft labels: label smoothing, knowledge distillation and semi-supervised learning, and demonstrate their potential to enhance model accuracy and calibration. Our experiments show consistent improvements over the cross-entropy loss across 4 semantic segmentation datasets (Cityscapes, PASCAL VOC, ADE20K, DeepGlobe Land) and 13 architectures, including classic CNNs and recent vision transformers. Remarkably, our straightforward approach significantly outperforms state-of-the-art knowledge distillation and semi-supervised learning methods. The code is available at \href{https://github.com/zifuwanggg/JDTLosses}{https://github.com/zifuwanggg/JDTLosses}.

Motivation & Objective

  • Motivate the need for IoU losses that handle soft labels to support LS, KD, and SSL in segmentation.
  • Introduce Jaccard Metric Losses (JMLs) that match soft-label behavior while retaining IoU accuracy.
  • Show how boundary-aware label smoothing and confidence-based class selection improve KD and calibration.
  • Empirically validate JMLs across 13 architectures on 4 datasets with strong gains over CE and SOTA KD/SSL methods.

Proposed method

  • Define Jaccard Metric Losses (JMLs) as two soft-label compatible surrogates that are metrics on [0,1]^p.
  • Prove both JML candidates are metrics on [0,1]^p and relate them to SJL in hard-label settings.
  • Introduce boundary label smoothing (BLS) to apply smoothing selectively at image boundaries.
  • In knowledge distillation, use active class selection based on teacher confidence to stabilize training and focus on relevant classes.
  • Provide a KD framework (JML-KD) that combines CE and JML losses with a confidence-based class selection mechanism.
  • Demonstrate that JML-LS, JML-KD, and JML-BLS can be integrated with standard backbones/segmentation architectures and evaluated with mIoU, Acc, and calibration metrics.

Experimental results

Research questions

  • RQ1Can Jaccard-based losses with soft labels outperform traditional CE losses in segmentation tasks?
  • RQ2Do JMLs preserve equivalence to SJL on hard labels while enabling soft-label training techniques (LS, KD, SSL)?
  • RQ3Does boundary-aware smoothing improve calibration and accuracy, and how should KD be regularized with active-class selection?
  • RQ4How do JML-based methods perform across diverse datasets and architectures compared to state-of-the-art KD and SSL methods?

Key findings

  • JMLs significantly improve accuracy over CE across Cityscapes, PASCAL VOC, ADE20K, and DeepGlobe across 13 models.
  • JMLs with soft labels yield better mIoU than CE, often by more than 2 percentage points on several datasets.
  • JMLs are metrics on [0,1]^p and match SJL on hard labels, enabling soft-label training without sacrificing the IoU basis.
  • Boundary label smoothing (BLS) and knowledge-distillation–style distillation (JML-KD) yield strong calibration improvements, including boundary-specific ECE reductions.
  • A simple JML-KD setup with active-class selection (teacher confidence-based) outperforms several state-of-the-art segmentation KD methods on benchmark datasets.
  • JML-BLS and JML-KD consistently improve calibration metrics, including BECE and boundary-region calibration, compared to CE-based training.

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.