Seesaw Loss for Long-Tailed Instance Segmentation

Jiaqi Wang, Wenwei Zhang, Yuhang Zang, Yuhang Cao, Jiangmiao Pang, Tao Gong, Kai Chen, Ziwei Liu, Chen Change Loy, Dahua Lin

Abstract

In real-world instance segmentation, data distributions are typically long-tailed, causing standard models to be dominated by frequent "head" classes at the expense of rare "tail" categories. We present Seesaw Loss, a dynamic and distribution-agnostic loss function that re-balances gradients to mitigate excessive penalties on rare classes while compensating for potential misclassifications. Evaluated on the LVIS v1 dataset, Seesaw Loss significantly improves performance for rare categories, boosting $AP_r$ from 0.8% to 18.1% in a standard Mask R-CNN framework. Our method achieves state-of-the-art results without the need for complex multi-stage training.

Introduction

Machine learning models often struggle with long-tailed datasets where a few categories possess an overwhelming number of instances compared to hundreds of rare classes. In instance segmentation, this imbalance leads to head classes acting as "bullies," providing excessive negative signals for tail classes during training. Consequently, classifiers become biased toward frequent categories, often misclassifying rare objects as background or common classes.

Conceptual overview of Seesaw Loss and its impact on accuracy across the long-tail distribution.

Methods

Seesaw Loss addresses the long-tail challenge by dynamically adjusting gradients through two complementary factors:

  1. Mitigation Factor ($M_{ij}$): This factor reduces the negative gradient (penalty) that a frequent class $i$ imposes on a rare class $j$. By calculating the ratio of cumulative training instances, the penalty is scaled down for tail classes, allowing them to learn representative features more effectively.
  2. Compensation Factor ($C_{ij}$): To prevent over-prediction of tail classes, this factor monitors instances where a tail class is incorrectly predicted with higher probability than the ground truth. In such cases, the penalty is increased to maintain classifier discipline.

Additionally, the framework employs Normalized Linear Activation (NLA) to reduce scale variance in classifier weights and an Objectness Branch to decouple the detection of objects from their specific categorization, preventing the accidental reduction of penalties for background regions.

Results

Our experiments on the LVIS v1 dataset demonstrate that Seesaw Loss provides substantial improvements, particularly for rare classes. As shown in the performance comparison, Seesaw Loss outperforms existing specialized methods such as Equalization Loss (EQL) and Balanced Group Softmax (BAGS).

Performance comparison on LVIS v1 across different frameworks and samplers.

When integrated with Cascade Mask R-CNN and Repeat Factor Sampling (RFS), Seesaw Loss achieves a state-of-the-art 30.1% AP. Furthermore, its effectiveness on ImageNet-LT demonstrates its versatility across different recognition tasks, improving top-1 accuracy by 6% over standard Cross-Entropy loss.

Conclusion

Seesaw Loss offers a simple yet powerful end-to-end solution for long-tailed instance segmentation. By balancing mitigation and compensation in an online, distribution-agnostic manner, it overcomes the limitations of traditional cross-entropy loss. Future research may focus on automated hyperparameter tuning and enhancing mask quality for rare objects with limited visual data.

Summary updated

BibTeX
@inproceedings{wang2021seesaw,
  author = {Jiaqi Wang and Wenwei Zhang and Yuhang Zang and Yuhang Cao and Jiangmiao Pang and Tao Gong and Kai Chen and Ziwei Liu and Chen Change Loy and Dahua Lin},
  title = {{Seesaw Loss for Long-Tailed Instance Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00957},
}
Figure