We present a simple self-training method that achieves 87.4% top-1 accuracyon ImageNet, which is 1.0% better than the state-of-the-art model that requires3.5B weakly labeled Instagram images. On robustness test sets, it improvesImageNet-A top-1 accuracy from 16.6% to 74.2%, reduces ImageNet-C meancorruption error from 45.7 to 31.2, and reduces ImageNet-P mean flip rate from27.8 to 16.1. To achieve this result, we first train an EfficientNet model on labeledImageNet images and use it as a teacher to generate pseudo labels on 300Munlabeled images. We then train a larger EfficientNet as a student model on thecombination of labeled and pseudo labeled images. We iterate this process byputting back the student as the teacher. During the generation of the pseudolabels, the teacher is not noised so that the pseudo labels are as good aspossible. But during the learning of the student, we inject noise such as dataaugmentation, dropout, stochastic depth to the student so that the noisedstudent is forced to learn harder from the pseudo labels.
Quick Read (beta)
Self-training with Noisy Student improves ImageNet classification
We present a simple self-training method that achieves 87.4% top-1 accuracy on ImageNet, which is 1.0% better than the state-of-the-art model that requires 3.5B weakly labeled Instagram images. On robustness test sets, it improves ImageNet-A top-1 accuracy from 16.6% to 74.2%, reduces ImageNet-C mean corruption error from 45.7 to 31.2, and reduces ImageNet-P mean flip rate from 27.8 to 16.1.
To achieve this result, we first train an EfficientNet model on labeled ImageNet images and use it as a teacher to generate pseudo labels on 300M unlabeled images. We then train a larger EfficientNet as a student model on the combination of labeled and pseudo labeled images. We iterate this process by putting back the student as the teacher. During the generation of the pseudo labels, the teacher is not noised so that the pseudo labels are as good as possible. But during the learning of the student, we inject noise such as data augmentation, dropout, stochastic depth to the student so that the noised student is forced to learn harder from the pseudo labels.
Deep learning has shown remarkable successes in image recognition in recent years [krizhevsky2012imagenet, szegedy2015going, simonyan2014very, he2016deep, tan2019efficientnet]. However state-of-the-art vision models are still trained with supervised learning which requires a large corpus of labeled images to work well. By showing the models only labeled images, we limit ourselves from making use of unlabeled images available in much larger quantities to improve accuracy and robustness of state-of-the-art models.
Here we use unlabeled images to improve the state-of-the-art ImageNet accuracy and show that the accuracy gain has an outsized impact on robustness. For this purpose, we use a much larger corpus of unlabeled images, where some images may not belong to any category in ImageNet. We train our model using the self-training framework [scudder1965probability] which has three main steps: 1) train a teacher model on labeled images, 2) use the teacher to generate pseudo labels on unlabeled images, and 3) train a student model on the combination of labeled images and pseudo labeled images. Finally, we iterate the algorithm a few times by treating the student as a teacher to generate new pseudo labels and train a new student.
Our experiments show that an important element for this simple method to work well at scale is that the student model should be noised during its training while the teacher should not be noised during the generation of pseudo labels. This way, the pseudo labels are as good as possible, and the noised student is forced to learn harder from the pseudo labels. To noise the student, we use dropout [srivastava2014dropout], data augmentation [cubuk2019RandAugment] and stochastic depth [huang2016deep] during its training. We call the method self-training with Noisy Student to emphasize the role that noise plays in the method and results. To achieve strong results on ImageNet, the student model also needs to be large, typically larger than common vision models, so that it can leverage a large number of unlabeled images.
Using self-training with Noisy Student, together with 300M unlabeled images, we improve EfficientNet’s [tan2019efficientnet] ImageNet top-1 accuracy to 87.4%. This accuracy is 1.0% better than the previous state-of-the-art ImageNet accuracy which requires 3.5B weakly labeled Instagram images. Not only our method improves standard ImageNet accuracy, it also improves classification robustness on much harder test sets by large margins: ImageNet-A [hendrycks2019natural] top-1 accuracy from 16.6% to 74.2%, ImageNet-C [hendrycks2018benchmarking] mean corruption error (mCE) from 45.7 to 31.2 and ImageNet-P [hendrycks2018benchmarking] mean flip rate (mFR) from 27.8 to 16.1. Our main results are shown in Table 1.
|top-1 acc.||top-1 acc.||mCE||mFR|
2 Self-training with Noisy Student
Algorithm 1 gives an overview of self-training with Noisy Student (or Noisy Student in short). The inputs to the algorithm are both labeled and unlabeled images. We use the labeled images to train a teacher model using the standard cross entropy loss. We then use the teacher model to generate pseudo labels on unlabeled images. The pseudo labels can be soft (a continuous distribution) or hard (a one-hot distribution). We then train a student model which minimizes the combined cross entropy loss on both labeled images and unlabeled images. Finally, we iterate the process by putting back the student as a teacher to generate new pseudo labels and train a new student.
The algorithm is basically self-training, a method in semi-supervised learning (e.g., [scudder1965probability, yarowsky1995unsupervised]). We will discuss how our method is related to prior works in Section 5. Our main change is to add more sources of noise to the student to significantly improve it while removing the noise in the teacher when the teacher generates the pseudo labels.
When the student model is deliberately noised it is actually trained to be consistent to the more powerful teacher model that is not noised when it generates pseudo labels. In our experiments, we use dropout [srivastava2014dropout], stochastic depth [huang2016deep], data augmentation [cubuk2019RandAugment] to noise the student.
Although noise may appear to be limited and uninteresting, when it is applied to unlabeled data, it has a compound benefit of enforcing local smoothness in the decision function on both labeled and unlabeled data. Different kinds of noise, however, may have different effects. When data augmentation noise is used, the student must ensure that a translated image, for example, should have the same category with a non-translated image. This invariance constraint reduces the degrees of freedom in the model. When dropout and stochastic depth are used, the teacher model behaves like an ensemble of models (when it generates the pseudo labels, dropout is not used), whereas the student behaves like a single model. In other words, the student is forced to mimic a more powerful ensemble model.
The architectures for the student and teacher models can be the same or different. However an important requirement for Noisy Student to work well is that the student model needs to be sufficiently large to fit more data (labeled and pseudo labeled). For this purpose, we use the recently developed EfficientNet architectures [tan2019efficientnet] because they have a larger capacity than ResNet architectures [he2016deep]. Secondly, to enable the student to learn a more powerful model, we also make the student model larger than the teacher model. This is an important difference between our work and prior works on teacher-student framework whose main goal is model compression.
We find that Noisy Student is better with an additional trick: data balancing. Specifically, as all classes in ImageNet have a similar number of labeled images, we also need to balance the number of unlabeled images for each class. We duplicate images in classes where there are not enough images. For classes where we have too many images, we take the images with the highest confidence.
Finally, in the above, we say that the pseudo labels can be soft or hard. In our experiments, we observe that soft pseudo labels are usually more stable and lead to faster convergence, especially when the teacher model has low accuracy. Hence we use soft pseudo labels for our experiments unless otherwise specified.
In the following, we will first describe experiment details to achieve our results. We will then show our results on ImageNet and compare them with state-of-the-art models. Lastly, we will show the results of benchmarking our model on robustness datasets such as ImageNet-A, C and P and adversarial robustness.
3.1 Experiment Details
We conduct experiments on ImageNet 2012 ILSVRC challenge prediction task since it has been considered one of the most heavily benchmarked datasets in computer vision and that improvements on ImageNet transfer to other datasets [kornblith2019better, recht2019imagenet].
We obtain unlabeled images from the JFT dataset [hinton2015distilling, chollet2017xception], which has around 300M images. Although the images in the dataset have labels, we ignore the labels and treat them as unlabeled data. We used the version from [ngiam2018domain], which filtered the validation set of ImageNet.
We then perform data filtering and balancing on this corpus. First, we run an EfficientNet-B0 trained on ImageNet [tan2019efficientnet] over the JFT dataset to predict a label for each image. We then select images that have confidence of the label higher than 0.3. For each class, we select at most 130K images that have the highest confidence. Finally, for classes that have less than 130K images, we duplicate some images at random so that each class can have 130K images. Hence the total number of images that we use for training a student model is 130M (with some duplicated images). Due to duplications, there are only 81M unique images among these 130M images. We do not tune these hyperparameters extensively since our method is highly robust to them.
We use EfficientNets [tan2019efficientnet] as our baseline models because they provide better capacity for more data. In our experiments, we also further scale up EfficientNet-B7 and obtain EfficientNet-L0, L1 and L2. EfficientNet-L0 is wider and deeper than EfficientNet-B7 but uses a lower resolution, which gives it more parameters to fit a large number of unlabeled images with similar training speed. Then, EfficientNet-L1 is scaled up from EfficientNet-L0 by increasing width. Lastly, we follow the idea of compound scaling [tan2019efficientnet] and scale all dimensions to obtain EfficientNet-L2. Due to the large model size, the training time of EfficientNet-L2 is approximately five times the training time of EfficientNet-B7. For more information about the large architectures, please refer to Table 7 in Appendix A.1.
For labeled images, we use a batch size of 2048 by default and reduce the batch size when we could not fit the model into the memory. We find that using a batch size of 512, 1024, and 2048 leads to the same performance. We determine number of training steps and the learning rate schedule by the batch size for labeled images. Specifically, we train the student model for 350 epochs for models larger than EfficientNet-B4, including EfficientNet-L0, L1 and L2 and train the student model for 700 epochs for smaller models. The learning rate starts at 0.128 for labeled batch size 2048 and decays by 0.97 every 2.4 epochs if trained for 350 epochs or every 4.8 epochs if trained for 700 epochs.
For unlabeled images, we set the batch size to be three times the batch size of labeled images for large models, including EfficientNet-B7, L0, L1 and L2. For smaller models, we set the batch size of unlabeled images to be the same as the batch size of labeled images. In our implementation, labeled images and unlabeled images are concatenated together and we compute the average cross entropy loss.
Lastly, we apply the recently proposed technique to fix train-test resolution discrepancy [touvron2019fixing] for EfficientNet-L0, L1 and L2. In particular, we first perform normal training with a smaller resolution for 350 epochs. Then we finetune the model with a larger resolution for 1.5 epochs on unaugmented labeled images. Similar to [touvron2019fixing], we fix the shallow layers during finetuning.
Our largest model, EfficientNet-L2, needs to be trained for 3.5 days on a Cloud TPU v3 Pod, which has 2048 cores.
We use stochastic depth [huang2016deep], dropout [srivastava2014dropout] and RandAugment [cubuk2019RandAugment] to noise the student. The hyperparameters for these noise functions are the same for EfficientNet-B7, L0, L1 and L2. In particular, we set the survival probability in stochastic depth to 0.8 for the final layer and follow the linear decay rule for other layers. We apply dropout to the final classification layer with a dropout rate of 0.5. For RandAugment, we apply two random operations with the magnitude set to 27.
The best model in our experiments is a result of iterative training of teacher and student by putting back the student as the new teacher to generate new pseudo labels. During this process, we kept increasing the size of the student model to improve the performance. Our procedure went as follows. We first improved the accuracy of EfficientNet-B7 using EfficientNet-B7 as both the teacher and the student. Then by using the improved B7 model as the teacher, we trained an EfficientNet-L0 student model. Next, with the EfficientNet-L0 as the teacher, we trained a student model EfficientNet-L1, a wider model than L0. Afterward, we further increased the student model size to EfficientNet-L2, with the EfficientNet-L1 as the teacher. Lastly, we trained another EfficientNet-L2 student by using the EfficientNet-L2 model as the teacher.
|Method||# Params||Extra Data||Top-1 Acc.||Top-5 Acc.|
|ResNet-50 Billion-scale [billion_large_scale]||26M||3.5B images labeled with tags||81.2%||96.0%|
|ResNeXt-101 Billion-scale [billion_large_scale]||193M||84.8%||-|
|ResNeXt-101 WSL [mahajan2018exploring]||829M||85.4%||97.6%|
|FixRes ResNeXt-101 WSL [touvron2019fixing]||829M||86.4%||98.0%|
|Noisy Student (L2)||480M||300M unlabeled images||87.4%||98.2%|
3.2 ImageNet Results
We first report the validation set accuracy on the ImageNet 2012 ILSVRC challenge prediction task as commonly done in literature [krizhevsky2012imagenet, szegedy2015going, he2016deep, tan2019efficientnet] (see also [recht2019imagenet]). As shown in Table 2, Noisy Student with EfficientNet-L2 achieves 87.4% top-1 accuracy which is significantly better than the best previously reported accuracy on EfficientNet of 85.0%. The total gain of 2.4% comes from two sources: by making the model larger (+0.5%) and by Noisy Student (+1.9%). In other words, using Noisy Student makes a much larger impact to the accuracy than changing the architecture.
Further, Noisy Student outperforms the state-of-the-art accuracy of 86.4% by FixRes ResNeXt-101 WSL [mahajan2018exploring, touvron2019fixing] that requires 3.5 Billion Instagram images labeled with tags. As a comparison, our method only requires 300M unlabeled images, which is perhaps more easy to collect. Our model is also approximately twice as small in the number of parameters compared to FixRes ResNeXt-101 WSL.
Model size study: Noisy Student for EfficientNet B0-B7 without Iterative Training.
In addition to improving state-of-the-art results, we conduct additional experiments to verify if Noisy Student can benefit other EfficienetNet models. In the above experiments, iterative training was used to optimize the accuracy of EfficientNet-L2 but here we skip it as it is difficult to use iterative training for many experiments. We vary the model size from EfficientNet-B0 to EfficientNet-B7 [tan2019efficientnet] and use the same model as both the teacher and the student. We apply RandAugment to all EfficientNet baselines, leading to more competitive baselines. As shown in Figure 1, Noisy Student leads to a consistent improvement of around 0.8% for all model sizes. Overall, EfficientNets with Noisy Student provide a much better tradeoff between model size and accuracy when compared with prior works. The results also confirm that vision models can benefit from Noisy Student even without iterative training.
3.3 Robustness Results on ImageNet-A, ImageNet-C and ImageNet-P
We evaluate the best model, that achieves 87.4% top-1 accuracy, on three robustness test sets: ImageNet-A, ImageNet-C and ImageNet-P. ImageNet-C and P test sets [hendrycks2018benchmarking] include images with common corruptions and perturbations such as blurring, fogging, rotation and scaling. ImageNet-A test set [hendrycks2019natural] consists of difficult images that cause significant drops in accuracy to state-of-the-art models. These test sets are considered as “robustness” benchmarks because the test images are either much harder, for ImageNet-A, or the test images are different from the training images, for ImageNet-C and P.
For ImageNet-C and ImageNet-P, we evaluate our models on two released versions with resolution 224x224 and 299x299 and resize images to the resolution EfficientNet is trained on.
|Method||Top-1 Acc.||Top-5 Acc.|
|ResNeXt-101 [hendrycks2019natural] (32x4d)||5.9%||-|
|ResNeXt-101 [hendrycks2019natural] (64x4d)||7.3%||-|
|ResNeXt-101+SE [hendrycks2019natural] (32x4d)||14.2%||-|
|ResNeXt-101 WSL [mahajan2018exploring, orhan2019robustness]||16.6%||-|
|Noisy Student (L2)||74.2%||91.3%|
|Patch Guassian [lopes2019improving]||299||52.3%||60.4|
|ResNeXt-101 WSL [mahajan2018exploring, orhan2019robustness]||224||-||45.7|
|Noisy Student (L2)||224||72.8%||34.7|
|Noisy Student (L2)||299||75.5%||31.2|
|Low Pass Filter Pooling [zhang2019making]||224||-||51.2|
|ResNeXt-101 WSL [mahajan2018exploring, orhan2019robustness]||224||-||27.8|
|Noisy Student (L2)||224||83.1%||17.8|
|Noisy Student (L2)||299||84.3%||16.1|
As shown in Table 3, 4 and 5, when compared with the previous state-of-the-art model ResNeXt-101 WSL [mahajan2018exploring, orhan2019robustness] trained on 3.5B weakly labeled images, Noisy Student yields substantial gains on robustness datasets. On ImageNet-C, it reduces mean corruption error (mCE) from 45.7 to 31.2. On ImageNet-P, it leads to an mean flip rate (mFR) of 17.8 if we use a resolution of 224x224 (direct comparison) and 16.1 if we use a resolution of 299x299.11 1 For EfficientNet-L2, we use the model without finetuning with a larger test time resolution, since a larger resolution results in a discrepancy with the resolution of data and leads to degraded performance on ImageNet-C and ImageNet-P. These significant gains in robustness in ImageNet-C and ImageNet-P are surprising because our models were not deliberately optimizing for robustness (e.g., via data augmentation).
The biggest gain is observed on ImageNet-A: our method achieves 3.5x higher accuracy on ImageNet-A, going from 16.6% of the previous state-of-the-art to 74.2% top-1 accuracy. In contrast, changing architectures or training with weakly labeled data give modest gains in accuracy from 4.7% to 16.6%.
To intuitively understand the significant improvements on the three robustness benchmarks, we show several images in Figure 2 where the predictions of the standard model are incorrect and the predictions of the Noisy Student model are correct.
Figure 1(a) shows example images from ImageNet-A and the predictions of our models. The model with Noisy Student can successfully predict the correct labels of these highly difficult images. For example, without Noisy Student, the model predicts bullfrog for the image shown on the left of the second row, which might be resulted from the black lotus leaf on the water. With Noisy Student, the model correctly predicts dragonfly for the image. At the top-left image, the model without Noisy Student ignores the sea lions and mistakenly recognizes a buoy as a lighthouse, while the model with Noisy Student can recognize the sea lions.
Figure 1(b) shows images from ImageNet-C and the corresponding predictions. As can be seen from the figure, our model with Noisy Student makes correct predictions for images under severe corruptions and perturbations such as snow, motion blur and fog, while the model without Noisy Student suffers greatly under these conditions. The most interesting image is shown on the right of the first row. The swing in the picture is barely recognizable by human while the Noisy Student model still makes the correct prediction.
Figure 1(c) shows images from ImageNet-P and the corresponding predictions. As can be seen, our model with Noisy Student makes correct and consistent predictions as images undergone different perturbations while the model without Noisy Student flips predictions frequently. For instance, on the right column, as the image of the car undergone a small rotation, the standard model changes its prediction from racing car to car wheel to fire engine. In contrast, the predictions of the model with Noisy Student remain quite stable.
3.4 Adversarial Robustness Results
After testing our model’s robustness to common corruptions and perturbations, we also study its performance on adversarial perturbations. We evaluate our EfficientNet-L2 models with and without Noisy Student against an FGSM attack. This attack performs one gradient descent step on the input image [goodfellow2014explaining] with the update on each pixel set to . As shown in Figure 3, Noisy Student leads to approximately 10% improvement in accuracy even though the model is not optimized for adversarial robustness.
Note that these adversarial robustness results are not directly comparable to prior works since we use a large input resolution of 800x800 and adversarial vulnerability can scale with the input dimension [galloway2019batch, goodfellow2014explaining, gilmer2018adversarial, simon2019first]. Probably due to the same reason, at , EfficientNet-L2 achieves an accuracy of 1.1% under a stronger attack PGD with 10 iterations [madry2017towards], which is far from the SOTA results. Noisy Student can still improve the accuracy to 1.6%.
4 Ablation Study: The Importance of Noise in Self-training
In this section, we study the importance of noise and the effect of several noise methods used in our model. Since we use soft pseudo labels generated from the teacher model, when the student is trained to be exactly the same as the teacher model, the cross entropy loss on unlabeled data would be zero and the training signal would vanish. Hence, a question that naturally arises is why the student can outperform the teacher with soft pseudo labels. As stated earlier, we hypothesize that noising the student is needed so that it does not merely learn the teacher’s knowledge. We investigate the importance of noising in two scenarios with different amounts of unlabeled data and different teacher model accuracies. In both cases, we gradually remove augmentation, stochastic depth and dropout for unlabeled images, while keeping them for labeled images. This way, we can isolate the influence of noising on unlabeled images from the influence of preventing overfitting for labeled images.
|Model / Unlabeled Set Size||1.3M||130M|
|Noisy Student (B5)||83.9%||84.9%|
|w/o Aug, SD, Dropout||83.2%||84.3%|
Here we show the evidence in Table 6, noise such as stochastic depth, dropout and data augmentation plays an important role in enabling the student model to perform better than the teacher. The performance consistently drops with noise function removed. For example, with all noise removed, the accuracy drops from 84.9% to 84.3% in the case with 130M unlabeled images and drops from 83.9% to 83.2% in the case with 1.3M unlabeled images. However, in the case with 130M unlabeled images, with noise function removed, the performance is still improved to 84.3% from 84.0% when compared to the supervised baseline. We hypothesize that the improvement can be attributed to SGD, which introduces stochasticity into the training process.
One might argue that the improvements from using noise can be resulted from preventing overfitting the pseudo labels on the unlabeled images. We verify that this is not the case when we use 130M unlabeled images since the model does not overfit the unlabeled set from the training loss. While removing noise leads to a much lower training loss for labeled images, we observe that, for unlabeled images, removing noise leads to a smaller drop in training loss. This is probably because it is harder to overfit the large unlabeled dataset.
5 Related works
Our work is based on self-training (e.g., [scudder1965probability, yarowsky1995unsupervised, riloff2003learning]). Self-training first uses labeled data to train a good teacher model, then use the teacher model to label unlabeled data and finally use the labeled data and unlabeled data to jointly train a student model. In typical self-training with the teacher-student framework, noise injection to the student is not used by default, or the role of noise is not fully understood or justified. The main difference between our work and prior works is that we identify the importance of noise, and aggressively inject noise to make the student better.
Self-training was previously used to improve ResNet-50 from 76.4% to 81.2% top-1 accuracy [billion_large_scale] which is still far from the state-of-the-art accuracy. They did not show significant improvements in terms of robustness on ImageNet-A, C and P as we did. In terms of methodology, Yalniz et al. [billion_large_scale] also proposed to first only train on unlabeled images and then finetune their model on labeled images as the final stage. In Noisy Student, we combine these two steps into one because it simplifies the algorithm and leads to better performance in our preliminary experiments.
Also related to our work is Data Distillation [radosavovic2018data], which ensembled predictions for an image with different transformations to teach a student network. The main difference between Data Distillation and our method is that we use the noise to weaken the student, which is the opposite of their approach of strengthening the teacher by ensembling.
Parthasarathi et al. [parthasarathi2019lessons] used knowledge distillation on unlabeled data to teach a small student model for speech recognition. Their main goal is to find a small and fast model for deployment. As noise injection methods are not used in the student model, and the student model was also small, it is more difficult to make the student better than teacher.
Chowdhury et al. [Chowdhury19] used self-training for domain adaptation. Their purpose is different from ours: to adapt a teacher model on one domain to another. Their noise model is video specific and not relevant for image classification. Their framework is highly optimized for videos, e.g., prediction on which frame to use in a video, which is not as general as our work.
Apart from self-training, another important line of work in semi-supervised learning [chapelle2009semi, zhu2005semi] is based on consistency training [blum1998combining, bachman2014learning, rasmus2015semi, laine2016temporal, tarvainen2017mean, miyato2018virtual, luo2018smooth, qiao2018deep, chen2018semi, clark2018semi, park2018adversarial, athiwaratkun2018there, li2019certainty, verma2019interpolation, uda, mixmatch, zhai2019s]. These works constrain model predictions to be invariant to noise injected to the input, hidden states or model parameters. Although they have produced promising results, in our preliminary experiments, consistency regularization works less well on ImageNet because consistency regularization in the early phase of ImageNet training regularizes the model towards high entropy predictions, and prevents it from achieving good accuracy. A common workaround is to use entropy minimization or ramp up the consistency loss. However, the additional hyperparameters introduced by the ramping up schedule and the entropy minimization make them more difficult to use at scale. Compared to consistency training [miyato2018virtual, mixmatch, uda], the self-training / teacher-student framework is better suited for ImageNet because we can train a good teacher on ImageNet using label data.
Works based on pseudo label [lee2013pseudo, iscen2019label, shi2018transductive, arazo2019pseudo] are similar to self-training, but also suffers the same problem with consistency training, since it relies on a model being trained instead of a converged model with high accuracy to generate pseudo labels. Finally, frameworks in semi-supervised learning also include graph-based methods [zhu2003semi, weston2012deep, yang2016revisiting, kipf2016semi], methods that make use of latent variables as target variables [kingma2014semi, maaloe2016auxiliary, yang2017semi] and methods based on low-density separation [grandvalet2005semi, salimans2016improved, dai2017good], which might provide complementary benefits to our method.
As we use soft targets, our work is also related to methods in Knowledge Distillation [bucilu2006model, ba2014deep, hinton2015distilling, furlanello2018born]. The main use case of knowledge distillation is model compression by making the student model smaller. The main difference between our method and knowledge distillation is that knowledge distillation does not consider unlabeled data and does not aim to improve the student model.
A number of studies, e.g. [szegedy2013intriguing, hendrycks2018benchmarking, recht2019imagenet, gu2019using], have shown that computer vision models lack robustness. In other words, small changes in the input image can cause large changes to the predictions. Addressing the lack of robustness has become an important research direction in machine learning and computer vision in recent years.
Our study shows that using unlabeled data improves accuracy and general robustness. Our finding is consistent with similar arguments that using unlabeled data can improve adversarial robustness [carmon2019unlabeled, stanforth2019labels, najafi2019robustness, zhai2019adversarially]. The main difference between our work and these works is that they directly optimize adversarial robustness on unlabeled data, whereas we show that self-training with Noisy Student improves robustness greatly even without directly optimizing robustness.
Prior works on weakly-supervised learning require billions of weakly labeled data to improve state-of-the-art ImageNet models. In this work, we showed that it is possible to use unlabeled images to significantly advance both accuracy and robustness of state-of-the-art ImageNet models. We found that self-training is a simple and effective algorithm to leverage unlabeled data at scale. We improved it by adding noise to the student to learn beyond the teacher’s knowledge. The method, named self-training with Noisy Student, also benefits from the large capacity of EfficientNet family.
Our experiments showed that self-training with Noisy Student and EfficientNet can achieve an accuracy of 87.4% which is 1.9% higher than without Noisy Student. This result is also a new state-of-the-art and 1% better than the previous best method that used an order of magnitude more weakly labeled data [mahajan2018exploring, touvron2019fixing].
An important contribution of our work was to show that Noisy Student can potentially help addressing the lack of robustness in computer vision models. Our experiments showed that our model significantly improves accuracy on ImageNet-A, C and P without the need for deliberate data augmentation. For instance, on ImageNet-A, Noisy Student achieves 74.2% top-1 accuracy which is approximately 57% more accurate than the previous state-of-the-art model.
We thank the Google Brain team, Zihang Dai, Jeff Dean, Hieu Pham, Colin Raffel, Ilya Sutskever and Mingxing Tan for insightful discussions, Cihang Xie for robustness evaluation, Guokun Lai, Jiquan Ngiam, Jiateng Xie and Adams Wei Yu for feedbacks on the draft, Yanping Huang and Sameer Kumar for improving TPU implementation, Ekin Dogus Cubuk and Barret Zoph for help with RandAugment, Yanan Bao, Zheyun Feng and Daiyi Peng for help with the JFT dataset, Olga Wichrowska and Ola Spyra for help with infrastructure.
Appendix A Experiments
A.1 Architecture Details
The architecture specifications of EfficientNet-L0, L1 and L2 are listed in Table 7. We also list EfficientNet-B7 as a reference. Scaling width and resolution by leads to times training time and scaling depth by leads to times training time. Hence, EfficientNet-L0 has around the same training speed with EfficientNet-B7 but more parameters that give it a larger capacity. EfficientNet-L1 approximately doubles the training time of EfficientNet-L0. Finally, the training time of EfficientNet-L2 is around times the training time of EfficientNet-L1.
|Architecture name||Train Res.||Test Res.||# Params|
A.2 Study on Using Out-of-domain Data
Unlike previous studies in semi-supervised learning that use in-domain unlabeled data (e.g., CIFAR-10 images as unlabeled data for a small CIFAR-10 training set), to improve ImageNet, we must use out-of-domain unlabeled data. Here we study how to effectively use out-of-domain data. Since a teacher model’s confidence on an image can be a good indicator of whether it is an out-of-domain image, we consider the high-confidence images as in-domain images and the low-confidence images as out-of-domain images. We sample 1.3M images in confidence intervals .
We use EfficientNet-B0 as both the teacher model and the student model and compare using Noisy Student with soft pseudo labels and hard pseudo labels. The results are shown in Figure 4 with the following observations: (1) Soft pseudo labels and hard pseudo labels can both lead to great improvements with in-domain unlabeled images i.e., high-confidence images. (2) With out-of-domain unlabeled images, hard pseudo labels can hurt the performance while soft pseudo labels leads to robust performance.
We have also observed that using hard pseudo labels can achieve as good results or slightly better results when a larger teacher is used. Hence, whether soft pseudo labels or hard pseudo labels work better might need to be determined on a case-by-case basis.
A.3 Study on Unlabeled Data Size
We also study the effects of using different amounts of unlabeled data. We start with the 130M unlabeled images and gradually reduce the number of images. For simplicity, we experiment with using of the whole data by uniformly sampling images from the the unlabeled set though taking the images with highest confidence leads to better results. We use EfficientNet-B4 as both the teacher and the student. As can be seen from Table 8, the performance stays similar when we reduce the data to of the total data, which amounts to 8.1M images after duplicating. The performance drops when we further reduce it. Whether the model benefits from more unlabeled data depends on the capacity of the model since a small model can easily saturate, while a larger model can benefit from more data.
A.4 Study on Teacher Model’s Capacity
In all previous experiments, the student’s capacity is as large as or larger than the capacity of the teacher model. Here we study if it is possible to improve performance on small models by using a larger teacher model, since small models are useful when there are constraints for model size and latency in real-world applications. We use our best model Noisy Student with EfficientNet-L2 to teach student models with sizes ranging from EfficientNet-B0 to EfficientNet-B7. Iterative training is not used here for simplicity. We use the standard augmentation instead of RandAugment in this experiment.
The comparison is shown in Table 9. Using Noisy Student (EfficientNet-L2) as the teacher leads to another 0.8% improvement on top of the improved results. Notably, EfficientNet-B7 achieves an accuracy of 86.8%, which is 1.8% better than the supervised model. This shows that it is helpful to train a large model with high accuracy using Noisy Student when small models are needed for deployment.
|Model||# Params||Top-1 Acc.||Top-5 Acc.|
|Noisy Student (B0)||78.1||94.2|
|Noisy Student (B0, L2)||79.0||94.6|
|Noisy Student (B1)||80.3||95.1|
|Noisy Student (B1, L2)||81.4||95.6|
|Noisy Student (B2)||81.1||95.5|
|Noisy Student (B2, L2)||82.2||96.0|
|Noisy Student (B3)||82.4||96.2|
|Noisy Student (B3, L2)||83.4||96.6|
|Noisy Student (B4)||84.0||96.8|
|Noisy Student (B4, L2)||84.9||97.2|
|Noisy Student (B5)||84.9||97.2|
|Noisy Student (B5, L2)||85.6||97.6|
|Noisy Student (B6)||85.3||97.5|
|Noisy Student (B6, L2)||86.0||97.7|
|Noisy Student (B7)||85.9||97.6|
|Noisy Student (B7, L2)||86.8||98.0|
A.5 Details for Metrics on Robustness Benchmarks
The top-1 and top-5 accuracy are measured on the 200 classes that ImageNet-A includes. The mapping from the 200 classes to the original ImageNet classes are available online.22 2 https://github.com/hendrycks/natural-adv-examples/blob/master/eval.py
mCE (mean corruption error) is the weighted average of error rate on different corruptions, with AlexNet’s error rate as a baseline. The score is normalized by AlexNet’s error rate so that corruptions with different difficulties lead to scores of a similar scale. Please refer to [hendrycks2018benchmarking] for details about mCE and AlexNet’s error rate. The top-1 accuracy is simply the average top-1 accuracy for all corruptions and all severity degrees. The top-1 accuracy of prior methods are computed from their reported corruption error on each corruption.
Flip probability is the probability that the model changes top-1 prediction for different perturbations. mFR (mean flip rate) is the weighted average of flip probability on different perturbations, with AlexNet’s flip probability as a baseline. Please refer to [hendrycks2018benchmarking] for details about mFR and AlexNet’s flip probability. The top-1 accuracy reported in this paper is the average accuracy for all images included in ImageNet-P.