{'fraction_non_alphanumeric': 0.03694434513168871, 'fraction_numerical': 0.014777738052675486, 'mean_word_length': 4.857940663176265, '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}}
Semi-supervised Learning using Robust Loss

The amount of manually labeled data is limited in medical applications, so semi-supervised learning and automatic labeling strategies can be an asset for training deep neural networks. However, the quality of the automatically generated labels can be uneven and inferior to manual labels. In this paper, we suggest a semi-supervised training strategy for leveraging both manually labeled data and extra unlabeled data. In contrast to the existing approaches, we apply robust loss for the automated labeled data to automatically compensate for the uneven data quality using a teacher-student framework. First, we generate pseudo-labels for unlabeled data using a teacher model pre-trained on labeled data. These pseudo-labels are noisy, and using them along with labeled data for training a deep neural network can severely degrade learned feature representations and the generalization of the network. Here we mitigate the effect of these pseudo-labels by using robust loss functions. Specifically, we use three robust loss functions, namely beta cross-entropy, symmetric cross-entropy, and generalized cross-entropy. We show that our proposed strategy improves the model performance by compensating for the uneven quality of labels in image classification as well as segmentation applications.


Introduction
Deep neural networks usually require a large amount of labeled training data to achieve good performance. However, manual annotations, especially for medical images, are very time-consuming and costly to acquire. So it is desirable to incorporate extra knowledge from unlabeled data into the training process and assist supervised training. The dominant methods that leverage unlabeled data for classification, specifically semantic segmentation, include (1) consistency training [8,11] that ensure consistency of prediction in the presence of various perturbations. In these approaches, a standard supervised loss term (e.g., cross-entropy loss) is combined with an unsupervised consistency loss term that enforces consistent predictions in response to perturbations applied to unsupervised samples; and (2) pseudo-labeling [27,28,13,29,7] of the unlabeled images obtained from the model trained on the labeled images by generating pseudo-labels using another or even the same neural network. Generating pseudo-labels is a straightforward and effective way to enrich supervised information [7]. However the pseudo-labeled datasets inevitably include mislabeled data that introducing noise. These weakly labeled data can have a disproportionate impact on the learning process, and the model may over-fit to the outliers [25].
A major challenge in using auto-labeled data for training is accounting for noise in the pseudo-labels [16,27,28,13,29]. Several approaches deal with noise in pseudo-labeled data by focusing on heuristically controlling their use by (1) lowering the ratio of pseudo-labels in each mini-batch [28]; (2) selecting pseudolabels with high confidence [29]; or (3) setting lower weights in computing the loss for pseudo-labels [16].
Alternative approaches that mitigate the effect of noisy labels can be categorized into three classes: (1) label correction methods that improve the quality of raw labels by modeling characteristics of the noise and correcting incorrect labels [22]; (2) methods with robust loss that are inherently robust to labeling errors [21]; and (3) refined adaptive training strategies that are more robust to noisy labels [24].
Here we focus on robust loss functions that offer a theoretically-based approach to the noisy label problem [21]. Previous studies have shown some loss functions such as Mean Absolute Error (MAE) that were originally designed for regression problems can also be used in classification settings [9]. However, training with MAE has been found to be very challenging because of the gradient saturation issue [26] . The Generalized Cross-Entropy (GCE) [26] loss applies a Box-Cox transformation to probabilities that has been shown to be a generalized mixture of MAE and Cross-Entropy (CE). Using a similar idea of applying a power-law function, beta-cross entropy loss has been developed to mitigate the effect of noise in the training data [1,3]. Minimizing beta-cross entropy (BCE) is equivalent to minimizing beta-divergence [6], which is the robust counterpart of KL-divergence. BCE has an extra normalization term compared to the GCE loss. Another study suggested Symmetric Cross-Entropy (SCE) loss by combining Reverse Cross-Entropy (RCE) together with the CE loss [21].
Here we develop a semi-supervised learning strategy to utilize labeled data and weakly labeled data. A teacher-student training framework [23,7] is adopted. We propose to first generate pseudo-labels of the unlabeled data using a teacher model trained on ground-truth labels. Then we train a student model using a combination of ground-truth and pseudo-labels. We apply a robust loss to enhance model robustness to noise in pseudo-labels, so that both supervised and weakly supervised knowledge are combined in an optimized learning strategy. We demonstrate the effectiveness of the proposed strategy on a simple classification task and a brain tumor segmentation task.
In this work, our contribution is three-fold: -We improved model performance when only limited labeled data is available, which is especially meaningful to medical images. -We proposed a simple yet effective semi-supervised learning strategy by introducing a plug-and-play module: the robust loss function.
-The proposed strategy is agnostic to specific model architecture and can be applied to various segmentation or classification or even regression tasks.

Materials and Methods
First, we introduce the robust loss functions used for handling noise in pseudolabels in Sec.2.1 and illustrate the utility of the robust loss functions using a simulation. We then describe our semi-supervised strategy in Sec.2.2, which employs a teacher-student framework [23].
In a multi-class classification setting, the most commonly used loss function is multivariate cross-entropy given by: where x is the input variable, y is the response variable. p(k|x) is the probability output of a deep neural network (DNN) classifier, and q(k|x) is the one-hot encoding of the label. We use this as a baseline in our experiments below, however this loss is function is susceptible to label noise, which we address with the robust approaches described below. We develop a teacher-student semi-supervised framework by using both manually labeled as well as pseudo-labeled data. We propose to first generate pseudo-labels of the unlabeled data using a model trained on manually labeled ground-truth labels. Then we train a second model using these groundtruth labels and generated pseudo-labels simultaneously by applying a robust loss to enhance model robustness to noise in the pseudo-labels.

Robust loss functions
We evaluated three different robust loss functions to reduce the effect of pseudolabel noise. The Generalized Cross-Entropy (GCE) loss is defined as follows: GCE applies a Box-Cox transformation to probabilities (power-law function). Using L'Hôpital's rule it can be shown that GCE is equivalent to CE for lim q → 0 and to MAE when lim q → 1 so this loss is a generalization of CE and MAE [26]. The Beta Cross-Entropy (BCE) loss can be expressed as: BCE minimizes β-divergence [6] between the posterior and empirical distributions when the posterior is a categorical distribution [2,3]. Using L'Hôpital's rule, it can be shown that BCE is equivalent to CE for lim β → 0 where β-divergence also converges to KL-divergence. β-divergence is the robust counterpart of KLdivergence using a power-law function. BCE has an extra regularization term compared to GCE. This loss has not previously been applied to classification tasks [1,3].
The Reverse Cross-Entropy (RCE) loss is defined as [21]: A is the smoothed/clipped replacement of log{0}. MAE is a special case of RCE at A = −2. RCE has also been proved to be robust to label noise, and can be combined with CE to obtain the Symmetric Cross-Entropy (SCE): [21], where α and γ are hyper-parameters.
As an illustrative example (Figure 2), we created a simulated dataset with three classes using Gaussian mixtures plus outliers. The figure shows color-coded data according to their classes. A single layer perceptron was trained with the multivariate cross-entropy loss function (Eq. 1), which is a non-robust loss. The decision boundary determined by the network can be seen to be impacted by the presence of outliers in the data. The procedure was repeated by training the perceptron with multivariate β-cross entropy loss (Eq. 3), which is a robust loss. It can be seen that the decision boundaries, in this case, are minimally impacted by the presence of outliers.

Data samples
Decision Boundary using non-robust loss Decision Boundary using robust loss Fig. 2: An illustrative example of using robust loss for classification: (left) a simulated dataset with three distinct classes and a mislabeled subclass data, shown as a smaller cluster on the bottom left; (b) decision boundary computed using a single layer perceptron and multivariate cross-entropy loss (non-robust loss); (c) the decision boundary calculated using a single layer perceptron, but with multivariate beta-cross entropy (robust loss). It can be seen that the decision boundary computed using the non-robust loss is affected due to the mislabeled outliers, whereas the decision boundaries calculated using a robust loss are minimally impacted by the mislabeled data.

Training using unlabeled data and a robust loss function
We introduce a teacher-student framework [23] to perform semi-supervised learning for classification and its special case semantic segmentation. We assume we have a small number of labeled training samples and a large set of extra unlabeled samples. We first train a teacher model with standard cross-entropy loss using the labeled set and then generate pseudo-labels for the unlabeled set. The quality of pseudo-labels depends on the performance and generalizability of the teacher model. When the number of labeled samples is smaller, the generated pseudo-labels will become noisier. We then combine the true and pseudo-labels to re-train a student model. We used CE for human-annotated labels and the robust loss functions for pseudo-labels. An illustration of our framework is shown in Fig. 1.

Experiments and Results
To explore the effectiveness of our semi-supervised strategy, we performed image classification and segmentation tasks. We started with a simple classification task using the CIFAR-10 [12] dataset. We used this dataset as robust loss functions were previously applied on this dataset [14] using simulated noisy labels, and we wanted to investigate if these loss functions are useful for the semi-supervised learning using the same dataset. Then we performed a brain tumor segmentation task on the BraTS 2018 dataset [15,4,5] to further explore the benefits of our proposed strategy for medical imaging applications. To create a semi-supervised experiment setting, we first divide the training set into two groups, assuming a specific percentage (p) of subjects being the labeled group and the rest of subjects being the unlabeled group. Denote the total number of training subjects as N .
We define performance of the teacher model trained on N * p subjects as the lower bound and the model trained on N subjects (the entire training set) as the upper bound. We generated the pseudo-labels of N * (1 − p) subjects using the teacher model trained on the other N * p subjects. Then a student model is trained on both ground-truth labels and pseudo-labels.

CIFAR-10
First, we performed experiments on the CIFAR-10 dataset [12] (with 50000 images for training and 10000 for testing). We set p = 10% and trained our teacher network with ground truth labels. Then we generated pseudo-labels for the rest of 90% of the data and combined this set with the 10% ground truth labels to train the student model with CE, GCE, SCE, and BCE. The hyper-parameters for GCE, SCE and BCE losses were chosen based on a validation set (10% of the training data (β = 5), (q = 0.9), (α = 0.1, γ = 0.01)). For both teacher and student networks we used ResNet-18 [10] and trained the networks for 150 epochs using stochastic gradient descent [17] (momentum=0.9, weight decay=1e-4). The initial learning rate was 0.1 and reduced to 0.01 after 100 epochs. The results are summarized in Table 1. All robust losses improved the model performance.

Brain Tumour Segmentation
Backbone Model: We adopted a 3-dimensional CNN called TransBTS [20] as our backbone model, which combines U-Net [18] and Transformer [19] networks. TransBTS is based on an encoder-decoder structure and takes advantage of Transformer to learn not only local context information but also global semantic correlations [20]. TransBTS achieved superior performance compared to previous state-of-the-art models for the brain tumor segmentation task [20]. We trained the model for 1000 epochs from scratch with an Adam optimizer. The initial learning rate is 0.0002 and the batch size is set to 4.

Dataset and Evaluation:
We performed experiments on a publicly available dataset provided by the Brain Tumor Segmentation (BraTS) 2018 challenge [15,4,5]. The BraTS 2018 Training dataset includes 285 subjects with ground-truth labels. The Magnetic Resonance Images (MRIs) have been registered into a common space and the image dimension is 240 × 240 × 155.
The ground-truth labels contain three tumor tissue classes (necrotic and nonenhancing tumor: label 1, peritumoral edema: label 2, and GD-enhancing tumor:  , and a test set (57 subjects). We used the validation set to select the values of hyper-parameters, which are β = 0.001 for BCE loss; q = 0.7 for GCE loss; α = 0.01, γ = 1.0 for SCE loss. We used Dice score to quantitatively evaluate the segmentation accuracy for enhancing tumor region (ET, label 1), regions of the tumor core (TC, labels 1 and 4), and the whole tumor region (WT, labels 1, 2, and 4). To explore the benefits of our strategy when different numbers of ground-truth labels are available, we evaluated the segmentation accuracy when p = 30%, 50%, 70% of data is considered as labeled, respectively. We ran the experiments three times to compute mean and standard deviation for the Dice score, each time we select different subjects as labeled data. Table 2 compares the dice scores of segmentation results when different loss functions (CE, BCE, GCE, SCE) are applied during training. From Table 2 and Fig. 3 we can observe that applying robust loss improves the segmentation accuracy compared to the CE loss and the lower bound. The improvement is more significant when only a small number of labeled data is available. This is because a relatively large proportion of noisy labels has a more negative effect on the model performance, and applying robust loss can make the model less perturbed by noise. The proposed strategy at p = 30%, p = 50% achieved even better performance than the lower bound model at p = 50%, p = 70%, and comparable performance compared to the model with CE loss at p = 50%, p = 70%. When p = 70%, some of the robust loss results showed slightly worse dice scores compared to CE loss for the WT and TC classes. This is probably because the teacher model generated higher quality pseudo-labels when more ground truth labels are available, the noise level is negligible and these two classes are relatively easier to segment, so adding robust loss will not further boost model performance. To qualitatively evaluate the segmentation results, we selected two representative test subjects and showed the segmentation results produced by different approaches as well as ground-truth labels in Fig. 4. Evidently, segmentation results generated by the model with robust loss are more accurate, which verified the benefits of our semi-supervised strategy.

Conclusion
We developed a semi-supervised learning strategy that uses ground-truth labels and generated pseudo-labels during training and applies robust loss functions to mitigate the negative effect on the model from noises existing in pseudo-labels. The proposed semi-supervised learning strategy is simple to deploy because of the plug-and-play robust loss module and has open possibilities for various applications as it is agnostic to specific model architecture. The experimental results on classification and segmentation tasks show that the proposed semi-supervised learning strategy improved model performance, especially in scenarios where only a small amount of ground truth labels are available.