Jaccard Metric Losses: Optimizing the Jaccard Index with Soft Labels

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}.

Paper

References (93)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer KUTw7/10 · confidence 5/52023-06-26

Summary

This paper presents a new loss function for semantic segmentation based on the IoU loss. The authors found that the vanilla IoU loss is incompatible with the soft labels when label smoothing and knowledge distillation training techniques are used. Experiments show that the proposed approach works well on four widely-used semantic segmentation datasets. Ablation experiments also show some insightful take-home message for the readers.

Strengths

- The motivation of this paper is interesting. The authors observe an interesting problem of the vanilla IoU loss. - The novelty of this paper is clear. Improving the vanilla IoU loss is a meaningful topic for semantic segmentation. - The results are good. On four segmentation benchmarks, the proposed approach receives improvements.

Weaknesses

- In the main paper, the authors only show results based on ConvNets. The results based on Transformers are provided in the supplementary materials. From the results, it can be seen that the improvement of the proposed approach on ConvNets are higher than that on Transformers. I think the authors should explain why this happens. - Some visualizations should be moved to the main paper. I think it is interesting to see how the segmentation results change when the proposed method is used. - I also would like to recommend the authors to add some failure case analysis to see what readers can further do for semantic segmentation. - I am also interested in the results when large-sized models are used, for instance, SegFormer-B5.

Questions

- Some results using Transformers should be moved to the main paper though the improvement compared to the CNNs is not that significant. - It is also recommended to describe some works on semantic segmentation in the related work section. - Failure cases should be provided and discussed.

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

5: You are absolutely certain about your assessment. You are very familiar with the related work and checked the math/other details carefully.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

Not provided.

Reviewer 83cg6/10 · confidence 3/52023-06-29

Summary

The paper introduces Jaccard Metric Losses (JMLs) as a flexible alternative to Intersection over Union (IoU) losses for optimizing the Jaccard index in semantic segmentation tasks. Unlike IoU losses, JMLs can effectively process soft labels, enabling the use of important training techniques like label smoothing, knowledge distillation, and semi-supervised learning.

Strengths

1. Jaccard Metric Losses (JMLs) introduce a novel approach by mirroring the soft Jaccard loss in standard settings with hard labels while remaining compatible with soft labels. This flexibility is a significant contribution as it enables the incorporation of vital training techniques that rely on soft labels, such as label smoothing, knowledge distillation, and semi-supervised learning. This novel aspect makes JMLs an interesting and valuable addition to the field. 2. The paper demonstrates good results by showcasing consistent improvements over the cross-entropy loss across multiple semantic segmentation datasets (Cityscapes, PASCAL VOC, ADE20K, DeepGlobe Land) and a variety of architectures, including both classic CNNs and recent vision transformers. 3. The paper provides theoretical analysis of JMLs, which enhances the understanding of their properties and behavior.

Weaknesses

1. The paper highlights IoU losses as the baseline and the main motivation for introducing JMLs. However, the lack of direct comparisons between IoU losses and JMLs in the experiments is a weakness. While certain comparisons may not be possible, such as in knowledge distillation (KD) where IoU loss baselines require teachers, it would have been beneficial to include comparative analyses that demonstrate the importance of adapting IoU losses to soft labels. This would have provided a stronger justification for the need and effectiveness of JMLs. 2. Cross-entropy (CE) achieves better calibration performance in Tables 1 and 2. However, more discussion and explanation of this observation is needed. Understanding the reasons behind this disparity and addressing any potential limitations or trade-offs associated with JMLs' calibration performance would have added depth to the paper's analysis and interpretation.

Questions

Why CE group is much better than JML group in terms of calibration?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

4 excellent

Presentation

4 excellent

Contribution

4 excellent

Limitations

Needs to determine hyperparameters like $\epsilon$

Reviewer FApN7/10 · confidence 4/52023-07-06

Summary

The paper proposes JML (Jaccard Metric Losses) for segmentation. This builds up on previous IoU-based losses but with the added ability to process soft labels or probability distributions. JML losses can be further applied as follows: JML-BLS (Label smoothening Jaccard-based IoU loss, which is only computed at boundary pixels based on empirical analysis). JML-KD (Applying the soft JML loss to between student and teacher, as well as applying the soft JML loss between student and GT).

Strengths

Presentation: The reviewer appreciates authors' clarity of presentation of their concept. The paper is quite clear and tables are easy to understand. Mathematical notations have been thoroughly reviewed and hence the paper reads well. Originality: Although the work takes inspiration from IoU loss, and is quite a simple update to the original IoU loss concept, the technical contribution is quite clear and holds up. There has been work on IoU losses before but they are not used widely in literature, hence, there is a scope for improvement in this area. This work is a beneficial building block to further research in IoU losses. Transparency: The reviewer appreciates the code being made available. Results: The JML loss seems to work on a wide range of datasets, and more importantly, backbones. There are 12 different architectures in the paper as well as supp, and the loss works for both CNNs as well as transformer based backbones. This is very interesting as it shows the capability of this loss to provide a high impact in our field.

Weaknesses

There is a lot of information in the appendices, which might be more beneficial than some of the things in the main paper. One such example is the experiment with transformer-based backbones.

Questions

1. In tables 1-13, Did each experiment (row) start with the same set of pre-trained weights? 2. How did you tune the hyper-parameters for JML losses (specifically loss weights)? How easy(or difficult) is it to obtain the results provided in the paper. 3. Does adding JML ever reduce performance (with a higher weight, etc) 4. Could you address limitations of this work

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

No - The authors are suggested to address the limitations of this method (if any).

Reviewer L5GW5/10 · confidence 3/52023-07-06

Summary

The paper focuses on making IoU losses flexible to process soft labels. Jaccard Metric Losses are presented that works the same as soft Jaccard loss with hard labels but it is also compatible with soft labels. Experiments are presented in several tasks: label smoothing, knowledge distillation, and semi-supervised learning. The results show improvement over baselines.

Strengths

+ The paper focuses on addressing an important issue with IoU losses that they are not flexible to process soft labels + Experiments on several tasks (i.e., label smoothing, knowledge distillation, and semi-supervised learning) shows promising results.

Weaknesses

There are several confusions regarding experimental results. --There are discrepancies between the results presented in Table 5 and Table 3 for Cityscapes with DL3-R18. Table 3 reports 77.91 ± 0.16 whereas Table 5 reports 76.68 ± 0.33 as the best performance. For VOC, the best results match in the tables (75.89 ± 0.29). However, there is confusion between JML-KD and JML-BLS. For VOC, the JML-KD results in Table 3 match JML-BLS results in Table 5. -- As shown in Table 3, in knowledge distillation proposed student achieves 78.14. This is a bit surprising as the Teacher DeepLabV3-R101 has a lower mIoU of 78.07 (as reported in DIST[21]).  -- The reported performance in Table 1 and Table 2 do not compare with SOTA performance as shown in the papers. For example, the deeplabv3  paper with DL3-R101 model reports 81.3 mIoU in CityScapes and 85.7 mIoU in Pascal VOC. The presented proposed method results are lower compared to that and baselines are lower too. We see this for all the cases in Tables 1 and 2. I would suggest the authors use the proposed loss with the best-performing model and losses from the prior works to avoid any confusion.  To better convince the readers, I think improving on the best results reported in prior works would be helpful.

Questions

Please address the concerns in the weaknesses section. -- The rebuttal addressed most of my concerns. Hence, I increase the score.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

yes

Authorsrebuttal2023-08-20

Thanks for the review! We'd like to make sure if our responses have addressed your concerns

Dear reviewer, We really appreciate your time in reviewing our work. As the discussion period draws to a close, we'd like to take the chance to kindly inquire whether our responses have addressed your concerns. We're available to answer further concerns if there is still something unclear. Best, From the authors

Reviewer jE795/10 · confidence 3/52023-07-07

Summary

In this paper, the authors propose Jaccard Metric Losses (JMLs) for the training with soft labels in semantic segmentation. The authors analyze the limitations of previous IoU losses for soft labels, and propose JMLs to solve such limitations. Experiments for label smoothing, knowledge distillation and semi-supervised learning demonstrate the effectiveness of JMLs.

Strengths

1. It is interesting that using Jaccard-based losses to solve the soft label training problem. 2. This paper is well written and easy to read. 3. Experiments show large improvements for multiple architectures.

Weaknesses

1. The models in experiments seem a bit old. It would be great to show the performance with more recent architectures, such as Mask2Former. 2. Only small models are compared in experiments. It is important to show the performance for larger models to demonstrate the scalability.

Questions

Please solve my concerns in Weaknesses.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

No

Reviewer 83cg2023-08-14

Thank you for addressing my concerns. Forgot to mention another minor issue: Not sure if the use of "hard labels" is proper -- "soft labels" is easy to follow, but "hard" may be confused with "difficult". Perhaps "one-hot labels" is a better term.

Authorsrebuttal2023-08-14

Thanks for the suggestion. We will clearly state this distinction in the introduction.

Reviewer KUTw2023-08-15

Thanks for the responses. It seems that all reviewers have recognized the contributions of this paper and the authors have solved most of my concerns. I decide to keep my original rating score unchanged.

Reviewer jE792023-08-18

Dear authors, Thanks for your reply. Despite high citations, DeepLabV3+, PSPNet and SegFormer are actually old baselines in the segmentation community. Although Mask2Former may be more complex than previous methods, it and its modifications (such as ViT-Adapter and Oneformer) are the most popular semantic segmentation paradigms after 2022. They are quite different from previous baselines and achieve much higher performance. Therefore, I think it is important to show the effectiveness on this paradigm. In my opinion, if a loss can only be used in architectures 2 years ago, it might be hard to help future research.

Authorsrebuttal2023-08-18

Thanks for the reviewer's further comments

Many thanks for your follow-up comments! Now, we better understand the suggestion: In addition to the demonstrated practical usage on DeepLabV3+, SegFormer, etc, it would be great to demonstrate JMLs' effectiveness on Mask2Former to raise more future research interests. We're starting the experiments to demonstrate whether JMLs' ability to leverage soft labels can help the newest architectures. Before providing the results, currently, we can only provide the simple reasoning: As we all know, Mask2Former uses Soft Dice Loss, which is similar in spirit to Soft Jaccard Loss (SJL) and yield similar results [1]. And our experiments have demonstrated that JML can consistently improve SJL across a wide range of architectures. Therefore, we expect JML can help leverage the information in soft labels to further improve Mask2Former. After we got the results, we'll add the results to the revision of the paper. [1] Tom Eelbode, Jeroen Bertels, Maxim Berman, Dirk Vandermeulen, Frederik Maes, Raf Bisschops, and Matthew B. Blaschko. Optimization for medical image segmentation: Theory and Practice When Evaluating With Dice Score or Jaccard Index. TMI, 2020.

Reviewer jE792023-08-21

Thank you. I will keep my original rating. Overall, this work is well organized. I really hope the experiments can be improved in the revision.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC