Contour-weighted loss for class-imbalanced image segmentation
Zhhengyong Huang, Yao Sui
TL;DR
This work tackles severe data imbalance in medical image segmentation by introducing a contour-weighted compound loss (CWCD) that blends contour-weighted cross-entropy with separable dice loss. The contour maps derived from morphological erosion focus learning on object boundaries, while separable dice loss treats contour and non-contour regions separately to address intra- and inter-class imbalance. Empirical evaluation on BraTS and AMOS demonstrates that CWCD yields higher DSC than several state-of-the-art losses across multiple networks, with pronounced gains under strong imbalance, indicating improved boundary accuracy and robustness for multi-organ and tumor segmentation. The approach is practical for clinical-grade segmentation and is made available with code to facilitate adoption and further development.
Abstract
Image segmentation is critically important in almost all medical image analysis for automatic interpretations and processing. However, it is often challenging to perform image segmentation due to data imbalance between intra- and inter-class, resulting in over- or under-segmentation. Consequently, we proposed a new methodology to address the above issue, with a compact yet effective contour-weighted loss function. Our new loss function incorporates a contour-weighted cross-entropy loss and separable dice loss. The former loss extracts the contour of target regions via morphological erosion and generates a weight map for the cross-entropy criterion, whereas the latter divides the target regions into contour and non-contour components through the extracted contour map, calculates dice loss separately, and combines them to update the network. We carried out abdominal organ segmentation and brain tumor segmentation on two public datasets to assess our approach. Experimental results demonstrated that our approach offered superior segmentation, as compared to several state-of-the-art methods, while in parallel improving the robustness of those popular state-of-the-art deep models through our new loss function. The code is available at https://github.com/huangzyong/Contour-weighted-Loss-Seg.
