δARD loss for low-contrast medical image segmentation

Medical image segmentation is essential to image-based disease analysis and has proven to be significantly helpful for doctors to make decisions. Due to the low-contrast of some medical images, the accurate segmentation of medical images has always been a challenging problem. The experiment found that UNet with current loss functions cannot capture subtle information in target contours or regions in low-contrast medical images, which are crucial for subsequent disease diagnosis. We propose a robust loss by incorporating the difference in average radial derivative (ARD), length and region area to further help the network to achieve more accurate segmentation results. We evaluated the proposed loss function using UNet as the base segmentation network compared to five conventional loss functions on one private and four public medical image datasets. Experimental results illustrate that UNet with the proposed loss function can achieve the best segmentation performance, even better than the outstanding deep learning models with original loss functions. Furthermore, three representative datasets were chosen to validate the effectiveness of the proposed δARD loss function with seven different models. The experiments revealed δARD loss’s plug-and-play feature and its robustness over multiple models and datasets.


Introduction
Medical image segmentation plays a vital role in image-based disease analysis and is an important step in computer-aided diagnosis systems that can help doctors make correct decisions quickly.Due to the low-contrast of some medical images, the accurate segmentation of medical images has always been a challenging problem.Several examples are given in figures 1(a)-(c) resent representative images of an ultrasound benign breast tumor having a regular shape and smooth boundary (BD), an ultrasound malignant breast tumor with an irregular shape and rough lesion BD, and a microscopic image of lesion nuclei, respectively.As shown in figures 1(a) and (b), in breast ultrasound images there exist problems of artifacts, low-contrast and uneven intensity [1].Due to poor image quality, low image contrast, and tumor size and shape changes in breast ultrasound images, accurate identification of lesion boundaries becomes difficult.The microscopic image shown in figure 1(c) is composed of multiple nuclei, the contrast in the original image is low and multiple regions of interest need to be located during segmentation, thus increasing the complexity of accurate BD delineation.
In the training phase, the network is pushed to make predictions consistent with the ground truth (GT) by using the loss function.The choice of loss function plays an important role in improving segmentation performance because it enables convolutional neural network (CNN) to capture complex details related to region of interest (ROI).At present, researchers have proposed several loss functions, of which cross entropy (CE) loss and dice loss were the two most commonly used [2].In addition, active contour (AC) loss [3]  adopted an AC-like function with ROI length and region area as loss functions, which performs well in cardiac image segmentation tasks.BD loss [4] combined BD information and dice loss to enhance the segmentation effect because it was mentioned that only considering the BD was not conducive to accurate segmentation [5].Hausdorff (HD) loss [6] incorporated the Hausdorff distance of the segmentation method into the loss function to enhance the model effect.
Based on the attention to loss functions in low-contrast medical image segmentation, we conducted a comparative experiment of different loss functions on the low-contrast medical image datasets.Since UNet is the most widely used and has the most obvious effect on medical image segmentation, we use UNet as a framework to conduct loss function experiments.Meanwhile, to compare the effect of the loss functions, we selected distribution-based CE loss, region-based Dice loss, and three BD-based loss functions, including AC loss, BD loss and HD loss.
As shown in figure 2, the first line is the segmentation of malignant breast tumors, the second line is the segmentation of benign breast tumors, and the third line is the segmentation of lesion nuclei.In the segmentation of the first line of figure 2, it can be seen from the original image that the shape of the malignant tumor is irregular and has low-contrast and uneven intensity.For the three BD-based loss functions, AC loss, BD loss and HD loss, the identification area is not accurate because there are many scattered points of segmentation errors.The distribution-based CE loss identification area is relatively complete, but the shape cannot match that of GT and the region-based Dice loss identifies the most accuracy areas but the shape cannot match GT.In the second line segmentation of figure 2, it can be seen from the original image that the benign tumor has a regular shape, but there is also a problem of excessive noise in ultrasonic images.The segmentation results of the three BD loss functions showed that the location and shape of the tumor were accurately located, but due to the noise of the ultrasound image, some wrong parts were identified.CE loss and Dice loss accurately identified the target area, but the shape of the three BD-based loss recognition is not accurate.In the third line of segmentation in figure 2, it can be seen from the original image that the microscopic image of the diseased nucleus needs to be segmented into multiple focal areas.All five kinds of loss have the problem of region identification error.Relatively speaking, AC loss, BD loss and HD loss area identification error is larger, CE loss and Dice loss can identify the area relatively accurately, but the shape is slightly different from GT.It can be seen that there are still problems such as inaccurate target region recognition and inaccurate shape detail segmentation in medical image segmentation.
The above problems are divided into two aspects to discuss the loss functions problem in low-contrast medical image segmentation.The first is the accurate identification of the ROI region.It can be observed that distribution-based CE loss and region-based Dice loss perform better in integrity than BD-based loss.Therefore, to segment the integrity of the target, regional information in the loss function is essential.The second is the problem of inaccurate segmentation of shape details.Due to the low-contrast of medical image data, the segmentation shape of the existing loss cannot be close to GT.Even some existing BD loss cannot guarantee the shape fitting.Therefore, it is necessary to introduce other features in the loss function to pay more attention to the BD information.Therefore, to help the network capture information about valuable ROI shapes and regions in low-contrast medical images and perform excellent segmentation of medical images, this paper proposes a robust loss function that takes into account the average radial derivative increment(δARD), ROI length and region.In the past decade, CNN-based deep learning methods have achieved excellent results in the field of medical image segmentation by better understanding multi-layered image features.In particular, UNet and its variants have proven to be the most efficient and commonly used medical image segmentation method.Therefore, this paper conducts an experimental comparison of different loss functions based on the UNet framework.In addition, we set three hyperparameters to control the importance of the features so that the proposed losses can be applied to five medical image datasets.

Loss functions
Loss functions used in medical image segmentation tasks can be divided into four categories as follows: (i) Distribution-based loss Distribution-based loss functions aim to minimize the difference between the real probability distribution and the predicted probability distribution.The most typical distribution-based loss function is cross-entropy (CE), which is prone to slow progress in the iterative process in medical image datasets with class-imbalanced problems and may not be optimized to the best.Hence, some loss functions were proposed based on CE loss, such as TopK loss [7] and Focal loss [8], where I, J denotes the set of all the points on the horizontal and vertical dimensions, i, j denote the points in the set I, J, respectively.The GT pixel is denoted by u i,j , and the predicted pixels as v i,j .Ω denotes the set of all points contained in the whole image.
(ii) Region-based loss Typical region-based loss functions are dice loss [9], ioU loss and tversky loss [2], etc. Due to the lack of attention on the contour, region-based loss functions could not perform well on those medical images that contain ROIs with rough contours (e.g.figure 1(b)), (iii) BD-based loss BD-based loss functions compute the difference between the predictions and the GT in the shape-aware and the length-aware BD space.These include BD loss [4] and HD loss.Karimi and Septimiu [6] proposed HD loss and proved that hausdorff distance could be approximated by GT and distance transformation of prediction segmentation, avoiding unstable training.However, only considering BD is not conducive to accurate segmentation [5].Thus, AC loss combines length and region area together and helps CNN achieve better segmentation performance on medical image datasets, where λ and θ are two hyperparameters, (iv) Compound-based loss By combining different loss functions in some way, the compound-based loss functions could obtain more accurate segmentation results [2,10].However, the parameters introduced may have decreased efficiency.

Networkks
CNNs, such as AlexNet [11], UNet [12], UNet ++ [13], Dense-UNet [14] and SE-net [15], extract hierarchical structure and features with excellent performance, and have been widely used in segmentation tasks.In the field of medical image analysis, Ronnenberg et al [12] proposed a convolutional network for biomedical image segmentation, UNet, which can be trained end-to-end from very few images, has been widely used and improved.Rundo et al [16] proposed USE-Net for prostate region segmentation in multi-institutional MRI datasets, and the SE module's adaptive feature recalibration provides excellent cross-dataset generalization.Protonotarios et al [17] proposed a few-shot U-Net deep learning model for segmentation of lung cancer lesions in PET/CT imaging and continuously adjusted the weight of the model online according to user feedback to improve detection and classification accuracy.Zhuang et al [18] proposed a residual-extended-attention gate-unet (RDAUNet) that combines expansion residuals and attention gates into UNet architectures.UNet and its variants have proven to be the most efficient and commonly used medical image segmentation method.
In addition, to improve CNNs' lack of the ability to model long-range interactions [19,20], Transformer [21] was introduced into the field of computer vision.Subsequently in medical image segmentation tasks, and achieved successful results.Valanarasu et al [22] describe the Medical Transformer (MedT), which uses gated axial attention and performs best on small medical image datasets without pre-training.Shen et al [23] proposed a dilated transformer (DT) utilizing residual axial attention to further improve the performance of transformer-based approaches.Chen et al [24] proposed that TransUNet, Transformers can be used as a powerful encoder for medical image segmentation tasks, combined with U-Net to enhance finer details by recovering local spatial information.

Methodology
The overall segmentation framework is shown in figure 3.As the most commonly used medical image segmentation network with simple architecture, UNet is used as the base segmentation network to evaluate the proposed loss function (δARD).

δARD loss function
The proposed δARD loss function uses the BD and region information to accommodate the low-contrast data.As shown in equation ( 6), Loss δARDL consists of three calculation components.One contour-based loss function and one region-based loss function.
where α and β are two hyperparameters that can be tuned for the specific dataset and the based segmentation model to achieve the best performance; δ denotes the difference between the prediction and the GT; L and R denote the length and region area of the ROI.More descriptions of the three components of δARD will be given in the following sections 3.1.1and 3.1.2.

BD correlation (δARD and δ L):
BD information is vital for subsequent image-based disease analysis and diagnosis.Gomez et al [25].have obtained outstanding segmentation performance by taking the candidate contour with the largest ARD value as the ideal result, which shows that ARD has a certain effect on deciding the true contour in medical images.At the same time, length also plays an important role in the cardiac data in AC loss.Hence, we introduce ARD and length to the loss function to enhance the network's sensitivity to true lesion contours.
where J is the set of the lesion edges, ∆G is the edge derivation of the image, and r is a radial vector based on the center of the lesion area, where u represents GT value.However, we need to find the BD set J of the lesion first, and then find ARD for each point within the BD, which is very time-consuming for high-resolution medical images.Therefore, we simplify this process by solving the ARD and length of the entire image.The following takes the GT image as an example to find its ARD and length.
In order to simplify the calculation, we approximate the result of GT image dislocation subtraction as the BD of the lesion area and approximate the result of BD dislocation subtraction as the edge derivation, where I and J represent the set of points in the horizontal and vertical dimensions, respectively.B u (I − 1, J − 1) denotes the BD value of the simplified solution, The radial vector is simplified to calculate the difference between each point and the center.
where d(i, j) denotes the position of (i, j), i and j represent points in the set I and J, respectively.d • u denotes the average of d • u, that is, a central point of all lesion areas on the GT, where ϵ is the introduced error term and ϵ > 0, the GT pixel is denoted by u, and the predicted pixels as v, where 0 < λ, γ, α, β < 1.

Region correlation loss(R):
In the introduction, we proved the importance of regional information in loss from the paper [4] and experimental results.When there is regional information, the localization effect of the region is significantly enhanced.Therefore, it is necessary to introduce regional information, According to equation ( 16), R is divided into two parts R in and R out for calculation, where c in and c out represent the inside area and outside area of the GT region, respectively.

UNet architecture
For evaluating the proposed loss function, we choose UNet [12] as the fundamental segmentation framework.Figure 3 illustrates that UNet has an encoder-decoder-based architecture.Each encoder module is responsible for extracting image features.It contains two 3 × 3 convolutions layers, followed by a rectified linear unit and a 2 × 2 max pooling layer; while each decoder module is responsible for upsampling.It consists of a 2 × 2 up-convolution layer.Furthermore, UNet uses skip connection to combine multi-level feature maps and achieve good performance on medical image segmentation tasks.

Datasets
We evaluate the proposed δARD loss on one private and four public medical image datasets by five-fold cross-validation.Specifically, the private breast ultrasound image dataset (PBUSI) was collected from two ultrasound equipment, i.e.GE LOGIQ E9 and PHILIPS EPIQ 5.It consists of 878 breast ultrasound images each of which contains a tumor with varying size and shape.Two experienced radiologists participated in labeling ROI; BUSIS dataset [1] and Busi dataset [26] are two public breast ultrasound image datasets.BUSIS consists of 562 breast ultrasound images, each of which contains one tumor; while Busi consists of 647 images that contain multiple tumor types; MoNuSeg dataset [27] and GLAnd Segmentation (GLAS) dataset [28] are two public microscopic image datasets, among which MoNuSeg dataset contains images across multiple organs and patients, including 30 training data with 22 000 nuclear BD annotations and 14 testing data with 7000 nuclear.This dataset was created by downloading H&E stained tissue images captured at 40x magnification from TCGA archive; GLAS Segmentation consists of 165 images derived from 16 H&E stained histological sections of stage T3 or T42 colorectal adenocarcinoma.Each section belongs to a different patient, and sections were processed in the laboratory on different occasions.The dataset exhibits high inter-subject variability in both stain distribution and tissue architecture.The pathologist delineated the BD of each individual glandular object on that visual field.

Experiment design and configurations
In this paper, we design three experiments to verify the effect of the proposed loss on the segmentation of lesions in five medical image datasets, i.e.PBUSI, BUSIS, Busi, MoNuSeg and GLAS datasets.First, to verify the robustness of the proposed loss function, we compare it with the most related loss functions, i.e.AC loss, BD loss, HD loss and the most commonly used loss functions, i.e.CE loss and Dice loss.All the above loss functions were evaluated using UNet as the base segmentation network on the five medical image datasets.
Second, considering the performance of the proposed loss could be affected by the hyperparameters, including α and β, we conducted related experiments to find the best choice for α and β which can help UNet obtain the best segmentation performance on PBUSI dataset.Based on experience, we set 10 pairs of values for α and β.Specifically, when β is 1, we set α to be 0.5, 1, 1.1, 1.2, 1.5 and 2; and when α is 1, we set β to be 1.1, 1.2, 1.5 and 2.
Third, to further verify the effectiveness of the proposed loss function, we conducted a comparative analysis of state-of-the-art (SOTA) deep learning segmentation methods using the CE loss function or our proposed loss function in conjunction.By doing so, we aimed to explore the efficacy of our proposed loss function compared to the currently used CE loss function.SOTA methods i.e.UNet++ [13], RDAUNet [18], Attention UNet [29], Ghost UNet [30], MedT [22] and Trans UNet [24].We tested this experiment on three typical medical image datasets, i.e.PBUSI, MoNuSeg and GLAS datasets.
Furthermore, we used PyTorch to implement the whole framework and conducted the related experiments on one NVIDIA GeForce GTX 1080ti GPU.During the training period, the learning rate, batch size and epochs were set to 0.0001, 10 and 200, respectively; and all input images were resized to 256 × 256.Moreover, we adopted three typical evaluation metrics that include true positive ratio (TPR), false positive ratio (FPR), Jaccard index (JI), Dice similarity coefficient (DSC), F1 score (F1), Precision (PC) and Specificity (SP).

Comparison experiments with typical loss functions
In experiment 1, to verify the robustness of the proposed loss function, we compare it with the most related loss functions, i.e.AC loss, BD loss, HD loss and the most commonly used loss functions, i.e.CE loss and Dice loss.All the above loss functions were evaluated using UNet as the base segmentation network on the five medical image datasets.
Table 1 displays the experimental outcomes for typical loss functions such as CE loss, Dice loss, AC loss, HD loss, BD+Dice loss, and the newly proposed δARD loss presented in this paper.It is segmented into five experiments based on the datasets.The results of the segmentation of PBUSI dataset are demonstrated in lines 2-7 of table 1.This experiment signifies that δARD loss yields the highest values of TPR, FPR, JI, DSC, F1, and SP values.δARD loss outperformed the widely used CE loss with an uplift in TPR, FPR, JI, DSC, F1, and SP of 3.0%, 11.4%, 4.4%, 3.6%, 4.0%, and 0.2%, correspondingly.Comparing it to Dice loss, δARD loss shows enhancement in TPR, FPR, JI, DSC, F1, SP, and PC by 1.5%, 1.0%, 1.6%, 1.6%, 1.7%, 0.1%, and 1.1%, respectively.Additionally, when compared with similar BD+Dice loss, δARD loss achieved an improvement in TPR, FPR, JI, DSC, and F1by 1.7%, 0.1%, 0.2%, 1.3%, and 0.6%, respectively.In comparison with similar AC loss, δARD loss showed improvement in TPR, FPR, JI, DSC, F1, SP, and PC by 0.7%, 6.7%, 3.2%, 2.5%, 2.6%, 0.3%, and 4.4%, correspondingly.δARD loss shows the highest accuracy in the segmentation of the small breast ultrasound PBUSI dataset.Furthermore, the proposed δARD loss function improves the accuracy by concentrating on shape information.The same conclusion is observed in the quantization results of BUSIS, Busi, MoNuSeg, and GLAS datasets.Compared to other loss functions, δARD loss achieves optimal values in most indicators, significantly enhancing the overall segmentation results for low-contrast medical images.
From the above experimental results, we come to the following conclusion.First, we can observe that δARD has the highest TPR, JI, DSC, F1, SP, and PC values and the lowest FPR values on five low-contrast medical image datasets (slightly inferior to BD+Dice loss on GLAS dataset), which indicates that δARD has the best robustness and could help UNet achieve the best segmentation performance on medical image datasets.Second, compared with the most related AC loss, our study highlights that incorporating ARD into  the UNet architecture significantly enhances its capacity to capture more intricate BD information for low-contrast medical images.Additionally, we demonstrate that our proposed loss function outperforms well-established typical loss functions.
As shown in the first line of figure 4, BD loss, HD loss and Dice loss identified multiple areas due to low-contrast, and changes in lesion size, shape, and location.In contrast, the proposed δARD loss is more effective at enforcing BD and regional characteristics for low-contrast medical images by including ARD, length and area to enhance shape consistency.The result using the proposed loss in the second line of figure 4 is superior to other loss functions in accurately identifying and refining shape contours.Line 3 of figure 4 shows that δARD loss performs accurate segmentation of multiple small breast tumors.UNet identifies two small ROI without any false positives.AC loss, BD loss, and Dice loss models show more error areas, while CE loss and HD loss are worse than δARD loss.UNet was unable to obtain accurate and complete tumors when using the five loss functions shown in line 4 of figure 4. In contrast, interference can be successfully resisted using δARD loss.Therefore, this shows that δARD provides significant information, which helps UNet identify the true ROI region and BD for low-contrast medical images.It is worth noting that during the segmentation process, the false positive area increases, as shown in line 5 of figure 4.However, compared to other methods, the δARD model is closest to GT.
(line 4), and the multicores image (line 5).The results indicate that δARD achieves accurate ROI region consistency and resolves the multipoint prediction challenges encountered by other models.The use of δARD loss improves the model's performance by detecting complete ROI while reducing false positives, particularly in medical images with varying sizes, shapes, and ROI volumes.Our findings demonstrate that implementing the δARD loss function can enhance the contour shape and position accuracy of different models.
Table 3 presents the validation results of δARD on various datasets and models including UNet, UNet++, RDAUNet, Attention UNet, Ghost UNet, MedT, and Trans UNet.The study compared the effects of CE and δARD loss function on the segmentation of PBUSI, GLAS, and MoNuSeg datasets with seven models.Our findings indicate that δARD outperforms CE on both PBUSI and GLAS datasets.Notably, on 38 out of 49 measures in the MoNuSeg dataset, we achieved better results than CE loss.The significant improvement in the segmentation performance of different models through the use of our proposed loss function suggests its validity and effectiveness.Therefore, the results in table 3 provide evidence for the practicality of δARD loss function.

Conclusion
In this paper, we propose a robust loss function to improve the accuracy of low-contrast medical image segmentation.We design a loss function, called δARD loss, that incorporates the differences in ARD, target contour length and area.Additionally, we perform a comparative test on five medical image datasets, comparing the performance of our proposed loss function to five typical loss functions.Our results show that δARD loss outperforms all of the other loss functions.We also propose seven different segmentation models (UNet, UNet++, RDAUNet, Attention UNet, Ghost UNet, MedT and Trans UNet) as the basis for our study.By comparing the effects of applying both CE and δARD loss to these different models, we provide evidence that our proposed loss function is robust and effective for seven models across three medical image datasets.

Figure 1 .
Figure 1.Samples of medical images.From left to right: (a) an ultrasound image of a benign breast tumor, (b) an ultrasound image of a malignant breast tumor and (c) a microscopic image of lesion nuclei.

Figure 2 .
Figure 2. Examples of loss function experiment: from left to right are: original image, ground truth, AC, BD, HD, CE, Dice.
transformation of GT and segmentation.

Figure 3 .
Figure 3. Overview of our proposed method which takes the object's area, ARD, and length of the boundaries into account during training.

Figure 5 .
Figure 5. Examples of typical segmentation results on PBUSI, GLAS and MoNuSeg datasets.From left to right are: UNet, UNet++, Attention UNet, Ghost UNet, RDAUNet, MedT and Trans UNet.To facilitate display, the key part of the picture is enlarged and displayed.The green line represents GT, the red line represents δARD loss in the model, and the blue line represents CE loss in the model.

Table 2 .
δARD performance under hyperparameters α and β settings.We have bolded the best result of the loss functions used in each dataset in the table. Note: