{'fraction_non_alphanumeric': 0.026003391746749576, 'fraction_numerical': 0.009218593729616906, 'mean_word_length': 5.244366005973391, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
D-LEMA: Deep Learning Ensembles from Multiple Annotations -- Application to Skin Lesion Segmentation

Medical image segmentation annotations suffer from inter- and intra-observer variations even among experts due to intrinsic differences in human annotators and ambiguous boundaries. Leveraging a collection of annotators' opinions for an image is an interesting way of estimating a gold standard. Although training deep models in a supervised setting with a single annotation per image has been extensively studied, generalizing their training to work with datasets containing multiple annotations per image remains a fairly unexplored problem. In this paper, we propose an approach to handle annotators' disagreements when training a deep model. To this end, we propose an ensemble of Bayesian fully convolutional networks (FCNs) for the segmentation task by considering two major factors in the aggregation of multiple ground truth annotations: (1) handling contradictory annotations in the training data originating from inter-annotator disagreements and (2) improving confidence calibration through the fusion of base models' predictions. We demonstrate the superior performance of our approach on the ISIC Archive and explore the generalization performance of our proposed method by cross-dataset evaluation on the PH2 and DermoFit datasets.


Introduction
The semantic segmentation task in computer vision involves partitioning an image into a set of multiple nonoverlapping and semantically interpretable regions [10], and this entails assigning pixel-wise class labels to the entire image, making it a dense prediction task. Segmentation is a crucial task in the visual computing pipeline and is often used to improve several downstream tasks such as classification and depth estimation [39]. Following the seminal work of Long et al. [24], deep learning-based semantic image segmentation models have gained prominence because of their superior performance over traditional approaches. The majority of deep learning-based semantic segmentation models, however, rely on supervised learning of dense pixel annotations for the labels in images. State of the art supervised learning algorithms rely upon training using large volumes of data to yield acceptable results, and previous work has shown the importance of sufficient annotated data for visual tasks [28,12,34]. Particularly, Sun et al. [34] showed that the performance of segmentation models in terms of overlap based measures exhibits a logarithmic relationship with the amount of training data used for representation learning for semantic segmentation.
Collecting ground truth annotations for semantic segmentation is considerably more expensive than doing so for other visual tasks such as classification and object detection because of the dense annotations involved. While this can partly be ameliorated by crowd-sourcing the annotation process to non-experts, the presence of multiple object classes in a scene, coupled with factors such as illumination, shading, and occlusion, makes delineating the exact object boundaries an ambiguous and tedious task, leading to inter-annotator disagreements. The presence of multiple annotations ( Figure 1) further leads to the challenge of deciding upon an ideal ground truth against which the model's performance is assessed. Moreover, there exists a tradeoff between the precision and the generalizability of an 'ideal' segmentation ground truth, since aoverly precise delineation may not be reflective of the typical uncertainty encountered in practice when localizing the boundary [38]. A similar trade-off exists between the quality and the efficiency of these annotations: High quality dense annotations, although useful, take up more time to collect than relatively less informative approximate annotations (e.g., bounding boxes or simplified polygons). These problems are exacerbated further for medical images since medical imaging datasets with accurate pixel-level annotations are much smaller than their natural image counterparts [35], which can be attributed to the high cost associated with expert annotations, the difficulty in quantifying a true reference standard, the laborious nature of making dense annotations, which is even more difficult for 3D medical image volumes, and patient data privacy concerns. To add to this, the manual annotation of anatomical regions of interest can be very subjective and presents considerable inter-and intra-annotator disagreements even amongst experts across multiple medical imaging modalities [37,7,36,29,9], making it difficult to converge on a single gold standard annotation for model training and evaluation.
One of the seminal works on comparing a segmentation model's performance by comparing against a collection of (human-annotated) segmentations is that proposed by Warfield et al. [38], where they proposed an expectation maximization algorithm for the simultaneous truth and performance level estimation (STAPLE). Given a collection of segmentation masks, STAPLE generates a probabilistic estimate of the true segmentation mask as well as the segmentation performance of each of the segmentations in the collection. This was followed by several other extensions of STAPLE which addressed its limitations such as susceptibilities to large variations in inter-annotator uncertainty and annotator performance [3,14,21,23].
More recently, Mirikharaji et al. [27] showed that leveraging different levels of annotation reliability, using spatially-adaptive reweighting while learning deep learning based segmentation model parameters, helps improve performance, and demonstrated superior segmentation accuracy using a large number of low quality, 'noisy' annotations along with only a small fraction of precise annotations. Hu et al. [11] used a modified probabilistic U-Net [17] model to generate quantifiable aleatoric and epistemic uncertainty estimates for segmentation using a supervised learning framework which modeled inter-annotator variability as aleatoric uncertainty ground truth. Ribeiro et al. [29] proposed an approach to improve inter-annotator agreement by conditioning the segmentation masks using morphological image processing operations (opening and closing), convex hulls and bounding boxes to remove details specific to any single particular annotator. They argue that the conditioning could be deemed as denoising operations, removing the annotator specific details from the segmentation masks. The same authors then proposed to train their segmentation model on a subset of the images, derived by filtering out all samples whose mean pairwise Cohen's kappa score was less than 0.5, thus using only those segmentations which largely agree between annotators [30].
Despite the obvious benefits of improving segmentation performance, it is also crucial to analyze the predictive uncertainty of deep networks in medical image segmentation. In machine learning, the uncertainty has been classified into aleatoric and epistemic types. The aleatoric, which reflects the inherent noise in the data, has been estimated using a second auxiliary output in the network [16]. Bayesian neural networks (BNNs) have adopted Monte Carlo (MC) dropout [8] to reflect the epistemic uncertainty associated with the network parameters. Thanks to their simplicity, MC dropout uncertainty estimation has been studied in the context of general semantic segmentation [15] as well as medical image segmentation [18,33]. However, the uncertainty estimates obtained using MC dropout tend to be miscalibrated, i.e., they do not correspond well with the model error [22]. Recently, there have been efforts to improve the uncertainty calibration using ensemble learning. Particularly, Lakshminarayanan et al. [19] demonstrated the advantage of ensemble learning, i.e., averaging a collection of models trained from different initializations, in yielding more accurate predictive uncertainty estimates for classification and regression tasks. Mehrtash et al. [25] studied the performance of ensemble learning for predictive uncertainty in medical image segmentation. Particular to skin lesion segmentation, Jungo et al. [13] thoroughly studied the reliability of existing uncertainty estimation methods and showed their benefits and limitations [13].
Deep neural networks have been shown to potentially overfit to noisy labels [40] and our motivation for this work is to avoid single annotator bias [20]. Therefore, we seek training deep segmentation models to learn from multiple annotations as available instead of discarding some annotations. Rather than selecting a subset of images to learn from Ribeiro et al. [30], we instead propose a generalized approach of annotation weighting by leveraging different groups of consistent annotations in an ensemble method towards efficiently learning from all available annotations. We also utilize uncertainty estimates [16,19] in an ensemble learning framework to improve predictive uncertainty and calibration confidence in the final prediction. Contribution claims: We consider two major factors in the aggregation of multiple ground truth annotations: (1) handling contradictory annotations in the training data originating from inter-annotator disagreements, and (2) improving the model's confidence calibration through deep ensembling. Our hypothesis is that given a new image, leveraging different experts' skills independently and fusing them in an ensemble model, while considering their estimated uncertainty, makes for a more reliable final prediction.

Problem Statement and Method Overview
Let X = {X n } N 1 and Y = {Y n } N 1 be a set of N images and segmentation ground truth masks, respectively. In a supervised learning scheme, a network is trained to learn a function f θ : X n →Ŷ n parameterized by θ, which maps an image X n to the corresponding estimated segmentation maskŶ n . Approximating the mapping function f θ using a single annotation per image has been well studied in the literature. However, training supervised models in the presence of multiple annotations remains largely unexplored.
Let us assume that K annotators have independently an- notated different subsets of the images resulting in a set of segmentation ground truths Y = {{Y mn } Mn m=1 } N n=1 , where M n denotes the number of available annotations for X n . Inconsistent annotations for a given image could mislead the network and substantially deteriorate the performance of the model. Let M indicate the maximum number of annotations per image over the entire dataset. Instead of aggregating multiple annotations to estimate a single ground truth before the training phase, we propose to (1) learn a set of M mapping functions F = {f θ i } through ensembling M base deep models trained over the union of available annotations and (2) minimize the confusion induced from observing multiple annotations through a spatial reweighting scheme during training. (3) Lastly, we demonstrate that our proposed ensemble learning framework not only improves the segmentation performance but also provides a well-calibrated predictive uncertainty. Figure 2 illustrates the overview of our ensemble learning framework for skin lesion segmentation with multiple annotations.

Detailed Method
Non-contradictory Subsets Selection: To handle contradictory annotations arising from having multiple annotations per image during the training, we partition the entire dataset into M disjoint subsets, denoted by {C i } M i=1 , such that each C i includes at most one unique annotation for every image. In particular, for each image, with M n ≤ M annotations, we randomly assign the M n annotations to A naïve approach is to utilize these disjoint subsets to train individual base models independently. Even though this solution prevents exposing each ensemble base model to multiple annotations per image and encourages a diverse set of model performance, however, each disjoint set includes a small number of training samples which can adversely affect the generalization capability of individual base models. To address this issue, we combine all images along with all available annotations into a union dataset, denoted as U, and use it to train M base networks. Following Mirikharaji et al. [27], we utilize these non-contradictory subsets to assess the quality of annotations in U. Specifically, spatially-adaptive weight maps associated with varying annotations in U are learned to adjust the contribution of each annotated pixel in the optimization of deep network based on its consistency with clean annotations in {C i }. Learning Models: In more details, for each base model i, i ∈ 1, ..., M , we define a cross-entropy loss, denoted as L = {L C i ce } over each non-contradictory set C i . We then, in a meta-learning paradigm, learn a set of spatial weight maps for all annotations U based on the gradients of the cross-entropy losses with respect to the weights maps, i.e. ∇ W i L C i ce . This way, W i is optimized to cancel out the contributions of annotations inconsistent with C i while optimizing the parameters for i th base network, i.e.
Note that every image in C i has only one ground truth. W i are encoded in L and they are optimized along with the network parameters θ i for each individual base model. By integrating the information in the optimized W i , we can determine the degree by which a pixel-level annotation from any of annotators is considered noisy for model i, depending on how similar this annotation is to the annotations in C i . Therefore: Fusion of Predictions: Once the individual base models are trained, the final prediction of the entire ensemble for the X n is obtained by using a weighted fusion [31], that is: where α i n is the combination coefficient for prediction by model i. The simplest way to determine α i n is to consider equally weighted averaging and set them to 1/M . Another popular technique is to set α i n coefficients according to the confidence of the model [32]. In this work, we explore both aggregation techniques in our experimental evaluations. Uncertainty-driven Aggregation: For the uncertaintydriven aggregation of base models, we leverage aleatoric uncertainty, which models irreducible observation noise, to estimate how confident a base model is about its prediction, and utilize the confidence when combining the base models' prediction maps. Following Kendall et al. [16], we approximate the aleatoric uncertainty for each pixel q ∈ X n by placing a Gaussian distribution over the logit space before applying a sigmoid function in the last layer and reformulate the network output as: where f i and σ i are the network i outputs.
We use the aleatoric uncertainty in two forms: (1) considering the pixel-wise uncertainty values as spatiallyadaptive coefficients and (2) averaging the pixel-wise uncertainty into a single scalar image-level coefficient.

Data
For training, we used the International Skin Imaging Collaboration (ISIC) Archive data [1,6,5], the largest dermoscopic public dataset with over 13,000 images, captured by diverse devices in international clinical centers. All images are 8-bit RGB color dermoscopy images. Similar to Ribeiro et al. [30], we utilized 2,223 images with more than one segmentation ground truth mask (2,094 with two, 100 with three and 36 with four and 3 with five) to train our models. We split all 2,223 images to 80% for training and 20% for validation. For model selection, we randomly selected which annotation to use in validation set. To create our noncontradictory annotation sets, all training data are randomly and uniformly partitioned into five groups of overlapping images but unique ground truth annotations. ISIC ground truth masks were generated using three different pipelines with different levels of border irregularities all involving a dermatologist with expertise in dermoscopy: (1) an automatic algorithm followed by an expert review; (2) a semiautomatic algorithm controlled by an expert; and (3) manually drawing a polygon by an expert. A large variation of disagreement based on Cohen's kappa scores with the mean 0.67 is reported in Ribeiro et al. [29]. Figure 1 shows some examples of skin lesion images with multiple lesion boundary annotations from this dataset.
To thoroughly assess the segmentation performance of our proposed ensemble framework, we leveraged three publicly available datasets in our evaluations. All the images in the used datasets are resized into 96 × 96 pixels and normalized using the per-channel mean and standard deviation across the entire dataset. A brief description of these test datasets are provided as follows: • ISIC: Ribeiro et al. [30] randomly selected a test set of 2,000 images with just one segmentation ground truth from ISIC Archive. We used the exact set in our experimental evaluations for fair comparisons.
• PH 2 : The PH 2 (Pedro Hispano Hospital) dataset contains 200 8-bit RGB color dermoscopic images [26]. All images are acquired under the same condition using Tuebinger Mole Analyzer system at 20× magnification.
• DermoFit: This dataset has 1300 8-bit RGB color clinical images [2]. The images are captured with a Canon EOS 350D SLR camera at the same distance from the lesion under controlled lighting conditions.

Base Models and Implementation Details
Our architecture is an encoder-decoder architecture with residual and skip connections transferring the information in the encoder modules to the corresponding decoder modules [4]. Since the images in our training dataset are paired with at most five annotations (M = 5), our ensemble framework consists of five base deep neural networks. Each network outputs two spatial maps in the last layer: the dense segmentation prediction and the predicted aleatoric uncertainty map. In training the aleatoric loss, 10 Monte Carlo samples from logits are taken. Stochastic gradient descent with an initial learning rate of 10 −4 is used to optimize the network parameters. The batch size for optimizing the spatial weight maps and network parameters is 64 and 2. The momentum and weight decay are set to 0.99 and 5 ×10 5 , respectively. Table 1 compares the segmentation performance of our baseline models as well as the individual base models, across different prediction fusion schemes, using the Jaccard index. To train the baseline model, for every image in the training batch, we randomly select which ground truth to use when optimizing the loss function (row A). While it is interesting to consider each annotator separately and evaluate their performance, the assignments between annotators and ground truth are not stated in the ISIC Archive dataset. Instead, we evaluate the performance of each base model trained on non-contradictory annotations simulating an expert knowledge (rows B to F). In addition, we compare the performance of our proposed method against the work of Ribeiro et al. [30] where a subset of samples with  For the fusion stage, we examine three approaches as listed below:

Results
• Uniformly weighted fusion: The predictions from the base models are combined by averaging the output probabilities.
• Pixel level confidence-based fusion: The predictions from the models are fused using normalized confidence spatial maps computed by inverting the predicted aleatoric outputs.
• Image level confidence-based fusion: The aleatoric uncertainty maps are aggregated into an image level aleatoric scalars and the predictions of the base models are combined based on the image-level normalized confidence scalars computed by inverting the uncertainty scalars.
Our results demonstrate that leveraging all available annotations effectively in an ensemble framework consistently improves the performance of the segmentation performance both in a held-out test set and over two other distinct datasets. Looking into different variants of our deep ensemble method, it is evident that aggregating the aleatoric uncertainty into the image-level scalar and leveraging them in the fusion stage (row H) either outperforms or exhibits competitive performance against the uniform averaging scheme (row G).
While modeling predictive uncertainty in clinical applications without a 'real' gold standard is helpful in decision making, miscalibrated uncertainty with overconfident predictions leads to an unreliable outcome. To evaluate the calibration quality of our ensemble annotation aggregation against Bayesian FCNs, we implemented Bayesian epistemic uncertainty using dropout for each base model. Similar to Bayesian SegNet [15], we added five dropout layers in the central part of the encoder and the decoder after each convolutional layer. Dropout probability is set to 0.3 and they are kept active at the inference time. Fifteen feedforwards are executed to perform MC sampling and the output mean is considered as the final segmentation prediction.
To evaluate the quality of the predictive uncertainty, we use two widely used metric in the literature [19,8]; negative log-likelihood (NLL) and Brier score (Br). Given a segmentation network with sigmoid non-linearity in the output layer, NLL and Br for X n are calculated as follows: Consistent with prior studies on deep ensembling [19,25], Table 2 indicates that our annotation aggregation ensemble with five base models consistently improves the confidence calibration and predictive uncertainty for three datasets in comparison to modeling epistemic uncertainty by MC dropout.
The spatially adaptive weight maps for model i, W i , are learned to prevent penalizing the pixels whose feature maps are similar to the feature maps of data in C i while their gradient direction is not similar to the direction of loss gradient on annotations in C i . To qualitatively evaluate matrices W i , in Figures 3 and 4, we overlay the learned weight maps, in training iteration 100K, over the inconsistency maps (absolute differences of ground truth masks). Looking into the color-coded boxes shows how the location of the cyan pixels matches the inconsistency maps (zero or very close to zero weights are assigned to inconsistent annotated pixels), which results in exclusively leveraging the experts knowledge in C i when learning θ i .

Conclusion
Approaches to train deep segmentation models do not trivially generalize to datasets with multiple image annotations. We propose an ensemble paradigm to deal with discrepancies in segmentation annotations. A robust-toannotation-noise learning scheme is utilized to efficiently leverage the multiple experts' opinions toward learning from all available annotations and improve the generalization performance of deep segmentation models. The quality of predictive uncertainty in clinical applications without true gold standards is critical. Our model captures two types of uncertainty, aleatoric uncertainty modeled in the training loss function and epistemic uncertainty modeled in the ensemble framework to improve confidence calibration.