Loss Functions For Semantic Segmentation
Loss Functions For Semantic Segmentation
segmentation
Shruti Jadon
IEEE Member
[email protected]
Abstract—Image Segmentation has been an active field of have proposed a new log-cosh dice loss function for semantic
research as it has a wide range of applications, ranging from segmentation. To showcase its efficiency, we compared the
automated disease detection to self driving cars. In the past performance of all loss functions on NBFS Skull-stripping
5 years, various papers came up with different objective loss
arXiv:2006.14822v4 [eess.IV] 3 Sep 2020
functions used in different cases such as biased data, sparse dataset [1] and shared the outcomes in form of Dice Co-
segmentation, etc. In this paper, we have summarized some of the efficient, Sensitivity, and Specificity. The code implementa-
well-known loss functions widely used for Image Segmentation tion is available at GitHub: https://github.com/shruti-jadon/
and listed out the cases where their usage can help in fast Semantic-Segmentation-Loss-Functions.
and better convergence of a model. Furthermore, we have also
introduced a new log-cosh dice loss function and compared its
performance on NBFS skull-segmentation open source data-set
with widely used loss functions. We also showcased that certain
loss functions perform well across all data-sets and can be taken
as a good baseline choice in unknown data distribution scenarios.
I. I NTRODUCTION
Deep learning has revolutionized various industries ranging
from software to manufacturing. Medical community has Fig. 1. Sample Brain Lesion Segmentation CT Scan [2]. In this segmentation
also benefited from deep learning. There have been multiple mask you can see, that number of pixels of white area(targeted lesion) is less
than number of black pixels.
innovations in disease classification, example, tumor segmen-
tation using U-Net and cancer detection using SegNet. Image
segmentation is one of the crucial contribution of deep learning
TABLE I
community to medical fields. Apart from telling that some T YPES OF S EMANTIC S EGMENTATION L OSS F UNCTIONS [3]
disease exists it also showcases where exactly it exists. It
has drastically helped in creating algorithms to detect tumors, Type Loss Function
Distribution-based Loss Binary Cross-Entropy
lesions etc. in various types of medical scans. Weighted Cross-Entropy
Image Segmentation can be defined as classification task Balanced Cross-Entropy
on pixel level. An image consists of various pixels, and these Focal Loss
Distance map derived loss penalty term
pixels grouped together define different elements in image. A Region-based Loss Dice Loss
method of classifying these pixels into the a elements is called Sensitivity-Specificity Loss
semantic image segmentation. The choice of loss/objective Tversky Loss
Focal Tversky Loss
function is extremely important while designing complex Log-Cosh Dice Loss(ours)
image segmentation based deep learning architectures as they Boundary-based Loss Hausdorff Distance loss
instigate the learning process of algorithm. Therefore, since Shape aware loss
Compounded Loss Combo Loss
2012, researchers have experimented with various domain Exponential Logarithmic Loss
specific loss function to improve results for their datasets.
In this paper we have summarized fifteen such segmentation
based loss functions that have been proven to provide state
II. L OSS F UNCTIONS
of art results in different domains. These loss function can
be categorized into 4 categories: Distribution-based, Region- Deep Learning algorithms use stochastic gradient descent
based, Boundary-based, and Compounded (Refer I). We have approach to optimize and learn the objective. To learn an
also discussed the conditions to determine which objective/loss objective accurately and faster, we need to ensure that our
function might be useful in a scenario. Apart from this, we mathematical representation of objectives, also known as loss
y − µy + C4 p − µp + C4
e=| − | (24)
σy + C4 σp + C4
Log-Cosh Dice Loss(ours) Variant of Dice Loss and inspired regression log-cosh approach for smoothing
Variations can be used for skewed dataset
Hausdorff Distance loss Inspired by Hausdorff Distance metric used for evaluation of segmentation
Loss tackle the non-convex nature of Distance metric by adding some variations
Shape aware loss Variation of cross-entropy loss by adding a shape based coefficient
used in cases of hard-to-segment boundaries.
Combo Loss Combination of Dice Loss and Binary Cross-Entropy
used for lightly class imbalanced by leveraging benefits of BCE and Dice Loss
Exponential Logarithmic Loss Combined function of Dice Loss and Binary Cross-Entropy
Focuses on less accurately predicted cases
Correlation Maximized Structural Similarity Loss Focuses on Segmentation Structure.
Used in cases of structural importance such as medical images.
TABLE III
C OMPARISON OF SOME ABOVE MENTIONED LOSS FUNCTIONS ON BASIS
OF D ICE SCORES , S ENSITIVITY AND S PECIFICITY FOR S KULL
S EGMENTATION