The segmentation of skin lesions is a crucial task in clinical decision\nsupport systems for the computer aided diagnosis of skin lesions. Although deep\nlearning-based approaches have improved segmentation performance, these models\nare often susceptible to class imbalance in the data, particularly, the\nfraction of the image occupied by the background healthy skin. Despite\nvariations of the popular Dice loss function being proposed to tackle the class\nimbalance problem, the Dice loss formulation does not penalize\nmisclassifications of the background pixels. We propose a novel metric-based\nloss function using the Matthews correlation coefficient, a metric that has\nbeen shown to be efficient in scenarios with skewed class distributions, and\nuse it to optimize deep segmentation models. Evaluations on three skin lesion\nimage datasets: the ISBI ISIC 2017 Skin Lesion Segmentation Challenge dataset,\nthe DermoFit Image Library, and the PH2 dataset, show that models trained using\nthe proposed loss function outperform those trained using Dice loss by 11.25%,\n4.87%, and 0.76% respectively in the mean Jaccard index. The code is available\nat https://github.com/kakumarabhishek/MCC-Loss.\n