Label Refinery: Improving ImageNet Classification through Label Progression
Among the three main components (data, labels, and models) of any supervised learning system, data and models have been the main subjects of active research. However, studying labels and their properties has received very little attention. Current principles and paradigms of labeling impose several challenges to machine learning algorithms. Labels are often incomplete, ambiguous, and redundant. In this paper we study the effects of various properties of labels and introduce the Label Refinery: an iterative procedure that updates the ground truth labels after examining the entire dataset. We show significant gain using refined labels across a wide range of models. Using a Label Refinery improves the state-of-the-art top-1 accuracy of (1) AlexNet from 59.3 to 67.2, (2) MobileNet from 70.6 to 73.39, (3) MobileNet-0.25 from 50.6 to 55.59, (4) VGG19 from 72.7 to 75.46, and (5) Darknet19 from 72.9 to 74.47.READ FULL TEXT VIEW PDF
Partial Multi-label Learning (PML) aims to induce the multi-label predic...
The performance of a machine learning system is usually evaluated by usi...
In conventional supervised learning, a training dataset is given with
In model serving, having one fixed model during the entire often life-lo...
Annotating large unlabeled datasets can be a major bottleneck for machin...
We introduce DaiMoN, a decentralized artificial intelligence model netwo...
We introduce the "Incremental Implicitly-Refined Classi-fication (IIRC)"...
Label Refinery: Improving ImageNet Classification through Label Progression
There are three main components in the typical pipeline of supervised learning systems: the data, the model, and the labels. Sources of data have expanded drastically in past several years. We have observed the impact of large-scale datasets for several visual tasks. A variety of data augmentation methods [1, 2, 3, 4] have effectively expanded these datasets and improved the performance of learning systems. Models have also been extensively studied in the literature. Recognition systems have shown improvements by increasing the depth of the architectures [5, 6], introducing new activation and normalization layers [7, 8]
, and developing optimization techniques and loss functions[9, 10]. In contrast to the improvements in data and models, little effort has focused on improving labels.
Current labeling principles and practices impose specific challenges on our learning algorithms. 1) Incompleteness: A natural image of a particular category will contain other object categories as well. For example, Figure 2 shows an example from ImageNet that is labeled “cat” but the image contains a “ball” as well. This problem is rooted in the nature of how researchers define and collect labels, and is not unique to a specific dataset. 2) Taxonomy Dependency: Categories that are far from each other in the taxonomy structure can be very similar visually. 3) Inconsistency: To prevent overfitting, various loss functions and regularization techniques have been introduced into the training process. Data augmentation  is one of the most effective methods employed to prevent neural networks from memorizing the training data. Most modern state-of-the-art architectures for image classification are trained with crop-level data augmentation, in which crops of the image used for training can be as small as of the area of the original image . For many categories, such small crops will frequently result in patches in which the object of interest is no longer visible (Figure 2), resulting in an inconsistency with the original label.
To address the aforementioned shortcomings, we argue that several characteristics should apply to ideal labels. Labels should be soft
to provide more coverage for co-occurring and visually-related objects. Traditional one-hot vector labels introduce challenges in the modeling stage. Labels should beinformative of the specific image, meaning that they should not be identical for all the images in a given class. For example, an image of a “dog” that has similar appearance to a “cat” should have a different label than an image of a “dog” that has similar appearance to a “fox”. This also suggest that labels should be defined at the instance-level rather than the category-level. Determining the best label for each instance may require observing the entire data to establish intra- and inter-category relations, suggesting that labels should be collective across the whole dataset. Labels should also be consistent with the image content when crops are taken. Therefore, labels should be dynamic in the sense that the label for a crop should depend on the content of the crop.
In this paper we introduce Label Refinery, a solution that uses a neural network model and the data to modify crop labels during training. Refining the labels while training enables us to generate soft, informative, collective, and dynamic labels. Figure 1 depicts an example of a label refinery. As models go through the stages of the refinery labels are updated based on the previous models. This results in major improvements in the accuracy and generalization. The output of the lable refinery is a set of labels from which one can learn a model. The model trained from the produced lables are much more accurate and more robust to overfiting.
Our experiments show that Label Refining consistently improves the accuracy of object classification networks by a large margin across a variety of popular network architectures. Our improvements in Top-1 accuracy on the ImageNet validation set include: AlexNet from to , VGG19 from to , ResNet18 from to , ResNet50 from to , DarkNet19 from to , MobileNet0.25 from to , and MobileNet1 from to . Collective and dynamic labels enable standard models to generalize better, resulting in significant improvements in image classification. Figure 1 Plots the train versus test accuracies as models go through the label refinery procedure. The gap between train and test accuracies is getting smaller and closer to an ideal generalization.
We further demonstrate that a trained model can serve as a Label Refinery for another model of the same architecture. For example, we iterate through several successions of training a new AlexNet model by using the previously trained AlexNet model as a Label Refiner. Our results show major improvements (from to ) on using AlexNet to refine lables for another AlexNet. Note that the final AlexNet has not seen the actual groundtruth labels in the past few stages. The final AlexNet models demonstrate greatly reduced overfitting compared to the original models (Figure 4 and Figure 5). We also experiment with using a model of one architecture as a Label Refiner for a model of another architecture. Further, we have also shown that adversarialy modifying image examples improves the accuracy when using label refinery.
Our contributions include: (1) introducing the Label Refinery for crop-level label augmentation, (2) improving state-of-the-art accuracy on ImageNet for a variety of existing architectures, (3) demonstrating the ability of a network to improve accuracy by training from labels generated by another network of the same architecture, and (4) generating adversarial examples to improve the performance of the Label Refinery method.
Label Smoothing and Regularization: Softening labels has been used to improve generalization.  uniformly redistributes of the weight from the ground-truth label to other classes to help regularize during training. DisturbLabel  replaces some of the labels in a training batch with random labels. This helps regularize training by preventing overfitting to ground-truth labels.  augments noisy labels using other models to improve label consistency.  introduces a notion of local distributional smoothness in model outputs based on the smoothness of the model’s outputs when inputs are perturbed. The smoothness criterion is enforced with the purpose of regularizing models. The work of  explores penalizing networks by regularizing the entropy of the model outputs. Unlike our method, these approaches can not address the inconsistency of the labels.
Incorporating Taxonomy: Several methods have explored using taxonomy to improve label and model quality. 
uses cross-category relationships from knowledge graphs to mitigate the issues caused by noisy labels. designs a hierarchical loss to reduce the penalty for predictions that are close in taxonomy to the ground-truth.  investigates learning multi-label classification with missing labels. They incorporate instance-level information as well as semantic hierarchies in their solution. Incorporating taxonomic information directly into the model’s architecture is explored in . 
uses the output of existing binary classifiers to address the problem of training models on single-label examples that contain multiple training categories. These methods fail to address the incompleteness of the labels. Instead of directly using taxonomy, our model collectively infer the visual relations between categories to impose these knowledge into the training while capturing a complete description of the image.
Data Augmentation: To preserve generalization, several data augmentations such as cropping, rotating, and flipping input images have been applied in training models [8, 6, 5, 20].  proposes data warping and synthetic over-sampling to generate additional training data.  and  explore using GANs to generate training examples. Most of such augmentation techniques further confuse the model with inconsistent labels. For example, a random crop of an image might not contain the main object the that image We propose augmenting the labels alongside with the data by refining them during training when augmenting the data.
Teacher-Student Training: Using another network or an ensemble of multiple networks as a teacher model to train a student model has been explored in [21, 22, 23, 24, 25, 26].  explores training a shallow student network from a deeper teacher network. A teacher model is used in [26, 24] to train a compressed student network. Most similar to our work is , where they introduce distillation loss for training a model from an ensemble of its own. We show that Label Refinery must be done at the crop level, it benefits from being performed iteratively, and models benefit by learning off of the labels generated by the exact same model.
Previous works have shown that data augmentation using cropping significantly improves the performance of classification models [8, 27]. Given a dataset , we can formalize data augmentation by defining a new dataset , where is a stochastic function that generates crops on-the-fly for the image . The image labels assigned to the augmented crops are often not accurate (Figure 2 and Figure 3). We address this problem by passing the dataset through multiple Label Refiners. The first Label Refinery network is trained over the dataset with the inaccurate crop labels. The second Label Refinery network is trained over the same set of images, but uses labels generated by . More formally, we can view this procedure as training on a new augmented dataset . Once is trained, we can similarly use it to train a subsequent network .
We train the first Label Refinery network using the cross-entropy loss against the image-level ground-truth labels. We train all subsequent Label Refinery models for by minimizing the KL-divergence between its output and the soft label generated by the previous Label Refinery . Letting
be the probability assigned to classin the output of model on some crop , our loss function for training model is:
The second term is the entropy of the soft labels, and is constant with respect to . We can remove it and instead minimize the cross entropy loss:
Note that training using cross entropy loss can be viewed as a special case of our sequential training method using KL-divergence in which is trained from the original image-level labels. It’s worth emphasizing that the subsequent models do not see the original ground truth labels . The information in the original labels is propagated by the sequence of Label Refinery networks.
If any of the Label Refinery networks have Batch Normalization
, we put them in training mode even at the label generation step. That is, their effective mean and standard deviation to be computed from the current training batch as opposed to the saved running mean and running variance. We have observed that this results in more accurate labels and, therefore, more accurate models. We believe that this is due to the fact that the Label Refinery has been trained with the Batch Normalization layers in the training mode. Hence it produces more accurate labelsfor the training set if it’s in the same mode.
It is possible to use the same network architecture for some (or all) of the Label Refinery networks in the sequence. We have empirically observed that the dataset labels improve iteratively even when the same network architecture is used multiple times (Section 4). This is because the same Label Refinery network trained on the new refined dataset becomes more accurate that its previous versions over each pass. Thus, subsequent networks are trained with more accurate labels.
The accuracy of a trained model heavily depends on the consistency of the labels provided to it during training. Unfortunately, assessing the quality of crop labels quantitatively is not possible because there crop level labels are not provided. Asking human annotators to evaluate individual crops is infeasible both due to the number of possible crops and due to the difficulty of evaluating soft labels to a large number of categories for a crop in which there may not be a single main object. We can use a network’s validation set accuracy as a measure of its ability to produce correct labels for crops. Intuitively, this measurement serves as an indication of the quality of a Label Refinery network. However, we observe that models with higher validation accuracy do not always produce better crop labels if the model with higher validation accuracy is severely overfit to the training set. Intuitively, this is because the model will reproduce the ground-truth image labels for training set images. We explore this more in Section 4.1.
One popular way to augment ImageNet data is to crop patches as small as of the area of the image . In the presence of such aggressive data augmentation, the original image label is often very inaccurate for the given crop. Whereas traditional methods only augment the image input data through cropping, we additionally augment the labels using Label Refinery networks to produce labels for the crops. Smaller networks such as MobileNet  usually aren’t trained with such small crops. Yet, we observe that such networks can benefit from small crops if a Label Refinery is used. This demonstrates that a primary cause in accuracy degradation of such networks is inaccurate labels on small crops.
Using a Label Refinery network allows us to generate labels for any set of images. Our training dataset depends only on the input images , and labels are generated on-the-fly by the Refinery network . This means that we are no longer limited to using images in the training set . We could use another unlabeled image dataset as a source of . We could even use synthetic images. We experiment with using the Label Refinery in conjunction with the network being trained in order to generate adversarial examples on which the two networks disagree.
Let and be two of the networks in a sequence of Label Refinery networks. Given a crop , we define to be a modification of for which and
output different probability distributions. Following the practice of for generating adversarial examples, we define as
, where is the KL-divergence loss defined in Equation 1. This update performs one step of gradient ascent in the direction of increasing the KL-divergance loss. In other words, the input is modified to exacerbate the discrepancy between the output probability distributions. In order to prevent the model being trained from becoming confused by the unnatural inputs , we batch the adversarial examples with their corresponding natural crops .
We evaluate the effect of label refining for a variety of network architectures on the standard ImageNet, ILSRVC2012  classification challenge. We first explore the effect of label refining when the Label Refinery network architecture is identical to the architecture of the network being trained. We then evaluate the effect of label refining when the Label Refinery uses a more accurate network architecture. Finally, we present some ablation studies and analysis to investigate the source of the improvements. Note that all experiments are done with a single model over a single validation crop.
All models are trained using PyTorch on GPUs for epochs to ensure convergence. The learning rate is constant for the first epochs. It is divided by after epoch and again divided by after epoch . We use an initial learning rate of to train AlexNet and an initial learning rate of for all other networks. We use image cropping and horizontal flipping to augment the training set. When cropping, we follow the data augmentation practice of  in which the crop areas are chosen uniformly from to of the area of the image. We use a batch size of for all models except the MobileNet variations, for which we use batch size of . Except for adversarial inputs experiments, we train models from refined labels starting from a random initialization. Our source code is available at http://github.com/hessamb/label-refinery.
Self-Refinement: We first explore using a Label Refinery to train another network with the same architecture. Table 1 shows the results for self-refinement on various architectures. Each row represents a randomly-initialized instance of the network architecture trained with labels refined by the model directly one row above it in the table. All six network architectures improve their accuracy through self-refinement. For AlexNet the self-refining process must be repeated times before convergence, whereas MobileNet and ResNet-50 converge much faster. We argue that this is because AlexNet is more overfit to the training set. Therefore, it takes more training iterations to forget the information that it has memorized from training examples. One might argue that this is due to the extended training time of models. However, we experimented with training models for an equal number of total epochs and the model accuracies did not improve further. This is discussed further in Section 4.1.
Cross-Architecture Refinement: The architecture of a Label Refinery network can be different from that of the trained network. A high-quality Label Refinery should not overfit on training data even if its validation accuracy is high. In other words, under the same validation accuracy, a network with lower training accuracy is a better Label Refinery. Intuitively, this property allows the refinery to generate high-quality crop labels that are reflective of the true content of the crops. This property prevents the refinery from simply predicting the training labels. We observe that a ResNet-50 model trained to top-1 validation accuracy on ImageNet can serve as a high-quality refinery. Table 2 shows that a variety of network architectures benefit significantly from training with refined labels. All network architectures that we tried using Label Refineries gained significant accuracy improvement over their previous state-of-the-art. AlexNet and ResNetXnor-50111ResNetXnor-50 is the XNOR-net  version of ResNet-50 in which layers are binary. achieve more than a point improvement in top-1 accuracy. Efficient and compact models such as MobileNet benefit significantly from cross-architecture refinement. VGG networks have a very high capacity and they overfit to the training set more than the other networks. Providing more accurate training set labels helps them to fit to more accurate signals and perform better at validation time. Darknet19, the backbone architecture of YOLOv2 , improves almost points when trained with refined labels.
|Model||Paper Number||Our Impl.||Label Refinery|
|Model||GT Labels||Label Refinery||Adversarial|
Adversarial Inputs: As discussed in Section 3.1 we can adversarially augment our training set with patches on which the refinery network and the trained model disagree. We used a gradient step of , as defined in Equation 3 to augment the dataset. We batch each adversarially modified crop with the original crop during training. This helps to ensure the trained model does not drift too far from natural images. We observe in Table 3 that smaller models further improve beyond the improvements from using a Label Refinery alone.
|AlexNet – no refinery|
|AlexNet – soft static refinery|
|AlexNet – hard dynamic refinery|
|AlexNet – soft dynamic refinery|
|AlexNet – no refinery|
|AlexNet – taxonomy based refined categories|
|AlexNet – visually refined categories|
|AlexNet – visually refined images|
We explore the characteristics of models trained using a Label Refinery. We first explore how much of the improvement comes from the dynamic labeling of the image crops and how much of it comes from softening the target labels. We then explore the overfitting characteristics of models trained with a Label Refinery. Finally, we explore using various loss functions to train models against the refined labels. Most of the analyses are performed on AlexNet architecture because it trains relatively fast ( day) on the ImageNet dataset.
Dynamic Labels vs. Soft Labels: The benefits of using a label refinery are twofold: (1) Each crop is dynamically re-labeled with more accurate labels for the crop (Figure 2), and (2) images are softly labeled according to the distribution of visually similar objects in the crop (Figure 3). We find that both aspects of the refinement process improve performance. To assess the improvement from dynamic labeling alone, we perform label refinement with hard dynamic labels. Specifically, we assign a one-hot label to each crop by passing the crop to the Label Refinery and choosing the most-likely category from the output. To observe the improvement from soft labeling alone, we perform label refinement with soft static labels. To compute these labels for a given crop, we pass a center crop of the original image to the refiner rather than using the training crop. We compare the results for soft static labels and hard dynamic labels in Table 4. Both dynamic labeling and soft labeling significantly improve the accuracy of AlexNet. When they are combined we observe an additional improvement, suggesting that they address different issues with labels in the dataset.
Category Level Refining vs. Image Level Refining:
Labels can be refined at the category level. That is, all images in a class can be assigned a unique soft label that models intra-category similarities. At the category level, labels can be refined either by visual cues (based on the visual similarity between the categories) or by semantic relations (based on the taxonomic relationship between the categories). Since ImageNet categories are drawn from WordNet, we can use taxonomy-based distances to refine the labels. We experiment with using the Wu-Palmer similarity of the WordNet  categories to refine the category labels. Table 5 compares refining labels at the category level with refining at the image level. We observe larger improvements when the labels are refined at the image level. Our experiment shows that taxonomy-based refinement does not improve training. We believe this is because WordNet similarities do not correlate well with visual similarities in the image space. Refining category labels based off of their WordNet distance can confuse the target model.
|AlexNet – no refinery||N/A||N/A|
|AlexNet – refinery: VGG16|
|AlexNet – refinery: MobileNet|
|AlexNet – refinery: ResNet-50|
Model Generalization: Figure 4 and 4 show the per-category train and validation accuracies of ImageNet categories for models trained with a Label Refinery. Each point in the plot shows the average and standard deviation of the accuracies for a set of categories. Figure 4 shows the accuracies of a sequence of AlexNet models (in different colors). AlexNet trained using the ground-truth labels has much higher train accuracy. Successive models demonstrate less overfitting as shown by the decrease in the ratio between train accuracy and validation accuracy. Figure 4 shows the per-category accuracies of AlexNet and ResNet-50, as well as an AlexNet model trained with a ResNet50 Label Refinery. ResNet-50 trained with weight decay generalizes better compared to AlexNet, which has two fully connected layers. Intuitively, the generalization of ResNet-50 enbles it to generate accurate per-crop labels for the training set. Thus, training AlexNet with a ResNet-50 Label Refinery allows AlexNet to perform well on the test set without overfiting to the original ground-truth labels.
|AlexNet – no refinery|
|AlexNet – l2 loss|
|AlexNet – KL-divergence from output to label|
|AlexNet – KL-divergence from label to output|
Figure 5 shows the training set and validation set accuracies of a sequence of AlexNet models trained with a Label Refinery. The AlexNet trained with ground-truth labels achieves training accuracy for the majority of classes, but achieves much lower validation set accuracies. By contrast, AlexNet5 has a training accuracy profile more closely resembling its validation accuracy profile. Figure 6 shows a similar phenomena training AlexNet with a ResNet-50 refinery. It’s interesting to note that the training and validation profiles of AlexNet trained with a ResNet50 Label Refinery more closely resemble the refinery than the original AlexNet.
Choice of Label Refinery Network: A good Label Refinery network should generate accurate labels for the training set crops. A Label Refinery’s validation accuracy is an informative signal of its quality. However, if the Label Refinery network is heavily overfitted on the training set, it will not be helpful during training because it will produce the same ground-truth label for all image crops. Table 6 compares different architecture choices for refinery network. VGG16 is a worse choice of Label Refinery than MobileNet, even though VGG16 is more accurate. This is because VGG16 severely overfits to the training set and therefore produces labels too similar to the ground-truth.
Choice of Loss Function: We can use a variety of loss functions to train our target networks to match the soft labels. The KL-divergence loss function that we use is a generalization of the standard cross-entropy classification loss. Note that KL-divergence is not a symmetric function (i.e. ). Table 7 shows the model accuracy if other standard loss functions are used.
Qualitative Results: Using a refinery to produce crop labels reduces overfitting by providing more accurate labels during training. In Figure 7, we see an example in which a training image crop does not contain enough information to identify the image category as “barbershop”. In spite of this, AlexNet assigns the crop a label of barbershop with high confidence. This is due to overfitting on the training set. By using an AlexNet as a refinery, AlexNet2 learns to generalize better. It produces a lower score for “barbershop”, and a higher score for other categories. Generalization behavior improves with successive rounds of label refining until AlexNet5 produces a smooth distribution over plausible categories. In Figure 8, we see an example of a “soccer ball” from the validation set of ImageNet. AlexNet incorrectly predicts “airship” with high confidence. This prediction is most likely because the main object is surrounded by blue sky, which is common for an airship but uncommon for a soccer ball. By using AlexNet as a refinery to train another AlexNet model we achieve a reduced score for “airship” and a higher score for “soccer ball”. After several rounds of successive refining we achieve an AlexNet model that makes the correct prediction without completely forgetting the similarities between the soccer ball in the sky and an airship.
In this paper we address shortcomings commonly found in the labels of supervised learning pipelines. We introduce a solution to refine the labels during training in order to improve the generalization and the accuracy of learning models. The proposed Label Refinery allows us to dynamically label augmented training crops with soft targets. Using a Label Refinery, we achieve a significant gain in the classification accuracy across a wide range of network architectures. Our experimental evaluation shows improvement in the state-of-the-art accuracy for popular architectures including AlexNet, VGG, ResNet, MobileNet, and XNOR-Net.
Inception-v4, inception-resnet and the impact of residual connections on learning.In: AAAI. Volume 4. (2017) 12